Updated for 1.7.2

This commit is contained in:
GotoLink 2014-02-22 22:25:26 +01:00
commit 29228e18fe
105 changed files with 1939 additions and 2690 deletions

View file

@ -2,17 +2,16 @@ package mysticworld.util;
import java.io.File;
import mysticworld.lib.BlockIds;
import mysticworld.MysticWorld;
import mysticworld.lib.Booleans;
import mysticworld.lib.ItemIds;
import mysticworld.lib.Strings;
import net.minecraftforge.common.Configuration;
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);
//Boolean Configurations
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);
@ -20,45 +19,6 @@ public class Config {
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);
//Block Configuration
BlockIds.ORE_STONE_1 = config.getBlock(Strings.IMBUED_STONE_NAME, BlockIds.ORE_STONE_1).getInt(BlockIds.ORE_STONE_1);
BlockIds.BUSH = config.getBlock(Strings.BUSH_NAME, BlockIds.BUSH).getInt(BlockIds.BUSH);
BlockIds.LIGHT_CUBE = config.getBlock(Strings.LIGHT_CUBE_NAME, BlockIds.LIGHT_CUBE).getInt(BlockIds.LIGHT_CUBE);
BlockIds.PLATFORM = config.getBlock(Strings.PLATFORM_NAME, BlockIds.PLATFORM).getInt(BlockIds.PLATFORM);
BlockIds.PILLAR = config.getBlock(Strings.PILLAR_NAME, BlockIds.PILLAR).getInt(BlockIds.PILLAR);
BlockIds.PILLAR_INSERT = config.getBlock(Strings.PILLAR_INSERT_NAME, BlockIds.PILLAR_INSERT).getInt(BlockIds.PILLAR_INSERT);
//Item Configuration
ItemIds.IMBUED_SHARD = config.getItem(Strings.IMBUED_SHARD_NAME, ItemIds.IMBUED_SHARD).getInt(ItemIds.IMBUED_SHARD);
ItemIds.STAFF_PARTS = config.getItem(Strings.STAFF_NAME, ItemIds.STAFF_PARTS).getInt(ItemIds.STAFF_PARTS);
ItemIds.FIRE_STAFF = config.getItem(Strings.FIRE_STAFF_NAME, ItemIds.FIRE_STAFF).getInt(ItemIds.FIRE_STAFF);
ItemIds.WATER_STAFF = config.getItem(Strings.WATER_STAFF_NAME, ItemIds.WATER_STAFF).getInt(ItemIds.WATER_STAFF);
ItemIds.EARTH_STAFF = config.getItem(Strings.EARTH_STAFF_NAME, ItemIds.EARTH_STAFF).getInt(ItemIds.EARTH_STAFF);
ItemIds.AIR_STAFF = config.getItem(Strings.AIR_STAFF_NAME, ItemIds.AIR_STAFF).getInt(ItemIds.AIR_STAFF);
ItemIds.ENERGY_STAFF = config.getItem(Strings.ENERGY_STAFF_NAME, ItemIds.ENERGY_STAFF).getInt(ItemIds.ENERGY_STAFF);
ItemIds.STAFF_POWER = config.getItem(Strings.POWER_STAFF_NAME, ItemIds.STAFF_POWER).getInt(ItemIds.STAFF_POWER);
ItemIds.BUSH_FRUIT = config.getItem(Strings.BUSH_FRUIT_NAME, ItemIds.BUSH_FRUIT).getInt(ItemIds.BUSH_FRUIT);
ItemIds.VERDITE_HELMET = config.getItem(Strings.VERDITE_HELMET_NAME, ItemIds.VERDITE_HELMET).getInt(ItemIds.VERDITE_HELMET);
ItemIds.VERDITE_CHESTPLATE = config.getItem(Strings.VERDITE_CHESTPLATE_NAME, ItemIds.VERDITE_CHESTPLATE).getInt(ItemIds.VERDITE_CHESTPLATE);
ItemIds.VERDITE_LEGGINGS = config.getItem(Strings.VERDITE_LEGGINGS_NAME, ItemIds.VERDITE_LEGGINGS).getInt(ItemIds.VERDITE_LEGGINGS);
ItemIds.VERDITE_BOOTS = config.getItem(Strings.VERDITE_BOOTS_NAME, ItemIds.VERDITE_BOOTS).getInt(ItemIds.VERDITE_BOOTS);
ItemIds.MITHRIL_HELMET = config.getItem(Strings.MITHRIL_HELMET_NAME, ItemIds.MITHRIL_HELMET).getInt(ItemIds.MITHRIL_HELMET);
ItemIds.MITHRIL_CHESTPLATE = config.getItem(Strings.MITHRIL_CHESTPLATE_NAME, ItemIds.MITHRIL_CHESTPLATE).getInt(ItemIds.MITHRIL_CHESTPLATE);
ItemIds.MITHRIL_LEGGINGS = config.getItem(Strings.MITHRIL_LEGGINGS_NAME, ItemIds.MITHRIL_LEGGINGS).getInt(ItemIds.MITHRIL_LEGGINGS);
ItemIds.MITHRIL_BOOTS = config.getItem(Strings.MITHRIL_BOOTS_NAME, ItemIds.MITHRIL_BOOTS).getInt(ItemIds.MITHRIL_BOOTS);
ItemIds.ADAMANTINE_HELMET = config.getItem(Strings.ADAMANTINE_HELMET_NAME, ItemIds.ADAMANTINE_HELMET).getInt(ItemIds.ADAMANTINE_HELMET);
ItemIds.ADAMANTINE_CHESTPLATE = config.getItem(Strings.ADAMANTINE_CHESTPLATE_NAME, ItemIds.ADAMANTINE_CHESTPLATE).getInt(ItemIds.ADAMANTINE_CHESTPLATE);
ItemIds.ADAMANTINE_LEGGINGS = config.getItem(Strings.ADAMANTINE_LEGGINGS_NAME, ItemIds.ADAMANTINE_LEGGINGS).getInt(ItemIds.ADAMANTINE_LEGGINGS);
ItemIds.ADAMANTINE_BOOTS = config.getItem(Strings.ADAMANTINE_BOOTS_NAME, ItemIds.ADAMANTINE_BOOTS).getInt(ItemIds.ADAMANTINE_BOOTS);
ItemIds.IRIDIUM_HELMET = config.getItem(Strings.IRIDIUM_HELMET_NAME, ItemIds.IRIDIUM_HELMET).getInt(ItemIds.IRIDIUM_HELMET);
ItemIds.IRIDIUM_CHESTPLATE = config.getItem(Strings.IRIDIUM_CHESTPLATE_NAME, ItemIds.IRIDIUM_CHESTPLATE).getInt(ItemIds.IRIDIUM_CHESTPLATE);
ItemIds.IRIDIUM_LEGGINGS = config.getItem(Strings.IRIDIUM_LEGGINGS_NAME, ItemIds.IRIDIUM_LEGGINGS).getInt(ItemIds.IRIDIUM_LEGGINGS);
ItemIds.IRIDIUM_BOOTS = config.getItem(Strings.IRIDIUM_BOOTS_NAME, ItemIds.IRIDIUM_BOOTS).getInt(ItemIds.IRIDIUM_BOOTS);
ItemIds.FIRE_ORB = config.getItem(Strings.FIRE_ORB_NAME, ItemIds.FIRE_ORB).getInt(ItemIds.FIRE_ORB);
ItemIds.WATER_ORB = config.getItem(Strings.WATER_ORB_NAME, ItemIds.WATER_ORB).getInt(ItemIds.WATER_ORB);
ItemIds.EARTH_ORB = config.getItem(Strings.EARTH_ORB_NAME, ItemIds.EARTH_ORB).getInt(ItemIds.EARTH_ORB);
ItemIds.AIR_ORB = config.getItem(Strings.AIR_ORB_NAME, ItemIds.AIR_ORB).getInt(ItemIds.AIR_ORB);
ItemIds.ENERGY_ORB = config.getItem(Strings.ENERGY_ORB_NAME, ItemIds.ENERGY_ORB).getInt(ItemIds.ENERGY_ORB);
ItemIds.VOID_SHARD = config.getItem(Strings.VOID_SHARD_NAME, ItemIds.VOID_SHARD).getInt(ItemIds.VOID_SHARD);
config.save();
}
}

