diff --git a/build.properties b/build.properties index 581d312..7a248d8 100644 --- a/build.properties +++ b/build.properties @@ -1,7 +1,7 @@ # Minecraft Version -mc_version=1.12 -forge_version=14.21.1.2415 -mappings=snapshot_20170624 +mc_version=1.12.2 +forge_version=14.23.1.2555 +mappings=snapshot_20171003 # Mod Version -mod_version=1.0.1 +mod_version=1.0.2 diff --git a/src/main/java/cofh/cofhworld/CoFHWorld.java b/src/main/java/cofh/cofhworld/CoFHWorld.java index 188023d..7cd3dbb 100644 --- a/src/main/java/cofh/cofhworld/CoFHWorld.java +++ b/src/main/java/cofh/cofhworld/CoFHWorld.java @@ -1,10 +1,8 @@ package cofh.cofhworld; import cofh.cofhworld.command.CommandCoFHWorld; -import cofh.cofhworld.init.FeatureParser; import cofh.cofhworld.init.WorldHandler; import cofh.cofhworld.init.WorldProps; -import net.minecraft.world.World; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -23,7 +21,7 @@ public class CoFHWorld { public static final String MOD_ID = "cofhworld"; public static final String MOD_NAME = "CoFH World"; - public static final String VERSION = "1.0.1"; + public static final String VERSION = "1.0.2"; public static final String VERSION_MAX = "1.1.0"; public static final String VERSION_GROUP = "required-after:" + MOD_ID + "@[" + VERSION + "," + VERSION_MAX + ");"; public static final String UPDATE_URL = "https://raw.github.com/cofh/version/master/" + MOD_ID + "_update.json"; @@ -67,8 +65,9 @@ public void loadComplete(FMLLoadCompleteEvent event) { } @Mod.EventHandler - public void onServerStarted(FMLServerStartingEvent event) - { + public void onServerStarted(FMLServerStartingEvent event) { + event.registerServerCommand(new CommandCoFHWorld()); } + } diff --git a/src/main/java/cofh/cofhworld/biome/BiomeInfo.java b/src/main/java/cofh/cofhworld/biome/BiomeInfo.java index 8fb9dfa..69e1007 100644 --- a/src/main/java/cofh/cofhworld/biome/BiomeInfo.java +++ b/src/main/java/cofh/cofhworld/biome/BiomeInfo.java @@ -41,7 +41,7 @@ public boolean isBiomeEqual(Biome biome, Random rand) { default: break; case 0: - String name = biome.getBiomeName(); + String name = biome.getRegistryName().toString(); r = name.hashCode() == hash && name.equals(data); break; case 1: @@ -51,7 +51,7 @@ public boolean isBiomeEqual(Biome biome, Random rand) { r = BiomeDictionary.hasType(biome, (Type) data); break; case 4: - r = ((Collection) data).contains(biome.getBiomeName()); + r = ((Collection) data).contains(biome.getRegistryName().toString()); break; case 5: r = ((Collection) data).contains(biome.getTempCategory()); diff --git a/src/main/java/cofh/cofhworld/command/CommandCoFHWorld.java b/src/main/java/cofh/cofhworld/command/CommandCoFHWorld.java index 6ae3b01..55462d2 100644 --- a/src/main/java/cofh/cofhworld/command/CommandCoFHWorld.java +++ b/src/main/java/cofh/cofhworld/command/CommandCoFHWorld.java @@ -10,64 +10,75 @@ public class CommandCoFHWorld extends CommandTreeBase { - @Override - public String getName() { - return "cofhworld"; - } - - @Override - public String getUsage(ICommandSender sender) { - return "cofhworld.usage"; - } - - public CommandCoFHWorld() { - addSubcommand(new CommandReload()); - addSubcommand(new CommandList()); - } - - // Command to reload all feature definitions - public static class CommandReload extends CommandBase { - @Override - public String getName() { - return "reload"; - } - - @Override - public String getUsage(ICommandSender sender) { - return "cofhworld.reload.usage"; - } - - @Override - public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { - if (WorldHandler.reloadConfig()) { - notifyCommandListener(sender, this, "cofhworld.reload.successful"); - } else { - notifyCommandListener(sender, this, "cofhworld.reload.failed"); - } - } - } - - // Command to list all feature definitions - public static class CommandList extends CommandBase { - - @Override - public String getName() { - return "list"; - } - - @Override - public String getUsage(ICommandSender sender) { - return "cofhworld.list.usage"; - } - - @Override - public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { - StringBuilder b = new StringBuilder(); - b.append("\n"); - for (IFeatureGenerator feature: WorldHandler.getFeatures()) { - b.append("* " + feature.getFeatureName() + "\n"); - } - notifyCommandListener(sender, this, "cofhworld.list", b.toString()); - } - } + @Override + public String getName() { + + return "cofhworld"; + } + + @Override + public String getUsage(ICommandSender sender) { + + return "cofhworld.usage"; + } + + public CommandCoFHWorld() { + + addSubcommand(new CommandReload()); + addSubcommand(new CommandList()); + } + + // Command to reload all feature definitions + public static class CommandReload extends CommandBase { + + @Override + public String getName() { + + return "reload"; + } + + @Override + public String getUsage(ICommandSender sender) { + + return "cofhworld.reload.usage"; + } + + @Override + public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { + + if (WorldHandler.reloadConfig()) { + notifyCommandListener(sender, this, "cofhworld.reload.successful"); + } else { + notifyCommandListener(sender, this, "cofhworld.reload.failed"); + } + } + } + + // Command to list all feature definitions + public static class CommandList extends CommandBase { + + @Override + public String getName() { + + return "list"; + } + + @Override + public String getUsage(ICommandSender sender) { + + return "cofhworld.list.usage"; + } + + @Override + public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException { + + StringBuilder b = new StringBuilder(); + b.append("\n"); + for (IFeatureGenerator feature : WorldHandler.getFeatures()) { + b.append("* " + feature.getFeatureName() + "\n"); + } + notifyCommandListener(sender, this, "cofhworld.list", b.toString()); + } + } + } diff --git a/src/main/java/cofh/cofhworld/init/WorldHandler.java b/src/main/java/cofh/cofhworld/init/WorldHandler.java index 3d4ef7f..5d67afa 100644 --- a/src/main/java/cofh/cofhworld/init/WorldHandler.java +++ b/src/main/java/cofh/cofhworld/init/WorldHandler.java @@ -145,18 +145,20 @@ public static boolean removeFeature(IFeatureGenerator feature) { } public static IFeatureGenerator findFeature(String name) { + for (IFeatureGenerator feature : features) { - if (feature.getFeatureName().equals(name)) { - return feature; - } + if (feature.getFeatureName().equals(name)) { + return feature; } - return null; } - + return null; + } + public static List getFeatures() { + return features; } - + /* EVENT HANDLING */ @SubscribeEvent public void handlePopulateChunkEvent(PopulateChunkEvent.Pre event) {