Cleaning stuff

This commit is contained in:
GotoLink 2014-10-19 19:26:23 +02:00
commit 6a43d84a7f
10 changed files with 127 additions and 93 deletions

View file

@ -7,19 +7,17 @@ import mysticworld.lib.Booleans;
import net.minecraftforge.common.config.Configuration;
public class Config {
public static Configuration config;
public static void initialize(File file) {
config = new Configuration(file);
MysticWorld.instance.ENABLE = config.get("General", "Enable", true).getBoolean(true);
Configuration config = new Configuration(file);
MysticWorld.instance.ENABLE = config.get("General", "Enable", true).getBoolean();
//Boolean Configurations
Booleans.ENABLE_IMBUED_STONE_GEN = config.get("World Generation", "Enable Imbued Stones Generation", true).getBoolean(true);
Booleans.ENABLE_BUSH_GEN = config.get("World Generation", "Enable Bush Generation", true).getBoolean(true);
Booleans.ENABLE_GLACIER_GEN = config.get("World Generation", "Enable Glacier Biome", true).getBoolean(true);
Booleans.ENABLE_JUNGLE_REWRITE = config.get("World Generation", "Enable Vanilla Jungle Biome Modification", true).getBoolean(true);
Booleans.ENABLE_MOUNTAIN_GEN = config.get("World Generation", "Enable Mountain Biome", true).getBoolean(true);
Booleans.ENABLE_STEPPE_GEN = config.get("World Generation", "Enable Steppe Biome", true).getBoolean(true);
Booleans.ENABLE_TUNDRA_GEN = config.get("World Generation", "Enable Tundra Biome", true).getBoolean(true);
Booleans.ENABLE_IMBUED_STONE_GEN = config.get("World Generation", "Enable Imbued Stones Generation", true).getBoolean();
Booleans.ENABLE_BUSH_GEN = config.get("World Generation", "Enable Bush Generation", true).getBoolean();
Booleans.ENABLE_GLACIER_GEN = config.get("World Generation", "Enable Glacier Biome", true).getBoolean();
Booleans.ENABLE_JUNGLE_REWRITE = config.get("World Generation", "Enable Vanilla Jungle Biome Modification", true).getBoolean();
Booleans.ENABLE_MOUNTAIN_GEN = config.get("World Generation", "Enable Mountain Biome", true).getBoolean();
Booleans.ENABLE_STEPPE_GEN = config.get("World Generation", "Enable Steppe Biome", true).getBoolean();
Booleans.ENABLE_TUNDRA_GEN = config.get("World Generation", "Enable Tundra Biome", true).getBoolean();
config.save();
}
}

View file

@ -19,8 +19,8 @@ public class TickHandler {
@SubscribeEvent
public void tickStart(TickEvent.PlayerTickEvent event) {
if(event.phase== TickEvent.Phase.START && event.side.isServer() && event.player.worldObj.getWorldTime()%20==0)
pillarTick(event.player, event.player.worldObj, new Random());
if(event.phase == TickEvent.Phase.START && event.side.isServer() && event.player.worldObj.getWorldTime()%20==0)
pillarTick(event.player, event.player.worldObj, event.player.getRNG());
}
private static void pillarTick(EntityPlayer player, World world, Random rand) {
@ -67,7 +67,7 @@ public class TickHandler {
if (itemStack != null
&& (itemStack.getItem() == Items.wooden_pickaxe || itemStack.getItem() == Items.stone_pickaxe || itemStack.getItem() == Items.iron_pickaxe
|| itemStack.getItem() == Items.golden_pickaxe || itemStack.getItem() == Items.diamond_pickaxe)) {
if (itemStack.isItemEnchanted() != true && player.experienceLevel >= 10) {
if (!itemStack.isItemEnchanted() && player.experienceLevel >= 10) {
player.experienceLevel -= 10;
itemStack.addEnchantment(enchantmentsPick[rand.nextInt(3)], rand.nextInt(4) + 1);
}