View file

@ -13,27 +13,27 @@ public class RecipeHandler {
}
private static void bootsRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "# #", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "# #", "# #", '#', input);
}
private static void chestplateRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "# #", "###", "###", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "# #", "###", "###", '#', input);
}
private static void helmetRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "###", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "###", "# #", '#', input);
}
private static void itemRecipes() {
//Staff Hilt Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 1), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.diamond });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 1), " # ", "#$#", " # ", '#', net.minecraft.init.Items.gold_ingot, '$', net.minecraft.init.Items.diamond);
//Staff Handle Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 2), new Object[] { "#", "$", "S", '#', Item.goldNugget, '$', Item.stick, 'S', Item.dyePowder });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 2), "#", "$", "S", '#', net.minecraft.init.Items.gold_nugget, '$', net.minecraft.init.Items.stick, 'S', net.minecraft.init.Items.dye);
//Staff Topper Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 3), new Object[] { " # ", "#$#", " # ", '#', Item.ingotGold, '$', Item.netherStar });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 3), " # ", "#$#", " # ", '#', net.minecraft.init.Items.gold_ingot, '$', net.minecraft.init.Items.nether_star);
//Staff Recipe
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 0), new Object[] { " #", " X ", "Y ", '#', new ItemStack(ItemHandler.staffParts, 1, 3), 'X',
new ItemStack(ItemHandler.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler.staffParts, 1, 1) });
GameRegistry.addRecipe(new ItemStack(ItemHandler.staffParts, 1, 0), " #", " X ", "Y ", '#', new ItemStack(ItemHandler.staffParts, 1, 3), 'X',
new ItemStack(ItemHandler.staffParts, 1, 2), 'Y', new ItemStack(ItemHandler.staffParts, 1, 1));
//Orb Recipes
orbRecipe(ItemHandler.fireOrb, new ItemStack(ItemHandler.imbuedShard, 1, 0));
orbRecipe(ItemHandler.waterOrb, new ItemStack(ItemHandler.imbuedShard, 1, 1));
@ -69,15 +69,15 @@ public class RecipeHandler {
}
private static void itemSmelting() {
GameRegistry.addSmelting(ItemHandler.imbuedShard.itemID, new ItemStack(ItemHandler.voidShard), 0.5f);
GameRegistry.addSmelting(ItemHandler.imbuedShard, new ItemStack(ItemHandler.voidShard), 0.5f);
}
private static void leggingsRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "###", "# #", "# #", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "###", "# #", "# #", '#', input);
}
private static void orbRecipe(Item output, ItemStack input) {
GameRegistry.addRecipe(new ItemStack(output), new Object[] { "##", "##", '#', input });
GameRegistry.addRecipe(new ItemStack(output), "##", "##", '#', input);
}
private static void staffRecipe(Item output, ItemStack input) {

View file

@ -1,56 +1,36 @@
package mysticworld.util;
import java.util.EnumSet;
import java.util.Random;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.TickEvent;
import mysticworld.blocks.BlockHandler;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.item.Item;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
import cpw.mods.fml.common.IScheduledTickHandler;
import cpw.mods.fml.common.TickType;
public class TickHandler implements IScheduledTickHandler {
public class TickHandler {
public static final Enchantment[] enchantmentsPick = { Enchantment.efficiency, Enchantment.fortune, Enchantment.silkTouch, Enchantment.unbreaking };
@Override
public String getLabel() {
return "mystic world tick";
@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());
}
@Override
public int nextTickSpacing() {
return 20;
}
@Override
public void tickEnd(EnumSet<TickType> type, Object... tickData) {
}
@Override
public EnumSet<TickType> ticks() {
return EnumSet.of(TickType.PLAYER);
}
@Override
public void tickStart(EnumSet<TickType> type, Object... tickData) {
EntityPlayer player = (EntityPlayer) tickData[0];
pillarTick(player, player.worldObj, player.inventory, new Random());
}
private static void pillarTick(EntityPlayer player, World world, InventoryPlayer inventory, Random rand) {
ItemStack itemStack = inventory.getCurrentItem();
private static void pillarTick(EntityPlayer player, World world, Random rand) {
ItemStack itemStack = player.inventory.getCurrentItem();
int blockX = (int) player.posX - 1;
int blockY = (int) (player.posY - 0.15D);
int blockZ = (int) player.posZ - 1;
int blockId = world.getBlockId(blockX, blockY, blockZ);
Block blockId = world.getBlock(blockX, blockY, blockZ);
int blockMeta = world.getBlockMetadata(blockX, blockY, blockZ);
if (blockId == BlockHandler.pillarPlatform.blockID) {
if (blockId == BlockHandler.pillarPlatform) {
switch (blockMeta) {
//food
case 0:
@ -85,8 +65,8 @@ public class TickHandler implements IScheduledTickHandler {
//enchanter
case 7:
if (itemStack != null
&& (itemStack.itemID == Item.pickaxeWood.itemID || itemStack.itemID == Item.pickaxeStone.itemID || itemStack.itemID == Item.pickaxeIron.itemID
|| itemStack.itemID == Item.pickaxeGold.itemID || itemStack.itemID == Item.pickaxeDiamond.itemID)) {
&& (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) {
player.experienceLevel -= 10;
itemStack.addEnchantment(enchantmentsPick[rand.nextInt(3)], rand.nextInt(4) + 1);