Skip to content

Commit

Permalink
Bump to 1.0.2. This is an intermediate step before we look at the mas…
Browse files Browse the repository at this point in the history
…sive rewrite. :)

Signed-off-by: King Lemming <[email protected]>
  • Loading branch information
KingLemming committed Nov 28, 2017
1 parent c7647ef commit a6624ea
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 77 deletions.
8 changes: 4 additions & 4 deletions build.properties
Original file line number Diff line number Diff line change
@@ -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
9 changes: 4 additions & 5 deletions src/main/java/cofh/cofhworld/CoFHWorld.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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";
Expand Down Expand Up @@ -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());
}

}
4 changes: 2 additions & 2 deletions src/main/java/cofh/cofhworld/biome/BiomeInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -51,7 +51,7 @@ public boolean isBiomeEqual(Biome biome, Random rand) {
r = BiomeDictionary.hasType(biome, (Type) data);
break;
case 4:
r = ((Collection<String>) data).contains(biome.getBiomeName());
r = ((Collection<String>) data).contains(biome.getRegistryName().toString());
break;
case 5:
r = ((Collection<TempCategory>) data).contains(biome.getTempCategory());
Expand Down
131 changes: 71 additions & 60 deletions src/main/java/cofh/cofhworld/command/CommandCoFHWorld.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}

}
14 changes: 8 additions & 6 deletions src/main/java/cofh/cofhworld/init/WorldHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<IFeatureGenerator> getFeatures() {

return features;
}

/* EVENT HANDLING */
@SubscribeEvent
public void handlePopulateChunkEvent(PopulateChunkEvent.Pre event) {
Expand Down

0 comments on commit a6624ea

Please sign in to comment.