summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-03-23 14:51:06 +0000
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-03-23 14:51:06 +0000
commit6312636fd9a4d0f56dc7c9ff474a99d879bcb4e9 (patch)
treee3279753210bfb169a00cd3f146a80baf624150e /src/main/java/darkknight
parente86949a1ad3269ec66c9de65e2c92f5e66251411 (diff)
Reworked the whole repo.
Diffstat (limited to 'src/main/java/darkknight')
-rw-r--r--src/main/java/darkknight/jewelrycraft/CommonProxy.java13
-rw-r--r--src/main/java/darkknight/jewelrycraft/CreativeTabLiquids.java42
-rw-r--r--src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java187
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockDisplayer.java244
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java171
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockJCOre.java14
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockJewelAltar.java164
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java230
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockList.java69
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockMolder.java205
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockMoltenMetal.java269
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockShadow.java192
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockShadowEye.java134
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockShadowHand.java138
-rw-r--r--src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java260
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/AbstractTab.java74
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/ClientProxy.java87
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/GuiGuide.java241
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/GuiJewelry.java69
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/GuiRingChest.java50
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java24
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/TabJewelry.java27
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/TabRegistry.java86
-rw-r--r--src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java124
-rw-r--r--src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java54
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java27
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java87
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java63
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiHandler.java78
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java97
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTab.java84
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java176
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java78
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabIntroduction.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java166
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabModifiers.java74
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabRitual.java125
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/JewelryInventory.java165
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/Page.java197
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotBracelet.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotEarrings.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotNecklace.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotRing.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java55
-rw-r--r--src/main/java/darkknight/jewelrycraft/curses/Curse.java116
-rw-r--r--src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java25
-rw-r--r--src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java23
-rw-r--r--src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java30
-rw-r--r--src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java41
-rw-r--r--src/main/java/darkknight/jewelrycraft/curses/CurseList.java25
-rw-r--r--src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java25
-rw-r--r--src/main/java/darkknight/jewelrycraft/damage/DamageSourceList.java26
-rw-r--r--src/main/java/darkknight/jewelrycraft/effects/EffectBlazePowder.java95
-rw-r--r--src/main/java/darkknight/jewelrycraft/effects/EffectEnderEye.java79
-rw-r--r--src/main/java/darkknight/jewelrycraft/effects/EffectFeather.java88
-rw-r--r--src/main/java/darkknight/jewelrycraft/effects/EffectsList.java22
-rw-r--r--src/main/java/darkknight/jewelrycraft/effects/ModifierEffects.java85
-rw-r--r--src/main/java/darkknight/jewelrycraft/entities/EntityHalfHeart.java45
-rw-r--r--src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java107
-rw-r--r--src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java44
-rw-r--r--src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java23
-rw-r--r--src/main/java/darkknight/jewelrycraft/events/BucketHandler.java79
-rw-r--r--src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java465
-rw-r--r--src/main/java/darkknight/jewelrycraft/events/KeyBindings.java34
-rw-r--r--src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java68
-rw-r--r--src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java102
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java261
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemBracelet.java40
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemClayMolds.java87
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemCrystal.java113
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemEarrings.java40
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemGuide.java32
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemList.java57
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemMolds.java87
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java133
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java225
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemNecklace.java40
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemRing.java40
-rw-r--r--src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java165
-rw-r--r--src/main/java/darkknight/jewelrycraft/lib/Reference.java9
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ItemStackModelRenderer.java71
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelDisplayer.java265
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelHalfHeart.java497
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelHandPedestal.java146
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelHeart.java539
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java165
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelMask.java917
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelMolder.java101
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java162
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelShadowHand.java29
-rw-r--r--src/main/java/darkknight/jewelrycraft/model/ModelSmelter.java301
-rw-r--r--src/main/java/darkknight/jewelrycraft/network/PacketClearColorCache.java44
-rw-r--r--src/main/java/darkknight/jewelrycraft/network/PacketHandler.java4
-rw-r--r--src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java59
-rw-r--r--src/main/java/darkknight/jewelrycraft/network/PacketRequestLiquidData.java82
-rw-r--r--src/main/java/darkknight/jewelrycraft/network/PacketRequestPlayerInfo.java42
-rw-r--r--src/main/java/darkknight/jewelrycraft/network/PacketSendCurseStats.java71
-rw-r--r--src/main/java/darkknight/jewelrycraft/network/PacketSendLiquidData.java100
-rw-r--r--src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java58
-rw-r--r--src/main/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java91
-rw-r--r--src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java104
-rw-r--r--src/main/java/darkknight/jewelrycraft/recipes/CraftingRecipes.java59
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java90
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java88
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java133
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java182
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java154
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java144
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java273
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java7
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java186
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/ItemRender.java65
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/MaskRender.java30
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java262
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java47
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java136
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java138
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java79
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java20
-rw-r--r--src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java125
-rw-r--r--src/main/java/darkknight/jewelrycraft/util/BlockUtils.java155
-rw-r--r--src/main/java/darkknight/jewelrycraft/util/JewelryNBT.java728
-rw-r--r--src/main/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java221
-rw-r--r--src/main/java/darkknight/jewelrycraft/util/PlayerUtils.java38
-rw-r--r--src/main/java/darkknight/jewelrycraft/worldGen/Generation.java73
-rw-r--r--src/main/java/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java454
-rw-r--r--src/main/java/darkknight/jewelrycraft/worldGen/village/JCTrades.java127
-rw-r--r--src/main/java/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java50
128 files changed, 15788 insertions, 0 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/CommonProxy.java b/src/main/java/darkknight/jewelrycraft/CommonProxy.java
new file mode 100644
index 0000000..c6fa39f
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/CommonProxy.java
@@ -0,0 +1,13 @@
+package darkknight.jewelrycraft;
+
+/**
+ * The Class CommonProxy.
+ */
+public class CommonProxy
+{
+ public void preInit()
+ {}
+
+ public void postInit()
+ {}
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/CreativeTabLiquids.java b/src/main/java/darkknight/jewelrycraft/CreativeTabLiquids.java
new file mode 100644
index 0000000..bdf57b7
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/CreativeTabLiquids.java
@@ -0,0 +1,42 @@
+package darkknight.jewelrycraft;
+
+import java.util.List;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+/**
+ * The Class CreativeTabLiquids.
+ */
+public class CreativeTabLiquids extends CreativeTabs
+{
+ /**
+ * Instantiates a new creative tab liquids.
+ *
+ * @param par2Str the par2 str
+ */
+ public CreativeTabLiquids(String par2Str)
+ {
+ super(par2Str);
+ }
+
+ /**
+ * @return the Item for the icon
+ */
+ @Override
+ public Item getTabIconItem()
+ {
+ return ItemList.bucket;
+ }
+
+ /**
+ * @param par1List List of items to display
+ */
+ @Override
+ public void displayAllReleventItems(List par1List)
+ {
+ for(int i = 0; i < JewelrycraftUtil.metal.size(); i++)
+ par1List.add(ItemList.bucket.getModifiedItemStack(JewelrycraftUtil.metal.get(i)));
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java b/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java
new file mode 100644
index 0000000..fd7058f
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/JewelrycraftMod.java
@@ -0,0 +1,187 @@
+/*
+ * Mod made by DarkKnight during the Modjam 3
+ * It's an awesome mod
+ * I love me! :D
+ */
+package darkknight.jewelrycraft;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Logger;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.Entity;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.gen.structure.MapGenStructureIO;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.common.Mod;
+import cpw.mods.fml.common.Mod.EventHandler;
+import cpw.mods.fml.common.Mod.Instance;
+import cpw.mods.fml.common.ModMetadata;
+import cpw.mods.fml.common.SidedProxy;
+import cpw.mods.fml.common.event.FMLInitializationEvent;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.event.FMLServerStartingEvent;
+import cpw.mods.fml.common.network.NetworkRegistry;
+import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
+import cpw.mods.fml.common.registry.EntityRegistry;
+import cpw.mods.fml.common.registry.GameRegistry;
+import cpw.mods.fml.common.registry.VillagerRegistry;
+import cpw.mods.fml.relauncher.Side;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.commands.JewelrycraftCommands;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.container.GuiHandler;
+import darkknight.jewelrycraft.curses.CurseList;
+import darkknight.jewelrycraft.damage.DamageSourceList;
+import darkknight.jewelrycraft.effects.EffectsList;
+import darkknight.jewelrycraft.entities.EntityHalfHeart;
+import darkknight.jewelrycraft.entities.EntityHeart;
+import darkknight.jewelrycraft.events.BucketHandler;
+import darkknight.jewelrycraft.events.EntityEventHandler;
+import darkknight.jewelrycraft.events.KeyBindings;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.lib.Reference;
+import darkknight.jewelrycraft.network.PacketClearColorCache;
+import darkknight.jewelrycraft.network.PacketKeyPressEvent;
+import darkknight.jewelrycraft.network.PacketRequestLiquidData;
+import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
+import darkknight.jewelrycraft.network.PacketSendCurseStats;
+import darkknight.jewelrycraft.network.PacketSendLiquidData;
+import darkknight.jewelrycraft.network.PacketSendPlayerInfo;
+import darkknight.jewelrycraft.recipes.CraftingRecipes;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.worldGen.Generation;
+import darkknight.jewelrycraft.worldGen.village.ComponentJewelry;
+import darkknight.jewelrycraft.worldGen.village.JCTrades;
+import darkknight.jewelrycraft.worldGen.village.VillageJewelryHandler;
+
+@Mod (modid = Reference.MODID, name = Reference.MODNAME, version = Reference.VERSION)
+public class JewelrycraftMod
+{
+ @Instance (Reference.MODID)
+ public static JewelrycraftMod instance;
+ @SidedProxy (clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy")
+ public static CommonProxy proxy;
+ public static final Logger logger = Logger.getLogger("Jewelrycraft");
+ public static File dir;
+ public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft"){
+ @Override
+ public Item getTabIconItem()
+ {
+ return Item.getItemFromBlock(BlockList.jewelCraftingTable);
+ }
+ };
+ public static CreativeTabs liquids = new CreativeTabLiquids("Liquids");
+ public static NBTTagCompound saveData = new NBTTagCompound();
+ public static NBTTagCompound clientData = new NBTTagCompound();
+ public static File liquidsConf;
+ public static SimpleNetworkWrapper netWrapper;
+ public static boolean fancyRender;
+ public static final int MAX_CURSES = 10;
+
+ /**
+ * Pre initialization of mod stuff.
+ *
+ * @param e FMLPreInitializationEvent
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ @EventHandler
+ public void preInit(FMLPreInitializationEvent e) throws IOException
+ {
+ ConfigHandler.preInit(e);
+ BlockList.preInit(e);
+ ItemList.preInit(e);
+ CraftingRecipes.preInit(e);
+ CurseList.preInit(e);
+ OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot));
+ OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre));
+ VillagerRegistry.instance().registerVillagerId(3000);
+ VillagerRegistry.instance().registerVillageTradeHandler(3000, new JCTrades());
+ VillagerRegistry.instance().registerVillageCreationHandler(new VillageJewelryHandler());
+ try{
+ MapGenStructureIO.func_143031_a(ComponentJewelry.class, "Jewelrycraft:Jewelry");
+ }
+ catch(Throwable e2){
+ logger.severe("Error registering Jewelrycraft Structures with Vanilla Minecraft: this is expected in versions earlier than 1.7.10");
+ }
+ MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
+ MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
+ BucketHandler.INSTANCE.buckets.put(BlockList.moltenMetal, ItemList.bucket);
+
+ ModMetadata metadata = e.getModMetadata();
+ List<String> authorList = new ArrayList<String>();
+
+ authorList.add("DarkKnight (or sor1n)");
+ authorList.add("bspkrs");
+ authorList.add("domi1819");
+
+ dir = e.getModConfigurationDirectory();
+ proxy.preInit();
+ netWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.MODID);
+ netWrapper.registerMessage(PacketRequestLiquidData.class, PacketRequestLiquidData.class, 0, Side.SERVER);
+ netWrapper.registerMessage(PacketSendLiquidData.class, PacketSendLiquidData.class, 1, Side.CLIENT);
+ netWrapper.registerMessage(PacketClearColorCache.class, PacketClearColorCache.class, 2, Side.CLIENT);
+ netWrapper.registerMessage(PacketKeyPressEvent.class, PacketKeyPressEvent.class, 3, Side.SERVER);
+ netWrapper.registerMessage(PacketRequestPlayerInfo.class, PacketRequestPlayerInfo.class, 4, Side.SERVER);
+ netWrapper.registerMessage(PacketSendPlayerInfo.class, PacketSendPlayerInfo.class, 5, Side.CLIENT);
+ netWrapper.registerMessage(PacketSendCurseStats.class, PacketSendCurseStats.class, 6, Side.CLIENT);
+ metadata.autogenerated = false;
+ metadata.authorList = authorList;
+ metadata.url = "https://github.com/sor1n/Jewelrycraft";
+
+ createEntity(EntityHeart.class, "Heart", 0x000000, 0xFF0000, true);
+ createEntity(EntityHalfHeart.class, "Half-Heart", 0x000000, 0xFF0000, true);
+
+// EntityRegistry.addSpawn(EntityMob.class, 5, 2, 3, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.coldBeach, BiomeGenBase.frozenRiver);
+ }
+
+ public void createEntity(Class<? extends Entity> entity, String entityName, int solidColor, int spotColor, boolean hasSpawnEgg)
+ {
+ int randomID = EntityRegistry.findGlobalUniqueEntityId();
+ if(hasSpawnEgg) EntityRegistry.registerGlobalEntityID(entity, entityName, randomID, solidColor, spotColor);
+ else EntityRegistry.registerGlobalEntityID(entity, entityName, randomID);
+ EntityRegistry.registerModEntity(entity, entityName, randomID, this, 40, 3, true);
+ }
+
+ /**
+ * Initializes the world generation and key bindings.
+ *
+ * @param e FMLInitializationEvent
+ */
+ @EventHandler
+ public void init(FMLInitializationEvent e)
+ {
+ GameRegistry.registerWorldGenerator(new Generation(), 0);
+ if (FMLCommonHandler.instance().getSide() == Side.CLIENT) FMLCommonHandler.instance().bus().register(new KeyBindings());
+ new GuiHandler();
+ }
+
+ /**
+ * Post initialization of metals, modifiers and others.
+ *
+ * @param e FMLPostInitializationEvent
+ */
+ @EventHandler
+ public void postInit(FMLPostInitializationEvent e)
+ {
+ JewelrycraftUtil.addMetals();
+ JewelrycraftUtil.jamcrafters();
+ EffectsList.postInit(e);
+ DamageSourceList.postInit(e);
+ proxy.postInit();
+ }
+
+ @Mod.EventHandler
+ public void serverLoad(FMLServerStartingEvent event)
+ {
+ event.registerServerCommand(new JewelrycraftCommands());
+ }
+
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockDisplayer.java b/src/main/java/darkknight/jewelrycraft/block/BlockDisplayer.java
new file mode 100644
index 0000000..50c7c13
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockDisplayer.java
@@ -0,0 +1,244 @@
+package darkknight.jewelrycraft.block;
+
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+
+public class BlockDisplayer extends BlockContainer
+{
+ Random rand = new Random();
+
+ /**
+ * @param par2Material
+ */
+ protected BlockDisplayer(Material par2Material)
+ {
+ super(par2Material);
+ }
+
+ /**
+ * @param world
+ * @param var2
+ * @return
+ */
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntityDisplayer();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * @param iblockaccess
+ * @param i
+ * @param j
+ * @param k
+ * @param l
+ * @return
+ */
+ @Override
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getRenderType()
+ {
+ return -1;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityPlayer
+ * @param par6
+ * @param par7
+ * @param par8
+ * @param par9
+ * @return
+ */
+ @Override
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
+ {
+ TileEntityDisplayer te = (TileEntityDisplayer)world.getTileEntity(i, j, k);
+ ItemStack item = entityPlayer.inventory.getCurrentItem();
+ if (te != null){
+ if (item != null && item != new ItemStack(Item.getItemById(0), 0, 0) && !world.isRemote){
+ if (!te.hasObject){
+ te.object = item.copy();
+ te.quantity += item.stackSize;
+ te.object.stackSize = 1;
+ te.hasObject = true;
+ if (!entityPlayer.capabilities.isCreativeMode) entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, item.stackSize);
+ te.isDirty = true;
+ }else if (te.object.getItem() == item.getItem() && te.object != null && te.object != new ItemStack(Item.getItemById(0), 0, 0) && te.object.getItemDamage() == item.getItemDamage()) if (te.object.hasTagCompound() && item.hasTagCompound() && te.object.getTagCompound().equals(item.getTagCompound())){
+ te.quantity += item.stackSize;
+ if (!entityPlayer.capabilities.isCreativeMode) entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, item.stackSize);
+ te.isDirty = true;
+ }else if (!te.object.hasTagCompound() && !item.hasTagCompound()){
+ te.quantity += item.stackSize;
+ if (!entityPlayer.capabilities.isCreativeMode) entityPlayer.inventory.decrStackSize(entityPlayer.inventory.currentItem, item.stackSize);
+ te.isDirty = true;
+ }
+ }else if (item == null || item == new ItemStack(Item.getItemById(0), 0, 0)) if (!entityPlayer.capabilities.isCreativeMode) for(int inv = 0; inv < entityPlayer.inventory.getSizeInventory(); inv++){
+ item = entityPlayer.inventory.getStackInSlot(inv);
+ if (item != null && te.object.getItem() == item.getItem() && te.object != null && te.object != new ItemStack(Item.getItemById(0), 0, 0) && te.object.getItemDamage() == item.getItemDamage()) if (te.object.hasTagCompound() && item.hasTagCompound() && te.object.getTagCompound().equals(item.getTagCompound())){
+ te.quantity += item.stackSize;
+ if (!entityPlayer.capabilities.isCreativeMode) entityPlayer.inventory.decrStackSize(inv, item.stackSize);
+ te.isDirty = true;
+ te.markDirty();
+ }else if (!te.object.hasTagCompound() && !item.hasTagCompound()){
+ te.quantity += item.stackSize;
+ if (!entityPlayer.capabilities.isCreativeMode) entityPlayer.inventory.decrStackSize(inv, item.stackSize);
+ te.isDirty = true;
+ }
+ }
+ else if (entityPlayer.capabilities.isCreativeMode && te.hasObject && te.object.getItem() != null){
+ te.quantity += 64;
+ te.isDirty = true;
+ }
+ te.isDirty = true;
+ }
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param player
+ */
+ @Override
+ public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
+ {
+ TileEntityDisplayer te = (TileEntityDisplayer)world.getTileEntity(i, j, k);
+ if (te != null && !world.isRemote) if (te.hasObject && te.object != null && te.object != new ItemStack(Item.getItemById(0), 0, 0) && player.inventory.addItemStackToInventory(te.object)) if (!player.isSneaking()){
+ if (te.quantity > te.object.getMaxStackSize()){
+ te.object.stackSize = te.object.getMaxStackSize() - 1;
+ player.inventory.addItemStackToInventory(te.object);
+ te.object.stackSize = 1;
+ te.quantity -= te.object.getMaxStackSize();
+ te.isDirty = true;
+ }else{
+ te.object.stackSize = te.quantity - 1;
+ player.inventory.addItemStackToInventory(te.object);
+ te.hasObject = false;
+ te.object = new ItemStack(Item.getItemById(0), 0, 0);
+ te.quantity = 0;
+ te.isDirty = true;
+ }
+ te.isDirty = true;
+ }else{
+ if (te.quantity >= 2){
+ player.inventory.addItemStackToInventory(te.object);
+ te.object.stackSize = 1;
+ te.quantity--;
+ te.isDirty = true;
+ }else{
+ player.inventory.addItemStackToInventory(te.object);
+ te.object.stackSize = 1;
+ te.hasObject = false;
+ te.object = new ItemStack(Item.getItemById(0), 0, 0);
+ te.quantity = 0;
+ te.isDirty = true;
+ }
+ te.isDirty = true;
+ }
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param stack
+ */
+ public void dropItem(World world, double x, double y, double z, ItemStack stack)
+ {
+ EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1.5D, z + 0.5D, stack);
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.11000000298023224D;
+ world.spawnEntityInWorld(entityitem);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param block
+ * @param par6
+ */
+ @Override
+ public void breakBlock(World world, int i, int j, int k, Block block, int par6)
+ {
+ TileEntityDisplayer te = (TileEntityDisplayer)world.getTileEntity(i, j, k);
+ if (te != null && te.hasObject){
+ te.object.stackSize = te.quantity;
+ dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.object);
+ world.removeTileEntity(i, j, k);
+ }
+ super.breakBlock(world, i, j, k, block, par6);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityLiving
+ * @param par6ItemStack
+ */
+ @Override
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack)
+ {
+ int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
+ }
+
+ /**
+ * @param icon
+ */
+ @Override
+ public void registerBlockIcons(IIconRegister icon)
+ {
+ blockIcon = icon.registerIcon("jewelrycraft:displayer");
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java b/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java
new file mode 100644
index 0000000..6fe5b7f
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockHandPedestal.java
@@ -0,0 +1,171 @@
+package darkknight.jewelrycraft.block;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal;
+
+public class BlockHandPedestal extends BlockContainer
+{
+
+ /**
+ * @param material
+ */
+ protected BlockHandPedestal(Material material)
+ {
+ super(material);
+ setBlockBounds(0.2F, 0F, 0.2F, 0.8F, 1.0F, 0.8F);
+ }
+
+ /**
+ * @param world
+ * @param var2
+ * @return
+ */
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntityHandPedestal();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * @param iblockaccess
+ * @param i
+ * @param j
+ * @param k
+ * @param l
+ * @return
+ */
+ @Override
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getRenderType()
+ {
+ return -1;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityPlayer
+ * @param par6
+ * @param par7
+ * @param par8
+ * @param par9
+ * @return
+ */
+ @Override
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
+ {
+ TileEntityHandPedestal te = (TileEntityHandPedestal)world.getTileEntity(i, j, k);
+ ItemStack item = entityPlayer.inventory.getCurrentItem();
+ if (te != null){
+ if (!world.isRemote && te.getHeldItemStack() == null && item != null){
+ te.setHeldItemStack(item.copy());
+ te.closeHand();
+ if (!entityPlayer.capabilities.isCreativeMode) item.stackSize--;
+ te.markDirty();
+ }else if (entityPlayer.isSneaking()) if (entityPlayer.inventory.addItemStackToInventory(te.getHeldItemStack())){
+ te.removeHeldItemStack();
+ te.openHand();
+ }
+ te.markDirty();
+ }
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param stack
+ */
+ public void dropItem(World world, double x, double y, double z, ItemStack stack)
+ {
+ EntityItem entityitem = new EntityItem(world, x + 0.5, y + 1.5, z + 0.5, stack);
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.11000000298023224D;
+ world.spawnEntityInWorld(entityitem);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param block
+ * @param par6
+ */
+ @Override
+ public void breakBlock(World world, int i, int j, int k, Block block, int par6)
+ {
+ TileEntityHandPedestal te = (TileEntityHandPedestal)world.getTileEntity(i, j, k);
+ if (te != null && te.getHeldItemStack() != null){
+ dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.getHeldItemStack());
+ world.removeTileEntity(i, j, k);
+ }
+ super.breakBlock(world, i, j, k, block, par6);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityLiving
+ * @param par6ItemStack
+ */
+ @Override
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack)
+ {
+ int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 8 / 360 + 0.5) & 7;
+ world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
+ }
+
+ /**
+ * @param icon
+ */
+ @Override
+ public void registerBlockIcons(IIconRegister icon)
+ {
+ blockIcon = icon.registerIcon("minecraft:stonebrick");
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockJCOre.java b/src/main/java/darkknight/jewelrycraft/block/BlockJCOre.java
new file mode 100644
index 0000000..4e5ca6d
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockJCOre.java
@@ -0,0 +1,14 @@
+package darkknight.jewelrycraft.block;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockOre;
+import net.minecraft.block.material.Material;
+
+public class BlockJCOre extends BlockOre
+{
+ protected BlockJCOre()
+ {
+ super();
+ setHarvestLevel("pickaxe", 3);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockJewelAltar.java b/src/main/java/darkknight/jewelrycraft/block/BlockJewelAltar.java
new file mode 100644
index 0000000..e0a43bc
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockJewelAltar.java
@@ -0,0 +1,164 @@
+package darkknight.jewelrycraft.block;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.tileentity.TileEntityAltar;
+
+public class BlockJewelAltar extends BlockContainer
+{
+ @SideOnly (Side.CLIENT)
+ private IIcon altarSide;
+ @SideOnly (Side.CLIENT)
+ private IIcon altarBottom;
+ @SideOnly (Side.CLIENT)
+ private IIcon altarTop;
+
+ /**
+ *
+ */
+ public BlockJewelAltar()
+ {
+ super(Material.iron);
+ }
+
+ /**
+ * @param par0
+ * @return
+ */
+ public static boolean isNormalCube(int par0)
+ {
+ return true;
+ }
+
+ /**
+ * @param par1IconRegister
+ */
+ @Override
+ public void registerBlockIcons(IIconRegister par1IconRegister)
+ {
+ altarSide = par1IconRegister.registerIcon(getTextureName() + "_" + "side");
+ altarBottom = par1IconRegister.registerIcon(getTextureName() + "_" + "bottom");
+ altarTop = par1IconRegister.registerIcon(getTextureName() + "_" + "top");
+ }
+
+ /**
+ * @param par1
+ * @param par2
+ * @return
+ */
+ @Override
+ public IIcon getIcon(int par1, int par2)
+ {
+ return par1 == 1 ? altarTop : par1 == 0 ? altarBottom : altarSide;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityPlayer
+ * @param par6
+ * @param par7
+ * @param par8
+ * @param par9
+ * @return
+ */
+ @Override
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
+ {
+ TileEntityAltar te = (TileEntityAltar)world.getTileEntity(i, j, k);
+ ItemStack item = entityPlayer.inventory.getCurrentItem();
+ if (te != null && !world.isRemote){
+ if (item != null && item != new ItemStack(Item.getItemById(0), 0, 0) && (item.getItem() == ItemList.ring || item.getItem() == ItemList.necklace) && !te.hasObject){
+ te.object = item.copy();
+ item.stackSize = 0;
+ te.playerName = entityPlayer.getDisplayName();
+ te.isDirty = true;
+ te.markDirty();
+ te.hasObject = true;
+ }
+ if (te.object != null && te.object != new ItemStack(Item.getItemById(0), 0, 0) && te.hasObject && entityPlayer.isSneaking()){
+ entityPlayer.inventory.addItemStackToInventory(te.object);
+ te.object = new ItemStack(Item.getItemById(0), 0, 0);
+ te.playerName = "";
+ te.isDirty = true;
+ te.markDirty();
+ te.hasObject = false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param player
+ */
+ @Override
+ public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
+ {
+ TileEntityAltar te = (TileEntityAltar)world.getTileEntity(i, j, k);
+ if (te != null && !world.isRemote) if (te.object != null && te.object != new ItemStack(Item.getItemById(0), 0, 0)){}
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param stack
+ */
+ public void dropItem(World world, double x, double y, double z, ItemStack stack)
+ {
+ EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1.5D, z + 0.5D, stack);
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.11000000298023224D;
+ world.spawnEntityInWorld(entityitem);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param block
+ * @param par6
+ */
+ @Override
+ public void breakBlock(World world, int i, int j, int k, Block block, int par6)
+ {
+ TileEntityAltar te = (TileEntityAltar)world.getTileEntity(i, j, k);
+ if (te != null && te.object != null && te.object != new ItemStack(Item.getItemById(0), 0, 0)){
+ dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.object);
+ world.removeTileEntity(i, j, k);
+ }
+ super.breakBlock(world, i, j, k, block, par6);
+ }
+
+ /**
+ * @param world
+ * @param var2
+ * @return
+ */
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntityAltar();
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java b/src/main/java/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java
new file mode 100644
index 0000000..fae445e
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java
@@ -0,0 +1,230 @@
+package darkknight.jewelrycraft.block;
+
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class BlockJewelrsCraftingTable extends BlockContainer
+{
+ Random rand = new Random();
+
+ /**
+ * @param par2Material
+ */
+ protected BlockJewelrsCraftingTable(Material par2Material)
+ {
+ super(par2Material);
+ setBlockBounds(0.0F, 0F, 0.0F, 1.0F, 0.8F, 1.0F);
+ }
+
+ /**
+ * @param world
+ * @param var2
+ * @return
+ */
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntityJewelrsCraftingTable();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityPlayer
+ * @param par6
+ * @param par7
+ * @param par8
+ * @param par9
+ * @return
+ */
+ @Override
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
+ {
+ TileEntityJewelrsCraftingTable te = (TileEntityJewelrsCraftingTable)world.getTileEntity(i, j, k);
+ ItemStack item = entityPlayer.inventory.getCurrentItem();
+ if (te != null && !world.isRemote){
+ if (te.hasEndItem && item != null) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.hasenditem")));
+ if (!te.hasEndItem && !te.hasJewelry && item != null && JewelrycraftUtil.isJewelry(item)){
+ te.jewelry = item.copy();
+ te.hasJewelry = true;
+ if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize;
+ te.isDirty = true;
+ }
+ if (!te.hasEndItem && !te.hasGem && item != null && JewelrycraftUtil.isGem(item)){
+ te.gem = item.copy();
+ te.gem.stackSize = 1;
+ te.hasGem = true;
+ if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize;
+ te.isDirty = true;
+ }
+ if (!te.hasEndItem && te.hasJewelry && te.hasGem && !te.crafting){
+ te.carving = ConfigHandler.jewelryCraftingTime;
+ te.angle = 0;
+ te.crafting = true;
+ te.isDirty = true;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param stack
+ */
+ public void dropItem(World world, double x, double y, double z, ItemStack stack)
+ {
+ EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1D, z + 0.5D, stack);
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.21000000298023224D;
+ world.spawnEntityInWorld(entityitem);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param par5
+ * @param par6
+ */
+ @Override
+ public void breakBlock(World world, int i, int j, int k, Block par5, int par6)
+ {
+ TileEntityJewelrsCraftingTable te = (TileEntityJewelrsCraftingTable)world.getTileEntity(i, j, k);
+ if (te != null){
+ if (te.hasJewelry) dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.jewelry.copy());
+ if (te.hasGem) dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.gem.copy());
+ if (te.hasEndItem) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.endItem.copy());
+ world.removeTileEntity(i, j, k);
+ }
+ super.breakBlock(world, i, j, k, par5, par6);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityLiving
+ * @param par6ItemStack
+ */
+ @Override
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack)
+ {
+ int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param player
+ */
+ @Override
+ public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
+ {
+ TileEntityJewelrsCraftingTable te = (TileEntityJewelrsCraftingTable)world.getTileEntity(i, j, k);
+ if (te != null && !world.isRemote) if (player.isSneaking()){
+ if (te.hasJewelry){
+ dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.jewelry.copy());
+ te.jewelry = new ItemStack(Item.getItemById(0), 0, 0);
+ te.hasJewelry = false;
+ te.carving = -1;
+ te.crafting = false;
+ te.angle = 0F;
+ te.isDirty = true;
+ }
+ if (te.hasGem){
+ dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.gem.copy());
+ te.gem = new ItemStack(Item.getItemById(0), 0, 0);
+ te.hasGem = false;
+ te.carving = -1;
+ te.crafting = false;
+ te.angle = 0F;
+ te.isDirty = true;
+ }
+ }else if (te.hasEndItem){
+ dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.endItem.copy());
+ te.endItem = new ItemStack(Item.getItemById(0), 0, 0);
+ te.hasEndItem = false;
+ te.isDirty = true;
+ }else if (te.hasJewelry && te.hasGem && te.carving > 0 && te.jewelry != null) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.table.iscrafting", te.jewelry.getDisplayName()) + " (" + (ConfigHandler.jewelryCraftingTime - te.carving) * 100 / ConfigHandler.jewelryCraftingTime + "%)"));
+ else if (!te.hasGem) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.missinggem")));
+ else if (!te.hasJewelry) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.missingjewelry")));
+ }
+
+ /**
+ * @param iblockaccess
+ * @param i
+ * @param j
+ * @param k
+ * @param l
+ * @return
+ */
+ @Override
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getRenderType()
+ {
+ return -1;
+ }
+
+ /**
+ * @param icon
+ */
+ @Override
+ public void registerBlockIcons(IIconRegister icon)
+ {
+ blockIcon = icon.registerIcon("jewelrycraft:jewelrsCraftingTable");
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockList.java b/src/main/java/darkknight/jewelrycraft/block/BlockList.java
new file mode 100644
index 0000000..80a984c
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockList.java
@@ -0,0 +1,69 @@
+package darkknight.jewelrycraft.block;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraftforge.fluids.Fluid;
+import net.minecraftforge.fluids.FluidRegistry;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.registry.GameRegistry;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.tileentity.TileEntityAltar;
+import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal;
+import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowEye;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowHand;
+import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+
+public class BlockList
+{
+ public static Block shadowOre, smelter, molder, displayer, jewelCraftingTable, shadowBlock, shadowEye, jewelAltar, handPedestal, shadowHand;
+ public static BlockMoltenMetal moltenMetal;
+ public static Fluid moltenMetalFluid;
+ private static boolean isInitialized = false;
+
+ /**
+ * @param e
+ */
+ public static void preInit(FMLPreInitializationEvent e)
+ {
+ if (!isInitialized){
+ shadowOre = new BlockJCOre().setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockTextureName("jewelrycraft:oreShadow").setBlockName("Jewelrycraft.oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ smelter = new BlockSmelter().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName("Jewelrycraft.smelter").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ molder = new BlockMolder(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName("Jewelrycraft.molder").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ displayer = new BlockDisplayer(Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypeMetal).setBlockName("Jewelrycraft.displayer").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ jewelCraftingTable = new BlockJewelrsCraftingTable(Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundTypePiston).setBlockName("Jewelrycraft.jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ shadowBlock = new BlockShadow().setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName("jewelrycraft:blockShadow").setBlockName("Jewelrycraft.blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ jewelAltar = new BlockJewelAltar().setHardness(5.0F).setResistance(2.0F).setStepSound(Block.soundTypeMetal).setBlockTextureName("jewelrycraft:altar").setBlockName("Jewelrycraft.altar").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ shadowEye = new BlockShadowEye().setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName("Jewelrycraft.shadowEye").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ handPedestal = new BlockHandPedestal(Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundTypePiston).setBlockName("Jewelrycraft.handPedestal").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ shadowHand = new BlockShadowHand(Material.rock).setStepSound(Block.soundTypePiston).setBlockName("Jewelrycraft.shadowHand").setCreativeTab(JewelrycraftMod.jewelrycraft).setBlockUnbreakable();
+ GameRegistry.registerBlock(shadowOre, "shadowOre");
+ GameRegistry.registerBlock(shadowBlock, "shadowBlock");
+ GameRegistry.registerBlock(smelter, "Smelter");
+ GameRegistry.registerBlock(molder, "Molder");
+ GameRegistry.registerBlock(jewelCraftingTable, "jewelCraftingTable");
+ GameRegistry.registerBlock(displayer, "Displayer");
+ GameRegistry.registerBlock(jewelAltar, "Altar");
+ GameRegistry.registerBlock(shadowEye, "Shadow Eye");
+ GameRegistry.registerBlock(handPedestal, "Stone Bricks Pedestal");
+ GameRegistry.registerBlock(shadowHand, "Shadow Hand");
+ GameRegistry.registerTileEntity(TileEntitySmelter.class, "jewelrycraft:smelter");
+ GameRegistry.registerTileEntity(TileEntityMolder.class, "jewelrycraft:molder");
+ GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, "jewelrycraft:table");
+ GameRegistry.registerTileEntity(TileEntityDisplayer.class, "jewelrycraft:displayer");
+ GameRegistry.registerTileEntity(TileEntityBlockShadow.class, "jewelrycraft:blockShadow");
+ GameRegistry.registerTileEntity(TileEntityAltar.class, "jewelrycraft:altar");
+ GameRegistry.registerTileEntity(TileEntityShadowEye.class, "jewelrycraft:shadowEye");
+ GameRegistry.registerTileEntity(TileEntityHandPedestal.class, "jewelrycraft:handPedestal");
+ GameRegistry.registerTileEntity(TileEntityShadowHand.class, "jewelrycraft:shadowHand");
+ moltenMetalFluid = new Fluid("metal.molten").setLuminosity(15).setDensity(3000).setTemperature(2000).setViscosity(6000);
+ if (!FluidRegistry.registerFluid(moltenMetalFluid)) moltenMetalFluid = FluidRegistry.getFluid("metal.molten");
+ moltenMetal = new BlockMoltenMetal(moltenMetalFluid, Material.lava);
+ GameRegistry.registerBlock(moltenMetal, "moltenMetalLiquid");
+ isInitialized = true;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java b/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java
new file mode 100644
index 0000000..ce5e58b
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockMolder.java
@@ -0,0 +1,205 @@
+package darkknight.jewelrycraft.block;
+
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+
+public class BlockMolder extends BlockContainer
+{
+ Random rand = new Random();
+
+ /**
+ * @param par2Material
+ */
+ protected BlockMolder(Material par2Material)
+ {
+ super(par2Material);
+ setBlockBounds(0.1F, 0F, 0.1F, 0.9F, 0.2F, 0.9F);
+ }
+
+ /**
+ * @param world
+ * @param var2
+ * @return
+ */
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntityMolder();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityPlayer
+ * @param par6
+ * @param par7
+ * @param par8
+ * @param par9
+ * @return
+ */
+ @Override
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
+ {
+ TileEntityMolder te = (TileEntityMolder)world.getTileEntity(i, j, k);
+ ItemStack item = entityPlayer.inventory.getCurrentItem();
+ if (te != null && !world.isRemote){
+ if (item != null && !te.hasMold && item.getItem() == ItemList.molds){
+ te.mold = item.copy();
+ te.hasMold = true;
+ if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize;
+ entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.molder.addedmold", te.mold.getDisplayName())));
+ te.isDirty = true;
+ }
+ if (te.hasMold && entityPlayer.isSneaking() && !te.hasMoltenMetal){
+ dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.mold.copy());
+ te.mold = new ItemStack(Item.getItemById(0), 0, 0);
+ te.hasMold = false;
+ te.isDirty = true;
+ }else if (te.hasMoltenMetal) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.molder.hasmoltenmetal")));
+ }
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param stack
+ */
+ public void dropItem(World world, double x, double y, double z, ItemStack stack)
+ {
+ EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 0.5D, z + 0.5D, stack);
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.11000000298023224D;
+ world.spawnEntityInWorld(entityitem);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param par5
+ * @param par6
+ */
+ @Override
+ public void breakBlock(World world, int i, int j, int k, Block par5, int par6)
+ {
+ TileEntityMolder te = (TileEntityMolder)world.getTileEntity(i, j, k);
+ if (te != null){
+ if (te.hasJewelBase) dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.jewelBase.copy());
+ if (te.hasMold) dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.mold.copy());
+ world.removeTileEntity(i, j, k);
+ }
+ super.breakBlock(world, i, j, k, par5, par6);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityLiving
+ * @param par6ItemStack
+ */
+ @Override
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack)
+ {
+ int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param player
+ */
+ @Override
+ public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
+ {
+ TileEntityMolder me = (TileEntityMolder)world.getTileEntity(i, j, k);
+ if (me != null && !world.isRemote){
+ if (me.hasJewelBase){
+ dropItem(me.getWorldObj(), me.xCoord, me.yCoord, me.zCoord, me.jewelBase.copy());
+ me.jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
+ me.hasJewelBase = false;
+ }else if (me.hasMoltenMetal && me.cooling >= 0) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.molder.metaliscooling") + " (" + (ConfigHandler.ingotCoolingTime - me.cooling) * 100 / ConfigHandler.ingotCoolingTime + "%)"));
+ else if (me.mold.getItem() == ItemList.molds && !me.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.molder.moldisempty")));
+ else if (me.mold.getItem() != ItemList.molds) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.molder.moldismissing")));
+ me.isDirty = true;
+ }
+ }
+
+ /**
+ * @param iblockaccess
+ * @param i
+ * @param j
+ * @param k
+ * @param l
+ * @return
+ */
+ @Override
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getRenderType()
+ {
+ return -1;
+ }
+
+ /**
+ * @param icon
+ */
+ @Override
+ public void registerBlockIcons(IIconRegister icon)
+ {
+ blockIcon = icon.registerIcon("jewelrycraft:molder");
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockMoltenMetal.java b/src/main/java/darkknight/jewelrycraft/block/BlockMoltenMetal.java
new file mode 100644
index 0000000..ee67aff
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockMoltenMetal.java
@@ -0,0 +1,269 @@
+package darkknight.jewelrycraft.block;
+
+import java.io.IOException;
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.fluids.BlockFluidClassic;
+import net.minecraftforge.fluids.Fluid;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.network.PacketRequestLiquidData;
+import darkknight.jewelrycraft.network.PacketSendLiquidData;
+
+public class BlockMoltenMetal extends BlockFluidClassic
+{
+ @SideOnly (Side.CLIENT)
+ protected IIcon stillIcon;
+ @SideOnly (Side.CLIENT)
+ protected IIcon flowingIcon;
+
+ /**
+ * @param fluid
+ * @param material
+ */
+ public BlockMoltenMetal(Fluid fluid, Material material)
+ {
+ super(fluid, material);
+ setBlockName("Jewelrycraft.moltenMetal");
+ setQuantaPerBlock(5);
+ setRenderPass(1);
+ setLightLevel(15f);
+ }
+
+ /**
+ * @param side
+ * @param meta
+ * @return
+ */
+ @Override
+ public IIcon getIcon(int side, int meta)
+ {
+ return side == 0 || side == 1 ? stillIcon : flowingIcon;
+ }
+
+ /**
+ * @param register
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ public void registerBlockIcons(IIconRegister register)
+ {
+ stillIcon = register.registerIcon("jewelrycraft:moltenMetalStill");
+ flowingIcon = register.registerIcon("jewelrycraft:moltenMetalFlow");
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public boolean canDisplace(IBlockAccess world, int x, int y, int z)
+ {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.canDisplace(world, x, y, z);
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public boolean displaceIfPossible(World world, int x, int y, int z)
+ {
+ if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false;
+ return super.displaceIfPossible(world, x, y, z);
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ protected boolean canFlowInto(IBlockAccess world, int x, int y, int z)
+ {
+ if (world.getBlock(x, y, z).isAir(world, x, y, z)) return true;
+ Block block = world.getBlock(x, y, z);
+ if (block == this) return false;
+ if (displacements.containsKey(block)) return displacements.get(block);
+ Material material = block.getMaterial();
+ if (material.blocksMovement() || material == Material.water || material == Material.lava || material == Material.portal) return false;
+ int density = getDensity(world, x, y, z);
+ if (density == Integer.MAX_VALUE) return true;
+ if (this.density > density) return true;
+ else return false;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @return
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ public int colorMultiplier(IBlockAccess world, int i, int j, int k)
+ {
+ try{
+ return color(world, i, j, k, false, null);
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ return 0;
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param rand
+ */
+ @Override
+ public void updateTick(World world, int x, int y, int z, Random rand)
+ {
+ int quantaRemaining = quantaPerBlock - world.getBlockMetadata(x, y, z);
+ int expQuanta = -101;
+ // check adjacent block levels if non-source
+ if (quantaRemaining < quantaPerBlock){
+ int y2 = y - densityDir;
+ if (world.getBlock(x, y2, z) == this && JewelrycraftMod.saveData.getString(stringFromLocation(x, y2, z, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId))) || world.getBlock(x - 1, y2, z) == this && JewelrycraftMod.saveData.getString(stringFromLocation(x - 1, y2, z, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId))) || world.getBlock(x + 1, y2, z) == this && JewelrycraftMod.saveData.getString(stringFromLocation(x + 1, y2, z, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId))) || world.getBlock(x, y2, z - 1) == this && JewelrycraftMod.saveData.getString(stringFromLocation(x, y2, z - 1, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId))) || world.getBlock(x, y2, z + 1) == this && JewelrycraftMod.saveData.getString(stringFromLocation(x, y2, z + 1, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)))) expQuanta = quantaPerBlock - 1;
+ else{
+ int maxQuanta = -100;
+ if (JewelrycraftMod.saveData.getString(stringFromLocation(x - 1, y, z, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)))) maxQuanta = getLargerQuanta(world, x - 1, y, z, maxQuanta);
+ if (JewelrycraftMod.saveData.getString(stringFromLocation(x + 1, y, z, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)))) maxQuanta = getLargerQuanta(world, x + 1, y, z, maxQuanta);
+ if (JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z - 1, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)))) maxQuanta = getLargerQuanta(world, x, y, z - 1, maxQuanta);
+ if (JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z + 1, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)))) maxQuanta = getLargerQuanta(world, x, y, z + 1, maxQuanta);
+ expQuanta = maxQuanta - 1;
+ }
+ // decay calculation
+ if (expQuanta != quantaRemaining){
+ quantaRemaining = expQuanta;
+ if (expQuanta <= 0) world.setBlock(x, y, z, Blocks.air);
+ else{
+ world.setBlockMetadataWithNotify(x, y, z, quantaPerBlock - expQuanta, 3);
+ world.scheduleBlockUpdate(x, y, z, this, tickRate);
+ world.notifyBlocksOfNeighborChange(x, y, z, this);
+ }
+ }
+ }
+ // This is a "source" block, set meta to zero, and send a server only
+ // update
+ else if (quantaRemaining >= quantaPerBlock) world.setBlockMetadataWithNotify(x, y, z, 0, 2);
+ String originData = JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId));
+ // Flow vertically if possible
+ if (canDisplace(world, x, y + densityDir, z)){
+ JewelrycraftMod.saveData.setString(stringFromLocation(x, y + densityDir, z, world.provider.dimensionId), JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)));
+ flowIntoBlock(world, x, y + densityDir, z, 1, originData);
+ return;
+ }
+ // Flow outward if possible
+ int flowMeta = quantaPerBlock - quantaRemaining + 1;
+ if (flowMeta >= quantaPerBlock) return;
+ if (isSourceBlock(world, x, y, z) || !isFlowingVertically(world, x, y, z)){
+ if (world.getBlock(x, y - densityDir, z) == this && JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)).equals(JewelrycraftMod.saveData.getString(stringFromLocation(x, y - densityDir, z, world.provider.dimensionId)))) flowMeta = 1;
+ boolean flowTo[] = getOptimalFlowDirections(world, x, y, z);
+ if (flowTo[0]){
+ if (JewelrycraftMod.saveData.getTag(stringFromLocation(x - 1, y, z, world.provider.dimensionId)) == null || world.getBlock(x - 1, y, z).isAir(world, x - 1, y, z)) JewelrycraftMod.saveData.setString(stringFromLocation(x - 1, y, z, world.provider.dimensionId), JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)));
+ flowIntoBlock(world, x - 1, y, z, flowMeta, originData);
+ }
+ if (flowTo[1]){
+ if (JewelrycraftMod.saveData.getTag(stringFromLocation(x + 1, y, z, world.provider.dimensionId)) == null || world.getBlock(x + 1, y, z).isAir(world, x + 1, y, z)) JewelrycraftMod.saveData.setString(stringFromLocation(x + 1, y, z, world.provider.dimensionId), JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)));
+ flowIntoBlock(world, x + 1, y, z, flowMeta, originData);
+ }
+ if (flowTo[2]){
+ if (JewelrycraftMod.saveData.getTag(stringFromLocation(x, y, z - 1, world.provider.dimensionId)) == null || world.getBlock(x, y, z - 1).isAir(world, x, y, z - 1)) JewelrycraftMod.saveData.setString(stringFromLocation(x, y, z - 1, world.provider.dimensionId), JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)));
+ flowIntoBlock(world, x, y, z - 1, flowMeta, originData);
+ }
+ if (flowTo[3]){
+ if (JewelrycraftMod.saveData.getTag(stringFromLocation(x, y, z + 1, world.provider.dimensionId)) == null || world.getBlock(x, y, z + 1).isAir(world, x, y, z + 1)) JewelrycraftMod.saveData.setString(stringFromLocation(x, y, z + 1, world.provider.dimensionId), JewelrycraftMod.saveData.getString(stringFromLocation(x, y, z, world.provider.dimensionId)));
+ flowIntoBlock(world, x, y, z + 1, flowMeta, originData);
+ }
+ }
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param meta
+ * @param originData
+ */
+ public void flowIntoBlock(World world, int x, int y, int z, int meta, String originData)
+ {
+ if (meta < 0 || world.isRemote) return;
+ if (displaceIfPossible(world, x, y, z)){
+ world.setBlock(x, y, z, this, meta, 3);
+ JewelrycraftMod.saveData.setString(stringFromLocation(x, y, z, world.provider.dimensionId), originData);
+ String[] data = originData.split(":");
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Integer.parseInt(data[0]), Integer.parseInt(data[1]), Integer.parseInt(data[2])));
+ }
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param forcecolor
+ * @param itemC
+ * @return
+ * @throws IOException
+ */
+ @SideOnly (Side.CLIENT)
+ public static int color(IBlockAccess world, int i, int j, int k, boolean forcecolor, Item itemC) throws IOException
+ {
+ String ingotData = JewelrycraftMod.clientData.getString(String.valueOf(i) + " " + String.valueOf(j) + " " + String.valueOf(k) + " " + Minecraft.getMinecraft().theWorld.provider.dimensionId);
+ if (ingotData == ""){
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestLiquidData(Minecraft.getMinecraft().theWorld.provider.dimensionId, i, j, k));
+ return 0xFFFFFF;
+ }else{
+ String[] splitData = ingotData.split(":");
+ if (splitData.length == 3){
+ int color;
+ try{
+ Integer.parseInt(splitData[0]);
+ Integer.parseInt(splitData[1]);
+ color = Integer.parseInt(splitData[2]);
+ return color;
+ }
+ catch(Exception e){
+ e.printStackTrace();
+ }
+ }
+ }
+ return 16777215;
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @param z
+ * @param dimID
+ * @return
+ */
+ public static String stringFromLocation(int x, int y, int z, int dimID)
+ {
+ return x + " " + y + " " + z + " " + dimID;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockShadow.java b/src/main/java/darkknight/jewelrycraft/block/BlockShadow.java
new file mode 100644
index 0000000..b175fe6
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockShadow.java
@@ -0,0 +1,192 @@
+package darkknight.jewelrycraft.block;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow;
+
+public class BlockShadow extends BlockContainer
+{
+ private IIcon[] iconArray;
+
+ /**
+ *
+ */
+ public BlockShadow()
+ {
+ super(Material.iron);
+ setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getRenderBlockPass()
+ {
+ return 1;
+ }
+
+ /**
+ * @param worldObj
+ * @param x
+ * @param y
+ * @param z
+ * @param beaconX
+ * @param beaconY
+ * @param beaconZ
+ * @return
+ */
+ public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ)
+ {
+ return true;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param side
+ * @return
+ */
+ public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side)
+ {
+ return false;
+ }
+
+ /**
+ * @param par0
+ * @return
+ */
+ public static boolean isNormalCube(int par0)
+ {
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param var2
+ * @return
+ */
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntityBlockShadow();
+ }
+
+ /**
+ * @param par1IconRegister
+ */
+ @Override
+ public void registerBlockIcons(IIconRegister par1IconRegister)
+ {
+ iconArray = new IIcon[16];
+ for(int i = 0; i < iconArray.length; ++i)
+ iconArray[i] = par1IconRegister.registerIcon(getTextureName() + (15 - i));
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z)
+ {
+ if (world.getBlockMetadata(x, y, z) == 15) return null;
+ return super.getCollisionBoundingBoxFromPool(world, x, y, z);
+ }
+
+ /**
+ * @param par1IBlockAccess
+ * @param par2
+ * @param par3
+ * @param par4
+ */
+ @Override
+ public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
+ {
+ setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ }
+
+ /**
+ * @param p_149646_1_
+ * @param p_149646_2_
+ * @param p_149646_3_
+ * @param p_149646_4_
+ * @param p_149646_5_
+ * @return
+ */
+ @Override
+ public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_)
+ {
+ Block block = p_149646_1_.getBlock(p_149646_2_, p_149646_3_, p_149646_4_);
+ if (this == BlockList.shadowBlock) if (block == this) return false;
+ return block == this ? false : super.shouldSideBeRendered(p_149646_1_, p_149646_2_, p_149646_3_, p_149646_4_, p_149646_5_);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean hasComparatorInputOverride()
+ {
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param meta
+ * @return
+ */
+ @Override
+ public int getComparatorInputOverride(World world, int x, int y, int z, int meta)
+ {
+ return world.getBlockMetadata(x, y, z);
+ }
+
+ /**
+ * @param side
+ * @param meta
+ * @return
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ public IIcon getIcon(int side, int meta)
+ {
+ return iconArray[meta];
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockShadowEye.java b/src/main/java/darkknight/jewelrycraft/block/BlockShadowEye.java
new file mode 100644
index 0000000..1db2099
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockShadowEye.java
@@ -0,0 +1,134 @@
+package darkknight.jewelrycraft.block;
+
+import java.util.Random;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowEye;
+
+public class BlockShadowEye extends BlockContainer
+{
+ Random rand = new Random();
+
+ /**
+ *
+ */
+ protected BlockShadowEye()
+ {
+ super(Material.rock);
+ }
+
+ /**
+ * @param world
+ * @param var2
+ * @return
+ */
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntityShadowEye();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * @param iblockaccess
+ * @param i
+ * @param j
+ * @param k
+ * @param l
+ * @return
+ */
+ @Override
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getRenderType()
+ {
+ return -1;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityPlayer
+ * @param par6
+ * @param par7
+ * @param par8
+ * @param par9
+ * @return
+ */
+ @Override
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
+ {
+ TileEntityShadowEye tile = (TileEntityShadowEye)world.getTileEntity(i, j, k);
+ tile.active = true;
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param player
+ */
+ @Override
+ public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
+ {}
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityLiving
+ * @param par6ItemStack
+ */
+ @Override
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack)
+ {
+ int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
+ }
+
+ /**
+ * @param icon
+ */
+ @Override
+ public void registerBlockIcons(IIconRegister icon)
+ {
+ blockIcon = icon.registerIcon("minecraft:stonebrick");
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockShadowHand.java b/src/main/java/darkknight/jewelrycraft/block/BlockShadowHand.java
new file mode 100644
index 0000000..45a260f
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockShadowHand.java
@@ -0,0 +1,138 @@
+package darkknight.jewelrycraft.block;
+
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowHand;
+
+public class BlockShadowHand extends BlockContainer
+{
+
+ /**
+ * @param material
+ */
+ protected BlockShadowHand(Material material)
+ {
+ super(material);
+ setBlockBounds(0.2F, 0F, 0.2F, 0.8F, 1.0F, 0.8F);
+ }
+
+ /**
+ * @param world
+ * @param var2
+ * @return
+ */
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntityShadowHand();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * @param iblockaccess
+ * @param i
+ * @param j
+ * @param k
+ * @param l
+ * @return
+ */
+ @Override
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getRenderType()
+ {
+ return -1;
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param stack
+ */
+ public void dropItem(World world, double x, double y, double z, ItemStack stack)
+ {
+ EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1.5D, z + 0.5D, stack);
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.11000000298023224D;
+ world.spawnEntityInWorld(entityitem);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param block
+ * @param par6
+ */
+ @Override
+ public void breakBlock(World world, int i, int j, int k, Block block, int par6)
+ {
+ TileEntityShadowHand te = (TileEntityShadowHand)world.getTileEntity(i, j, k);
+ if (te != null && te.getHeldItemStack() != null){
+ dropItem(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, te.getHeldItemStack());
+ world.removeTileEntity(i, j, k);
+ }
+ super.breakBlock(world, i, j, k, block, par6);
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param entityLiving
+ * @param par6ItemStack
+ */
+ @Override
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack)
+ {
+ int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 8.0F / 360.0F + 0.5D) & 7;
+ world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
+ }
+
+ /**
+ * @param icon
+ */
+ @Override
+ public void registerBlockIcons(IIconRegister icon)
+ {
+ blockIcon = icon.registerIcon("minecraft:coal_block");
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java b/src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java
new file mode 100644
index 0000000..6d51a52
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/block/BlockSmelter.java
@@ -0,0 +1,260 @@
+package darkknight.jewelrycraft.block;
+
+import java.io.IOException;
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockContainer;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.IBlockAccess;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.item.ItemMoltenMetalBucket;
+import darkknight.jewelrycraft.network.PacketSendLiquidData;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class BlockSmelter extends BlockContainer
+{
+ Random rand = new Random();
+
+ public BlockSmelter()
+ {
+ super(Material.rock);
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World world, int var2)
+ {
+ return new TileEntitySmelter();
+ }
+
+ @Override
+ public boolean renderAsNormalBlock()
+ {
+ return false;
+ }
+
+ /**
+ * Spawns an item in the world at the specified location
+ *
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param stack
+ */
+ public void dropItem(World world, double x, double y, double z, ItemStack stack)
+ {
+ EntityItem entityitem = new EntityItem(world, x + 0.5D, y + 1.3D, z + 0.5D, stack);
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.11000000298023224D;
+ entityitem.delayBeforeCanPickup = 0;
+ world.spawnEntityInWorld(entityitem);
+ }
+
+ @Override
+ public void breakBlock(World world, int i, int j, int k, Block par5, int par6)
+ {
+ TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k);
+ if (te != null){
+ if (te.hasMetal) dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.metal.copy());
+ if (te.hasMoltenMetal && te.moltenMetal != null && Item.getIdFromItem(te.moltenMetal.getItem()) > 0){
+ ItemStack metal = te.moltenMetal;
+ ItemStack item = te.moltenMetal;
+ if (Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(metal.getItem()) == Block.getIdFromBlock(Blocks.carpet)) metal.setItemDamage(15 - metal.getItemDamage());
+ int color = 16777215;
+ JewelryNBT.addMetal(item, metal);
+ try{
+ color = ItemMoltenMetalBucket.color(item, 1);
+ System.out.println(color);
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ JewelrycraftMod.saveData.setString(i + " " + j + " " + k + " " + world.provider.dimensionId, Item.getIdFromItem(metal.getItem()) + ":" + metal.getItemDamage() + ":" + color);
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, i, j, k, Item.getIdFromItem(metal.getItem()), metal.getItemDamage(), color));
+ world.setBlock(i, j, k, BlockList.moltenMetal, 0, 3);
+ int quant = (int)(te.quantity * 10);
+ if (quant == 1) world.setBlockMetadataWithNotify(i, j, k, 4, 3);
+ if (quant == 2) world.setBlockMetadataWithNotify(i, j, k, 4, 3);
+ if (quant == 3) world.setBlockMetadataWithNotify(i, j, k, 3, 3);
+ if (quant == 4) world.setBlockMetadataWithNotify(i, j, k, 3, 3);
+ if (quant == 5) world.setBlockMetadataWithNotify(i, j, k, 2, 3);
+ if (quant == 6) world.setBlockMetadataWithNotify(i, j, k, 2, 3);
+ if (quant == 7) world.setBlockMetadataWithNotify(i, j, k, 1, 3);
+ if (quant == 8) world.setBlockMetadataWithNotify(i, j, k, 1, 3);
+ if (quant == 9) world.setBlockMetadataWithNotify(i, j, k, 0, 3);
+ }
+ world.removeTileEntity(i, j, k);
+ }
+ super.breakBlock(world, i, j, k, par5, par6);
+ }
+
+ @Override
+ public boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9)
+ {
+ TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k);
+ ItemStack item = entityPlayer.inventory.getCurrentItem();
+ if (te != null && te.hasMoltenMetal && te.quantity >= 0.9f && !te.pouring && item != null && item.getItem() == Items.bucket){
+ te.quantity = 0f;
+ te.hasMoltenMetal = false;
+ ItemStack metalBucket = new ItemStack(ItemList.bucket, 1);
+ ItemStack ingot = te.moltenMetal.copy();
+ if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage());
+ JewelryNBT.addMetal(metalBucket, ingot);
+ --item.stackSize;
+ entityPlayer.inventory.addItemStackToInventory(metalBucket);
+ te.isDirty = true;
+ return true;
+ }
+ if (te != null && !world.isRemote){
+ if (te.hasMetal && entityPlayer.isSneaking()){
+ dropItem(world, te.xCoord, te.yCoord, te.zCoord, te.metal.copy());
+ te.hasMetal = false;
+ te.melting = -1;
+ te.isDirty = true;
+ }
+ if (item != null && item.getItem() != null && !(item.getItem() instanceof ItemMoltenMetalBucket)){
+ int index = -1;
+ for(int a = 0; a < JewelrycraftUtil.jamcraftPlayers.size(); a++)
+ if (entityPlayer.getUniqueID().toString().equals(JewelrycraftUtil.jamcraftPlayers.get(a))) index = a;
+ if(entityPlayer.capabilities.isCreativeMode) index = 1;
+ boolean canPlace = item != null && (JewelrycraftUtil.isMetal(item) || JewelrycraftUtil.isOre(item) || index >= 0);
+ boolean isOre = false, oreCoincidesWithMetal = false, itemCoincidesWithMetal = false, itemCoincidesWithMoltenMetal = false, overflow = false;
+ isOre = JewelrycraftUtil.isOre(item);
+ if (te.metal != null && te.metal.getItem() != null) itemCoincidesWithMetal = item.getItem().equals(te.metal.getItem()) && item.getItemDamage() == te.metal.getItemDamage();
+ if (te.moltenMetal != null && te.moltenMetal.getItem() != null){
+ itemCoincidesWithMoltenMetal = item.getItem().equals(te.moltenMetal.getItem()) && item.getItemDamage() == te.moltenMetal.getItemDamage();
+ if (isOre) oreCoincidesWithMetal = te.moltenMetal.getItem().equals(JewelrycraftUtil.getIngotFromOre(item.getItem()).getItem()) && te.moltenMetal.getItemDamage() == JewelrycraftUtil.getIngotFromOre(item.getItem()).getItemDamage();
+ }
+ overflow = isOre ? te.metal.stackSize * 0.2f + te.quantity < 0.8f : te.metal.stackSize * 0.1f + te.quantity < 0.9f;
+ boolean isValid = te.hasMoltenMetal ? itemCoincidesWithMoltenMetal : true;
+ if (te.quantity < 0.9f && !te.pouring && canPlace && isValid){
+ boolean check = isOre ? oreCoincidesWithMetal && te.quantity < 0.8f : itemCoincidesWithMoltenMetal;
+ boolean check2 = isOre ? oreCoincidesWithMetal : itemCoincidesWithMetal;
+ if (!te.hasMetal && !te.hasMoltenMetal || !te.hasMetal && te.hasMoltenMetal && check){
+ entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.smelter.nowsmeltingingot", item.getDisplayName())));
+ te.metal = item.copy();
+ // if (Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(te.metal.getItem()) == Block.getIdFromBlock(Blocks.carpet)) te.metal.setItemDamage(15 - te.metal.getItemDamage());
+ te.metal.stackSize = 1;
+ te.hasMetal = true;
+ te.melting = ConfigHandler.ingotMeltingTime;
+ if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize;
+ te.isDirty = true;
+ }else if (te.hasMetal && te.hasMoltenMetal && check2 && overflow || te.hasMetal && !te.hasMoltenMetal && itemCoincidesWithMetal && overflow){
+ entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("Smelting extra " + (isOre ? "ores" : "ingots") + " (" + (te.metal.stackSize + 1) + ")")));
+ te.metal.stackSize++;
+ te.hasMetal = true;
+ te.melting += ConfigHandler.ingotMeltingTime;
+ if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize;
+ te.isDirty = true;
+ }
+ te.isDirty = true;
+ }else if (item != null && (te.hasMetal || te.hasMoltenMetal) && !itemCoincidesWithMoltenMetal && te.quantity < 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("Item does not match contents!")));
+ else if (item != null && !item.getUnlocalizedName().toLowerCase().contains("ingot") && te.quantity < 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.itemrenamedtoingot")));
+ else if (item != null && te.quantity >= 0.9f) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("Smelter is at full capacity.")));
+ }else if (item != null && item.getItem() != null && item.getItem() instanceof ItemMoltenMetalBucket && !te.hasMoltenMetal && !te.hasMetal){
+ te.hasMoltenMetal = true;
+ ItemStack ingot = JewelryNBT.ingot(item);
+ if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage());
+ te.moltenMetal = ingot;
+ te.quantity = 0.9f;
+ te.isDirty = true;
+ if (!entityPlayer.capabilities.isCreativeMode){
+ --item.stackSize;
+ dropItem(world, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, new ItemStack(Items.bucket));
+ }
+ }else if (item == null && te.hasMoltenMetal && te.moltenMetal.getItem() != null) entityPlayer.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.smelter.hasmolteningot", te.moltenMetal.getDisplayName())));
+ world.setTileEntity(i, j, k, te);
+ }
+ return true;
+ }
+
+ @Override
+ public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player)
+ {
+ TileEntitySmelter te = (TileEntitySmelter)world.getTileEntity(i, j, k);
+ TileEntityMolder me = null;
+ if (world.getBlockMetadata(i, j, k) == 0 && world.getTileEntity(i, j, k - 1) != null && world.getTileEntity(i, j, k - 1) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i, j, k - 1);
+ else if (world.getBlockMetadata(i, j, k) == 1 && world.getTileEntity(i + 1, j, k) != null && world.getTileEntity(i + 1, j, k) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i + 1, j, k);
+ else if (world.getBlockMetadata(i, j, k) == 2 && world.getTileEntity(i, j, k + 1) != null && world.getTileEntity(i, j, k + 1) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i, j, k + 1);
+ else if (world.getBlockMetadata(i, j, k) == 3 && world.getTileEntity(i - 1, j, k) != null && world.getTileEntity(i - 1, j, k) instanceof TileEntityMolder) me = (TileEntityMolder)world.getTileEntity(i - 1, j, k);
+ if (te != null && me != null && !world.isRemote) if (te.hasMoltenMetal && isConnectedToMolder(world, i, j, k) && me != null && me.hasMold && !me.hasMoltenMetal && !me.hasJewelBase){
+ te.pouring = true;
+ te.isDirty = true;
+// System.out.println(Block.getBlockById(Item.getIdFromItem(te.moltenMetal.getItem())));
+ }else if (te.hasMetal && te.melting > 0) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.smelter.metalismelting", te.metal.getDisplayName()) + " (" + (ConfigHandler.ingotMeltingTime * te.metal.stackSize - te.melting) * 100 / (ConfigHandler.ingotMeltingTime * te.metal.stackSize) + "%)"));
+ else if (te.hasMoltenMetal && !isConnectedToMolder(world, i, j, k)) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.molderismissing")));
+ else if (!me.hasMold && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.molderhasnomold")));
+ else if (me.hasMoltenMetal && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.molderhasmoltenmetal")));
+ else if (me.hasJewelBase && te.hasMoltenMetal) player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.modlerhasitem")));
+ else player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.empty")));
+ }
+
+ /**
+ * Determines if a molder is placed in front of this
+ *
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @return true if a molder is attached, false otherwise
+ */
+ public boolean isConnectedToMolder(World world, int i, int j, int k)
+ {
+ int blockMeta = world.getBlockMetadata(i, j, k);
+ if (blockMeta == 0 && world.getBlock(i, j, k - 1) instanceof BlockMolder) return true;
+ else if (blockMeta == 1 && world.getBlock(i + 1, j, k) instanceof BlockMolder) return true;
+ else if (blockMeta == 2 && world.getBlock(i, j, k + 1) instanceof BlockMolder) return true;
+ else if (blockMeta == 3 && world.getBlock(i - 1, j, k) instanceof BlockMolder) return true;
+ return false;
+ }
+
+ @Override
+ public void onBlockPlacedBy(World world, int i, int j, int k, EntityLivingBase entityLiving, ItemStack par6ItemStack)
+ {
+ int rotation = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
+ world.setBlockMetadataWithNotify(i, j, k, rotation, 2);
+ }
+
+ @Override
+ public boolean shouldSideBeRendered(IBlockAccess iblockaccess, int i, int j, int k, int l)
+ {
+ return false;
+ }
+
+ @Override
+ public boolean isOpaqueCube()
+ {
+ return false;
+ }
+
+ @Override
+ public int getRenderType()
+ {
+ return -1;
+ }
+
+ @Override
+ public void registerBlockIcons(IIconRegister icon)
+ {
+ blockIcon = icon.registerIcon("jewelrycraft:smelter");
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
new file mode 100644
index 0000000..6728181
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
@@ -0,0 +1,74 @@
+package darkknight.jewelrycraft.client;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.GuiButton;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.*;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+/**
+ * @author TinkersCOnstruct
+ */
+@SideOnly(Side.CLIENT)
+public abstract class AbstractTab extends GuiButton
+{
+ ResourceLocation texture = new ResourceLocation("textures/gui/container/creative_inventory/tabs.png");
+ ItemStack renderStack;
+ RenderItem itemRenderer = new RenderItem();
+
+ public AbstractTab(int id, int posX, int posY, ItemStack renderStack)
+ {
+ super(id, posX, posY, 28, 32, "");
+ this.renderStack = renderStack;
+ }
+
+ @Override
+ public void drawButton (Minecraft mc, int mouseX, int mouseY)
+ {
+ if (this.visible)
+ {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+
+ int yTexPos = this.enabled ? 3 : 32;
+ int ySize = this.enabled ? 25 : 32;
+ int xOffset = this.id == 2 ? 0 : 1;
+ int yPos = this.yPosition + (this.enabled ? 3 : 0);
+
+ mc.renderEngine.bindTexture(this.texture);
+ this.drawTexturedModalRect(this.xPosition, yPos, xOffset * 28, yTexPos, 28, ySize);
+
+ RenderHelper.enableGUIStandardItemLighting();
+ this.zLevel = 100.0F;
+ this.itemRenderer.zLevel = 100.0F;
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
+ this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 6, yPosition + 8);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ this.itemRenderer.zLevel = 0.0F;
+ this.zLevel = 0.0F;
+ RenderHelper.disableStandardItemLighting();
+ }
+ }
+
+ @Override
+ public boolean mousePressed (Minecraft mc, int mouseX, int mouseY)
+ {
+ boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
+
+ if (inWindow)
+ {
+ this.onTabClicked();
+ }
+
+ return inWindow;
+ }
+
+ public abstract void onTabClicked ();
+
+ public abstract boolean shouldAddToList ();
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/ClientProxy.java b/src/main/java/darkknight/jewelrycraft/client/ClientProxy.java
new file mode 100644
index 0000000..9baadcb
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/ClientProxy.java
@@ -0,0 +1,87 @@
+package darkknight.jewelrycraft.client;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.item.Item;
+import net.minecraft.util.ResourceLocation;
+import net.minecraftforge.client.MinecraftForgeClient;
+import net.minecraftforge.common.MinecraftForge;
+import cpw.mods.fml.client.registry.ClientRegistry;
+import cpw.mods.fml.client.registry.RenderingRegistry;
+import cpw.mods.fml.common.registry.VillagerRegistry;
+import darkknight.jewelrycraft.CommonProxy;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.entities.EntityHalfHeart;
+import darkknight.jewelrycraft.entities.EntityHeart;
+import darkknight.jewelrycraft.entities.renders.HeartRender;
+import darkknight.jewelrycraft.events.PlayerRenderHandler;
+import darkknight.jewelrycraft.events.ScreenHandler;
+import darkknight.jewelrycraft.model.ModelDisplayer;
+import darkknight.jewelrycraft.model.ModelHalfHeart;
+import darkknight.jewelrycraft.model.ModelHandPedestal;
+import darkknight.jewelrycraft.model.ModelHeart;
+import darkknight.jewelrycraft.model.ModelJewlersCraftingBench;
+import darkknight.jewelrycraft.model.ModelMolder;
+import darkknight.jewelrycraft.model.ModelShadowEye;
+import darkknight.jewelrycraft.model.ModelShadowHand;
+import darkknight.jewelrycraft.model.ModelSmelter;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal;
+import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowEye;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowHand;
+import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+import darkknight.jewelrycraft.tileentity.renders.ItemRender;
+import darkknight.jewelrycraft.tileentity.renders.TileEntityDisplayerRender;
+import darkknight.jewelrycraft.tileentity.renders.TileEntityHandPedestalRender;
+import darkknight.jewelrycraft.tileentity.renders.TileEntityJewelrsCraftingTableRender;
+import darkknight.jewelrycraft.tileentity.renders.TileEntityMolderRender;
+import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowEyeRender;
+import darkknight.jewelrycraft.tileentity.renders.TileEntityShadowHandRender;
+import darkknight.jewelrycraft.tileentity.renders.TileEntitySmelterRender;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class ClientProxy extends CommonProxy
+{
+ @Override
+ public void preInit()
+ {
+ ResourceLocation pedestalResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/BricksPedestal.png");
+ TileEntityHandPedestalRender pedestalRender = new TileEntityHandPedestalRender(new ModelHandPedestal(pedestalResourceLocation), pedestalResourceLocation);
+ ResourceLocation shadowResourceLocation = new ResourceLocation("jewelrycraft", "textures/tileentities/ShadowHand.png");
+ TileEntityShadowHandRender shadowHandRender = new TileEntityShadowHandRender(new ModelShadowHand(shadowResourceLocation), shadowResourceLocation);
+
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender());
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender());
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender());
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender());
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowEye.class, new TileEntityShadowEyeRender());
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityHandPedestal.class, pedestalRender);
+ ClientRegistry.bindTileEntitySpecialRenderer(TileEntityShadowHand.class, shadowHandRender);
+
+ MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.displayer), new ItemRender(new TileEntityDisplayerRender(), new TileEntityDisplayer(), new ModelDisplayer()));
+ MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.jewelCraftingTable), new ItemRender(new TileEntityJewelrsCraftingTableRender(), new TileEntityJewelrsCraftingTable(), new ModelJewlersCraftingBench()));
+ MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.smelter), new ItemRender(new TileEntitySmelterRender(), new TileEntitySmelter(), new ModelSmelter()));
+ MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.molder), new ItemRender(new TileEntityMolderRender(), new TileEntityMolder(), new ModelMolder()));
+ MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowEye), new ItemRender(new TileEntityShadowEyeRender(), new TileEntityShadowEye(), new ModelShadowEye()));
+ MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.handPedestal), new ItemRender(pedestalRender, new TileEntityHandPedestal(), new ModelHandPedestal(pedestalResourceLocation)));
+ MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(BlockList.shadowHand), new ItemRender(shadowHandRender, new TileEntityShadowHand(), new ModelShadowHand(shadowResourceLocation)));
+ VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation("jewelrycraft", "textures/entities/jeweler.png"));
+
+ RenderingRegistry.registerEntityRenderingHandler(EntityHeart.class, new HeartRender(new ModelHeart(), 0.25F));
+ RenderingRegistry.registerEntityRenderingHandler(EntityHalfHeart.class, new HeartRender(new ModelHalfHeart(), 0.25F));
+
+ TabRegistry.registerTab(new InventoryTabVanilla());
+ TabRegistry.registerTab(new TabJewelry());
+ MinecraftForge.EVENT_BUS.register(new TabRegistry());
+ MinecraftForge.EVENT_BUS.register(new PlayerRenderHandler());
+ ResourceLocation jeweleryTexture = new ResourceLocation("jewelrycraft", "textures/gui/curses.png");
+ MinecraftForge.EVENT_BUS.register(new ScreenHandler(Minecraft.getMinecraft(), jeweleryTexture));
+ }
+
+ @Override
+ public void postInit()
+ {
+ JewelrycraftUtil.addStuff();
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/GuiGuide.java b/src/main/java/darkknight/jewelrycraft/client/GuiGuide.java
new file mode 100644
index 0000000..09fc6a3
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/GuiGuide.java
@@ -0,0 +1,241 @@
+package darkknight.jewelrycraft.client;
+
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockAir;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.inventory.Container;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.block.BlockShadowEye;
+import darkknight.jewelrycraft.container.GuiRectangle;
+import darkknight.jewelrycraft.container.GuiTab;
+import darkknight.jewelrycraft.container.GuiTabBlocks;
+import darkknight.jewelrycraft.container.GuiTabGemsAndIngots;
+import darkknight.jewelrycraft.container.GuiTabIntroduction;
+import darkknight.jewelrycraft.container.GuiTabItems;
+import darkknight.jewelrycraft.container.GuiTabModifiers;
+import darkknight.jewelrycraft.container.GuiTabRitual;
+
+public class GuiGuide extends GuiContainer
+{
+ public int page, rot, del;
+ public boolean prevHover, nextHover;
+ World world;
+ private final GuiTab[] tabs;
+ private GuiTab activeTab;
+ ResourceLocation pageTexture, flippedPageTexture;
+
+ /**
+ * @param container
+ * @param world
+ * @param pageTex
+ * @param flipPageTex
+ */
+ public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex)
+ {
+ super(container);
+ page = 1;
+ rot = 0;
+ del = 0;
+ this.world = world;
+ tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabModifiers(4), new GuiTabRitual(5)};
+ activeTab = tabs[0];
+ pageTexture = pageTex;
+ flippedPageTexture = flipPageTex;
+ }
+
+ /**
+ * @param f
+ * @param i
+ * @param j
+ */
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
+ {
+ nextHover = false;
+ prevHover = false;
+ if (del == 0) rot++;
+ del++;
+ if (del >= 2) del = 0;
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture);
+ drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture);
+ drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180);
+ for(GuiRectangle tab: tabs){
+ int srcX = 24;
+ int sizeX = 19;
+ if (tab == activeTab){
+ srcX += 38;
+ sizeX += 3;
+ }else if (tab.inRect(this, i, j)) srcX += 19;
+ tab.draw(this, srcX, 180, sizeX, 18);
+ }
+ if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){
+ drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14);
+ nextHover = true;
+ }
+ if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){
+ drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14);
+ prevHover = true;
+ }
+ activeTab.drawBackground(this, i, j, page);
+ activeTab.drawBackground(this, i, j, page + 1);
+ ArrayList<String> text = new ArrayList<String>();
+ text.add(Integer.toString(page));
+ drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj);
+ text.remove(Integer.toString(page));
+ text.add(Integer.toString(page + 1));
+ drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRendererObj);
+ for(int tab = 0; tab < tabs.length; tab++)
+ renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon());
+ }
+
+ /**
+ * @param x
+ * @param y
+ */
+ @Override
+ protected void drawGuiContainerForegroundLayer(int x, int y)
+ {
+ activeTab.drawForeground(this, x, y, page);
+ activeTab.drawForeground(this, x, y, page + 1);
+ for(GuiTab tab: tabs)
+ tab.drawString(this, x, y, tab.getName());
+ }
+
+ /**
+ * @param x
+ * @param y
+ * @param button
+ */
+ @Override
+ protected void mouseClicked(int x, int y, int button)
+ {
+ if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2;
+ else if (prevHover && page > 1) page -= 2;
+ activeTab.mouseClick(this, x, y, button);
+ for(GuiTab tab: tabs)
+ if (activeTab != tab) if (tab.inRect(this, x, y)){
+ activeTab = tab;
+ page = 1;
+ break;
+ }
+ }
+
+ /**
+ * @param item
+ * @param x
+ * @param y
+ * @param activeIcon
+ */
+ public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon)
+ {
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
+ entityitem.hoverStart = 0.0F;
+ if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))) y -= 4;
+ GL11.glTranslatef(x, y, 100);
+ float scale = 30F;
+ GL11.glScalef(-scale, scale, scale);
+ if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0);
+ if (item.isItemEqual(new ItemStack(BlockList.jewelAltar))){
+ GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F);
+ GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F);
+ }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){
+ GL11.glScalef(1.2F, 1.2F, 1.2F);
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ GL11.glTranslatef(0F, 0.05F, 0F);
+ }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting();
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param item
+ * @param x
+ * @param y
+ * @param scale
+ */
+ public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot)
+ {
+ GL11.glPushMatrix();
+ EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
+ entityitem.hoverStart = 0.0F;
+ GL11.glTranslatef(x, y, 100);
+ GL11.glScalef(-scale, scale, scale);
+ GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F);
+ if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F);
+ else{
+ // GL11.glRotatef(entityitem.getEntityItem().getItemDamage() % 8 / 8F * 360, 0, 1, 0);
+ GL11.glRotatef(xRot, 1, 0, 0);
+ GL11.glRotatef(yRot, 0, 1, 0);
+ GL11.glRotatef(zRot, 0, 0, 1);
+ if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F);
+ if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F);
+ }
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @return
+ */
+ public int getLeft()
+ {
+ return guiLeft;
+ }
+
+ /**
+ * @return
+ */
+ public int getTop()
+ {
+ return guiTop;
+ }
+
+ /**
+ * @return
+ */
+ public FontRenderer getFont()
+ {
+ return fontRendererObj;
+ }
+
+ /**
+ * @param lst
+ * @param x
+ * @param y
+ */
+ @SuppressWarnings ("rawtypes")
+ public void drawHoverString(List lst, int x, int y)
+ {
+ drawHoveringText(lst, x, y, fontRendererObj);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/GuiJewelry.java b/src/main/java/darkknight/jewelrycraft/client/GuiJewelry.java
new file mode 100644
index 0000000..0f8e59a
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/GuiJewelry.java
@@ -0,0 +1,69 @@
+package darkknight.jewelrycraft.client;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.container.ContainerJewelryTab;
+import darkknight.jewelrycraft.container.JewelryInventory;
+import darkknight.jewelrycraft.events.KeyBindings;
+
+public class GuiJewelry extends GuiContainer
+{
+ ResourceLocation texture;
+
+ /**
+ * @param containerJewelryTab
+ * @param texture
+ */
+ public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture)
+ {
+ super(containerJewelryTab);
+ xSize = 194;
+ ySize = 166;
+ this.texture = texture;
+ }
+
+ /**
+ * @param f
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY)
+ {
+ GL11.glColor3f(1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
+ }
+
+ /**
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
+ {}
+
+ /**
+ * @param charecter
+ * @param key
+ */
+ @Override
+ protected void keyTyped(char charecter, int key)
+ {
+ super.keyTyped(charecter, key);
+ if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen();
+ }
+
+ @Override
+ public void initGui ()
+ {
+ super.initGui();
+ int cornerX = guiLeft;
+ int cornerY = guiTop;
+ this.buttonList.clear();
+ TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class);
+ TabRegistry.addTabsToList(this.buttonList);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/GuiRingChest.java b/src/main/java/darkknight/jewelrycraft/client/GuiRingChest.java
new file mode 100644
index 0000000..2504d6f
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/GuiRingChest.java
@@ -0,0 +1,50 @@
+package darkknight.jewelrycraft.client;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.container.ContainerRingChest;
+
+public class GuiRingChest extends GuiContainer
+{
+ public ContainerRingChest container;
+ ResourceLocation texture;
+
+ /**
+ * @param container
+ * @param texture
+ */
+ public GuiRingChest(ContainerRingChest container, ResourceLocation texture)
+ {
+ super(container);
+ this.container = container;
+ xSize = 176;
+ ySize = 166;
+ this.texture = texture;
+ }
+
+ /**
+ * @param f
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY)
+ {
+ GL11.glColor3f(1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
+ }
+
+ /**
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
+ {
+ fontRendererObj.drawString("Linked Chest", 8, 6, 0x404040);
+ fontRendererObj.drawString("Inventory", 8, 72, 0x404040);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java b/src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java
new file mode 100644
index 0000000..c8d598c
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java
@@ -0,0 +1,24 @@
+package darkknight.jewelrycraft.client;
+
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+
+public class InventoryTabVanilla extends AbstractTab
+{
+ public InventoryTabVanilla()
+ {
+ super(0, 0, 0, new ItemStack(Blocks.crafting_table));
+ }
+
+ @Override
+ public void onTabClicked ()
+ {
+ TabRegistry.openInventoryGui();
+ }
+
+ @Override
+ public boolean shouldAddToList ()
+ {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java b/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java
new file mode 100644
index 0000000..4598962
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java
@@ -0,0 +1,27 @@
+package darkknight.jewelrycraft.client;
+
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.network.PacketKeyPressEvent;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+
+public class TabJewelry extends AbstractTab
+{
+ public TabJewelry()
+ {
+ super(0, 0, 0, new ItemStack(ItemList.necklace));
+ }
+
+ @Override
+ public void onTabClicked ()
+ {
+ JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0));
+ }
+
+ @Override
+ public boolean shouldAddToList ()
+ {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java
new file mode 100644
index 0000000..2765b73
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java
@@ -0,0 +1,86 @@
+package darkknight.jewelrycraft.client;
+
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiInventory;
+import net.minecraft.network.play.client.C0DPacketCloseWindow;
+import net.minecraftforge.client.event.GuiScreenEvent;
+import cpw.mods.fml.client.FMLClientHandler;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.client.*;
+
+/**
+ * @author TinkersConstruct
+ */
+public class TabRegistry
+{
+ private static ArrayList<AbstractTab> tabList = new ArrayList<AbstractTab>();
+
+ public static void registerTab (AbstractTab tab)
+ {
+ tabList.add(tab);
+ }
+
+ public static ArrayList<AbstractTab> getTabList ()
+ {
+ return tabList;
+ }
+
+ @SideOnly(Side.CLIENT)
+ @SubscribeEvent
+ public void guiPostInit (GuiScreenEvent.InitGuiEvent.Post event)
+ {
+ if ((event.gui instanceof GuiInventory))
+ {
+ int xSize = 176;
+ int ySize = 166;
+ int guiLeft = (event.gui.width - xSize) / 2;
+ int guiTop = (event.gui.height - ySize) / 2;
+ if(!mc.thePlayer.getActivePotionEffects().isEmpty()) guiLeft += 60;
+
+ updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class);
+ addTabsToList(event.buttonList);
+ }
+ }
+
+ private static Minecraft mc = FMLClientHandler.instance().getClient();
+
+ public static void openInventoryGui ()
+ {
+ mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId));
+ GuiInventory inventory = new GuiInventory(mc.thePlayer);
+ mc.displayGuiScreen(inventory);
+ }
+
+ public static void updateTabValues (int cornerX, int cornerY, Class<?> selectedButton)
+ {
+ int count = 2;
+ for (int i = 0; i < tabList.size(); i++)
+ {
+ AbstractTab t = tabList.get(i);
+
+ if (t.shouldAddToList())
+ {
+ t.id = count;
+ t.xPosition = cornerX + (count - 2) * 28;
+ t.yPosition = cornerY - 28;
+ t.enabled = !t.getClass().equals(selectedButton);
+ count++;
+ }
+ }
+ }
+
+ public static void addTabsToList (List buttonList)
+ {
+ for (AbstractTab tab : tabList)
+ {
+ if (tab.shouldAddToList())
+ {
+ buttonList.add(tab);
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java b/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java
new file mode 100644
index 0000000..e8f639d
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/commands/JewelrycraftCommands.java
@@ -0,0 +1,124 @@
+/**
+ *
+ */
+package darkknight.jewelrycraft.commands;
+
+/**
+ * @author Sorin
+ *
+ */
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+import net.minecraft.command.CommandBase;
+import net.minecraft.command.ICommandSender;
+import net.minecraft.command.WrongUsageException;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.ChatComponentTranslation;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IChatComponent;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.curses.Curse;
+import darkknight.jewelrycraft.events.EntityEventHandler;
+import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class JewelrycraftCommands extends CommandBase
+{
+ private List aliases;
+
+ public JewelrycraftCommands()
+ {
+ this.aliases = new ArrayList();
+ this.aliases.add("jw");
+ this.aliases.add("jc");
+ this.aliases.add("jcrft");
+ this.aliases.add("jCraft");
+ this.aliases.add("jewelry");
+ }
+
+ @Override
+ public String getCommandName()
+ {
+ return "jewelrycraft";
+ }
+
+ @Override
+ public String getCommandUsage(ICommandSender var1)
+ {
+ String use = "/jewelrycraft <addCursePoints:getCursePoints:setCursePoints> <user> [points] | ";
+ use += "/jewelrycraft <addModifier> <modifier> |";
+ use += "/jewelrycraft <addCurse> <user> <curseID> <curseGrade>";
+ return use;
+ }
+
+ @Override
+ public List getCommandAliases()
+ {
+ return aliases;
+ }
+
+ @Override
+ public void processCommand(ICommandSender commandSender, String[] astring)
+ {
+ if (astring.length == 0 || astring[0].equals("help")) throw new WrongUsageException(getCommandUsage(commandSender));
+ if (astring[0].equals("getCursePoints")){
+ EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]);
+ commandSender.addChatMessage(new ChatComponentTranslation(Integer.toString(JewelrycraftUtil.getCursePoints(entityplayermp))));
+ }else if (astring[0].equals("addCursePoints")){
+ int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0);
+ EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]);
+ JewelrycraftUtil.addCursePoints(entityplayermp, points);
+ }else if (astring[0].equals("setCursePoints")){
+ int points = CommandBase.parseIntWithMin(commandSender, astring[2], 0);
+ EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]);
+ JewelrycraftUtil.addCursePoints(entityplayermp, points - JewelrycraftUtil.getCursePoints(entityplayermp));
+ }else if (astring[0].equals("addModifier")){
+ ItemStack item = new ItemStack(CommandBase.getItemByText(commandSender, astring[1]));
+ EntityPlayerMP entityplayermp = getPlayer(commandSender, commandSender.getCommandSenderName());
+ ArrayList<ItemStack> modifier = new ArrayList<ItemStack>();
+ modifier.add(item);
+ JewelryNBT.addModifiers(entityplayermp.getCurrentEquippedItem(), modifier);
+ }else if (astring[0].equals("addCurse")){
+ EntityPlayerMP entityplayermp = getPlayer(commandSender, astring[1]);
+ int curse = Integer.valueOf(astring[2]);
+ int grade = Integer.valueOf(astring[3]);
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(entityplayermp, "Jewelrycraft");
+ if(curse < Curse.getCurseList().size() && grade <= 2)
+ {
+ EntityEventHandler.addCurse(entityplayermp, playerInfo, curse, grade);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ }
+ else if(curse >= Curse.getCurseList().size()) entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse ID exceedes the maximum value of " + (Curse.getCurseList().size() - 1)));
+ else entityplayermp.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "Curse grade exceedes the maximum value of 2"));
+
+ }
+ }
+
+ @Override
+ public List addTabCompletionOptions(ICommandSender icommandsender, String[] astring)
+ {
+ final List<String> MATCHES = new LinkedList<String>();
+ final String ARG_LC = astring[astring.length - 1].toLowerCase();
+ if (astring.length == 1){
+ if ("addCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCursePoints");
+ if ("getCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("getCursePoints");
+ if ("setCursePoints".toLowerCase().startsWith(ARG_LC)) MATCHES.add("setCursePoints");
+ if ("addModifier".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addModifier");
+ if ("addCurse".toLowerCase().startsWith(ARG_LC)) MATCHES.add("addCurse");
+ }else if (astring.length == 2){
+ if (!astring[0].equals("addModifier")){
+ for(String un: MinecraftServer.getServer().getAllUsernames())
+ if (un.toLowerCase().startsWith(ARG_LC)) MATCHES.add(un);
+ }else if (!astring[0].equals("addCurse")) return getListOfStringsFromIterableMatchingLastWord(astring, Item.itemRegistry.getKeys());
+ }
+ return MATCHES.isEmpty() ? null : MATCHES;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java b/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java
new file mode 100644
index 0000000..a7d4157
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/config/ConfigHandler.java
@@ -0,0 +1,54 @@
+package darkknight.jewelrycraft.config;
+
+import java.io.File;
+import net.minecraftforge.common.config.Configuration;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+
+public class ConfigHandler
+{
+ public static Configuration config;
+ public static int ingotCoolingTime = 100;
+ public static int ingotMeltingTime = 1500;
+ public static int jewelryCraftingTime = 200;
+ private static boolean isInitialized = false;
+ public static boolean generateVillageNetherstar = false;
+ public static boolean canFurnacesGenerateIngots = true;
+ public static int maxVillageJewelers = 1;
+ public static int jewelerWeight = 30;
+ public static int ingotChestMin = 1;
+ public static int ingotChestMax = 4;
+ public static int ingotChestMaxStack = 2;
+ public static int jewelsChestMin = 2;
+ public static int jewelsChestMax = 5;
+ public static int furnacesIngotStackMin = 2;
+ public static int furnacesIngotStackMax = 5;
+
+ /**
+ * Generates the config file and all the elements and attributes them to the appropriate variables if they exist
+ *
+ * @param e FMLPreInitializationEvent
+ */
+ public static void preInit(FMLPreInitializationEvent e)
+ {
+ if (!isInitialized){
+ config = new Configuration(new File(e.getModConfigurationDirectory(), "JewelryCraftv2.0.cfg"));
+ config.load();
+ ingotCoolingTime = config.get("Timers", "Molder Ingot Cooling Time", ingotCoolingTime, "This sets the number of ticks you need to wait before the mold is cooled.").getInt();
+ ingotMeltingTime = config.get("Timers", "Ingot Melting Time", ingotMeltingTime, "This sets the number of ticks you need to wait before an ingot is completely smelted.").getInt();
+ jewelryCraftingTime = config.get("Timers", "Jewelry Crafting Time", jewelryCraftingTime, "This sets the number of ticks it takes for a jewel to be modified.").getInt();
+ generateVillageNetherstar = config.get("Village Generation", "Netherstar Generation", generateVillageNetherstar, "If set to true Nether Stars will be able to generate in Jewelers chests.").getBoolean(generateVillageNetherstar);
+ canFurnacesGenerateIngots = config.get("Village Generation", "Furnace Ingots Generation", canFurnacesGenerateIngots, "If set to true jewelers will generate ingots in furnaces.").getBoolean(canFurnacesGenerateIngots);
+ maxVillageJewelers = config.get("Village Generation", "Maximum Jewelers", maxVillageJewelers, "Sets how many jewelers can be in a village.").getInt();
+ jewelerWeight = config.get("Village Generation", "Jewelers Weight", jewelerWeight, "Chance of getting a jeweler in a village. The higher the value, the higher the chance.").getInt();
+ ingotChestMin = config.get("Village Generation", "Ingot Chest Min", ingotChestMin, "Minimum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt();
+ ingotChestMax = config.get("Village Generation", "Ingot Chest Max", ingotChestMax, "Maximum number of ingots that can be found in a chest from the Jeweler. (It's the chest from the back part)").getInt();
+ ingotChestMaxStack = config.get("Village Generation", "Ingot Chest Max Stack", ingotChestMaxStack, "Maximum number of the stack the ingots can be. For example: if set to 2 and ingots have a chance of generating, you have a chance of getting a stack of max 2 ingots in a chest.").getInt();
+ jewelsChestMin = config.get("Village Generation", "Jewelers Chest Min", jewelsChestMin, "Determines the minimum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt();
+ jewelsChestMax = config.get("Village Generation", "Jewelers Chest Max", jewelsChestMax, "Determines the maximum nuber of jewels/modifiers that can be generated in the front chests of a Jeweler.").getInt();
+ furnacesIngotStackMin = config.get("Village Generation", "Ingot Furnace Min", furnacesIngotStackMin, "Determines the minimum number of ingots that can generate in a furnace.").getInt();
+ furnacesIngotStackMax = config.get("Village Generation", "Ingot Furnace Max", furnacesIngotStackMax, "Determines the maximum number of ingots that can generate in a furnace.").getInt();
+ config.save();
+ isInitialized = true;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java b/src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java
new file mode 100644
index 0000000..b6513a3
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java
@@ -0,0 +1,27 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+
+/**
+ * User: joel / Date: 16.12.13 / Time: 22:36
+ */
+public class ContainerGuide extends Container
+{
+
+ /**
+ *
+ */
+ public ContainerGuide()
+ {}
+
+ /**
+ * @param entityplayer
+ * @return
+ */
+ @Override
+ public boolean canInteractWith(EntityPlayer entityplayer)
+ {
+ return true;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java b/src/main/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java
new file mode 100644
index 0000000..701b338
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java
@@ -0,0 +1,87 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import darkknight.jewelrycraft.item.ItemRing;
+
+public class ContainerJewelryTab extends Container
+{
+
+ /**
+ * @param player
+ * @param inv
+ * @param extra
+ */
+ public ContainerJewelryTab(EntityPlayer player, IInventory inv, IInventory extra)
+ {
+ int x, y;
+ // Rings
+ for(x = 0; x <= 9; x++)
+ addSlotToContainer(new SlotRing(extra, x, 8 + x * 18, 7));
+ // Bracelets
+ for(x = 10; x <= 13; x++)
+ addSlotToContainer(new SlotBracelet(extra, x, 8 + (x - 10) * 18, 26));
+ // Necklaces
+ for(x = 14; x <= 16; x++)
+ addSlotToContainer(new SlotNecklace(extra, x, 8 + (x - 14) * 18, 45));
+ // Earrings
+ addSlotToContainer(new SlotEarrings(extra, 17, 8, 64));
+ // Hotbar
+ for(x = 0; x < 9; ++x)
+ addSlotToContainer(new Slot(inv, x, 17 + x * 18, 142));
+ // Inventory
+ for(x = 0; x < 3; ++x)
+ for(y = 0; y < 9; ++y)
+ addSlotToContainer(new Slot(inv, 9 + y + x * 9, 17 + y * 18, 84 + x * 18));
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return true;
+ }
+
+ /**
+ * @param player
+ * @param slotID
+ * @return
+ */
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
+ {
+ ItemStack itemstack = null;
+ Slot slot = (Slot)inventorySlots.get(slotID);
+ if (slot != null && slot.getHasStack()){
+ ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+ if (slotID < 18){
+ if (!mergeItemStack(itemstack1, 18, 18 + 36, true)) return null;
+ slot.onSlotChange(itemstack1, itemstack);
+ }else if (itemstack1.getItem() instanceof ItemRing){
+ if (!mergeItemStack(itemstack1, 0, 10, false)) return null;
+ }else if (itemstack1.getItem() instanceof ItemBracelet){
+ if (!mergeItemStack(itemstack1, 10, 14, false)) return null;
+ }else if (itemstack1.getItem() instanceof ItemNecklace){
+ if (!mergeItemStack(itemstack1, 14, 17, false)) return null;
+ }else if (itemstack1.getItem() instanceof ItemEarrings){
+ if (!mergeItemStack(itemstack1, 17, 18, false)) return null;
+ }else{
+ if (!mergeItemStack(itemstack1, 18, 54, true)) return null;
+ slot.onSlotChange(itemstack1, itemstack);
+ }
+ if (itemstack1.stackSize == 0) slot.putStack((ItemStack)null);
+ else slot.onSlotChanged();
+ }
+ return itemstack;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java b/src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java
new file mode 100644
index 0000000..925ded7
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java
@@ -0,0 +1,63 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntityChest;
+
+public class ContainerRingChest extends Container
+{
+ public TileEntityChest theChest;
+
+ /**
+ * @param inv
+ * @param chest
+ */
+ public ContainerRingChest(InventoryPlayer inv, TileEntityChest chest)
+ {
+ theChest = chest;
+ int x, y;
+ for(x = 0; x < 9; x++)
+ addSlotToContainer(new SlotRingChest(inv, x, 8 + 18 * x, 142, x == inv.currentItem));
+ for(y = 0; y < 3; y++)
+ for(x = 0; x < 9; x++)
+ addSlotToContainer(new Slot(inv, x + 9 + y * 9, 8 + 18 * x, 84 + y * 18));
+ for(y = 0; y < 3; y++)
+ for(x = 0; x < 9; x++)
+ addSlotToContainer(new SlotRingChest(chest, 26 - (x + y * 9), 8 + 18 * (8 - x), 17 + (2 - y) * 18, false));
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return true;
+ }
+
+ /**
+ * @param par1EntityPlayer
+ * @param par2
+ * @return
+ */
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
+ {
+ ItemStack itemstack = null;
+ Slot slot = (Slot)inventorySlots.get(par2);
+ if (slot != null && slot.getHasStack()){
+ ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+ if (par2 < 27){
+ if (!mergeItemStack(itemstack1, 27, inventorySlots.size(), true)) return null;
+ }else if (!mergeItemStack(itemstack1, 0, 27, false)) return null;
+ if (itemstack1.stackSize == 0) slot.putStack((ItemStack)null);
+ else slot.onSlotChanged();
+ }
+ return itemstack;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/container/GuiHandler.java
new file mode 100644
index 0000000..6ebd3e9
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiHandler.java
@@ -0,0 +1,78 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntityChest;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.network.IGuiHandler;
+import cpw.mods.fml.common.network.NetworkRegistry;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.client.GuiJewelry;
+import darkknight.jewelrycraft.client.GuiRingChest;
+
+public class GuiHandler implements IGuiHandler
+{
+ ResourceLocation pageTexture = new ResourceLocation("jewelrycraft", "textures/gui/guidePage.png");
+ ResourceLocation flippedPageTexture = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png");
+ ResourceLocation chestTexture = new ResourceLocation("jewelrycraft", "textures/gui/chest_ring.png");
+ ResourceLocation jewelryInvTexture = new ResourceLocation("jewelrycraft", "textures/gui/jewelry_tab.png");
+
+ /**
+ *
+ */
+ public GuiHandler()
+ {
+ NetworkRegistry.INSTANCE.registerGuiHandler(JewelrycraftMod.instance, this);
+ }
+
+ /**
+ * @param ID
+ * @param player
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
+ {
+ switch(ID)
+ {
+ case 0:
+ return new ContainerRingChest(player.inventory, (TileEntityChest)world.getTileEntity(x, y, z));
+ case 1:
+ return new ContainerGuide();
+ case 2:
+ return new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player));
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * @param ID
+ * @param player
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
+ {
+ switch(ID)
+ {
+ case 0:
+ return new GuiRingChest((ContainerRingChest)getServerGuiElement(ID, player, world, x, y, z), chestTexture);
+ case 1:
+ return new GuiGuide((ContainerGuide)getServerGuiElement(ID, player, world, x, y, z), world, pageTexture, flippedPageTexture);
+ case 2:
+ return new GuiJewelry(new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)), jewelryInvTexture);
+ default:
+ return null;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java b/src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java
new file mode 100644
index 0000000..50b7cd5
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java
@@ -0,0 +1,97 @@
+package darkknight.jewelrycraft.container;
+
+import java.util.Arrays;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+public class GuiRectangle
+{
+ private int x;
+ private int y;
+ private int w;
+ private int h;
+
+ /**
+ * @param x
+ * @param y
+ * @param w
+ * @param h
+ */
+ public GuiRectangle(int x, int y, int w, int h)
+ {
+ this.x = x;
+ this.y = y;
+ this.w = w;
+ this.h = h;
+ }
+
+ /**
+ * @param gui
+ * @param mouseX
+ * @param mouseY
+ * @return
+ */
+ public boolean inRect(GuiGuide gui, int mouseX, int mouseY)
+ {
+ mouseX -= gui.getLeft();
+ mouseY -= gui.getTop();
+ return x <= mouseX && mouseX <= x + w && y <= mouseY && mouseY <= y + h;
+ }
+
+ /**
+ * @param x
+ */
+ public void setX(int x)
+ {
+ this.x = x;
+ }
+
+ /**
+ * @param y
+ */
+ public void setY(int y)
+ {
+ this.y = y;
+ }
+
+ /**
+ * @param gui
+ * @param srcX
+ * @param srcY
+ */
+ public void draw(GuiGuide gui, int srcX, int srcY)
+ {
+ gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, w, h);
+ }
+
+ /**
+ * @param gui
+ * @param srcX
+ * @param srcY
+ * @param width
+ * @param height
+ */
+ public void draw(GuiGuide gui, int srcX, int srcY, int width, int height)
+ {
+ gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, width, height);
+ }
+
+ /**
+ * @param gui
+ * @param mouseX
+ * @param mouseY
+ * @param str
+ */
+ public void drawString(GuiGuide gui, int mouseX, int mouseY, String str)
+ {
+ if (inRect(gui, mouseX, mouseY)) gui.drawHoverString(Arrays.asList(str.split("\n")), mouseX - gui.getLeft(), mouseY - gui.getTop());
+ }
+
+ /**
+ * @return
+ */
+ public ItemStack getIcon()
+ {
+ return null;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTab.java b/src/main/java/darkknight/jewelrycraft/container/GuiTab.java
new file mode 100644
index 0000000..e315d3a
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTab.java
@@ -0,0 +1,84 @@
+package darkknight.jewelrycraft.container;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+@SideOnly (Side.CLIENT)
+public abstract class GuiTab extends GuiRectangle
+{
+ int values, del;
+ private String name;
+
+ /**
+ * @param name
+ * @param id
+ */
+ public GuiTab(String name, int id)
+ {
+ super(-62, 10 + 19 * id, 19, 18);
+ this.name = name;
+ values = 0;
+ del = 0;
+ }
+
+ /**
+ * @return
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ public abstract void drawBackground(GuiGuide gui, int x, int y, int page);
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ public abstract void drawForeground(GuiGuide gui, int x, int y, int page);
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ public void mouseClick(GuiGuide gui, int x, int y, int button)
+ {}
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ * @param timeSinceClicked
+ */
+ public void mouseMoveClick(GuiGuide gui, int x, int y, int button, long timeSinceClicked)
+ {}
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ public void mouseReleased(GuiGuide gui, int x, int y, int button)
+ {}
+
+ /**
+ * @return
+ */
+ public int getMaxPages()
+ {
+ return 1;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java
new file mode 100644
index 0000000..de50533
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java
@@ -0,0 +1,176 @@
+package darkknight.jewelrycraft.container;
+
+import java.awt.Desktop;
+import java.net.URL;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.item.ItemList;
+
+public class GuiTabBlocks extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabBlocks(int id)
+ {
+ super("Blocks", id);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(BlockList.jewelAltar);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ text = "This ore is extremely rare and can be found only between Y-level 5 and 8. It can only be mined using a diamond pickaxe.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.shadowOre), text, 90f, true);
+ break;
+ case 2:
+ text = "The Shadow Block is crafted using 9 shadow ingots. Magicians believed it held the ability to merge with the shadows. It becomes more transparent as it";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowBlock), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot));
+ break;
+ case 3:
+ text = "gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 4:
+ text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.smelter), new ItemStack(Blocks.cobblestone), new ItemStack(Items.bucket), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone));
+ break;
+ case 5:
+ text = "melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do is right click on it with any ore or ingot. It can melt multimple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 6:
+ text = "added. If right clicked when done smelting, it will say what the block contains.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 7:
+ text = "The molder is a key piece in creating jewellery. You need to pour the molten metal out of the smelter somewhere. That somewhere is the";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.molder), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone));
+ break;
+ case 8:
+ text = "molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 9:
+ text = "have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 10:
+ text = "This table allows you to add a gem to a piece of jewellery. Right click the block while holding a jewellery to add it in. Then do the same with a gem (you";
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values >= 4) values = 0;
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.jewelCraftingTable), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone));
+ break;
+ case 11:
+ text = "can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 12:
+ text = "jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 13:
+ text = "This block can store any jewellery in it and activate their effects as it were a player. To do that simply right click the block with a jewellery. Crouch +";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.jewelAltar), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.wool, 1, 5), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.wool, 1, 5), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick));
+ break;
+ case 14:
+ text = "Right Click to retreive the jewellery.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 15:
+ text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: " + Integer.MAX_VALUE + ") of a single item/block placed in it. It will";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.displayer), null, new ItemStack(Items.iron_ingot), null, new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block));
+ break;
+ case 16:
+ text = "display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 17:
+ text = "If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 18:
+ text = "get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 19:
+ text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.handPedestal), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), null, new ItemStack(Blocks.stonebrick), null, new ItemStack(Blocks.stone_slab, 1, 5), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stone_slab, 1, 5));
+ break;
+ case 20:
+ text = "sacrifices to 'The Dark One' in exchange for unimaginable powers.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 21:
+ text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowEye), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Items.ender_eye), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick));
+ break;
+ case 22:
+ text = "though, for He sees everything. To see how to create the ritual look in the Ritual tab.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ default:
+ ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return 21;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ @Override
+ public void mouseClick(GuiGuide gui, int x, int y, int button)
+ {
+ if (gui.page == 21 && x >= gui.getLeft() + 130 && x <= gui.getLeft() + 160 && y >= gui.getTop() + 40 && y <= gui.getTop() + 50) try{
+ Desktop.getDesktop().browse(new URL("http://imgur.com/a/Zk0LW").toURI());
+ }
+ catch(Exception e){}
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java
new file mode 100644
index 0000000..5f2bde0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java
@@ -0,0 +1,78 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class GuiTabGemsAndIngots extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabGemsAndIngots(int id)
+ {
+ super("Gems and ingots", id);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(Items.emerald);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ int xPos = page % 2 == 0 ? 107 : -35;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ for(int i = (page - 1) * 9; i < page * 9; i++)
+ if (i < JewelrycraftUtil.gem.size()){
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0);
+ gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.gem.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ page -= JewelrycraftUtil.gem.size() / 9 + 1;
+ for(int i = (page - 1) * 9; i < page * 9; i++)
+ if (i < JewelrycraftUtil.metal.size() && page > 0){
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0);
+ gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabIntroduction.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabIntroduction.java
new file mode 100644
index 0000000..f14c81e
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabIntroduction.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.item.ItemList;
+
+public class GuiTabIntroduction extends GuiTab
+{
+ public GuiTabIntroduction(int id)
+ {
+ super("Introduction", id);
+ }
+
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(ItemList.ring);
+ }
+
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ text = "Welcome to Jewelrycraft 2! This mod is about making jewelry that you can modify to your own will. To find out how to create a jewelry, please consult the book and look at the Smelter block. To add modifiers to it you need to perform a ritual. To see how to do that, look at the Cursed Eye";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 2:
+ text = "block in this giude. Please be aware that even if you can add anything as a modifier and can have multiple modifiers on one jewelry, this mod is still in alpha and does not have that many modifiers implemtnted and currently don't have any different effects depending on";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 3:
+ text = "the gem used. To see what modifiers are currently implemented, just look in the Modifiers tab located in this guide (it is the one with the blaze powder as an icon).";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ }
+ }
+
+ @Override
+ public int getMaxPages()
+ {
+ return 4;
+ }
+
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java
new file mode 100644
index 0000000..85c7211
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java
@@ -0,0 +1,166 @@
+package darkknight.jewelrycraft.container;
+
+import java.awt.Desktop;
+import java.net.URL;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class GuiTabItems extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabItems(int id)
+ {
+ super("Items", id);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(ItemList.thiefGloves);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ text = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewelry work.";
+ Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true, new ItemStack(BlockList.shadowOre), new ItemStack(ItemList.shadowIngot));
+ break;
+ case 2:
+ text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.thiefGloves), new ItemStack(ItemList.shadowIngot), null, new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15));
+ break;
+ case 3:
+ text = "right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded emeralds back as well. This has a maximum of 10 uses before it breaks.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 4:
+ text = "In order to get the ingot back from the smelter you need a mold for it. However, this mold can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 0), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball));
+ break;
+ case 5:
+ text = "To create a ring you need a mold for it. However, this one is too soft to be used. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 1), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null);
+ break;
+ case 6:
+ text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 2), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null);
+ break;
+ case 7:
+ text = "To create a bracelet you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 3), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball));
+ break;
+ case 8:
+ text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 4), null, null, null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, null, null);
+ break;
+ case 9:
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values > 4) values = 0;
+ text = "By smelting a clay mold you get a harder version which can be used to create jewelry. Simply right click with this on a molder to attach it and you're ready to go.";
+ Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true, new ItemStack(ItemList.clayMolds, 1, values), new ItemStack(ItemList.molds, 1, values));
+ break;
+ case 10:
+ text = "Crystals don't do much as of yet. They can be dyed in any color and used as gems to create a nice jewelry.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.crystal, 1, 15), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null);
+ break;
+ case 11:
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values >= 15) values = 0;
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.crystal, 1, values), new ItemStack(Items.dye, 1, values), new ItemStack(ItemList.crystal, 1, 15));
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop() + 60, true, text, x, y, true, new ItemStack(ItemList.crystal, 1, 15), new ItemStack(Items.dye, 1, 15), new ItemStack(ItemList.crystal, 1, values));
+ break;
+ case 12:
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values > 4) values = 0;
+ text = "It's this exact guide. I don't even know why you're reading this. I added this recipe in case you lose the original. Even if this is more helpful than NEI, I do suggest";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.guide), new ItemStack(ItemList.molds, 1, values), new ItemStack(Items.book));
+ break;
+ case 13:
+ String link = "HERE";
+ if (x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK;
+ text = "installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really appreciate it. After that you can share it in the main thread " + link + "." + " This mod was made by DarkKnight (or sor1n, depends";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 14:
+ text = "where you got this mod from) and the help of domi1819 and bspkrs.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 15:
+ ItemStack item = new ItemStack(ItemList.bucket);
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values > JewelrycraftUtil.metal.size() - 1) values = 0;
+ JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy());
+ text = "These buckets contain molten metal. To obtain one simply Right Click a full Smelter to get a bucket. You can pour the metal, other than that it has no use. You can place the molten metal back in a Smelter by Right Clicking one with it.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, item, text, 40f, 0, 0, true, 45, 10, true);
+ break;
+ default:
+ ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return 15;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ @Override
+ public void mouseClick(GuiGuide gui, int x, int y, int button)
+ {
+ if (gui.page == 13 && x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) try{
+ Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/topic/2210959-164smp-ssp-jewelrycraft-version-12/").toURI());
+ }
+ catch(Exception e){}
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabModifiers.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabModifiers.java
new file mode 100644
index 0000000..89db85b
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabModifiers.java
@@ -0,0 +1,74 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+public class GuiTabModifiers extends GuiTab
+{
+ int maxPages;
+ public GuiTabModifiers(int id)
+ {
+ super("Modifiers", id);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(Items.blaze_powder);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all of modifiers that have a use and what they do, in the form of a story/riddle/poem. However different jewellery have different effects for the same modifier.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 2:
+ text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 7, new ItemStack(Items.blaze_powder), text, 40f, true);
+ break;
+ case 3:
+ text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 7, new ItemStack(Items.feather), text, 40f, true);
+ break;
+ case 4:
+ text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 7, new ItemStack(Items.ender_eye), text, 40f, true);
+ break;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return 4;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabRitual.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabRitual.java
new file mode 100644
index 0000000..eed8072
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabRitual.java
@@ -0,0 +1,125 @@
+package darkknight.jewelrycraft.container;
+
+import org.lwjgl.opengl.GL11;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+public class GuiTabRitual extends GuiTab
+{
+ public GuiTabRitual(int id)
+ {
+ super("Ritual", id);
+ }
+
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(BlockList.handPedestal);
+ }
+
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for(int i = -1; i < 10; i++)
+ for(int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+
+ //Top
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0);
+
+ //Left
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0);
+
+ //Bottom
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0);
+
+ //Right
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 2:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for(int i = -1; i < 10; i++)
+ for(int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 3:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for(int i = -1; i < 10; i++)
+ for(int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 4:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for(int i = -1; i < 10; i++)
+ for(int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0);
+ break;
+
+ case 5:
+ Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 5", gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for(int i = -1; i < 10; i++)
+ for(int j = 0; j < 11; j++)
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ break;
+ }
+ }
+
+ @Override
+ public int getMaxPages()
+ {
+ return 5;
+ }
+
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/JewelryInventory.java b/src/main/java/darkknight/jewelrycraft/container/JewelryInventory.java
new file mode 100644
index 0000000..ce6f0b5
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/JewelryInventory.java
@@ -0,0 +1,165 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import darkknight.jewelrycraft.item.ItemRing;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class JewelryInventory implements IInventory
+{
+ public EntityPlayer player;
+ public ItemStack[] inventory = new ItemStack[18];
+
+ /**
+ * @param player
+ */
+ public JewelryInventory(EntityPlayer player)
+ {
+ this.player = player;
+ NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ for(int i = 0; i < 18; i++)
+ inventory[i] = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("ext" + i));
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getSizeInventory()
+ {
+ return inventory.length;
+ }
+
+ /**
+ * @param slot
+ * @return
+ */
+ @Override
+ public ItemStack getStackInSlot(int slot)
+ {
+ return inventory[slot];
+ }
+
+ /**
+ * @param slot
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int slot, int amount)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ if (stack != null) if (stack.stackSize > amount){
+ stack = stack.splitStack(amount);
+ markDirty();
+ }else setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ /**
+ * @param slot
+ * @return
+ */
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot)
+ {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ /**
+ * @param slot
+ * @param stack
+ */
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack)
+ {
+ inventory[slot] = stack;
+ if (stack != null && stack.stackSize > getInventoryStackLimit()) stack.stackSize = getInventoryStackLimit();
+ markDirty();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public String getInventoryName()
+ {
+ return "Jewelry";
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean hasCustomInventoryName()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getInventoryStackLimit()
+ {
+ return 1;
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void markDirty()
+ {
+ NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ for(int i = 0; i < 18; i++)
+ if (inventory[i] != null) nbt.setTag("ext" + i, inventory[i].writeToNBT(nbt.getCompoundTag("ext" + i)));
+ else nbt.removeTag("ext" + i);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer player)
+ {
+ return true;
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void openInventory()
+ {}
+
+ /**
+ *
+ */
+ @Override
+ public void closeInventory()
+ {}
+
+ /**
+ * @param slot
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack stack)
+ {
+ if (slot >= 0 && slot <= 9 && stack.getItem() instanceof ItemRing) return true;
+ else if (slot >= 10 && slot <= 13 && stack.getItem() instanceof ItemBracelet) return true;
+ else if (slot >= 14 && slot <= 16 && stack.getItem() instanceof ItemNecklace) return true;
+ else if (slot == 17 && stack.getItem() instanceof ItemEarrings) return true;
+ return false;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/container/Page.java b/src/main/java/darkknight/jewelrycraft/container/Page.java
new file mode 100644
index 0000000..beaa0bc
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/Page.java
@@ -0,0 +1,197 @@
+package darkknight.jewelrycraft.container;
+
+import java.util.ArrayList;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+public class Page
+{
+ static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png");
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param isSmall
+ * @param text
+ * @param mouseX
+ * @param mouseY
+ * @param items
+ */
+ public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ ArrayList<String> name = new ArrayList<String>();
+ if (isSmall){
+ gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46);
+ gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0, 0, 0);
+ for(int i = 1; i <= 4; i++)
+ if (items.length > i && items[i] != null){
+ int posX = x + 8 + (i - 1) % 2 * 22;
+ int posY = y + 26 + (i - 1) / 2 * 22;
+ gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
+ name.add(items[i].getDisplayName());
+ if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ drawText(gui, text, x, y + 25);
+ }else{
+ gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54);
+ gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0, 0, 0);
+ for(int i = 1; i <= 9; i++)
+ if (items.length > i && items[i] != null){
+ int posX = x + 8 + (i - 1) % 3 * 19;
+ int posY = y + 22 + (i - 1) / 3 * 17;
+ gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
+ name.add(items[i].getDisplayName());
+ if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ drawText(gui, text, x, y + 32);
+ GL11.glColor4f(1, 1, 1, 1);
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param text
+ * @param mouseX
+ * @param mouseY
+ * @param items
+ */
+ public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items)
+ {
+ ArrayList<String> name = new ArrayList<String>();
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52);
+ gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0, 0);
+ name.add(items[0].getDisplayName());
+ if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0, 0);
+ drawText(gui, text, x, y + 30);
+ GL11.glColor4f(1, 1, 1, 1);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param item
+ * @param text
+ * @param size
+ */
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0);
+ drawText(gui, text, x - 2, y - (int)(250 / size));
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item, float xRot, float yRot, float zRot)
+ {
+ ArrayList<String> name = new ArrayList<String>();
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12);
+ if(item.getItem() != null){
+ name.add(item.getDisplayName());
+ if (mouseX >= x + 10 && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 10);
+ name.removeAll(name);
+ }
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glColor4f(1, 1, 1, 1);
+ if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot, zRot);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param item
+ * @param text
+ * @param size
+ * @param txtX
+ * @param txtY
+ * @param showName
+ * @param imgX
+ * @param imgY
+ */
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0);
+ drawText(gui, text, x + txtX, y + txtY);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param text
+ */
+ public static void addTextPage(GuiGuide gui, int x, int y, String text)
+ {
+ y -= 25;
+ drawText(gui, text, x, y);
+ GL11.glColor4f(1, 1, 1, 1);
+ }
+
+ /**
+ * @param gui
+ * @param text
+ * @param x
+ * @param y
+ */
+ public static void drawText(GuiGuide gui, String text, int x, int y)
+ {
+ String[] s = text.split(" ");
+ String displayText = "";
+ ArrayList<String> textLines = new ArrayList<String>();
+ for(String element: s)
+ if ((displayText + element + " ").length() <= 24) displayText += element + " ";
+ else{
+ textLines.add(displayText.trim());
+ displayText = element + " ";
+ }
+ textLines.add(displayText.trim());
+ for(int i = 0; i < textLines.size(); i++)
+ gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/SlotBracelet.java b/src/main/java/darkknight/jewelrycraft/container/SlotBracelet.java
new file mode 100644
index 0000000..c82421d
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotBracelet.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemBracelet;
+
+public class SlotBracelet extends Slot
+{
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotBracelet(IInventory tile, int slotID, int x, int y)
+ {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return stack.getItem() instanceof ItemBracelet;
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return true;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/SlotEarrings.java b/src/main/java/darkknight/jewelrycraft/container/SlotEarrings.java
new file mode 100644
index 0000000..550f4f9
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotEarrings.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemEarrings;
+
+public class SlotEarrings extends Slot
+{
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotEarrings(IInventory tile, int slotID, int x, int y)
+ {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return stack.getItem() instanceof ItemEarrings;
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return true;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/SlotNecklace.java b/src/main/java/darkknight/jewelrycraft/container/SlotNecklace.java
new file mode 100644
index 0000000..42543b0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotNecklace.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemNecklace;
+
+public class SlotNecklace extends Slot
+{
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotNecklace(IInventory tile, int slotID, int x, int y)
+ {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return stack.getItem() instanceof ItemNecklace;
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return true;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/SlotRing.java b/src/main/java/darkknight/jewelrycraft/container/SlotRing.java
new file mode 100644
index 0000000..52aa4fb
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotRing.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemRing;
+
+public class SlotRing extends Slot
+{
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotRing(IInventory tile, int slotID, int x, int y)
+ {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return stack.getItem() instanceof ItemRing;
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return true;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java b/src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java
new file mode 100644
index 0000000..b1f553c
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java
@@ -0,0 +1,55 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+
+public class SlotRingChest extends Slot
+{
+ public boolean locked = false;
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ * @param locked
+ */
+ public SlotRingChest(IInventory tile, int slotID, int x, int y, boolean locked)
+ {
+ super(tile, slotID, x, y);
+ this.locked = locked;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack)
+ {
+ return !locked;
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount)
+ {
+ if (!locked) return super.decrStackSize(amount);
+ return null;
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player)
+ {
+ return !locked;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/Curse.java b/src/main/java/darkknight/jewelrycraft/curses/Curse.java
new file mode 100644
index 0000000..f833542
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/curses/Curse.java
@@ -0,0 +1,116 @@
+package darkknight.jewelrycraft.curses;
+
+import java.util.ArrayList;
+import java.util.Random;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+
+public class Curse
+{
+ protected int id, texturepack;
+ protected String name, description;
+ protected Random rand = new Random();
+ private static ArrayList<Curse> curses = new ArrayList<Curse>();
+ public static ArrayList<Curse> availableCurses = new ArrayList<Curse>();
+
+ /**
+ * @param id the ID of the curse
+ * @param name the name of the curse
+ * @param texturepack the ID of the pack the texture is located in
+ */
+ protected Curse(int id, String name, int texturepack)
+ {
+ this.id = id;
+ this.name = name;
+ this.texturepack = texturepack;
+ curses.add(this);
+ availableCurses.add(this);
+ }
+
+ /**
+ * @return the name of the curse
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * @return the description of the curse
+ */
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public Curse setDescription(String desc)
+ {
+ description = desc;
+ return this;
+ }
+
+ /**
+ * @return the curse ID
+ */
+ public int getID()
+ {
+ return id;
+ }
+
+ /**
+ * @return the texture pack ID
+ */
+ public int getTexturePack()
+ {
+ return texturepack;
+ }
+
+ /**
+ * @param world
+ * @param player
+ */
+ public void action(World world, EntityPlayer player)
+ {}
+
+ /**
+ * @param world
+ * @param player
+ */
+ public void deathAction(World world, EntityPlayer player)
+ {}
+
+ /**
+ * @param world
+ * @param player
+ */
+ public void respawnAction(World world, EntityPlayer player)
+ {}
+
+ /**
+ * @param world
+ * @param player
+ */
+ public void attackedAction(World world, EntityPlayer player)
+ {}
+
+ /**
+ * @param world
+ * @param player
+ */
+ public void attackedByPlayerAction(World world, EntityPlayer player, Entity target)
+ {}
+
+ public boolean itemToss()
+ {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ public static ArrayList<Curse> getCurseList()
+ {
+ return curses;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java
new file mode 100644
index 0000000..62483cd
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/curses/CurseBlind.java
@@ -0,0 +1,25 @@
+package darkknight.jewelrycraft.curses;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.world.World;
+
+public class CurseBlind extends Curse
+{
+ public CurseBlind(int id, String name, int text)
+ {
+ super(id, name, text);
+ }
+
+ @Override
+ public void action(World world, EntityPlayer player)
+ {
+ if (!player.isPotionActive(Potion.blindness) || player.getActivePotionEffect(Potion.blindness).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 60));
+ }
+
+ public String getDescription()
+ {
+ return "You see the light slowly fading in front of you";
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java
new file mode 100644
index 0000000..8718524
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/curses/CurseFlamingSoul.java
@@ -0,0 +1,23 @@
+package darkknight.jewelrycraft.curses;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.world.World;
+
+public class CurseFlamingSoul extends Curse
+{
+ public CurseFlamingSoul(int id, String name, int text)
+ {
+ super(id, name, text);
+ }
+
+ @Override
+ public void action(World world, EntityPlayer player)
+ {
+ if (!player.isBurning() && rand.nextInt(20) == 0) player.setFire(5);
+ }
+
+ public String getDescription()
+ {
+ return "Is it me or is it getting hot in here?";
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java
new file mode 100644
index 0000000..1626925
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/curses/CurseGreed.java
@@ -0,0 +1,30 @@
+package darkknight.jewelrycraft.curses;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.world.World;
+
+public class CurseGreed extends Curse
+{
+ public CurseGreed(int id, String name, int text)
+ {
+ super(id, name, text);
+ }
+
+ @Override
+ public void action(World world, EntityPlayer player)
+ {
+ }
+
+ @Override
+ public boolean itemToss()
+ {
+ return true;
+ }
+
+ public String getDescription()
+ {
+ return "You might need that later";
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java
new file mode 100644
index 0000000..aa815f7
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/curses/CurseInfamy.java
@@ -0,0 +1,41 @@
+package darkknight.jewelrycraft.curses;
+
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.SharedMonsterAttributes;
+import net.minecraft.entity.monster.EntityMob;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.damage.DamageSourceList;
+import darkknight.jewelrycraft.entities.EntityHalfHeart;
+import darkknight.jewelrycraft.entities.EntityHeart;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class CurseInfamy extends Curse
+{
+ public CurseInfamy(int id, String name, int text)
+ {
+ super(id, name, text);
+ }
+
+ @Override
+ public void attackedByPlayerAction(World world, EntityPlayer player, Entity target)
+ {
+ if (rand.nextInt(5) == 0 && !world.isRemote && !(target instanceof EntityMob) && target instanceof EntityLiving && !(target instanceof EntityHeart) && !(target instanceof EntityHalfHeart) && target.canAttackWithItem()){
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (playerInfo.getFloat("BlackHeart") < 20F) playerInfo.setFloat("BlackHeart", playerInfo.getFloat("BlackHeart") + 1.0F);
+ if (player.getMaxHealth() >= 3F){
+ player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() - 1.0F);
+ player.setHealth(player.getHealth() - 1.0F);
+ }
+ JewelrycraftUtil.addCursePoints(player, 10);
+ }
+ }
+
+ public String getDescription()
+ {
+ return "What have you done?!";
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseList.java b/src/main/java/darkknight/jewelrycraft/curses/CurseList.java
new file mode 100644
index 0000000..4e796ff
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/curses/CurseList.java
@@ -0,0 +1,25 @@
+package darkknight.jewelrycraft.curses;
+
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import darkknight.jewelrycraft.lib.Reference;
+
+public class CurseList
+{
+ private static Curse rotten, flaming, blind, greed, infamy;
+ private static boolean isInitialized = false;
+
+ /**
+ * @param e
+ */
+ public static void preInit(FMLPreInitializationEvent e)
+ {
+ if (!isInitialized){
+ rotten = new CurseRottenHeart(0, Reference.MODNAME + ":" + "Rotten Heart", 0);
+ flaming = new CurseFlamingSoul(1, Reference.MODNAME + ":" + "Flaming Soul", 0);
+ greed = new CurseGreed(2, Reference.MODNAME + ":" + "Greed", 0);
+ blind = new CurseBlind(3, Reference.MODNAME + ":" + "Blind", 0);
+ infamy = new CurseInfamy(4, Reference.MODNAME + ":" + "Infamy", 0);
+ isInitialized = true;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java
new file mode 100644
index 0000000..f7fcfae
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/curses/CurseRottenHeart.java
@@ -0,0 +1,25 @@
+package darkknight.jewelrycraft.curses;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.world.World;
+
+public class CurseRottenHeart extends Curse
+{
+ public CurseRottenHeart(int id, String name, int text)
+ {
+ super(id, name, text);
+ }
+
+ @Override
+ public void action(World world, EntityPlayer player)
+ {
+ if (!player.isPotionActive(Potion.poison) || player.getActivePotionEffect(Potion.poison).getDuration() < 30) player.addPotionEffect(new PotionEffect(Potion.poison.id, 80));
+ }
+
+ public String getDescription()
+ {
+ return "Your heart slowly rots inside";
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/damage/DamageSourceList.java b/src/main/java/darkknight/jewelrycraft/damage/DamageSourceList.java
new file mode 100644
index 0000000..019b036
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/damage/DamageSourceList.java
@@ -0,0 +1,26 @@
+package darkknight.jewelrycraft.damage;
+
+import net.minecraft.util.DamageSource;
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+
+/**
+ * @author Sorin
+ */
+public class DamageSourceList
+{
+ public static DamageSource shadows, weak, blackHeart;
+ private static boolean isInitialized = false;
+
+ /**
+ * @param e
+ */
+ public static void postInit(FMLPostInitializationEvent e)
+ {
+ if (!isInitialized){
+ shadows = new DamageSource("shadows").setDamageBypassesArmor().setDamageIsAbsolute();
+ blackHeart = new DamageSource("blackHeart").setDamageBypassesArmor().setDamageIsAbsolute();
+ weak = new DamageSource("weak");
+ isInitialized = true;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectBlazePowder.java b/src/main/java/darkknight/jewelrycraft/effects/EffectBlazePowder.java
new file mode 100644
index 0000000..949d0d8
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/effects/EffectBlazePowder.java
@@ -0,0 +1,95 @@
+package darkknight.jewelrycraft.effects;
+
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.DamageSource;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import darkknight.jewelrycraft.item.ItemRing;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class EffectBlazePowder extends ModifierEffects
+{
+ public EffectBlazePowder()
+ {
+ super(new ItemStack(Items.blaze_powder));
+ }
+
+ @Override
+ public void action(ItemStack item, EntityPlayer player, Item jewelry)
+ {
+ int pos = JewelryNBT.doesModifierExist(item, modifier);
+ if (jewelry instanceof ItemNecklace && pos != -1){
+ //Positive for necklace
+ player.extinguish();
+
+ //Negative for necklace
+ if (player.isInWater()) player.attackEntityFrom(DamageSource.drown, 1f);
+ }
+ //Negative for bracelet
+ if (jewelry instanceof ItemBracelet && pos != -1 && player.isInWater()){
+ player.motionX *= 0.6D;
+ player.motionY *= 0.6D;
+ player.motionZ *= 0.6D;
+ player.motionY -= 0.02D;
+ if (player.isCollidedHorizontally) player.motionY = 0.30000001192092896D;
+ }
+
+ //Negative for earrings
+ if (jewelry instanceof ItemEarrings && pos != -1){
+ if (player.getAir() >= 300) player.setAir(player.getAir() / 2);
+ else player.setAir(player.getAir() - 1);
+ }
+ }
+
+ @Override
+ public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount)
+ {
+ int pos = JewelryNBT.doesModifierExist(item, modifier);
+ //Balanced for ring
+ if (jewelry instanceof ItemRing && pos != -1 && !player.isInWater()) target.setFire(2);
+ return false;
+ }
+
+ @Override
+ public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount)
+ {
+// int pos = JewelryNBT.doesModifierExist(item, modifier);
+// if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){
+// //Positive for earrings
+// int stackSize = JewelryNBT.modifier(item).get(pos).stackSize;
+// player.heal((float)(0.05 * stackSize));
+// return true;
+// }
+// //Positive for bracelet
+// if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) return true;
+ return false;
+ }
+
+ public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount)
+ {
+
+ }
+
+ public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount)
+ {
+ int pos = JewelryNBT.doesModifierExist(item, modifier);
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (jewelry instanceof ItemEarrings && pos != -1 && rand.nextInt(4) == 0) if (source == DamageSource.lava || source == DamageSource.inFire || source == DamageSource.onFire){
+ //Positive for earrings
+ int stackSize = JewelryNBT.modifier(item).get(pos).stackSize;
+ player.heal((float)(0.05 * stackSize));
+ playerInfo.setBoolean("negateDamage", true);
+ }
+ //Positive for bracelet
+ if (jewelry instanceof ItemBracelet && pos != -1) if (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava && player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY - 0.7, player.boundingBox.maxZ), Material.lava) && !player.worldObj.isMaterialInBB(AxisAlignedBB.getBoundingBox(player.boundingBox.minX, player.boundingBox.minY + 0.9, player.boundingBox.minZ, player.boundingBox.maxX, player.boundingBox.maxY, player.boundingBox.maxZ), Material.lava)) playerInfo.setBoolean("negateDamage", true);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectEnderEye.java b/src/main/java/darkknight/jewelrycraft/effects/EffectEnderEye.java
new file mode 100644
index 0000000..eb7bef7
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/effects/EffectEnderEye.java
@@ -0,0 +1,79 @@
+package darkknight.jewelrycraft.effects;
+
+import net.minecraft.block.BlockOre;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.settings.GameSettings.Options;
+import net.minecraft.entity.monster.EntityEnderman;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.Vec3;
+import net.minecraft.world.ChunkPosition;
+import net.minecraft.world.biome.BiomeGenBase;
+import cpw.mods.fml.relauncher.ReflectionHelper;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import darkknight.jewelrycraft.item.ItemRing;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class EffectEnderEye extends ModifierEffects
+{
+ private boolean originalVD = false;
+ private float originalViewDistance;
+ public EffectEnderEye()
+ {
+ super(new ItemStack(Items.ender_eye));
+ }
+
+ @Override
+ public void action(ItemStack item, EntityPlayer player, Item jewelry)
+ {
+ int pos = JewelryNBT.doesModifierExist(item, modifier);
+ if (jewelry instanceof ItemEarrings && pos != -1 && !player.worldObj.isRemote){
+ for(Object e: player.worldObj.getEntitiesWithinAABB(EntityEnderman.class, player.boundingBox.expand(100D, 0D, 100D))){
+ EntityEnderman enderman = (EntityEnderman)e;
+ ReflectionHelper.setPrivateValue(EntityEnderman.class, enderman, -1, "stareTimer", "field_70826_g");
+ Vec3 vec3 = player.getLook(1.0F).normalize();
+ Vec3 vec31 = Vec3.createVectorHelper(enderman.posX - player.posX, enderman.boundingBox.minY + (double)(enderman.height / 2.0F) - (player.posY + (double)player.getEyeHeight()), enderman.posZ - player.posZ);
+ double d0 = vec31.lengthVector();
+ vec31 = vec31.normalize();
+ double d1 = vec3.dotProduct(vec31);
+ if (d1 > 1.0D - 0.025D / d0 && player.canEntityBeSeen(enderman)){
+ enderman.setTarget(null);
+ if (!player.isPotionActive(Potion.confusion) || player.getActivePotionEffect(Potion.confusion).getDuration() <= 80) player.addPotionEffect(new PotionEffect(Potion.confusion.id, 300, 2));
+ }
+ }
+ }
+ if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote){
+ ChunkPosition chunkposition = player.worldObj.findClosestStructure("Stronghold", (int)player.posX, (int)player.posY, (int)player.posZ);
+ if (chunkposition != null){
+ Minecraft.getMinecraft().thePlayer.motionX += 0.01D * Math.signum((double)chunkposition.chunkPosX - player.posX);
+ Minecraft.getMinecraft().thePlayer.motionZ += 0.01D * Math.signum((double)chunkposition.chunkPosZ - player.posZ);
+ }
+ }
+ if (jewelry instanceof ItemBracelet && pos != -1 && !player.worldObj.isRemote && player.worldObj.getBiomeGenForCoords((int)player.posX, (int)player.posZ) == BiomeGenBase.sky && (!player.isPotionActive(Potion.moveSpeed) || player.getActivePotionEffect(Potion.moveSpeed).getDuration() < 30)) player.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 140, 1));
+ if (jewelry instanceof ItemBracelet && pos != -1 && !player.worldObj.isRemote && rand.nextInt(500) == 15) player.setPositionAndUpdate(player.posX + rand.nextInt(30)*(rand.nextBoolean()?-1:1), player.posY, player.posZ + rand.nextInt(30)*(rand.nextBoolean()?-1:1));
+ if (jewelry instanceof ItemRing && pos != -1 && rand.nextInt(200) == 12){
+ Minecraft.getMinecraft().gameSettings.setOptionFloatValue(Options.RENDER_DISTANCE, 1.0F);
+ for(int i = (int)player.posX - 2; i <= (int)player.posX + 2; i++)
+ for(int j = (int)player.posY - 2; j <= (int)player.posY + 2; j++)
+ for(int k = (int)player.posZ - 2; k <= (int)player.posZ + 2; k++)
+ if(player.worldObj.getBlock(i, j, k) instanceof BlockOre)
+ player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "You sense some " + player.worldObj.getBlock(i, j, k).getLocalizedName() + " around you."));
+ }
+ }
+
+ @Override
+ public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount)
+ {
+ int pos = JewelryNBT.doesModifierExist(item, modifier);
+ if (jewelry instanceof ItemNecklace && pos != -1 && !player.worldObj.isRemote) player.addPotionEffect(new PotionEffect(Potion.blindness.id, 100, 1));
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectFeather.java b/src/main/java/darkknight/jewelrycraft/effects/EffectFeather.java
new file mode 100644
index 0000000..2acaf76
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/effects/EffectFeather.java
@@ -0,0 +1,88 @@
+package darkknight.jewelrycraft.effects;
+
+import java.util.Iterator;
+import java.util.List;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.projectile.EntityArrow;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EnumChatFormatting;
+import darkknight.jewelrycraft.damage.DamageSourceList;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import darkknight.jewelrycraft.item.ItemRing;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class EffectFeather extends ModifierEffects
+{
+ public EffectFeather()
+ {
+ super(new ItemStack(Items.feather));
+ }
+
+ @Override
+ public void action(ItemStack item, EntityPlayer player, Item jewelry)
+ {
+ int pos = JewelryNBT.doesModifierExist(item, modifier);
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ // Positive earrings
+ if (jewelry instanceof ItemEarrings && pos != -1){
+ AxisAlignedBB axisalignedbb = player.boundingBox.expand(1.0D, 1.0D, 1.0D);
+ List list = player.worldObj.getEntitiesWithinAABB(EntityArrow.class, axisalignedbb);
+ if (!player.worldObj.isRemote && list != null && !list.isEmpty()){
+ Iterator iterator = list.iterator();
+ while (iterator.hasNext()){
+ EntityArrow arrow = (EntityArrow)iterator.next();
+ if (rand.nextInt(3) == 0 && (arrow.shootingEntity == null || !(arrow.shootingEntity.equals(player)) || arrow.canBePickedUp == 0)) arrow.setDead();
+ }
+ }
+ }
+ // Positive bracelet
+ if (jewelry instanceof ItemBracelet && pos != -1){
+ if (player.motionY < 0) player.motionY *= 0.6D;
+ player.setAIMoveSpeed(player.getAIMoveSpeed() / 2);
+ player.fallDistance = 0F;
+ }
+ }
+
+ @Override
+ public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount)
+ {
+ int pos = JewelryNBT.doesModifierExist(item, modifier);
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ NBTTagCompound enemyData = target.getEntityData();
+ if (jewelry instanceof ItemRing && pos != -1 && enemyData.getInteger("reAttacked") == 0){
+ enemyData.setInteger("reAttacked", enemyData.getInteger("reAttacked") + 1);
+ target.attackEntityFrom(DamageSource.causePlayerDamage(player), amount / 2F);
+ if (rand.nextInt(2) == 0){
+ enemyData.setInteger("stunTime", 50);
+ enemyData.setBoolean("stunned", true);
+ }
+ playerInfo.setBoolean("weakDamage", true);
+ }
+ if (enemyData.getInteger("reAttacked") == 1) enemyData.setInteger("reAttacked", 0);
+ }
+
+ @Override
+ public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount)
+ {
+ int pos = JewelryNBT.doesModifierExist(item, modifier);
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (jewelry instanceof ItemNecklace && pos != -1 && rand.nextInt(4) == 0 && source != DamageSourceList.weak && source != DamageSource.inFire && source != DamageSource.onFire && source != DamageSource.lava){
+ player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.GRAY + "The necklace protected you from taking damage!"));
+ playerInfo.setBoolean("negateDamage", true);
+ }
+ // Negative necklace
+ if (jewelry instanceof ItemNecklace && pos != -1 && (source == DamageSource.inFire || source == DamageSource.onFire || source == DamageSource.lava) && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 3F);
+ // Negative earrings
+ if (jewelry instanceof ItemEarrings && pos != -1 && source.damageType.equals("arrow") && source != DamageSourceList.weak) player.attackEntityFrom(DamageSourceList.weak, amount * 2F);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/EffectsList.java b/src/main/java/darkknight/jewelrycraft/effects/EffectsList.java
new file mode 100644
index 0000000..13abc48
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/effects/EffectsList.java
@@ -0,0 +1,22 @@
+package darkknight.jewelrycraft.effects;
+
+import cpw.mods.fml.common.event.FMLPostInitializationEvent;
+
+public class EffectsList
+{
+ private static ModifierEffects blazePowder, enderEye, feather;
+ private static boolean isInitialized = false;
+
+ /**
+ * @param e
+ */
+ public static void postInit(FMLPostInitializationEvent e)
+ {
+ if (!isInitialized){
+ blazePowder = new EffectBlazePowder();
+ enderEye = new EffectEnderEye();
+ feather = new EffectFeather();
+ isInitialized = true;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/effects/ModifierEffects.java b/src/main/java/darkknight/jewelrycraft/effects/ModifierEffects.java
new file mode 100644
index 0000000..d3c8e38
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/effects/ModifierEffects.java
@@ -0,0 +1,85 @@
+package darkknight.jewelrycraft.effects;
+
+import java.util.ArrayList;
+import java.util.Random;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.DamageSource;
+
+public class ModifierEffects
+{
+ protected ItemStack modifier;
+ protected Random rand = new Random();
+ protected static ArrayList<ModifierEffects> effects = new ArrayList<ModifierEffects>();
+
+ /**
+ * @param modifier
+ */
+ public ModifierEffects(ItemStack modifier)
+ {
+ this.modifier = modifier;
+ effects.add(this);
+ }
+
+ /**
+ * @return
+ */
+ public static ArrayList<ModifierEffects> getEffects()
+ {
+ return effects;
+ }
+
+ /**
+ * @param item
+ * @param player
+ * @param jewelry
+ */
+ public void action(ItemStack item, EntityPlayer player, Item jewelry)
+ {};
+
+ /**
+ * @param item
+ * @param player
+ * @param target
+ * @param jewelry
+ * @return
+ */
+ public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount)
+ {
+ return false;
+ }
+
+ /**
+ * @param item
+ * @param player
+ * @param source
+ * @param jewelry
+ * @return
+ */
+ public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount)
+ {
+ return false;
+ }
+
+ /**
+ * @param item
+ * @param player
+ * @param target
+ * @param jewelry
+ * @return
+ */
+ public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, Item jewelry, float amount)
+ {}
+
+ /**
+ * @param item
+ * @param player
+ * @param source
+ * @param jewelry
+ * @return
+ */
+ public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, Item jewelry, float amount)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/entities/EntityHalfHeart.java b/src/main/java/darkknight/jewelrycraft/entities/EntityHalfHeart.java
new file mode 100644
index 0000000..4fc1e39
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/entities/EntityHalfHeart.java
@@ -0,0 +1,45 @@
+/**
+ *
+ */
+package darkknight.jewelrycraft.entities;
+
+import net.minecraft.entity.SharedMonsterAttributes;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.potion.PotionEffect;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+/**
+ * @author Sorin
+ */
+public class EntityHalfHeart extends EntityHeart
+{
+ public EntityHalfHeart(World world)
+ {
+ super(world);
+ }
+
+ @Override
+ public void onCollideWithPlayer(EntityPlayer player)
+ {
+ if (!player.worldObj.isRemote){
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (getType().equals("Red") && player.getHealth() < player.getMaxHealth()){
+ player.heal(1f);
+ this.setDead();
+ }else if (getType().equals("White") && playerInfo.getFloat("WhiteHeart") > 0.1F){
+ playerInfo.setFloat(getType() + "Heart", 0F);
+ player.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(player.getMaxHealth() + 2f);
+ this.setDead();
+ }else if (!getType().equals("Red") && playerInfo.getFloat(getType() + "Heart") < 20f){
+ playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + 1.0F <= 20f ? playerInfo.getFloat(getType() + "Heart") + 1.0F : 20f);
+ this.setDead();
+ }
+ }
+ else JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java b/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java
new file mode 100644
index 0000000..ebd64e7
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/entities/EntityHeart.java
@@ -0,0 +1,107 @@
+/**
+ *
+ */
+package darkknight.jewelrycraft.entities;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
+import darkknight.jewelrycraft.util.PlayerUtils;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.EnumCreatureAttribute;
+import net.minecraft.entity.SharedMonsterAttributes;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.util.DamageSource;
+import net.minecraft.world.World;
+
+/**
+ * @author Sorin
+ */
+public class EntityHeart extends EntityLiving
+{
+ public EntityHeart(World world)
+ {
+ super(world);
+ this.setSize(0.4F, 0.4F);
+ }
+
+ public boolean isEntityInvulnerable()
+ {
+ return true;
+ }
+
+ protected boolean canDespawn()
+ {
+ return false;
+ }
+
+ @Override
+ public void onCollideWithPlayer(EntityPlayer player)
+ {
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (getType() == "Red" && player.getHealth() < player.getMaxHealth()){
+ player.heal(2f);
+ this.setDead();
+ }
+ else if (getType() != "Red" && playerInfo.getFloat(getType() + "Heart") < 20f){
+ playerInfo.setFloat(getType() + "Heart", playerInfo.getFloat(getType() + "Heart") + 2.0F <= 20f ? playerInfo.getFloat(getType() + "Heart") + 2.0F : 20f);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ this.setDead();
+ }
+ }
+
+ @Override
+ protected void updateEntityActionState()
+ {
+ }
+
+ @SideOnly(Side.CLIENT)
+ public boolean canRenderOnFire()
+ {
+ return false;
+ }
+
+ protected void entityInit()
+ {
+ super.entityInit();
+ this.dataWatcher.addObject(16, "Red");
+ }
+
+ public void writeEntityToNBT(NBTTagCompound nbt)
+ {
+ super.writeEntityToNBT(nbt);
+ nbt.setString("Type", getType());
+ }
+
+ /**
+ * (abstract) Protected helper method to read subclass entity data from NBT.
+ */
+ public void readEntityFromNBT(NBTTagCompound nbt)
+ {
+ super.readEntityFromNBT(nbt);
+ setType(nbt.getString("Type"));
+ }
+
+ public String getType()
+ {
+ return this.dataWatcher.getWatchableObjectString(16);
+ }
+
+ public void setType(String type)
+ {
+ this.dataWatcher.updateObject(16, type);
+ }
+
+ public EnumCreatureAttribute getCreatureAttribute()
+ {
+ return EnumCreatureAttribute.UNDEAD;
+ }
+
+}
diff --git a/src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java b/src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java
new file mode 100644
index 0000000..6005bb3
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/entities/renders/HeartRender.java
@@ -0,0 +1,44 @@
+package darkknight.jewelrycraft.entities.renders;
+
+import org.lwjgl.opengl.GL11;
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.renderer.entity.RenderLiving;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.util.ResourceLocation;
+import darkknight.jewelrycraft.entities.EntityHeart;
+
+/**
+ * @author Sorin
+ */
+public class HeartRender extends RenderLiving
+{
+ protected ResourceLocation texture;
+
+ public HeartRender(ModelBase modelBase, float shadowSize)
+ {
+ super(modelBase, shadowSize);
+// texture = new ResourceLocation("jewelrycraft", "textures/entities/RedHeart.png");
+ }
+
+ @Override
+ protected void preRenderCallback(EntityLivingBase entity, float f)
+ {
+ preRenderCallbackHeart((EntityHeart) entity, f);
+ }
+
+ protected void preRenderCallbackHeart(EntityHeart entity, float f)
+ {
+ GL11.glScalef(0.4F, 0.4F, 0.4F);
+ GL11.glRotatef(55F, 1F, 0F, 0F);
+ String type = entity.getType();
+ if(type == "" || type == null) type = "Red";
+ texture = new ResourceLocation("jewelrycraft", "textures/entities/"+type+"Heart.png");
+ }
+
+ @Override
+ protected ResourceLocation getEntityTexture(Entity par1Entity)
+ {
+ return texture;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java b/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java
new file mode 100644
index 0000000..16ddfe1
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/entities/renders/RenderHelper.java
@@ -0,0 +1,23 @@
+package darkknight.jewelrycraft.entities.renders;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
+import org.lwjgl.opengl.GL11;
+
+public class RenderHelper
+{
+ public static void rotateIfSneaking(EntityPlayer player)
+ {
+ if (player.isSneaking()) applySneakingRotation();
+ }
+
+ public static void applySneakingRotation()
+ {
+ GL11.glRotatef(28.64789F, 1.0F, 0.0F, 0.0F);
+ }
+
+ public static void translateToHeadLevel(EntityPlayer player)
+ {
+ GL11.glTranslated(0, (player != Minecraft.getMinecraft().thePlayer ? 1.62F : 0F) - player.getDefaultEyeHeight() + (player.isSneaking() ? 0.0625 : 0), 0);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/events/BucketHandler.java b/src/main/java/darkknight/jewelrycraft/events/BucketHandler.java
new file mode 100644
index 0000000..871f26e
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/events/BucketHandler.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
+ *
+ * BuildCraft is distributed under the terms of the Minecraft Mod Public License
+ * 1.0, or MMPL. Please check the contents of the license located in
+ * http://www.mod-buildcraft.com/MMPL-1.0.txt
+ */
+package darkknight.jewelrycraft.events;
+
+import java.util.HashMap;
+import java.util.Map;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.world.World;
+import net.minecraftforge.event.entity.player.FillBucketEvent;
+import cpw.mods.fml.common.eventhandler.Event.Result;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.block.BlockMoltenMetal;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class BucketHandler
+{
+ public static BucketHandler INSTANCE = new BucketHandler();
+ public Map<Block, Item> buckets = new HashMap<Block, Item>();
+
+ /**
+ *
+ */
+ private BucketHandler()
+ {}
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onBucketFill(FillBucketEvent event)
+ {
+ ItemStack result = fillCustomBucket(event.world, event.target);
+ if (result == null) return;
+ event.result = result;
+ event.setResult(Result.ALLOW);
+ }
+
+ /**
+ * @param world
+ * @param pos
+ * @return
+ */
+ private ItemStack fillCustomBucket(World world, MovingObjectPosition pos)
+ {
+ Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
+ Item bucket = buckets.get(block);
+ if (bucket != null && world.getBlock(pos.blockX, pos.blockY, pos.blockZ) != Blocks.air && world.getBlock(pos.blockX, pos.blockY, pos.blockZ) instanceof BlockMoltenMetal){
+ world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
+ ItemStack item = new ItemStack(bucket);
+ String ingotData = JewelrycraftMod.saveData.getString(pos.blockX + " " + pos.blockY + " " + pos.blockZ + " " + world.provider.dimensionId);
+ if (ingotData != null && ingotData != ""){
+ String[] splitData = ingotData.split(":");
+ if (splitData.length == 3){
+ int itemID, itemDamage;
+ try{
+ itemID = Integer.parseInt(splitData[0]);
+ itemDamage = Integer.parseInt(splitData[1]);
+ Integer.parseInt(splitData[2]);
+ JewelryNBT.addMetal(item, new ItemStack(Item.getItemById(itemID), 1, itemDamage));
+ }
+ catch(Exception e){
+ e.printStackTrace();
+ }
+ }
+ }
+ return item;
+ }else return null;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java b/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java
new file mode 100644
index 0000000..f9cbd19
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/events/EntityEventHandler.java
@@ -0,0 +1,465 @@
+package darkknight.jewelrycraft.events;
+
+import ibxm.Player;
+import java.io.EOFException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.CompressedStreamTools;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.server.MinecraftServer;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.MathHelper;
+import net.minecraftforge.client.event.EntityViewRenderEvent;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.EntityJoinWorldEvent;
+import net.minecraftforge.event.entity.item.ItemTossEvent;
+import net.minecraftforge.event.entity.living.LivingAttackEvent;
+import net.minecraftforge.event.entity.living.LivingDeathEvent;
+import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent;
+import net.minecraftforge.event.entity.living.LivingFallEvent;
+import net.minecraftforge.event.entity.player.PlayerEvent;
+import net.minecraftforge.event.entity.player.PlayerFlyableFallEvent;
+import net.minecraftforge.event.world.WorldEvent;
+import org.lwjgl.opengl.GL11;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.curses.Curse;
+import darkknight.jewelrycraft.damage.DamageSourceList;
+import darkknight.jewelrycraft.entities.EntityHalfHeart;
+import darkknight.jewelrycraft.entities.EntityHeart;
+import darkknight.jewelrycraft.item.ItemBaseJewelry;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.lib.Reference;
+import darkknight.jewelrycraft.network.PacketClearColorCache;
+import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
+import darkknight.jewelrycraft.network.PacketSendCurseStats;
+import darkknight.jewelrycraft.network.PacketSendPlayerInfo;
+import darkknight.jewelrycraft.util.BlockUtils;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+/**
+ * Code taken from OpenBlocks
+ */
+public class EntityEventHandler
+{
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onEntityJoinWorld(EntityJoinWorldEvent event)
+ {
+ if (event.entity instanceof EntityPlayerMP) JewelrycraftMod.netWrapper.sendTo(new PacketClearColorCache(), (EntityPlayerMP)event.entity);
+ if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ final Entity entity = event.entity;
+ if (!event.world.isRemote && entity instanceof EntityPlayer){
+ EntityPlayer player = (EntityPlayer)entity;
+ NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean("givenGuide");
+ if (shouldGiveManual){
+ ItemStack manual = new ItemStack(ItemList.guide);
+ if (!player.inventory.addItemStackToInventory(manual)) BlockUtils.dropItemStackInWorld(player.worldObj, player.posX, player.posY, player.posZ, manual);
+ persistTag.setBoolean("givenGuide", true);
+ }
+ boolean render = persistTag.getBoolean("fancyRender");
+ JewelrycraftMod.fancyRender = render;
+ for(Curse curse: Curse.getCurseList())
+ if (!persistTag.hasKey(curse.getName())) persistTag.setInteger(curse.getName(), 0);
+ persistTag.setBoolean("sendInfo", true);
+ }
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onEntityUpdate(LivingUpdateEvent event)
+ {
+ Entity entity = event.entity;
+ if (entity.getEntityData().getBoolean("stunned") && entity.getEntityData().getInteger("stunTime") > 0){
+ entity.motionX *= 0D;
+ entity.motionZ *= 0D;
+ entity.motionY *= 0D;
+ entity.rotationPitch = entity.prevRotationPitch;
+ entity.rotationYaw = entity.prevRotationYaw;
+ entity.getEntityData().setInteger("stunTime", entity.getEntityData().getInteger("stunTime") - 1);
+ if (entity.getEntityData().getInteger("stunTime") == 0) entity.getEntityData().setBoolean("stunned", false);
+ entity.worldObj.spawnParticle("spell", entity.posX, entity.posY + entity.height, entity.posZ, 0.0D, 0.3D, 0.0D);
+ }
+ if (entity instanceof EntityPlayer){
+ EntityPlayer player = (EntityPlayer)entity;
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ playerInfo.setBoolean("fancyRender", JewelrycraftMod.fancyRender);
+ if (playerInfo.getBoolean("stunned") && playerInfo.getInteger("stunTime") > 0){
+ player.motionX *= 0D;
+ player.motionZ *= 0D;
+ player.motionY *= 0D;
+ player.rotationPitch = entity.prevRotationPitch;
+ player.rotationYaw = entity.prevRotationYaw;
+ playerInfo.setInteger("stunTime", playerInfo.getInteger("stunTime") - 1);
+ if (playerInfo.getInteger("stunTime") == 0) playerInfo.setBoolean("stunned", false);
+ player.worldObj.spawnParticle("spell", entity.posX, entity.posY + 0.5F, entity.posZ, 0.0D, 0.3D, 0.0D);
+ }
+ for(int i = 0; i < 18; i++)
+ if (playerInfo.hasKey("ext" + i)){
+ NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
+ ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
+ ((ItemBaseJewelry)item.getItem()).action(item, player);
+ }
+ if (!player.worldObj.isRemote){
+ if (playerInfo.hasKey("reselectCurses") && !playerInfo.getBoolean("reselectCurses")){
+ playerInfo.setInteger("curseTime", playerInfo.getInteger("curseTime") - 10000);
+ if (playerInfo.getInteger("curseTime") <= 0) playerInfo.setBoolean("reselectCurses", true);
+ }
+ if (playerInfo.hasKey("playerCursePointsChanged") && playerInfo.getBoolean("playerCursePointsChanged")){
+ int points = playerInfo.getInteger("cursePoints");
+ for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++)
+ if (points > (i - 1) * 1750) addCurse(player, playerInfo, i);
+ if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){
+ playerInfo.setInteger("curseTime", 23000);
+ playerInfo.setBoolean("reselectCurses", false);
+ }
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ }
+ if (playerInfo.getBoolean("playerCursePointsChanged")) playerInfo.setBoolean("playerCursePointsChanged", false);
+ if (playerInfo.getBoolean("sendInfo")){
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendCurseStats());
+ playerInfo.setBoolean("sendInfo", false);
+ }
+ for(Curse curse: Curse.getCurseList())
+ if (playerInfo.getInteger(curse.getName()) > 0) curse.action(player.worldObj, player);
+ }
+ }
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onEntityAttacked(LivingAttackEvent event)
+ {
+ Entity entity = event.entityLiving;
+ if (entity instanceof EntityPlayer && !(event.source.getEntity() instanceof EntityPlayer)){
+ EntityPlayer player = (EntityPlayer)entity;
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (event.source.getEntity() != null && event.source.getEntity().getEntityData().getBoolean("stunned")) event.setCanceled(true);
+ if (!player.worldObj.isRemote) for(int i = 0; i < 18; i++)
+ if (playerInfo.hasKey("ext" + i)){
+ NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
+ ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
+ if (((ItemBaseJewelry)item.getItem()).onPlayerAttackedCacellable(item, player, event.source, event.ammount)){
+ event.setCanceled(true);
+ break;
+ }
+ if (playerInfo.getBoolean("negateDamage")){
+ playerInfo.setBoolean("negateDamage", false);
+ event.setCanceled(true);
+ break;
+ }
+ ((ItemBaseJewelry)item.getItem()).onPlayerAttacked(item, player, event.source, event.ammount);
+ }
+ if (player.getHealth() != player.prevHealth){
+ if (playerInfo.getFloat("WhiteHeart") > 0){
+ playerInfo.setFloat("WhiteHeart", 0f);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ }
+ if (playerInfo.getFloat("BlueHeart") > 0){
+ float damage = playerInfo.getFloat("BlueHeart") - event.ammount;
+ if (damage >= 0){
+ playerInfo.setFloat("BlueHeart", damage);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ player.heal(event.ammount);
+ }else{
+ playerInfo.setFloat("BlueHeart", 0f);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ player.heal(Math.abs(damage));
+ }
+ }else if (playerInfo.getFloat("BlackHeart") > 0){
+ AxisAlignedBB axisalignedbb = player.boundingBox.expand(2.0D, 0.0D, 2.0D);
+ List enemies = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, axisalignedbb);
+ if (enemies != null && !enemies.isEmpty()){
+ Iterator iterator = enemies.iterator();
+ while (iterator.hasNext()){
+ Entity enemy = (Entity)iterator.next();
+ enemy.attackEntityFrom(DamageSourceList.blackHeart, 5f * event.ammount);
+ }
+ }
+ float damage = playerInfo.getFloat("BlackHeart") - event.ammount;
+ if (damage >= 0){
+ playerInfo.setFloat("BlackHeart", damage);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ player.heal(event.ammount);
+ }else{
+ playerInfo.setFloat("BlackHeart", 0f);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ player.heal(Math.abs(damage));
+ }
+ }
+ }
+ for(Curse curse: Curse.getCurseList())
+ if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedAction(player.worldObj, player);
+ }else if (event.source.getEntity() instanceof EntityPlayer){
+ EntityPlayer player = (EntityPlayer)event.source.getEntity();
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ for(int i = 0; i < 18; i++)
+ if (playerInfo.hasKey("ext" + i)){
+ NBTTagCompound nbt = (NBTTagCompound)playerInfo.getTag("ext" + i);
+ ItemStack item = ItemStack.loadItemStackFromNBT(nbt);
+ if (((ItemBaseJewelry)item.getItem()).onEntityAttackedCacellable(item, player, entity, event.ammount)){
+ event.setCanceled(true);
+ break;
+ }
+ if (playerInfo.getBoolean("weakDamage")){
+ playerInfo.setBoolean("weakDamage", false);
+ event.setCanceled(true);
+ break;
+ }
+ ((ItemBaseJewelry)item.getItem()).onEntityAttacked(item, player, entity, event.ammount);
+ }
+ for(Curse curse: Curse.getCurseList())
+ if (playerInfo.getInteger(curse.getName()) > 0) curse.attackedByPlayerAction(entity.worldObj, player, entity);
+ }
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onPlayerRespawn(PlayerEvent.Clone event)
+ {
+ EntityPlayer player = event.entityPlayer;
+ if (!player.worldObj.isRemote){
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (playerInfo.hasKey("cursePoints") && playerInfo.getInteger("cursePoints") > 0){
+ int points = playerInfo.getInteger("cursePoints");
+ for(int i = 1; i <= JewelrycraftMod.MAX_CURSES; i++)
+ if (points > (i - 1) * 1750) addCurse(player, playerInfo, i);
+ if (!playerInfo.hasKey("curseTime") || !playerInfo.hasKey("reselectCurses") || playerInfo.getBoolean("reselectCurses")){
+ playerInfo.setInteger("curseTime", 23000);
+ playerInfo.setBoolean("reselectCurses", false);
+ }
+ }
+ playerInfo.setBoolean("sendInfo", true);
+ playerInfo.setFloat("BlueHeart", 0f);
+ playerInfo.setFloat("BlackHeart", 0f);
+ playerInfo.setFloat("WhiteHeart", 0f);
+ for(Curse curse: Curse.getCurseList())
+ if (playerInfo.getInteger(curse.getName()) > 0) curse.respawnAction(player.worldObj, player);
+ }
+ if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ }
+
+ /**
+ * @param player
+ * @param playerInfo
+ * @param curse
+ */
+ public void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseNo)
+ {
+ if (Curse.availableCurses.size() > 0 && curseNo > Curse.getCurseList().size() - Curse.availableCurses.size()){
+ int no = JewelrycraftUtil.rand.nextInt(Curse.availableCurses.size());
+ Curse cur = Curse.availableCurses.get(no);
+ playerInfo.setInteger(cur.getName(), 1);
+ Curse.availableCurses.remove(cur);
+ playerInfo.setBoolean("sendInfo", true);
+ }
+ }
+
+ public static void addCurse(EntityPlayer player, NBTTagCompound playerInfo, int curseID, int grade)
+ {
+ Curse cur = Curse.getCurseList().get(curseID);
+ if (Curse.availableCurses.size() > 0 && Curse.availableCurses.contains(cur)){
+ playerInfo.setInteger(cur.getName(), grade);
+ Curse.availableCurses.remove(cur);
+ playerInfo.setBoolean("sendInfo", true);
+ }
+ }
+
+ @SubscribeEvent
+ public void itemToss(ItemTossEvent event)
+ {
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(event.player, "Jewelrycraft");
+ for(Curse curse: Curse.getCurseList())
+ if (playerInfo.getInteger(curse.getName()) > 0 && curse.itemToss()){
+ EntityItem entityitem = new EntityItem(event.player.worldObj, event.player.posX + 0.5D, event.player.posY + 0.5D, event.player.posZ + 0.5D, event.entityItem.getEntityItem());
+ entityitem.motionX = 0;
+ entityitem.motionZ = 0;
+ entityitem.motionY = 0.11000000298023224D;
+ event.player.worldObj.spawnEntityInWorld(entityitem);
+ List players = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
+ Iterator plrs = players.iterator();
+ while (plrs.hasNext())
+ ((EntityPlayerMP)plrs.next()).addChatComponentMessage(new ChatComponentText("<" + event.player.getDisplayName() + "> This is MY item! MINE! I will NEVER give it to you! Mine! Mine! MINE!"));
+ event.setCanceled(true);
+ }
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void playerFileSave(PlayerEvent.SaveToFile event)
+ {
+ if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onEntityDead(LivingDeathEvent event)
+ {
+ final Entity entity = event.entity;
+ Random rand = new Random();
+ String[] types = {"Red", "Blue", "White", "Black"};
+ if (!entity.worldObj.isRemote && !(entity instanceof EntityPlayer) && entity instanceof EntityLiving){
+ EntityLiving live = (EntityLiving)entity;
+ String type = types[rand.nextInt(4)];
+ if (rand.nextInt(6) == 0){
+ if (type == "White"){
+ EntityHeart h = new EntityHalfHeart(live.worldObj);
+ h.setType(type);
+ h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F);
+ live.worldObj.spawnEntityInWorld(h);
+ }else{
+ for(int i = 1; i <= 1 + rand.nextInt(1 + (int)(live.getMaxHealth() / 20)); i++){
+ EntityHeart[] hearts = {new EntityHeart(live.worldObj), new EntityHalfHeart(entity.worldObj)};
+ EntityHeart h = hearts[rand.nextInt(2)];
+ h.setType(type);
+ h.setLocationAndAngles(live.posX, live.posY, live.posZ, MathHelper.wrapAngleTo180_float(rand.nextFloat() * 360.0F), 0.0F);
+ live.worldObj.spawnEntityInWorld(h);
+ }
+ }
+ }
+ }
+ if (entity instanceof EntityPlayer){
+ EntityPlayer player = (EntityPlayer)entity;
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ playerInfo.setFloat("BlueHeart", 0f);
+ playerInfo.setFloat("BlackHeart", 0f);
+ playerInfo.setFloat("WhiteHeart", 0f);
+ if (playerInfo.hasKey("reselectCurses") && playerInfo.getBoolean("reselectCurses")){
+ for(Curse l: Curse.getCurseList()){
+ if (playerInfo.getInteger(l.getName()) == 1){
+ playerInfo.setInteger(l.getName(), 0);
+ if (!Curse.availableCurses.contains(l)) Curse.availableCurses.add(l);
+ }else if (playerInfo.getInteger(l.getName()) >= 2) playerInfo.setInteger(l.getName(), 1);
+ }
+ if (entity.worldObj.isRemote) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ }
+ playerInfo.setBoolean("sendInfo", true);
+ for(Curse curse: Curse.getCurseList())
+ if (playerInfo.getInteger(curse.getName()) > 0) curse.deathAction(player.worldObj, player);
+ }
+ if (event.entity instanceof EntityPlayer && !(event.entity instanceof EntityPlayerMP)) JewelrycraftMod.netWrapper.sendToServer(new PacketRequestPlayerInfo());
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onWorldLoad(WorldEvent.Load event)
+ {
+ if (!event.world.isRemote){
+ new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft").mkdirs();
+ JewelrycraftMod.liquidsConf = new File(JewelrycraftMod.dir + File.separator + "Jewelrycraft", "JLP" + event.world.getWorldInfo().getWorldName() + ".cfg");
+ try{
+ if (!JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.liquidsConf.createNewFile();
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ }
+ if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{
+ if (JewelrycraftMod.liquidsConf.exists()) JewelrycraftMod.saveData = CompressedStreamTools.readCompressed(new FileInputStream(JewelrycraftMod.liquidsConf));
+ }
+ catch(EOFException e){
+ e.printStackTrace();
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onWorldSave(WorldEvent.Save event)
+ {
+ if (FMLCommonHandler.instance().getEffectiveSide().isServer()) try{
+ if (JewelrycraftMod.liquidsConf.exists()) CompressedStreamTools.writeCompressed(JewelrycraftMod.saveData, new FileOutputStream(JewelrycraftMod.liquidsConf));
+ }
+ catch(EOFException e){
+ e.printStackTrace();
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ @SideOnly (Side.CLIENT)
+ public void fogColors(EntityViewRenderEvent.FogColors event)
+ {
+ if (event.entity instanceof EntityPlayer){
+ EntityPlayer player = (EntityPlayer)event.entity;
+ NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (persistTag.getBoolean("nearStartedRitual")){
+ event.red = 0f;
+ event.green = 0f;
+ event.blue = 0f;
+ }
+ }
+ if (event.isCancelable()) event.setCanceled(true);
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ @SideOnly (Side.CLIENT)
+ public void fogDensity(EntityViewRenderEvent.FogDensity event)
+ {}
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ @SideOnly (Side.CLIENT)
+ public void renderFog(EntityViewRenderEvent.RenderFogEvent event)
+ {
+ if (event.entity instanceof EntityPlayer){
+ EntityPlayer player = (EntityPlayer)event.entity;
+ NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ if (persistTag.getBoolean("nearStartedRitual")){
+ GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP);
+ GL11.glFogf(GL11.GL_FOG_DENSITY, 0.6F);
+ }
+ }
+ if (event.isCancelable()) event.setCanceled(true);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java b/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java
new file mode 100644
index 0000000..a032047
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/events/KeyBindings.java
@@ -0,0 +1,34 @@
+package darkknight.jewelrycraft.events;
+
+import net.minecraft.client.settings.KeyBinding;
+import org.lwjgl.input.Keyboard;
+import cpw.mods.fml.client.registry.ClientRegistry;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import cpw.mods.fml.common.gameevent.InputEvent;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.network.PacketKeyPressEvent;
+
+public class KeyBindings
+{
+ public static KeyBinding render = new KeyBinding("Pretty Render", Keyboard.KEY_Z, "Jewelrycraft");
+ public static KeyBinding inventory = new KeyBinding("Jewelry Inventory", Keyboard.KEY_J, "Jewelrycraft");
+
+ /**
+ *
+ */
+ public KeyBindings()
+ {
+ ClientRegistry.registerKeyBinding(render);
+ ClientRegistry.registerKeyBinding(inventory);
+ }
+
+ /**
+ * @param event
+ */
+ @SubscribeEvent
+ public void onKeyInput(InputEvent.KeyInputEvent event)
+ {
+ if (render.isPressed()) JewelrycraftMod.fancyRender = !JewelrycraftMod.fancyRender;
+ if (inventory.isPressed()) JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0));
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java b/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java
new file mode 100644
index 0000000..d85620a
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/events/PlayerRenderHandler.java
@@ -0,0 +1,68 @@
+package darkknight.jewelrycraft.events;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.server.MinecraftServer;
+import net.minecraftforge.client.event.RenderPlayerEvent;
+import org.lwjgl.opengl.GL11;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import darkknight.jewelrycraft.entities.renders.RenderHelper;
+import darkknight.jewelrycraft.lib.Reference;
+import darkknight.jewelrycraft.model.ModelMask;
+import darkknight.jewelrycraft.tileentity.renders.MaskRender;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class PlayerRenderHandler
+{
+ ModelMask maskModel = new ModelMask();
+ MaskRender mask = new MaskRender();
+
+ public static String[] infamyCache = new String[] {};
+
+ @SubscribeEvent
+ public void renderScreen(RenderPlayerEvent.Specials.Post event)
+ {
+ if (infamyCache != null)
+ {
+ Iterator<EntityPlayer> players = event.entityPlayer.worldObj.playerEntities.iterator();
+
+ while(players.hasNext())
+ {
+ EntityPlayer player = players.next();
+ if (checkPlayerInfamy(player.getDisplayName()) && event.entityPlayer.getDisplayName().equals(player.getDisplayName()))
+ {
+ float yaw = player.prevRotationYawHead + (player.rotationYawHead - player.prevRotationYawHead) * event.partialRenderTick;
+ float yawOffset = player.prevRenderYawOffset + (player.renderYawOffset - player.prevRenderYawOffset) * event.partialRenderTick;
+ float pitch = player.prevRotationPitch + (player.rotationPitch - player.prevRotationPitch) * event.partialRenderTick;
+ GL11.glPushMatrix();
+ GL11.glColor4f(1, 1, 1, 1);
+ GL11.glRotatef(yawOffset, 0, -1, 0);
+ GL11.glRotatef(yaw - 90, 0, 1, 0);
+ GL11.glRotatef(pitch, 0, 0, -1);
+ GL11.glRotatef(90F, 0, 1F, 0F);
+ RenderHelper.translateToHeadLevel(player);
+ GL11.glScalef(1.6f, 1.6f, 1.6f);
+ GL11.glTranslatef(-0.25F, -0.25F, -0.25F);
+ mask.doRender(event.entityPlayer, 0F, 0F, 0F, 0F, 0F);
+ GL11.glPopMatrix();
+ }
+ }
+ }
+ }
+
+ /**
+ * @param string
+ * @return
+ */
+ private boolean checkPlayerInfamy(String string)
+ {
+ for (int i = 0; i < infamyCache.length; i++)
+ if (infamyCache[i].equals(string)) return true;
+
+ return false;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java b/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java
new file mode 100644
index 0000000..7121f3e
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/events/ScreenHandler.java
@@ -0,0 +1,102 @@
+package darkknight.jewelrycraft.events;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.Gui;
+import net.minecraft.client.gui.GuiChat;
+import net.minecraft.client.gui.ScaledResolution;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.ResourceLocation;
+import net.minecraftforge.client.event.RenderGameOverlayEvent;
+import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
+import net.minecraftforge.event.entity.player.PlayerOpenContainerEvent;
+import org.lwjgl.opengl.GL11;
+import cpw.mods.fml.common.eventhandler.SubscribeEvent;
+import darkknight.jewelrycraft.curses.Curse;
+
+public class ScreenHandler extends Gui
+{
+ private Minecraft mc;
+ public static NBTTagCompound tagCache = null;
+ public static int cooldown;
+ static ResourceLocation texture;
+ static ResourceLocation hearts = new ResourceLocation("jewelrycraft", "textures/gui/hearts.png");
+
+ public ScreenHandler(Minecraft mc, ResourceLocation tex)
+ {
+ super();
+ this.mc = mc;
+ texture = tex;
+ }
+
+ @SubscribeEvent
+ public void renderScreen(RenderGameOverlayEvent event)
+ {
+// if (event.type != ElementType.TEXT) Gui.drawRect(0, 0, mc.displayWidth, mc.displayHeight, 0xff000000);
+ if (event.isCancelable() || event.type != ElementType.ALL || tagCache == null) return;
+ if (!mc.gameSettings.showDebugInfo && !(mc.currentScreen instanceof GuiChat)){
+ int count = 0;
+ int size = 32;
+ ScaledResolution resolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
+ if (tagCache.hasKey("cursePoints") && tagCache.getInteger("cursePoints") > 0){
+ mc.renderEngine.bindTexture(texture);
+ for(Curse curse: Curse.getCurseList()){
+ if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){
+ Gui.drawRect(0, (size / 2 + 6) * count, 24 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 4 + (size / 2 + 6) * count + 16, 0xaf000000);
+ Gui.drawRect(2, 2 + (size / 2 + 6) * count, 22 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 2 + (size / 2 + 6) * count + 16, 0x95700064);
+ count++;
+ }
+ }
+ count = 0;
+ for(Curse curse: Curse.getCurseList())
+ if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){
+ int tag = curse.getID();
+ GL11.glPushMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glScalef(0.5f, 0.5f, 0.0f);
+ drawTexturedModalRect(4, 4 + (size + 12) * count, tag % size * size, tag / size * size, size, size);
+ GL11.glPopMatrix();
+ count++;
+ }
+ count = 0;
+ size = 16;
+ for(Curse curse: Curse.getCurseList())
+ if (tagCache.hasKey(curse.getName()) && tagCache.getInteger(curse.getName()) > 0){
+ int tag = curse.getID();
+ mc.fontRenderer.drawStringWithShadow(curse.getName().split(":")[1], 20, 7 + (size + 6) * count, 16777215);
+ if (tagCache.getInteger(curse.getName()) == 2){
+ mc.renderEngine.bindTexture(hearts);
+ GL11.glPushMatrix();
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glColor4f(1f, 1f, 1f, 0.5f);
+ drawTexturedModalRect(15 + mc.fontRenderer.getStringWidth(curse.getName().split(":")[1]), 8 + (size + 6) * count, 3 * size, 0, size, size);
+ GL11.glPopMatrix();
+ }
+ count++;
+ }
+ }
+ GL11.glPushMatrix();
+ GL11.glColor4f(1f, 1f, 1f, 1.0f);
+ mc.renderEngine.bindTexture(hearts);
+ count = 0;
+ size = 16;
+ if (tagCache.getFloat("BlueHeart") > 0){
+ for(int i = 0; i < (int)tagCache.getFloat("BlueHeart") / 2; i++)
+ drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 0 * size, size, size);
+ if (tagCache.getFloat("BlueHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlueHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 0 * size, 1 * size, size, size);
+ }
+ count++;
+ if (tagCache.getFloat("BlackHeart") > 0){
+ for(int i = 0; i < MathHelper.ceiling_float_int((tagCache.getFloat("BlackHeart")) / 2.0F); i++)
+ drawTexturedModalRect(2 + 13 * i, resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 0 * size, size, size);
+ if (tagCache.getFloat("BlackHeart") % 2 != 0) drawTexturedModalRect(2 + 13 * ((int)tagCache.getFloat("BlackHeart") / 2), resolution.getScaledHeight() / 2 - 25 + 16 * count, 1 * size, 1 * size, size, size);
+ }
+ count++;
+ if (tagCache.getFloat("WhiteHeart") > 0)
+ drawTexturedModalRect(2, resolution.getScaledHeight() / 2 - 25 + 16 * count, 2 * size, 1 * size, size, size);
+ GL11.glPopMatrix();
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java b/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java
new file mode 100644
index 0000000..cb38b76
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemBaseJewelry.java
@@ -0,0 +1,261 @@
+package darkknight.jewelrycraft.item;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import javax.imageio.ImageIO;
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.texture.TextureManager;
+import net.minecraft.client.resources.IResourceManager;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.DamageSource;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.util.StatCollector;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.effects.ModifierEffects;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public abstract class ItemBaseJewelry extends Item
+{
+ public ItemBaseJewelry()
+ {
+ super();
+ setMaxStackSize(1);
+ setCreativeTab(JewelrycraftMod.jewelrycraft);
+ }
+
+ public boolean requiresMultipleRenderPasses()
+ {
+ return true;
+ }
+
+ @SideOnly (Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass)
+ {
+ try{
+ return color(stack, pass);
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ return 16777215;
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ * @throws IOException
+ */
+ public static int color(ItemStack stack, int pass) throws IOException
+ {
+ IResourceManager rm = Minecraft.getMinecraft().getResourceManager();
+ BufferedImage icon;
+ if (pass == 0 && stack != null && JewelryNBT.ingot(stack) != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0 && JewelryNBT.ingot(stack).getIconIndex() != null && JewelryNBT.ingotColor(stack) == 16777215){
+ ItemStack ingot = JewelryNBT.ingot(stack);
+ icon = ImageIO.read(rm.getResource(getLocation(ingot, stack, true)).getInputStream());
+ int height = icon.getHeight();
+ int width = icon.getWidth();
+ Map m = new HashMap();
+ for(int i = 0; i < width; i++)
+ for(int j = 0; j < height; j++){
+ int rgb = icon.getRGB(i, j);
+ int red = rgb >> 16 & 0xff;
+ int green = rgb >> 8 & 0xff;
+ int blue = rgb & 0xff;
+ int[] rgbArr = {red, green, blue};
+ int Cmax = Math.max(red, Math.max(green, blue));
+ int Cmin = Math.min(red, Math.min(green, blue));
+ if (!isGray(rgbArr)) m.put(rgb, (Cmax + Cmin) / 2);
+ }
+ int color = getMostCommonColour(m);
+ if (JewelryNBT.ingot(stack) != null && JewelryNBT.ingot(stack).getItem().getColorFromItemStack(JewelryNBT.ingot(stack), 1) != 16777215) JewelryNBT.addIngotColor(stack, JewelryNBT.ingot(stack).getItem().getColorFromItemStack(JewelryNBT.ingot(stack), 1));
+ else JewelryNBT.addIngotColor(stack, color);
+ }else if (pass == 1 && stack != null && JewelryNBT.gem(stack) != null && JewelryNBT.gem(stack).getIconIndex() != null && JewelryNBT.gem(stack) != null){
+ ItemStack gem = JewelryNBT.gem(stack);
+ icon = ImageIO.read(rm.getResource(getLocation(gem, stack, true)).getInputStream());
+ int height = icon.getHeight();
+ int width = icon.getWidth();
+ Map m = new HashMap();
+ for(int i = 0; i < width; i++)
+ for(int j = 0; j < height; j++){
+ int rgb = icon.getRGB(i, j);
+ int red = rgb >> 16 & 0xff;
+ int green = rgb >> 8 & 0xff;
+ int blue = rgb & 0xff;
+ int[] rgbArr = {red, green, blue};
+ int Cmax = Math.max(red, Math.max(green, blue));
+ int Cmin = Math.min(red, Math.min(green, blue));
+ if (!isGray(rgbArr)) m.put(rgb, (Cmax + Cmin) / 2);
+ }
+ int color = getMostCommonColour(m);
+ if (JewelryNBT.gem(stack).getItem().getColorFromItemStack(JewelryNBT.gem(stack), 1) == 16777215) JewelryNBT.addGemColor(stack, color);
+ else JewelryNBT.addGemColor(stack, JewelryNBT.gem(stack).getItem().getColorFromItemStack(JewelryNBT.gem(stack), 1));
+ }
+ if (pass == 0 && JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack);
+ if (pass == 1 && JewelryNBT.gem(stack) != null) return JewelryNBT.gemColor(stack);
+ else if (JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack);
+ return 16777215;
+ }
+
+ /**
+ * @param item
+ * @param stack
+ * @param changeMeta
+ * @return
+ */
+ public static ResourceLocation getLocation(ItemStack item, ItemStack stack, boolean changeMeta)
+ {
+ String domain = "";
+ String texture;
+ if (changeMeta && (Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.carpet))) item.setItemDamage(15 - item.getItemDamage());
+ IIcon itemIcon = item.getItem().getIcon(item, 0);
+ String iconName = itemIcon.getIconName();
+ if (iconName.substring(0, iconName.indexOf(":") + 1) != "") domain = iconName.substring(0, iconName.indexOf(":") + 1).replace(":", " ").trim();
+ else domain = "minecraft";
+ texture = iconName.substring(iconName.lastIndexOf(":") + 1) + ".png";
+ ResourceLocation textureLocation = null;
+ TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager();
+ if (texturemanager.getResourceLocation(item.getItemSpriteNumber()).toString().contains("items")) textureLocation = new ResourceLocation(domain.toLowerCase(), "textures/items/" + texture);
+ else textureLocation = new ResourceLocation(domain.toLowerCase(), "textures/blocks/" + texture);
+ return textureLocation;
+ }
+
+ /**
+ * @param map
+ * @return
+ */
+ public static int getMostCommonColour(Map map)
+ {
+ List list = new LinkedList(map.entrySet());
+ Collections.sort(list, new Comparator(){
+ public int compare(Object o1, Object o2)
+ {
+ return ((Comparable)((Map.Entry)o1).getValue()).compareTo(((Map.Entry)o2).getValue());
+ }
+ });
+ Map.Entry me = (Map.Entry)list.get(list.size() - 1);
+ for(int i = 0; i < list.size(); i++){
+ float alpha = Float.valueOf(list.get(i).toString().split("=")[1]);
+ if (alpha < 180) me = (Map.Entry)list.get(i);
+ }
+ int rgb = (Integer)me.getKey();
+ return rgb;
+ }
+
+ /**
+ * @param rgbArr
+ * @return
+ */
+ public static boolean isGray(int[] rgbArr)
+ {
+ int rgbSum = rgbArr[0] + rgbArr[1] + rgbArr[2];
+ if (rgbSum > 0 && rgbSum < 256 * 3) return false;
+ return true;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public String getItemStackDisplayName(ItemStack stack)
+ {
+ if (JewelryNBT.ingot(stack) != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0) return JewelryNBT.ingot(stack).getDisplayName().replace("Ingot", " ").trim() + " " + ("" + StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim();
+ return ("" + StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim();
+ }
+
+ /**
+ * allows items to add custom lines of information to the mouseover description.
+ *
+ * @param stack
+ * @param player
+ * @param list
+ * @param par4
+ */
+ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4)
+ {
+ if (stack.hasTagCompound() && par4){
+ ItemStack ingot = JewelryNBT.ingot(stack);
+ if (ingot != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0) list.add("Ingot: " + EnumChatFormatting.YELLOW + ingot.getDisplayName());
+ ItemStack gem = JewelryNBT.gem(stack);
+ if (gem != null) list.add("Gem: " + EnumChatFormatting.BLUE + gem.getDisplayName());
+ ArrayList<ItemStack> modifier = JewelryNBT.modifier(stack);
+ if (!modifier.isEmpty()) list.add("Modifiers: ");
+ for(int i = 0; i < modifier.size(); i++)
+ list.add(EnumChatFormatting.DARK_PURPLE + modifier.get(i).getDisplayName() + " x" + modifier.get(i).stackSize);
+ }
+ }
+
+ /**
+ * @param stack
+ * @param player
+ */
+ public void action(ItemStack stack, EntityPlayer player)
+ {
+ for(ModifierEffects mod: ModifierEffects.getEffects())
+ mod.action(stack, player, this);
+ }
+
+ /**
+ * @param item
+ * @param player
+ * @param source
+ * @return
+ */
+ public boolean onPlayerAttackedCacellable(ItemStack item, EntityPlayer player, DamageSource source, float amount)
+ {
+ for(ModifierEffects mod: ModifierEffects.getEffects())
+ return mod.onPlayerAttackedCacellable(item, player, source, this, amount);
+ return false;
+ }
+
+ /**
+ * @param item
+ * @param player
+ * @param target
+ * @return
+ */
+ public boolean onEntityAttackedCacellable(ItemStack item, EntityPlayer player, Entity target, float amount)
+ {
+ for(ModifierEffects mod: ModifierEffects.getEffects())
+ return mod.onEntityAttackedCacellable(item, player, target, this, amount);
+ return false;
+ }
+
+ /**
+ * @param item
+ * @param player
+ * @param source
+ * @return
+ */
+ public void onPlayerAttacked(ItemStack item, EntityPlayer player, DamageSource source, float amount)
+ {
+ for(ModifierEffects mod: ModifierEffects.getEffects()) mod.onPlayerAttacked(item, player, source, this, amount);
+ }
+
+ /**
+ * @param item
+ * @param player
+ * @param target
+ * @return
+ */
+ public void onEntityAttacked(ItemStack item, EntityPlayer player, Entity target, float amount)
+ {
+ for(ModifierEffects mod: ModifierEffects.getEffects()) mod.onEntityAttacked(item, player, target, this, amount);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemBracelet.java b/src/main/java/darkknight/jewelrycraft/item/ItemBracelet.java
new file mode 100644
index 0000000..b754186
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemBracelet.java
@@ -0,0 +1,40 @@
+package darkknight.jewelrycraft.item;
+
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class ItemBracelet extends ItemBaseJewelry
+{
+ public IIcon gem;
+
+ /**
+ *
+ */
+ public ItemBracelet()
+ {}
+
+ /**
+ * @param iconRegister
+ */
+ @Override
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ itemIcon = iconRegister.registerIcon("jewelrycraft:bracelet");
+ gem = iconRegister.registerIcon("jewelrycraft:jewelBracelet");
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass)
+ {
+ if (pass == 0) return itemIcon;
+ if (pass == 1 && JewelryNBT.gem(stack) != null) return gem;
+ return itemIcon;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemClayMolds.java b/src/main/java/darkknight/jewelrycraft/item/ItemClayMolds.java
new file mode 100644
index 0000000..9f99857
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemClayMolds.java
@@ -0,0 +1,87 @@
+package darkknight.jewelrycraft.item;
+
+import java.util.List;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MathHelper;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class ItemClayMolds extends Item
+{
+ /** List of molds color names */
+ public static final String[] moldsItemNames = new String[]{"clayIngot", "clayRing", "clayNecklace", "clayBracelet", "clayEarrings"};
+ @SideOnly (Side.CLIENT)
+ private IIcon[] moldsIcons;
+
+ /**
+ *
+ */
+ public ItemClayMolds()
+ {
+ super();
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ setMaxStackSize(1);
+ }
+
+ /**
+ * @param par1
+ * @return
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ /**
+ * Gets an icon index based on an item's damage value
+ */
+ public IIcon getIconFromDamage(int par1)
+ {
+ int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1);
+ return moldsIcons[j];
+ }
+
+ /**
+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different names based on their damage or NBT.
+ *
+ * @param par1ItemStack
+ * @return
+ */
+ @Override
+ public String getUnlocalizedName(ItemStack par1ItemStack)
+ {
+ int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, moldsItemNames.length - 1);
+ return super.getUnlocalizedName() + "." + moldsItemNames[i];
+ }
+
+ /**
+ * @param par1
+ * @param par2CreativeTabs
+ * @param par3List
+ */
+ @Override
+ @SuppressWarnings ({"unchecked", "rawtypes"})
+ @SideOnly (Side.CLIENT)
+ /**
+ * returns a list of items with the same ID, but different meta (eg: molds returns 16 items)
+ */
+ public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List)
+ {
+ for(int j = 0; j < moldsItemNames.length; ++j)
+ par3List.add(new ItemStack(par1, 1, j));
+ }
+
+ /**
+ * @param par1IconRegister
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister)
+ {
+ moldsIcons = new IIcon[moldsItemNames.length];
+ for(int i = 0; i < moldsItemNames.length; ++i)
+ moldsIcons[i] = par1IconRegister.registerIcon("jewelrycraft:" + moldsItemNames[i] + getIconString());
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemCrystal.java b/src/main/java/darkknight/jewelrycraft/item/ItemCrystal.java
new file mode 100644
index 0000000..ca6b58d
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemCrystal.java
@@ -0,0 +1,113 @@
+package darkknight.jewelrycraft.item;
+
+import java.util.List;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.World;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class ItemCrystal extends Item
+{
+ public IIcon overlay;
+ public static final int[] dyeColors = new int[]{1973019, 11743532, 3887386, 5320730, 2437522, 8073150, 2651799, 11250603, 4408131, 14188952, 4312372, 14602026, 6719955, 12801229, 15435844, 15790320};
+
+ /**
+ *
+ */
+ public ItemCrystal()
+ {
+ super();
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ }
+
+ /**
+ * @param iconRegister
+ */
+ @Override
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ itemIcon = iconRegister.registerIcon("jewelrycraft:crystal");
+ overlay = iconRegister.registerIcon("jewelrycraft:crystalOverlay");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean requiresMultipleRenderPasses()
+ {
+ return true;
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass)
+ {
+ if (pass == 1 && getDamage(stack) != 16) return dyeColors[getDamage(stack)];
+ return 16777215;
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass)
+ {
+ return pass == 0 ? itemIcon : overlay;
+ }
+
+ /**
+ * @param stack
+ * @param player
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param side
+ * @param par8
+ * @param par9
+ * @param par10
+ * @return
+ */
+ @Override
+ public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int i, int j, int k, int side, float par8, float par9, float par10)
+ {
+ return true;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public String getUnlocalizedName(ItemStack stack)
+ {
+ return super.getUnlocalizedName() + "." + stack.getItemDamage();
+ }
+
+ /**
+ * @param par1
+ * @param par2CreativeTabs
+ * @param par3List
+ */
+ @Override
+ @SuppressWarnings ({"unchecked", "rawtypes"})
+ public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List)
+ {
+ for(int j = 0; j < 16; ++j)
+ par3List.add(new ItemStack(par1, 1, j));
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemEarrings.java b/src/main/java/darkknight/jewelrycraft/item/ItemEarrings.java
new file mode 100644
index 0000000..2321df0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemEarrings.java
@@ -0,0 +1,40 @@
+package darkknight.jewelrycraft.item;
+
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class ItemEarrings extends ItemBaseJewelry
+{
+ public IIcon gem;
+
+ /**
+ *
+ */
+ public ItemEarrings()
+ {}
+
+ /**
+ * @param iconRegister
+ */
+ @Override
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ itemIcon = iconRegister.registerIcon("jewelrycraft:earrings");
+ gem = iconRegister.registerIcon("jewelrycraft:jewelEarrings");
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass)
+ {
+ if (pass == 0) return itemIcon;
+ if (pass == 1 && JewelryNBT.gem(stack) != null) return gem;
+ return itemIcon;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemGuide.java b/src/main/java/darkknight/jewelrycraft/item/ItemGuide.java
new file mode 100644
index 0000000..ed85dc4
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemGuide.java
@@ -0,0 +1,32 @@
+package darkknight.jewelrycraft.item;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.JewelrycraftMod;
+
+public class ItemGuide extends Item
+{
+
+ /**
+ *
+ */
+ public ItemGuide()
+ {
+ super();
+ }
+
+ /**
+ * @param stack
+ * @param world
+ * @param player
+ * @return
+ */
+ @Override
+ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player)
+ {
+ if (world.isRemote) player.openGui(JewelrycraftMod.instance, 1, player.worldObj, 0, 0, 0);
+ return stack;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemList.java b/src/main/java/darkknight/jewelrycraft/item/ItemList.java
new file mode 100644
index 0000000..b9acd96
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemList.java
@@ -0,0 +1,57 @@
+package darkknight.jewelrycraft.item;
+
+import net.minecraft.item.Item;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.registry.GameRegistry;
+import darkknight.jewelrycraft.JewelrycraftMod;
+
+public class ItemList
+{
+ public static Item thiefGloves;
+ public static Item shadowIngot;
+ public static Item molds;
+ public static Item clayMolds;
+ public static Item crystal;
+ public static ItemRing ring;
+ public static ItemNecklace necklace;
+ public static ItemBracelet bracelet;
+ public static ItemEarrings earrings;
+ public static Item guide;
+ public static ItemMoltenMetalBucket bucket;
+ public static ItemMoltenMetal metal;
+ private static boolean isInitialized = false;
+
+ /**
+ * @param e
+ */
+ public static void preInit(FMLPreInitializationEvent e)
+ {
+ if (!isInitialized){
+ thiefGloves = new ItemThiefGloves().setUnlocalizedName("Jewelrycraft.thiefGloves").setTextureName("jewelrycraft:thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ shadowIngot = new Item().setUnlocalizedName("Jewelrycraft.ingotShadow").setTextureName("jewelrycraft:ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ molds = new ItemMolds().setUnlocalizedName("Jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ clayMolds = new ItemClayMolds().setUnlocalizedName("Jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ ring = (ItemRing)new ItemRing().setUnlocalizedName("Jewelrycraft.ring").setTextureName("jewelrycraft:ring");
+ necklace = (ItemNecklace)new ItemNecklace().setUnlocalizedName("Jewelrycraft.necklace").setTextureName("jewelrycraft:necklace");
+ bracelet = (ItemBracelet)new ItemBracelet().setUnlocalizedName("Jewelrycraft.bracelet").setTextureName("jewelrycraft:bracelet");
+ earrings = (ItemEarrings)new ItemEarrings().setUnlocalizedName("Jewelrycraft.earrings").setTextureName("jewelrycraft:earrings");
+ crystal = new ItemCrystal().setUnlocalizedName("Jewelrycraft.crystal").setTextureName("jewelrycraft:crystal").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ guide = new ItemGuide().setUnlocalizedName("Jewelrycraft.guide").setTextureName("jewelrycraft:guide").setCreativeTab(JewelrycraftMod.jewelrycraft);
+ bucket = (ItemMoltenMetalBucket)new ItemMoltenMetalBucket().setUnlocalizedName("Jewelrycraft.bucket");
+ metal = (ItemMoltenMetal)new ItemMoltenMetal().setUnlocalizedName("Jewelrycraft.bucket");
+ GameRegistry.registerItem(thiefGloves, "thiefGloves");
+ GameRegistry.registerItem(shadowIngot, "shadowIngot");
+ GameRegistry.registerItem(molds, "molds");
+ GameRegistry.registerItem(clayMolds, "clayMolds");
+ GameRegistry.registerItem(ring, "ring");
+ GameRegistry.registerItem(necklace, "necklace");
+ GameRegistry.registerItem(bracelet, "bracelet");
+ GameRegistry.registerItem(earrings, "earrings");
+ GameRegistry.registerItem(crystal, "crystal");
+ GameRegistry.registerItem(guide, "guide");
+ GameRegistry.registerItem(bucket, "moltenMetalBucket");
+ GameRegistry.registerItem(metal, "moltenMetal");
+ isInitialized = true;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMolds.java b/src/main/java/darkknight/jewelrycraft/item/ItemMolds.java
new file mode 100644
index 0000000..106fcbe
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemMolds.java
@@ -0,0 +1,87 @@
+package darkknight.jewelrycraft.item;
+
+import java.util.List;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MathHelper;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+public class ItemMolds extends Item
+{
+ /** List of molds color names */
+ public static final String[] moldsItemNames = new String[]{"ingot", "ring", "necklace", "bracelet", "earrings"};
+ @SideOnly (Side.CLIENT)
+ private IIcon[] moldsIcons;
+
+ /**
+ *
+ */
+ public ItemMolds()
+ {
+ super();
+ setHasSubtypes(true);
+ setMaxDamage(0);
+ setMaxStackSize(1);
+ }
+
+ /**
+ * @param par1
+ * @return
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ /**
+ * Gets an icon index based on an item's damage value
+ */
+ public IIcon getIconFromDamage(int par1)
+ {
+ int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1);
+ return moldsIcons[j];
+ }
+
+ /**
+ * Returns the unlocalized name of this item. This version accepts an ItemStack so different stacks can have different names based on their damage or NBT.
+ *
+ * @param par1ItemStack
+ * @return
+ */
+ @Override
+ public String getUnlocalizedName(ItemStack par1ItemStack)
+ {
+ int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, moldsItemNames.length - 1);
+ return super.getUnlocalizedName() + "." + moldsItemNames[i];
+ }
+
+ /**
+ * @param par1
+ * @param par2CreativeTabs
+ * @param par3List
+ */
+ @Override
+ @SuppressWarnings ({"unchecked", "rawtypes"})
+ @SideOnly (Side.CLIENT)
+ /**
+ * returns a list of items with the same ID, but different meta (eg: molds returns 16 items)
+ */
+ public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List)
+ {
+ for(int j = 0; j < moldsItemNames.length; ++j)
+ par3List.add(new ItemStack(par1, 1, j));
+ }
+
+ /**
+ * @param par1IconRegister
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ public void registerIcons(IIconRegister par1IconRegister)
+ {
+ moldsIcons = new IIcon[moldsItemNames.length];
+ for(int i = 0; i < moldsItemNames.length; ++i)
+ moldsIcons[i] = par1IconRegister.registerIcon("jewelrycraft:" + moldsItemNames[i] + getIconString());
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java
new file mode 100644
index 0000000..0638da7
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetal.java
@@ -0,0 +1,133 @@
+package darkknight.jewelrycraft.item;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import javax.imageio.ImageIO;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.client.resources.IResourceManager;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class ItemMoltenMetal extends Item
+{
+
+ /**
+ *
+ */
+ public ItemMoltenMetal()
+ {
+ super();
+ setMaxStackSize(1);
+ }
+
+ /**
+ * @param iconRegister
+ */
+ @Override
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ itemIcon = iconRegister.registerIcon("jewelrycraft:moltenMetalStill");
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass)
+ {
+ try{
+ return color(stack, pass);
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ return 16777215;
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ * @throws IOException
+ */
+ public static int color(ItemStack stack, int pass) throws IOException
+ {
+ IResourceManager rm = Minecraft.getMinecraft().getResourceManager();
+ BufferedImage icon;
+ if (stack != null && JewelryNBT.ingot(stack) != null && Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) > 0 && JewelryNBT.ingot(stack).getIconIndex() != null && JewelryNBT.ingotColor(stack) == 16777215){
+ ResourceLocation ingot = ItemBaseJewelry.getLocation(JewelryNBT.ingot(stack), stack, false);
+ icon = ImageIO.read(rm.getResource(ingot).getInputStream());
+ int height = icon.getHeight();
+ int width = icon.getWidth();
+ Map m = new HashMap();
+ for(int i = 0; i < width; i++)
+ for(int j = 0; j < height; j++){
+ int rgb = icon.getRGB(i, j);
+ int red = rgb >> 16 & 0xff;
+ int green = rgb >> 8 & 0xff;
+ int blue = rgb & 0xff;
+ int[] rgbArr = {red, green, blue};
+ int Cmax = Math.max(red, Math.max(green, blue));
+ int Cmin = Math.min(red, Math.min(green, blue));
+ if (!isGray(rgbArr)) m.put(rgb, (Cmax + Cmin) / 2);
+ }
+ try{
+ int color = getMostCommonColour(m);
+ if (JewelryNBT.ingot(stack) != null && JewelryNBT.ingot(stack).getItem().getColorFromItemStack(JewelryNBT.ingot(stack), 1) != 16777215) JewelryNBT.addIngotColor(stack, JewelryNBT.ingot(stack).getItem().getColorFromItemStack(JewelryNBT.ingot(stack), 1));
+ else JewelryNBT.addIngotColor(stack, color);
+ }
+ catch(Exception e){
+ JewelryNBT.addIngotColor(stack, 16777215);
+ }
+ }
+ if (JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack);
+ return 0;
+ }
+
+ /**
+ * @param map
+ * @return
+ */
+ public static int getMostCommonColour(Map map)
+ {
+ List list = new LinkedList(map.entrySet());
+ Collections.sort(list, new Comparator(){
+ public int compare(Object o1, Object o2)
+ {
+ return ((Comparable)((Map.Entry)o1).getValue()).compareTo(((Map.Entry)o2).getValue());
+ }
+ });
+ Map.Entry me = (Map.Entry)list.get(list.size() - 1);
+ for(int i = 0; i < list.size(); i++){
+ float alpha = Float.valueOf(list.get(i).toString().split("=")[1]);
+ if (alpha < 180) me = (Map.Entry)list.get(i);
+ }
+ int rgb = (Integer)me.getKey();
+ return rgb;
+ }
+
+ /**
+ * @param rgbArr
+ * @return
+ */
+ public static boolean isGray(int[] rgbArr)
+ {
+ int rgbSum = rgbArr[0] + rgbArr[1] + rgbArr[2];
+ if (rgbSum > 0 && rgbSum < 256 * 3) return false;
+ return true;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java
new file mode 100644
index 0000000..9365224
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemMoltenMetalBucket.java
@@ -0,0 +1,225 @@
+package darkknight.jewelrycraft.item;
+
+import java.io.IOException;
+import net.minecraft.block.Block;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.util.StatCollector;
+import net.minecraft.world.World;
+import net.minecraftforge.common.MinecraftForge;
+import net.minecraftforge.event.entity.player.FillBucketEvent;
+import cpw.mods.fml.common.eventhandler.Event;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.network.PacketSendLiquidData;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class ItemMoltenMetalBucket extends Item
+{
+ public IIcon liquid;
+
+ /**
+ *
+ */
+ public ItemMoltenMetalBucket()
+ {
+ maxStackSize = 1;
+ }
+
+ /**
+ * Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
+ *
+ * @param stack
+ * @param par2World
+ * @param par3EntityPlayer
+ * @return
+ */
+ @Override
+ public ItemStack onItemRightClick(ItemStack stack, World par2World, EntityPlayer par3EntityPlayer)
+ {
+ boolean flag = BlockList.moltenMetal == Blocks.air;
+ MovingObjectPosition movingobjectposition = getMovingObjectPositionFromPlayer(par2World, par3EntityPlayer, flag);
+ if (movingobjectposition == null) return stack;
+ else{
+ FillBucketEvent event = new FillBucketEvent(par3EntityPlayer, stack, par2World, movingobjectposition);
+ if (MinecraftForge.EVENT_BUS.post(event)) return stack;
+ if (event.getResult() == Event.Result.ALLOW){
+ if (par3EntityPlayer.capabilities.isCreativeMode) return stack;
+ if (--stack.stackSize <= 0) return event.result;
+ if (!par3EntityPlayer.inventory.addItemStackToInventory(event.result)) par3EntityPlayer.dropPlayerItemWithRandomChoice(event.result, false);
+ return stack;
+ }
+ if (movingobjectposition.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK){
+ int i = movingobjectposition.blockX;
+ int j = movingobjectposition.blockY;
+ int k = movingobjectposition.blockZ;
+ if (!par2World.canMineBlock(par3EntityPlayer, i, j, k)) return stack;
+ if (flag){
+ if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, stack)) return stack;
+ par2World.getBlock(i, j, k).getMaterial();
+ par2World.getBlockMetadata(i, j, k);
+ par2World.setBlockToAir(i, j, k);
+ return func_150910_a(stack, par3EntityPlayer, ItemList.bucket);
+ }else{
+ if (BlockList.moltenMetal == Blocks.air) return new ItemStack(Items.bucket);
+ if (movingobjectposition.sideHit == 0) --j;
+ if (movingobjectposition.sideHit == 1) ++j;
+ if (movingobjectposition.sideHit == 2) --k;
+ if (movingobjectposition.sideHit == 3) ++k;
+ if (movingobjectposition.sideHit == 4) --i;
+ if (movingobjectposition.sideHit == 5) ++i;
+ if (!par3EntityPlayer.canPlayerEdit(i, j, k, movingobjectposition.sideHit, stack)) return stack;
+ try{
+ if (tryPlaceContainedLiquid(par2World, i, j, k, stack) && !par3EntityPlayer.capabilities.isCreativeMode) return new ItemStack(Items.bucket);
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ }
+ }
+ return stack;
+ }
+ }
+
+ /**
+ * @param p_150910_1_
+ * @param p_150910_2_
+ * @param p_150910_3_
+ * @return
+ */
+ private ItemStack func_150910_a(ItemStack p_150910_1_, EntityPlayer p_150910_2_, Item p_150910_3_)
+ {
+ if (p_150910_2_.capabilities.isCreativeMode) return p_150910_1_;
+ else if (--p_150910_1_.stackSize <= 0) return new ItemStack(p_150910_3_);
+ else{
+ if (!p_150910_2_.inventory.addItemStackToInventory(new ItemStack(p_150910_3_))) p_150910_2_.dropPlayerItemWithRandomChoice(new ItemStack(p_150910_3_, 1, 0), false);
+ return p_150910_1_;
+ }
+ }
+
+ /**
+ * Attempts to place the liquid contained inside the bucket.
+ *
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param stack
+ * @return
+ * @throws IOException
+ */
+ public boolean tryPlaceContainedLiquid(World world, int x, int y, int z, ItemStack stack) throws IOException
+ {
+ if (BlockList.moltenMetal == Blocks.air) return false;
+ else{
+ Material material = world.getBlock(x, y, z).getMaterial();
+ boolean flag = !material.isSolid();
+ if (!world.isAirBlock(x, y, z) && !flag) return false;
+ else if (stack != null && JewelryNBT.ingot(stack) != null){
+ if (!world.isRemote && flag && !material.isLiquid()) world.func_147480_a(x, y, z, true);
+ int color = color(stack, 1);
+ JewelrycraftMod.saveData.setString(x + " " + y + " " + z + " " + world.provider.dimensionId, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()) + ":" + JewelryNBT.ingot(stack).getItemDamage() + ":" + color);
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendLiquidData(world.provider.dimensionId, x, y, z, Item.getIdFromItem(JewelryNBT.ingot(stack).getItem()), JewelryNBT.ingot(stack).getItemDamage(), color));
+ world.setBlock(x, y, z, BlockList.moltenMetal, 0, 3);
+ return true;
+ }else return false;
+ }
+ }
+
+ /**
+ * @param iconRegister
+ */
+ @Override
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ itemIcon = iconRegister.registerIcon("bucket_empty");
+ liquid = iconRegister.registerIcon("jewelrycraft:bucketOverlay");
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ @SideOnly (Side.CLIENT)
+ public int getColorFromItemStack(ItemStack stack, int pass)
+ {
+ try{
+ return color(stack, pass);
+ }
+ catch(IOException e){
+ e.printStackTrace();
+ }
+ return 16777215;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean requiresMultipleRenderPasses()
+ {
+ return true;
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass)
+ {
+ if (pass == 0) return itemIcon;
+ if (pass == 1) return liquid;
+ return itemIcon;
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ * @throws IOException
+ */
+ public static int color(ItemStack stack, int pass) throws IOException
+ {
+ if (pass == 1) return ItemMoltenMetal.color(stack, pass);
+ return 16777215;
+ }
+
+ /**
+ * @param ingot
+ * @return
+ */
+ public ItemStack getModifiedItemStack(ItemStack ingot)
+ {
+ ItemStack itemstack = new ItemStack(this);
+ JewelryNBT.addMetal(itemstack, ingot);
+ return itemstack;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public String getItemStackDisplayName(ItemStack stack)
+ {
+ if (JewelryNBT.ingot(stack) != null){
+ ItemStack ingot = JewelryNBT.ingot(stack);
+ if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage());
+ return StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name").trim() + " " + ingot.getDisplayName().replace("Ingot", " ").trim();
+ }
+ return ("" + StatCollector.translateToLocal(getUnlocalizedNameInefficiently(stack) + ".name")).trim() + " Metal";
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemNecklace.java b/src/main/java/darkknight/jewelrycraft/item/ItemNecklace.java
new file mode 100644
index 0000000..9668589
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemNecklace.java
@@ -0,0 +1,40 @@
+package darkknight.jewelrycraft.item;
+
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class ItemNecklace extends ItemBaseJewelry
+{
+ public IIcon gem;
+
+ /**
+ *
+ */
+ public ItemNecklace()
+ {}
+
+ /**
+ * @param iconRegister
+ */
+ @Override
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ itemIcon = iconRegister.registerIcon("jewelrycraft:necklace");
+ gem = iconRegister.registerIcon("jewelrycraft:jewelNecklace");
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass)
+ {
+ if (pass == 0) return itemIcon;
+ if (pass == 1 && JewelryNBT.gem(stack) != null) return gem;
+ return itemIcon;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemRing.java b/src/main/java/darkknight/jewelrycraft/item/ItemRing.java
new file mode 100644
index 0000000..4472324
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemRing.java
@@ -0,0 +1,40 @@
+package darkknight.jewelrycraft.item;
+
+import net.minecraft.client.renderer.texture.IIconRegister;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class ItemRing extends ItemBaseJewelry
+{
+ public IIcon gem;
+
+ /**
+ *
+ */
+ public ItemRing()
+ {}
+
+ /**
+ * @param iconRegister
+ */
+ @Override
+ public void registerIcons(IIconRegister iconRegister)
+ {
+ itemIcon = iconRegister.registerIcon("jewelrycraft:ring");
+ gem = iconRegister.registerIcon("jewelrycraft:jewelRing");
+ }
+
+ /**
+ * @param stack
+ * @param pass
+ * @return
+ */
+ @Override
+ public IIcon getIcon(ItemStack stack, int pass)
+ {
+ if (pass == 0) return itemIcon;
+ if (pass == 1 && JewelryNBT.gem(stack) != null) return gem;
+ return itemIcon;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java b/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java
new file mode 100644
index 0000000..e9cbeca
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java
@@ -0,0 +1,165 @@
+package darkknight.jewelrycraft.item;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.passive.EntityVillager;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.village.MerchantRecipe;
+import net.minecraft.village.MerchantRecipeList;
+import org.lwjgl.input.Keyboard;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.relauncher.ReflectionHelper;
+import cpw.mods.fml.relauncher.Side;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class ItemThiefGloves extends Item
+{
+ public Random rand = new Random();
+
+ /**
+ *
+ */
+ public ItemThiefGloves()
+ {
+ super();
+ setCreativeTab(CreativeTabs.tabTools);
+ setMaxStackSize(1);
+ setMaxDamage(10);
+ }
+
+ /**
+ * @param stack
+ * @param player
+ * @param entity
+ * @return
+ */
+ @Override
+ public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity)
+ {
+ if (entity instanceof EntityVillager){
+ EntityVillager villager = (EntityVillager)entity;
+ int wealth = (Integer)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "wealth", "field_70956_bz");
+ MerchantRecipeList buyingList = (MerchantRecipeList)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "buyingList", "field_70963_i");
+ int chance = 5;
+ boolean areOtherVillagersAround = false, canTheySeeYou = false;
+ AxisAlignedBB axisalignedbb = villager.boundingBox.expand(4.0D, 4.0D, 4.0D);
+ List entities = villager.worldObj.getEntitiesWithinAABBExcludingEntity(villager, axisalignedbb);
+ for(Object s: entities)
+ if (s instanceof EntityVillager){
+ areOtherVillagersAround = true;
+ chance += rand.nextInt(2);
+ if (((EntityVillager)s).canEntityBeSeen(player)){
+ chance += 2;
+ canTheySeeYou = true;
+ }
+ }
+ if (villager.canEntityBeSeen(player)) chance += 5;
+ if (player.isPotionActive(Potion.invisibility)) chance -= 0.8 * chance;
+ if (player.capabilities.isCreativeMode) chance = 1;
+ int steal = rand.nextInt(chance);
+ if (steal == 0){
+ villager.dropItem(Items.emerald, wealth);
+ ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 0, "wealth", "field_70956_bz");
+ }
+ if (buyingList != null){
+ Iterator<?> iterator = buyingList.iterator();
+ if (steal == 0){
+ while (iterator.hasNext()){
+ MerchantRecipe recipe = (MerchantRecipe)iterator.next();
+ int toolUses = (Integer)ReflectionHelper.getPrivateValue(MerchantRecipe.class, recipe, "toolUses", "field_77400_d");
+ int quantity;
+ if (recipe.getItemToSell().isStackable()) quantity = recipe.getItemToSell().stackSize * (7 - toolUses);
+ else quantity = recipe.getItemToSell().stackSize;
+ ItemStack s = new ItemStack(recipe.getItemToSell().getItem(), quantity, recipe.getItemToSell().getItemDamage());
+ s.setTagCompound(recipe.getItemToSell().getTagCompound());
+ if (player.inventory.addItemStackToInventory(s)) ;
+ else villager.entityDropItem(s, 0);
+ JewelrycraftUtil.addCursePoints(player, 5);
+ player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + ": Hmmm... I seem to have lost my " + s.getDisplayName() + "!"));
+ stack.damageItem(1, player);
+ }
+ buyingList.clear();
+ ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 300, "timeUntilReset", "field_70961_j");
+ ReflectionHelper.setPrivateValue(EntityVillager.class, villager, true, "needsInitilization", "field_70959_by");
+ player.addChatMessage(new ChatComponentText("You hear a faint whisper in your ear: "));
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "Those who steal but don't get caught get rewarded and do not."));
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "Embrace the path you have gone, for the darkness will not"));
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "dwell on."));
+ }else{
+ stack.damageItem(1, player);
+ JewelrycraftUtil.addCursePoints(player, 25);
+ if (player.isPotionActive(Potion.invisibility)){
+ player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " sensed a strange presence around him, making him cling on to his items. You didn't get anything."));
+ }
+ else{
+ if (areOtherVillagersAround){
+ if (!canTheySeeYou){
+ player.addChatMessage(new ChatComponentText("As he was passing by, a random villager caught you trying to steal from Villager #" + villager.getProfession() + "."));
+ player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt."));
+ return true;
+ }
+ else{
+ player.addChatMessage(new ChatComponentText("A villager nearby saw you trying to steal from Villager #" + villager.getProfession() + "."));
+ player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt."));
+ return true;
+ }
+ }else{
+ player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " caught you trying to steal from him."));
+ player.addChatMessage(new ChatComponentText("Villager #" + villager.getProfession() + " curses you for the attempt."));
+ return true;
+ }
+ }
+ }
+ }
+ return true;
+ }else return super.itemInteractionForEntity(stack, player, entity);
+ }
+
+ /**
+ * @param stack
+ * @param player
+ * @param list
+ * @param par4
+ */
+ @Override
+ @SuppressWarnings ("unchecked")
+ public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings ("rawtypes") List list, boolean par4)
+ {
+ if (!shouldAddAdditionalInfo()) list.add(EnumChatFormatting.GRAY + additionalInfoInstructions());
+ else{
+ list.add(EnumChatFormatting.GRAY + "Right click with the gloves,");
+ list.add(EnumChatFormatting.GRAY + "while sneaking, on a villager");
+ list.add(EnumChatFormatting.GRAY + "to steal his stuff.");
+ }
+ }
+
+ /**
+ * @return
+ */
+ public static boolean shouldAddAdditionalInfo()
+ {
+ if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) return true;
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ public static String additionalInfoInstructions()
+ {
+ String message = "\247oPress \247b<SHIFT>\2477\247o for more information.";
+ return message;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/lib/Reference.java b/src/main/java/darkknight/jewelrycraft/lib/Reference.java
new file mode 100644
index 0000000..03dac51
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/lib/Reference.java
@@ -0,0 +1,9 @@
+package darkknight.jewelrycraft.lib;
+
+public class Reference
+{
+ public static final String MODID = "Jewelrycraft";
+ public static final String MODNAME = "Jewelrycraft";
+ public static final String VERSION = "2.0";
+ public static final String PACKET_CHANNEL = "Jewelrycraft";
+}
diff --git a/src/main/java/darkknight/jewelrycraft/model/ItemStackModelRenderer.java b/src/main/java/darkknight/jewelrycraft/model/ItemStackModelRenderer.java
new file mode 100644
index 0000000..3162061
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ItemStackModelRenderer.java
@@ -0,0 +1,71 @@
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.texture.TextureManager;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class ItemStackModelRenderer extends ModelRenderer
+{
+ private RenderItem renderItem;
+ private TextureManager textureManager;
+ private ResourceLocation resetResourceLocation;
+ private EntityItem entityItem;
+ private Minecraft mc;
+
+ /**
+ * @param modelBase
+ * @param resetResourceLocation
+ */
+ public ItemStackModelRenderer(ModelBase modelBase, ResourceLocation resetResourceLocation)
+ {
+ super(modelBase);
+ renderItem = (RenderItem)RenderManager.instance.entityRenderMap.get(EntityItem.class);
+ textureManager = (mc = Minecraft.getMinecraft()).getTextureManager();
+ this.resetResourceLocation = resetResourceLocation;
+ }
+
+ /**
+ * @param itemStack
+ */
+ public void setItemStack(ItemStack itemStack)
+ {
+ if (itemStack == null || itemStack.getItem() == null) entityItem = null;
+ else{
+ entityItem = new EntityItem(null, 0, 0, 0, itemStack);
+ entityItem.hoverStart = 0;
+ }
+ }
+
+ /**
+ * @param scale
+ */
+ @Override
+ public void render(float scale)
+ {
+ if (!isHidden && showModel && entityItem != null){
+ if (textureManager == null) textureManager = mc.getTextureManager();
+ GL11.glPushMatrix();
+ GL11.glTranslatef(offsetX, offsetY, offsetZ);
+ GL11.glTranslatef(rotationPointX * scale, rotationPointY * scale, rotationPointZ * scale);
+ GL11.glRotatef(rotateAngleZ * (180 / (float)Math.PI), 0, 0, 1);
+ GL11.glRotatef(rotateAngleY * (180 / (float)Math.PI), 0, 1, 0);
+ GL11.glRotatef(rotateAngleX * (180 / (float)Math.PI), 1, 0, 0);
+ boolean fancyGraphics = mc.gameSettings.fancyGraphics;
+ mc.gameSettings.fancyGraphics = true;
+ renderItem.doRender(entityItem, 0, 0, 0, 0, 0);
+ mc.gameSettings.fancyGraphics = fancyGraphics;
+ GL11.glPopMatrix();
+ textureManager.bindTexture(resetResourceLocation);
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelDisplayer.java b/src/main/java/darkknight/jewelrycraft/model/ModelDisplayer.java
new file mode 100644
index 0000000..065b87b
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelDisplayer.java
@@ -0,0 +1,265 @@
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+import org.lwjgl.opengl.GL11;
+
+public class ModelDisplayer extends ModelBase
+{
+ // fields
+ ModelRenderer Base;
+ ModelRenderer Ring11;
+ ModelRenderer Ring12;
+ ModelRenderer Ring13;
+ ModelRenderer Ring14;
+ ModelRenderer Ring31;
+ ModelRenderer Ring21;
+ ModelRenderer Ring32;
+ ModelRenderer Ring22;
+ ModelRenderer Ring33;
+ ModelRenderer Ring23;
+ ModelRenderer Ring34;
+ ModelRenderer Ring24;
+ ModelRenderer Ring25;
+ ModelRenderer Ring26;
+ ModelRenderer Ring27;
+ ModelRenderer Ring28;
+ ModelRenderer Ring35;
+ ModelRenderer Ring36;
+ ModelRenderer Ring37;
+ ModelRenderer Ring38;
+ ModelRenderer Ring39;
+ ModelRenderer Ring310;
+ ModelRenderer Ring311;
+ ModelRenderer Ring312;
+
+ /**
+ *
+ */
+ public ModelDisplayer()
+ {
+ textureWidth = 64;
+ textureHeight = 32;
+ Base = new ModelRenderer(this, 0, 0);
+ Base.addBox(0F, 0F, 0F, 16, 3, 16);
+ Base.setRotationPoint(-8F, 21F, -8F);
+ Base.setTextureSize(64, 32);
+ Base.mirror = true;
+ setRotation(Base, 0F, 0F, 0F);
+ Ring11 = new ModelRenderer(this, 0, 26);
+ Ring11.addBox(-2F, 0F, 2F, 4, 1, 1);
+ Ring11.setRotationPoint(0F, 19F, 0F);
+ Ring11.setTextureSize(64, 32);
+ Ring11.mirror = true;
+ setRotation(Ring11, 0F, 0F, 0F);
+ Ring12 = new ModelRenderer(this, 0, 20);
+ Ring12.addBox(-3F, 0F, -2F, 1, 1, 4);
+ Ring12.setRotationPoint(0F, 19F, 0F);
+ Ring12.setTextureSize(64, 32);
+ Ring12.mirror = true;
+ setRotation(Ring12, 0F, 0F, 0F);
+ Ring13 = new ModelRenderer(this, 0, 20);
+ Ring13.addBox(2F, 0F, -2F, 1, 1, 4);
+ Ring13.setRotationPoint(0F, 19F, 0F);
+ Ring13.setTextureSize(64, 32);
+ Ring13.mirror = true;
+ setRotation(Ring13, 0F, 0F, 0F);
+ Ring14 = new ModelRenderer(this, 0, 26);
+ Ring14.addBox(-2F, 0F, -3F, 4, 1, 1);
+ Ring14.setRotationPoint(0F, 19F, 0F);
+ Ring14.setTextureSize(64, 32);
+ Ring14.mirror = true;
+ setRotation(Ring14, 0F, 0F, 0F);
+ Ring21 = new ModelRenderer(this, 0, 29);
+ Ring21.addBox(-4F, 0F, 3F, 1, 1, 1);
+ Ring21.setRotationPoint(0F, 19F, 0F);
+ Ring21.setTextureSize(64, 32);
+ Ring21.mirror = true;
+ setRotation(Ring21, 0F, 0F, 0F);
+ Ring22 = new ModelRenderer(this, 0, 29);
+ Ring22.addBox(-4F, 0F, -4F, 1, 1, 1);
+ Ring22.setRotationPoint(0F, 19F, 0F);
+ Ring22.setTextureSize(64, 32);
+ Ring22.mirror = true;
+ setRotation(Ring22, 0F, 0F, 0F);
+ Ring23 = new ModelRenderer(this, 0, 29);
+ Ring23.addBox(3F, 0F, -4F, 1, 1, 1);
+ Ring23.setRotationPoint(0F, 19F, 0F);
+ Ring23.setTextureSize(64, 32);
+ Ring23.mirror = true;
+ setRotation(Ring23, 0F, 0F, 0F);
+ Ring34 = new ModelRenderer(this, 26, 20);
+ Ring34.addBox(6F, 0F, -4F, 1, 1, 8);
+ Ring34.setRotationPoint(0F, 19F, 0F);
+ Ring34.setTextureSize(64, 32);
+ Ring34.mirror = true;
+ setRotation(Ring34, 0F, 0F, 0F);
+ Ring24 = new ModelRenderer(this, 0, 29);
+ Ring24.addBox(3F, 0F, 3F, 1, 1, 1);
+ Ring24.setRotationPoint(0F, 19F, 0F);
+ Ring24.setTextureSize(64, 32);
+ Ring24.mirror = true;
+ setRotation(Ring24, 0F, 0F, 0F);
+ Ring25 = new ModelRenderer(this, 11, 20);
+ Ring25.addBox(4F, 0F, -3F, 1, 1, 6);
+ Ring25.setRotationPoint(0F, 19F, 0F);
+ Ring25.setTextureSize(64, 32);
+ Ring25.mirror = true;
+ setRotation(Ring25, 0F, 0F, 0F);
+ Ring26 = new ModelRenderer(this, 11, 28);
+ Ring26.addBox(-3F, 0F, -5F, 6, 1, 1);
+ Ring26.setRotationPoint(0F, 19F, 0F);
+ Ring26.setTextureSize(64, 32);
+ Ring26.mirror = true;
+ setRotation(Ring26, 0F, 0F, 0F);
+ Ring27 = new ModelRenderer(this, 11, 20);
+ Ring27.addBox(-5F, 0F, -3F, 1, 1, 6);
+ Ring27.setRotationPoint(0F, 19F, 0F);
+ Ring27.setTextureSize(64, 32);
+ Ring27.mirror = true;
+ setRotation(Ring27, 0F, 0F, 0F);
+ Ring28 = new ModelRenderer(this, 11, 28);
+ Ring28.addBox(-3F, 0F, 4F, 6, 1, 1);
+ Ring28.setRotationPoint(0F, 19F, 0F);
+ Ring28.setTextureSize(64, 32);
+ Ring28.mirror = true;
+ setRotation(Ring28, 0F, 0F, 0F);
+ Ring31 = new ModelRenderer(this, 0, 29);
+ Ring31.addBox(-6F, 0F, 4F, 1, 1, 1);
+ Ring31.setRotationPoint(0F, 19F, 0F);
+ Ring31.setTextureSize(64, 32);
+ Ring31.mirror = true;
+ setRotation(Ring31, 0F, 0F, 0F);
+ Ring32 = new ModelRenderer(this, 26, 20);
+ Ring32.addBox(-7F, 0F, -4F, 1, 1, 8);
+ Ring32.setRotationPoint(0F, 19F, 0F);
+ Ring32.setTextureSize(64, 32);
+ Ring32.mirror = true;
+ setRotation(Ring32, 0F, 0F, 0F);
+ Ring33 = new ModelRenderer(this, 26, 30);
+ Ring33.addBox(-4F, 0F, -7F, 8, 1, 1);
+ Ring33.setRotationPoint(0F, 19F, 0F);
+ Ring33.setTextureSize(64, 32);
+ Ring33.mirror = true;
+ setRotation(Ring33, 0F, 0F, 0F);
+ Ring35 = new ModelRenderer(this, 26, 30);
+ Ring35.addBox(-4F, 0F, 6F, 8, 1, 1);
+ Ring35.setRotationPoint(0F, 19F, 0F);
+ Ring35.setTextureSize(64, 32);
+ Ring35.mirror = true;
+ setRotation(Ring35, 0F, 0F, 0F);
+ Ring36 = new ModelRenderer(this, 0, 29);
+ Ring36.addBox(-5F, 0F, 5F, 1, 1, 1);
+ Ring36.setRotationPoint(0F, 19F, 0F);
+ Ring36.setTextureSize(64, 32);
+ Ring36.mirror = true;
+ setRotation(Ring36, 0F, 0F, 0F);
+ Ring37 = new ModelRenderer(this, 0, 29);
+ Ring37.addBox(5F, 0F, 4F, 1, 1, 1);
+ Ring37.setRotationPoint(0F, 19F, 0F);
+ Ring37.setTextureSize(64, 32);
+ Ring37.mirror = true;
+ setRotation(Ring37, 0F, 0F, 0F);
+ Ring38 = new ModelRenderer(this, 0, 29);
+ Ring38.addBox(4F, 0F, 5F, 1, 1, 1);
+ Ring38.setRotationPoint(0F, 19F, 0F);
+ Ring38.setTextureSize(64, 32);
+ Ring38.mirror = true;
+ setRotation(Ring38, 0F, 0F, 0F);
+ Ring39 = new ModelRenderer(this, 0, 29);
+ Ring39.addBox(4F, 0F, -6F, 1, 1, 1);
+ Ring39.setRotationPoint(0F, 19F, 0F);
+ Ring39.setTextureSize(64, 32);
+ Ring39.mirror = true;
+ setRotation(Ring39, 0F, 0F, 0F);
+ Ring310 = new ModelRenderer(this, 0, 29);
+ Ring310.addBox(5F, 0F, -5F, 1, 1, 1);
+ Ring310.setRotationPoint(0F, 19F, 0F);
+ Ring310.setTextureSize(64, 32);
+ Ring310.mirror = true;
+ setRotation(Ring310, 0F, 0F, 0F);
+ Ring311 = new ModelRenderer(this, 0, 29);
+ Ring311.addBox(-6F, 0F, -5F, 1, 1, 1);
+ Ring311.setRotationPoint(0F, 19F, 0F);
+ Ring311.setTextureSize(64, 32);
+ Ring311.mirror = true;
+ setRotation(Ring311, 0F, 0F, 0F);
+ Ring312 = new ModelRenderer(this, 0, 29);
+ Ring312.addBox(-5F, 0F, -6F, 1, 1, 1);
+ Ring312.setRotationPoint(0F, 19F, 0F);
+ Ring312.setTextureSize(64, 32);
+ Ring312.mirror = true;
+ setRotation(Ring312, 0F, 0F, 0F);
+ }
+
+ /**
+ * @param entity
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ @Override
+ public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ GL11.glPushMatrix();
+ Base.render(f5);
+ GL11.glTranslatef(0.0F, 0F - f, 0.0F);
+ Ring11.render(f5);
+ Ring12.render(f5);
+ Ring13.render(f5);
+ Ring14.render(f5);
+ GL11.glTranslatef(0.0F, 0F + f - f1, 0.0F);
+ Ring21.render(f5);
+ Ring22.render(f5);
+ Ring23.render(f5);
+ Ring24.render(f5);
+ Ring25.render(f5);
+ Ring26.render(f5);
+ Ring27.render(f5);
+ Ring28.render(f5);
+ GL11.glTranslatef(0.0F, 0F + f1 - f2, 0.0F);
+ Ring31.render(f5);
+ Ring32.render(f5);
+ Ring33.render(f5);
+ Ring34.render(f5);
+ Ring35.render(f5);
+ Ring36.render(f5);
+ Ring37.render(f5);
+ Ring38.render(f5);
+ Ring39.render(f5);
+ Ring310.render(f5);
+ Ring311.render(f5);
+ Ring312.render(f5);
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param model
+ * @param x
+ * @param y
+ * @param z
+ */
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+
+ /**
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelHalfHeart.java b/src/main/java/darkknight/jewelrycraft/model/ModelHalfHeart.java
new file mode 100644
index 0000000..1c0bb97
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelHalfHeart.java
@@ -0,0 +1,497 @@
+// Date: 2/13/2015 8:30:06 PM
+// Template version 1.1
+// Java generated by Techne
+// Keep in mind that you still need to fill in some blanks
+// - ZeuX
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+
+public class ModelHalfHeart extends ModelBase
+{
+ // fields
+ ModelRenderer s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, s22;
+ ModelRenderer f1, f3, f4, f5, f6, f7, f8, f9, f13, f14, f16, f17, f19, f20, f21, f22, f23, f24, f25, f26;
+ ModelRenderer b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b19, b20, b21, b23, b24, b25, b26;
+
+ public ModelHalfHeart()
+ {
+ textureWidth = 64;
+ textureHeight = 32;
+ s1 = new ModelRenderer(this, 0, 16);
+ s1.addBox(0F, 0F, 0F, 1, 1, 1);
+ s1.setRotationPoint(1F, 13F, 0F);
+ s1.setTextureSize(64, 32);
+ s1.mirror = true;
+ setRotation(s1, 0F, 0F, 0F);
+ s2 = new ModelRenderer(this, 0, 16);
+ s2.addBox(0F, 0F, 0F, 2, 1, 1);
+ s2.setRotationPoint(-1F, 23F, 0F);
+ s2.setTextureSize(64, 32);
+ s2.mirror = true;
+ setRotation(s2, 0F, 0F, 0F);
+ s3 = new ModelRenderer(this, 0, 16);
+ s3.addBox(0F, 0F, 0F, 2, 1, 1);
+ s3.setRotationPoint(2F, 12F, 0F);
+ s3.setTextureSize(64, 32);
+ s3.mirror = true;
+ setRotation(s3, 0F, 0F, 0F);
+ s4 = new ModelRenderer(this, 0, 16);
+ s4.addBox(0F, 0F, 0F, 1, 1, 1);
+ s4.setRotationPoint(1F, 22F, 0F);
+ s4.setTextureSize(64, 32);
+ s4.mirror = true;
+ setRotation(s4, 0F, 0F, 0F);
+ s5 = new ModelRenderer(this, 0, 16);
+ s5.addBox(0F, 0F, 0F, 1, 1, 1);
+ s5.setRotationPoint(4F, 13F, 0F);
+ s5.setTextureSize(64, 32);
+ s5.mirror = true;
+ setRotation(s5, 0F, 0F, 0F);
+ s6 = new ModelRenderer(this, 0, 16);
+ s6.addBox(0F, 0F, 0F, 1, 1, 1);
+ s6.setRotationPoint(5F, 18F, 0F);
+ s6.setTextureSize(64, 32);
+ s6.mirror = true;
+ setRotation(s6, 0F, 0F, 0F);
+ s7 = new ModelRenderer(this, 0, 16);
+ s7.addBox(0F, 0F, 0F, 1, 1, 1);
+ s7.setRotationPoint(5F, 14F, 0F);
+ s7.setTextureSize(64, 32);
+ s7.mirror = true;
+ setRotation(s7, 0F, 0F, 0F);
+ s8 = new ModelRenderer(this, 0, 16);
+ s8.addBox(0F, 0F, 0F, 1, 1, 1);
+ s8.setRotationPoint(-2F, 22F, 0F);
+ s8.setTextureSize(64, 32);
+ s8.mirror = true;
+ setRotation(s8, 0F, 0F, 0F);
+ s9 = new ModelRenderer(this, 0, 16);
+ s9.addBox(0F, 0F, 0F, 1, 1, 1);
+ s9.setRotationPoint(-2F, 13F, 0F);
+ s9.setTextureSize(64, 32);
+ s9.mirror = true;
+ setRotation(s9, 0F, 0F, 0F);
+ s10 = new ModelRenderer(this, 0, 16);
+ s10.addBox(0F, 0F, 0F, 1, 1, 1);
+ s10.setRotationPoint(-6F, 18F, 0F);
+ s10.setTextureSize(64, 32);
+ s10.mirror = true;
+ setRotation(s10, 0F, 0F, 0F);
+ s11 = new ModelRenderer(this, 0, 16);
+ s11.addBox(0F, 0F, 0F, 2, 1, 1);
+ s11.setRotationPoint(-4F, 12F, 0F);
+ s11.setTextureSize(64, 32);
+ s11.mirror = true;
+ setRotation(s11, 0F, 0F, 0F);
+ s12 = new ModelRenderer(this, 0, 16);
+ s12.addBox(0F, 0F, 0F, 1, 1, 1);
+ s12.setRotationPoint(-3F, 21F, 0F);
+ s12.setTextureSize(64, 32);
+ s12.mirror = true;
+ setRotation(s12, 0F, 0F, 0F);
+ s13 = new ModelRenderer(this, 0, 16);
+ s13.addBox(0F, 0F, 0F, 1, 1, 1);
+ s13.setRotationPoint(-5F, 13F, 0F);
+ s13.setTextureSize(64, 32);
+ s13.mirror = true;
+ setRotation(s13, 0F, 0F, 0F);
+ s14 = new ModelRenderer(this, 0, 16);
+ s14.addBox(0F, 0F, 0F, 1, 1, 1);
+ s14.setRotationPoint(-4F, 20F, 0F);
+ s14.setTextureSize(64, 32);
+ s14.mirror = true;
+ setRotation(s14, 0F, 0F, 0F);
+ s15 = new ModelRenderer(this, 0, 16);
+ s15.addBox(0F, 0F, 0F, 1, 1, 1);
+ s15.setRotationPoint(-6F, 14F, 0F);
+ s15.setTextureSize(64, 32);
+ s15.mirror = true;
+ setRotation(s15, 0F, 0F, 0F);
+ s16 = new ModelRenderer(this, 0, 16);
+ s16.addBox(0F, 0F, 0F, 1, 1, 1);
+ s16.setRotationPoint(-5F, 19F, 0F);
+ s16.setTextureSize(64, 32);
+ s16.mirror = true;
+ setRotation(s16, 0F, 0F, 0F);
+ s17 = new ModelRenderer(this, 0, 16);
+ s17.addBox(0F, 0F, 0F, 2, 1, 1);
+ s17.setRotationPoint(-1F, 14F, 0F);
+ s17.setTextureSize(64, 32);
+ s17.mirror = true;
+ setRotation(s17, 0F, 0F, 0F);
+ s18 = new ModelRenderer(this, 0, 16);
+ s18.addBox(0F, 0F, 0F, 1, 1, 1);
+ s18.setRotationPoint(2F, 21F, 0F);
+ s18.setTextureSize(64, 32);
+ s18.mirror = true;
+ setRotation(s18, 0F, 0F, 0F);
+ s19 = new ModelRenderer(this, 0, 16);
+ s19.addBox(0F, 0F, 0F, 1, 3, 1);
+ s19.setRotationPoint(6F, 15F, 0F);
+ s19.setTextureSize(64, 32);
+ s19.mirror = true;
+ setRotation(s19, 0F, 0F, 0F);
+ s20 = new ModelRenderer(this, 0, 16);
+ s20.addBox(0F, 0F, 0F, 1, 1, 1);
+ s20.setRotationPoint(3F, 20F, 0F);
+ s20.setTextureSize(64, 32);
+ s20.mirror = true;
+ setRotation(s20, 0F, 0F, 0F);
+ s21 = new ModelRenderer(this, 0, 16);
+ s21.addBox(0F, 0F, 0F, 1, 3, 1);
+ s21.setRotationPoint(-7F, 15F, 0F);
+ s21.setTextureSize(64, 32);
+ s21.mirror = true;
+ setRotation(s21, 0F, 0F, 0F);
+ s22 = new ModelRenderer(this, 0, 16);
+ s22.addBox(0F, 0F, 0F, 1, 1, 1);
+ s22.setRotationPoint(4F, 19F, 0F);
+ s22.setTextureSize(64, 32);
+ s22.mirror = true;
+ setRotation(s22, 0F, 0F, 0F);
+ f1 = new ModelRenderer(this, 0, 0);
+ f1.addBox(0F, 0F, 0F, 1, 1, 1);
+ f1.setRotationPoint(-1F, 22F, 1F);
+ f1.setTextureSize(64, 32);
+ f1.mirror = true;
+ setRotation(f1, 0F, 0F, 0F);
+ f3 = new ModelRenderer(this, 0, 0);
+ f3.addBox(0F, 0F, 0F, 6, 3, 1);
+ f3.setRotationPoint(-6F, 15F, 1F);
+ f3.setTextureSize(64, 32);
+ f3.mirror = true;
+ setRotation(f3, 0F, 0F, 0F);
+ f4 = new ModelRenderer(this, 0, 0);
+ f4.addBox(0F, 0F, 0F, 7, 1, 1);
+ f4.setRotationPoint(-5F, 18F, 1F);
+ f4.setTextureSize(64, 32);
+ f4.mirror = true;
+ setRotation(f4, 0F, 0F, 0F);
+ f5 = new ModelRenderer(this, 0, 0);
+ f5.addBox(0F, 0F, 0F, 5, 1, 1);
+ f5.setRotationPoint(-4F, 19F, 1F);
+ f5.setTextureSize(64, 32);
+ f5.mirror = true;
+ setRotation(f5, 0F, 0F, 0F);
+ f6 = new ModelRenderer(this, 0, 0);
+ f6.addBox(0F, 0F, 0F, 3, 1, 1);
+ f6.setRotationPoint(-3F, 20F, 1F);
+ f6.setTextureSize(64, 32);
+ f6.mirror = true;
+ setRotation(f6, 0F, 0F, 0F);
+ f7 = new ModelRenderer(this, 0, 0);
+ f7.addBox(0F, 0F, 0F, 3, 1, 1);
+ f7.setRotationPoint(-2F, 21F, 1F);
+ f7.setTextureSize(64, 32);
+ f7.mirror = true;
+ setRotation(f7, 0F, 0F, 0F);
+ f8 = new ModelRenderer(this, 0, 0);
+ f8.addBox(0F, 0F, 0F, 4, 1, 1);
+ f8.setRotationPoint(-5F, 14F, 1F);
+ f8.setTextureSize(64, 32);
+ f8.mirror = true;
+ setRotation(f8, 0F, 0F, 0F);
+ f9 = new ModelRenderer(this, 0, 0);
+ f9.addBox(0F, 0F, 0F, 2, 1, 1);
+ f9.setRotationPoint(-4F, 13F, 1F);
+ f9.setTextureSize(64, 32);
+ f9.mirror = true;
+ setRotation(f9, 0F, 0F, 0F);
+ f13 = new ModelRenderer(this, 0, 0);
+ f13.addBox(0F, 0F, 0F, 5, 1, 1);
+ f13.setRotationPoint(-5F, 16F, 2F);
+ f13.setTextureSize(64, 32);
+ f13.mirror = true;
+ setRotation(f13, 0F, 0F, 0F);
+ f14 = new ModelRenderer(this, 0, 0);
+ f14.addBox(0F, 0F, 0F, 6, 1, 1);
+ f14.setRotationPoint(-5F, 17F, 2F);
+ f14.setTextureSize(64, 32);
+ f14.mirror = true;
+ setRotation(f14, 0F, 0F, 0F);
+ f16 = new ModelRenderer(this, 0, 0);
+ f16.addBox(0F, 0F, 0F, 3, 1, 1);
+ f16.setRotationPoint(-4F, 15F, 2F);
+ f16.setTextureSize(64, 32);
+ f16.mirror = true;
+ setRotation(f16, 0F, 0F, 0F);
+ f17 = new ModelRenderer(this, 0, 0);
+ f17.addBox(0F, 0F, 0F, 1, 1, 1);
+ f17.setRotationPoint(-3F, 14F, 2F);
+ f17.setTextureSize(64, 32);
+ f17.mirror = true;
+ setRotation(f17, 0F, 0F, 0F);
+ f19 = new ModelRenderer(this, 0, 0);
+ f19.addBox(0F, 0F, 0F, 1, 1, 1);
+ f19.setRotationPoint(-3F, 15F, 3F);
+ f19.setTextureSize(64, 32);
+ f19.mirror = true;
+ setRotation(f19, 0F, 0F, 0F);
+ f20 = new ModelRenderer(this, 0, 0);
+ f20.addBox(0F, 0F, 0F, 3, 1, 1);
+ f20.setRotationPoint(-4F, 16F, 3F);
+ f20.setTextureSize(64, 32);
+ f20.mirror = true;
+ setRotation(f20, 0F, 0F, 0F);
+ f21 = new ModelRenderer(this, 0, 0);
+ f21.addBox(0F, 0F, 0F, 2, 1, 1);
+ f21.setRotationPoint(-2F, 20F, 2F);
+ f21.setTextureSize(64, 32);
+ f21.mirror = true;
+ setRotation(f21, 0F, 0F, 0F);
+ f22 = new ModelRenderer(this, 0, 0);
+ f22.addBox(0F, 0F, 0F, 4, 1, 1);
+ f22.setRotationPoint(-3F, 19F, 2F);
+ f22.setTextureSize(64, 32);
+ f22.mirror = true;
+ setRotation(f22, 0F, 0F, 0F);
+ f23 = new ModelRenderer(this, 0, 0);
+ f23.addBox(0F, 0F, 0F, 6, 1, 1);
+ f23.setRotationPoint(-4F, 18F, 2F);
+ f23.setTextureSize(64, 32);
+ f23.mirror = true;
+ setRotation(f23, 0F, 0F, 0F);
+ f24 = new ModelRenderer(this, 0, 0);
+ f24.addBox(0F, 0F, 0F, 3, 1, 1);
+ f24.setRotationPoint(-3F, 17F, 3F);
+ f24.setTextureSize(64, 32);
+ f24.mirror = true;
+ setRotation(f24, 0F, 0F, 0F);
+ f25 = new ModelRenderer(this, 0, 0);
+ f25.addBox(0F, 0F, 0F, 2, 1, 1);
+ f25.setRotationPoint(-2F, 18F, 3F);
+ f25.setTextureSize(64, 32);
+ f25.mirror = true;
+ setRotation(f25, 0F, 0F, 0F);
+ f26 = new ModelRenderer(this, 0, 0);
+ f26.addBox(0F, 0F, 0F, 1, 1, 1);
+ f26.setRotationPoint(-1F, 19F, 3F);
+ f26.setTextureSize(64, 32);
+ f26.mirror = true;
+ setRotation(f26, 0F, 0F, 0F);
+ b1 = new ModelRenderer(this, 0, 0);
+ b1.addBox(0F, 0F, 0F, 2, 1, 1);
+ b1.setRotationPoint(-2F, 20F, -2F);
+ b1.setTextureSize(64, 32);
+ b1.mirror = true;
+ setRotation(b1, 0F, 0F, 0F);
+ b2 = new ModelRenderer(this, 0, 0);
+ b2.addBox(0F, 0F, 0F, 1, 1, 1);
+ b2.setRotationPoint(-3F, 14F, -2F);
+ b2.setTextureSize(64, 32);
+ b2.mirror = true;
+ setRotation(b2, 0F, 0F, 0F);
+ b3 = new ModelRenderer(this, 0, 0);
+ b3.addBox(0F, 0F, 0F, 7, 1, 1);
+ b3.setRotationPoint(-6F, 15F, -1F);
+ b3.setTextureSize(64, 32);
+ b3.mirror = true;
+ setRotation(b3, 0F, 0F, 0F);
+ b4 = new ModelRenderer(this, 0, 0);
+ b4.addBox(0F, 0F, 0F, 6, 1, 1);
+ b4.setRotationPoint(-4F, 18F, -2F);
+ b4.setTextureSize(64, 32);
+ b4.mirror = true;
+ setRotation(b4, 0F, 0F, 0F);
+ b5 = new ModelRenderer(this, 0, 0);
+ b5.addBox(0F, 0F, 0F, 4, 1, 1);
+ b5.setRotationPoint(-3F, 19F, -2F);
+ b5.setTextureSize(64, 32);
+ b5.mirror = true;
+ setRotation(b5, 0F, 0F, 0F);
+ b6 = new ModelRenderer(this, 0, 0);
+ b6.addBox(0F, 0F, 0F, 3, 1, 1);
+ b6.setRotationPoint(-4F, 15F, -2F);
+ b6.setTextureSize(64, 32);
+ b6.mirror = true;
+ setRotation(b6, 0F, 0F, 0F);
+ b7 = new ModelRenderer(this, 0, 0);
+ b7.addBox(0F, 0F, 0F, 6, 2, 1);
+ b7.setRotationPoint(-6F, 16F, -1F);
+ b7.setTextureSize(64, 32);
+ b7.mirror = true;
+ setRotation(b7, 0F, 0F, 0F);
+ b8 = new ModelRenderer(this, 0, 0);
+ b8.addBox(0F, 0F, 0F, 1, 1, 1);
+ b8.setRotationPoint(-1F, 22F, -1F);
+ b8.setTextureSize(64, 32);
+ b8.mirror = true;
+ setRotation(b8, 0F, 0F, 0F);
+ b9 = new ModelRenderer(this, 0, 0);
+ b9.addBox(0F, 0F, 0F, 1, 1, 1);
+ b9.setRotationPoint(-3F, 15F, -3F);
+ b9.setTextureSize(64, 32);
+ b9.mirror = true;
+ setRotation(b9, 0F, 0F, 0F);
+ b10 = new ModelRenderer(this, 0, 0);
+ b10.addBox(0F, 0F, 0F, 2, 1, 1);
+ b10.setRotationPoint(-2F, 18F, -3F);
+ b10.setTextureSize(64, 32);
+ b10.mirror = true;
+ setRotation(b10, 0F, 0F, 0F);
+ b11 = new ModelRenderer(this, 0, 0);
+ b11.addBox(0F, 0F, 0F, 5, 2, 1);
+ b11.setRotationPoint(-5F, 16F, -2F);
+ b11.setTextureSize(64, 32);
+ b11.mirror = true;
+ setRotation(b11, 0F, 0F, 0F);
+ b12 = new ModelRenderer(this, 0, 0);
+ b12.addBox(0F, 0F, 0F, 3, 1, 1);
+ b12.setRotationPoint(-4F, 16F, -3F);
+ b12.setTextureSize(64, 32);
+ b12.mirror = true;
+ setRotation(b12, 0F, 0F, 0F);
+ b13 = new ModelRenderer(this, 0, 0);
+ b13.addBox(0F, 0F, 0F, 1, 1, 1);
+ b13.setRotationPoint(0F, 19F, 0F);
+ b13.setTextureSize(64, 32);
+ b13.mirror = true;
+ setRotation(b13, 0F, 0F, 0F);
+ b15 = new ModelRenderer(this, 0, 0);
+ b15.addBox(0F, 0F, 0F, 2, 1, 1);
+ b15.setRotationPoint(-3F, 17F, -3F);
+ b15.setTextureSize(64, 32);
+ b15.mirror = true;
+ setRotation(b15, 0F, 0F, 0F);
+ b16 = new ModelRenderer(this, 0, 0);
+ b16.addBox(0F, 0F, 0F, 2, 1, 1);
+ b16.setRotationPoint(-1F, 19F, -3F);
+ b16.setTextureSize(64, 32);
+ b16.mirror = true;
+ setRotation(b16, 0F, 0F, 0F);
+ b19 = new ModelRenderer(this, 0, 0);
+ b19.addBox(0F, 0F, 0F, 2, 1, 1);
+ b19.setRotationPoint(-4F, 13F, -1F);
+ b19.setTextureSize(64, 32);
+ b19.mirror = true;
+ setRotation(b19, 0F, 0F, 0F);
+ b20 = new ModelRenderer(this, 0, 0);
+ b20.addBox(0F, 0F, 0F, 1, 8, 1);
+ b20.setRotationPoint(-1F, 15F, 0F);
+ b20.setTextureSize(64, 32);
+ b20.mirror = true;
+ setRotation(b20, 0F, 0F, 0F);
+ b21 = new ModelRenderer(this, 0, 0);
+ b21.addBox(0F, 0F, 0F, 4, 1, 1);
+ b21.setRotationPoint(-5F, 14F, -1F);
+ b21.setTextureSize(64, 32);
+ b21.mirror = true;
+ setRotation(b21, 0F, 0F, 0F);
+ b23 = new ModelRenderer(this, 0, 0);
+ b23.addBox(0F, 0F, 0F, 6, 1, 1);
+ b23.setRotationPoint(-5F, 18F, -1F);
+ b23.setTextureSize(64, 32);
+ b23.mirror = true;
+ setRotation(b23, 0F, 0F, 0F);
+ b24 = new ModelRenderer(this, 0, 0);
+ b24.addBox(0F, 0F, 0F, 4, 1, 1);
+ b24.setRotationPoint(-4F, 19F, -1F);
+ b24.setTextureSize(64, 32);
+ b24.mirror = true;
+ setRotation(b24, 0F, 0F, 0F);
+ b25 = new ModelRenderer(this, 0, 0);
+ b25.addBox(0F, 0F, 0F, 3, 1, 1);
+ b25.setRotationPoint(-3F, 20F, -1F);
+ b25.setTextureSize(64, 32);
+ b25.mirror = true;
+ setRotation(b25, 0F, 0F, 0F);
+ b26 = new ModelRenderer(this, 0, 0);
+ b26.addBox(0F, 0F, 0F, 3, 1, 1);
+ b26.setRotationPoint(-2F, 21F, -1F);
+ b26.setTextureSize(64, 32);
+ b26.mirror = true;
+ setRotation(b26, 0F, 0F, 0F);
+ b14 = new ModelRenderer(this, 0, 0);
+ b14.addBox(0F, 0F, 0F, 1, 1, 1);
+ b14.setRotationPoint(0F, 16F, 0F);
+ b14.setTextureSize(64, 32);
+ b14.mirror = true;
+ setRotation(b14, 0F, 0F, 0F);
+ }
+
+ public void render(Entity entity, float angle1, float angle2, float angle3, float angle4, float angle5, float angle6)
+ {
+ super.render(entity, angle1, angle2, angle3, angle4, angle5, angle6);
+ setRotationAngles(angle1, angle2, angle3, angle4, angle5, angle6);
+ s1.render(angle6);
+ s2.render(angle6);
+ s3.render(angle6);
+ s4.render(angle6);
+ s5.render(angle6);
+ s6.render(angle6);
+ s7.render(angle6);
+ s8.render(angle6);
+ s9.render(angle6);
+ s10.render(angle6);
+ s11.render(angle6);
+ s12.render(angle6);
+ s13.render(angle6);
+ s14.render(angle6);
+ s15.render(angle6);
+ s16.render(angle6);
+ s17.render(angle6);
+ s18.render(angle6);
+ s19.render(angle6);
+ s20.render(angle6);
+ s21.render(angle6);
+ s22.render(angle6);
+ f1.render(angle6);
+ f3.render(angle6);
+ f4.render(angle6);
+ f5.render(angle6);
+ f6.render(angle6);
+ f7.render(angle6);
+ f8.render(angle6);
+ f9.render(angle6);
+ f13.render(angle6);
+ f14.render(angle6);
+ f16.render(angle6);
+ f17.render(angle6);
+ f19.render(angle6);
+ f20.render(angle6);
+ f21.render(angle6);
+ f22.render(angle6);
+ f23.render(angle6);
+ f24.render(angle6);
+ f25.render(angle6);
+ f26.render(angle6);
+ b1.render(angle6);
+ b2.render(angle6);
+ b3.render(angle6);
+ b4.render(angle6);
+ b5.render(angle6);
+ b6.render(angle6);
+ b7.render(angle6);
+ b8.render(angle6);
+ b9.render(angle6);
+ b10.render(angle6);
+ b11.render(angle6);
+ b12.render(angle6);
+ b13.render(angle6);
+ b15.render(angle6);
+ b16.render(angle6);
+ b19.render(angle6);
+ b20.render(angle6);
+ b21.render(angle6);
+ b23.render(angle6);
+ b24.render(angle6);
+ b25.render(angle6);
+ b26.render(angle6);
+ b14.render(angle6);
+ }
+
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelHandPedestal.java b/src/main/java/darkknight/jewelrycraft/model/ModelHandPedestal.java
new file mode 100644
index 0000000..312bd17
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelHandPedestal.java
@@ -0,0 +1,146 @@
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.ResourceLocation;
+import com.pau101.util.CubicBezier;
+import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class ModelHandPedestal extends ModelBase
+{
+ protected ModelRenderer plinth;
+ protected ModelRenderer base;
+ protected ModelRenderer shaft;
+ private ModelRenderer palm;
+ private ModelRenderer[] fingers;
+ private ModelRenderer thumb;
+ private ItemStackModelRenderer heldItemStack;
+ private CubicBezier easeInOut;
+
+ /**
+ * @param resetResourceLocation
+ */
+ public ModelHandPedestal(ResourceLocation resetResourceLocation)
+ {
+ initPedestalRenderers();
+ plinth.setRotationPoint(0, 16, 0);
+ plinth.addChild(base);
+ base.addChild(shaft);
+ initHandModelRenderers(resetResourceLocation);
+ initCubicBeziers();
+ }
+
+ /**
+ *
+ */
+ protected void initPedestalRenderers()
+ {
+ plinth = createModelRenderer(0, 0).addBox(-6, 4, -6, 12, 4, 12);
+ base = createModelRenderer(0, 0).addBox(-4, 0, -4, 8, 4, 8);
+ shaft = createModelRenderer(0, 0).addBox(-3, -4, -3, 6, 4, 6);
+ }
+
+ /**
+ *
+ */
+ private void initCubicBeziers()
+ {
+ easeInOut = new CubicBezier(0.4F, 0, 0.6F, 1);
+ }
+
+ /**
+ * @param textureOffsetX
+ * @param textureOffsetY
+ * @return
+ */
+ protected final ModelRenderer createModelRenderer(int textureOffsetX, int textureOffsetY)
+ {
+ ModelRenderer modelRenderer = new ModelRenderer(this, textureOffsetX, textureOffsetY);
+ modelRenderer.setTextureSize(textureWidth, textureHeight);
+ return modelRenderer;
+ }
+
+ /**
+ * @return
+ */
+ private ModelRenderer createPhalanges()
+ {
+ return createModelRenderer(0, 0).addBox(-1, -1.5F, 0, 2, 3, 5).addBox(-1, -5.5F, 2, 2, 4, 3);
+ }
+
+ /**
+ * @param resetResourceLocation
+ */
+ private void initHandModelRenderers(ResourceLocation resetResourceLocation)
+ {
+ palm = createModelRenderer(0, 0).addBox(-4, -8, -4, 8, 4, 8);
+ shaft.addChild(palm);
+ int fingerCount = 4;
+ fingers = new ModelRenderer[fingerCount];
+ for(int i = 0; i < fingerCount; i++){
+ ModelRenderer phalanges = createPhalanges();
+ float theta = (i / (float)fingerCount - 0.5F + 1F / fingerCount / 2) * ((float)Math.PI * 0.6F);
+ phalanges.rotateAngleY = theta;
+ phalanges.setRotationPoint(MathHelper.sin(theta) * 5, -5.75F, MathHelper.cos(theta) * 5 - 1);
+ fingers[i] = phalanges;
+ palm.addChild(phalanges);
+ }
+ thumb = createPhalanges();
+ thumb.rotateAngleY = (float)Math.PI;
+ thumb.rotationPointY = -5.75F;
+ thumb.rotationPointZ = -3;
+ palm.addChild(thumb);
+ heldItemStack = new ItemStackModelRenderer(this, resetResourceLocation);
+ heldItemStack.rotateAngleZ = (float)Math.PI;
+ heldItemStack.rotateAngleX = (float)(Math.PI / 2);
+ heldItemStack.setRotationPoint(0, -8.5F, -3.5F);
+ palm.addChild(heldItemStack);
+ }
+
+ /**
+ * @param pedestal
+ * @param partialRenderTicks
+ * @param scale
+ */
+ public void render(TileEntityHandPedestal pedestal, float partialRenderTicks, float scale)
+ {
+ handleHeldItemStack(pedestal.getHeldItemStack());
+ float gripScale = pedestal.getGripScale();
+ float grip = easeInOut.eval(pedestal.getGrip(partialRenderTicks)) * gripScale;
+ float rotateAngleX = (float)(grip * 75 * Math.PI / 180 + (1 - grip) * 10 * Math.PI / 180);
+ float rotateAngleZ = (float)(grip * 20 * Math.PI / 180);
+ for(int i = 0; i < fingers.length; i++){
+ ModelRenderer phalanges = fingers[i];
+ phalanges.rotateAngleX = rotateAngleX;
+ phalanges.rotateAngleZ = rotateAngleZ * (2F / (fingers.length - 1) * i - 1);
+ }
+ thumb.rotateAngleX = (float)(grip * 60 * Math.PI / 180 + (1 - grip) * 10 * Math.PI / 180);
+ thumb.rotateAngleZ = rotateAngleZ;
+ plinth.render(scale);
+ }
+
+ /**
+ * @param itemStack
+ */
+ private void handleHeldItemStack(ItemStack itemStack)
+ {
+ heldItemStack.setItemStack(itemStack);
+ if (itemStack != null){
+ Item item = itemStack.getItem();
+ if (item instanceof ItemBlock){
+ heldItemStack.rotateAngleX = 0;
+ heldItemStack.rotationPointZ = 0;
+ }else{
+ heldItemStack.rotateAngleX = (float)(Math.PI / 2);
+ heldItemStack.rotationPointZ = -3.5F;
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelHeart.java b/src/main/java/darkknight/jewelrycraft/model/ModelHeart.java
new file mode 100644
index 0000000..0c6a438
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelHeart.java
@@ -0,0 +1,539 @@
+// Date: 2/13/2015 8:18:43 PM
+// Template version 1.1
+// Java generated by Techne
+// Keep in mind that you still need to fill in some blanks
+// - ZeuX
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+
+public class ModelHeart extends ModelBase
+{
+ // fields
+ ModelRenderer s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, s22;
+ ModelRenderer f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26;
+ ModelRenderer b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15, b16, b17, b18, b19, b20, b21, b22, b23, b24, b25, b26;
+
+ public ModelHeart()
+ {
+ textureWidth = 64;
+ textureHeight = 32;
+ s1 = new ModelRenderer(this, 0, 16);
+ s1.addBox(0F, 0F, 0F, 1, 1, 1);
+ s1.setRotationPoint(1F, 13F, 0F);
+ s1.setTextureSize(64, 32);
+ s1.mirror = true;
+ setRotation(s1, 0F, 0F, 0F);
+ s2 = new ModelRenderer(this, 0, 16);
+ s2.addBox(0F, 0F, 0F, 2, 1, 1);
+ s2.setRotationPoint(-1F, 23F, 0F);
+ s2.setTextureSize(64, 32);
+ s2.mirror = true;
+ setRotation(s2, 0F, 0F, 0F);
+ s3 = new ModelRenderer(this, 0, 16);
+ s3.addBox(0F, 0F, 0F, 2, 1, 1);
+ s3.setRotationPoint(2F, 12F, 0F);
+ s3.setTextureSize(64, 32);
+ s3.mirror = true;
+ setRotation(s3, 0F, 0F, 0F);
+ s4 = new ModelRenderer(this, 0, 16);
+ s4.addBox(0F, 0F, 0F, 1, 1, 1);
+ s4.setRotationPoint(1F, 22F, 0F);
+ s4.setTextureSize(64, 32);
+ s4.mirror = true;
+ setRotation(s4, 0F, 0F, 0F);
+ s5 = new ModelRenderer(this, 0, 16);
+ s5.addBox(0F, 0F, 0F, 1, 1, 1);
+ s5.setRotationPoint(4F, 13F, 0F);
+ s5.setTextureSize(64, 32);
+ s5.mirror = true;
+ setRotation(s5, 0F, 0F, 0F);
+ s6 = new ModelRenderer(this, 0, 16);
+ s6.addBox(0F, 0F, 0F, 1, 1, 1);
+ s6.setRotationPoint(5F, 18F, 0F);
+ s6.setTextureSize(64, 32);
+ s6.mirror = true;
+ setRotation(s6, 0F, 0F, 0F);
+ s7 = new ModelRenderer(this, 0, 16);
+ s7.addBox(0F, 0F, 0F, 1, 1, 1);
+ s7.setRotationPoint(5F, 14F, 0F);
+ s7.setTextureSize(64, 32);
+ s7.mirror = true;
+ setRotation(s7, 0F, 0F, 0F);
+ s8 = new ModelRenderer(this, 0, 16);
+ s8.addBox(0F, 0F, 0F, 1, 1, 1);
+ s8.setRotationPoint(-2F, 22F, 0F);
+ s8.setTextureSize(64, 32);
+ s8.mirror = true;
+ setRotation(s8, 0F, 0F, 0F);
+ s9 = new ModelRenderer(this, 0, 16);
+ s9.addBox(0F, 0F, 0F, 1, 1, 1);
+ s9.setRotationPoint(-2F, 13F, 0F);
+ s9.setTextureSize(64, 32);
+ s9.mirror = true;
+ setRotation(s9, 0F, 0F, 0F);
+ s10 = new ModelRenderer(this, 0, 16);
+ s10.addBox(0F, 0F, 0F, 1, 1, 1);
+ s10.setRotationPoint(-6F, 18F, 0F);
+ s10.setTextureSize(64, 32);
+ s10.mirror = true;
+ setRotation(s10, 0F, 0F, 0F);
+ s11 = new ModelRenderer(this, 0, 16);
+ s11.addBox(0F, 0F, 0F, 2, 1, 1);
+ s11.setRotationPoint(-4F, 12F, 0F);
+ s11.setTextureSize(64, 32);
+ s11.mirror = true;
+ setRotation(s11, 0F, 0F, 0F);
+ s12 = new ModelRenderer(this, 0, 16);
+ s12.addBox(0F, 0F, 0F, 1, 1, 1);
+ s12.setRotationPoint(-3F, 21F, 0F);
+ s12.setTextureSize(64, 32);
+ s12.mirror = true;
+ setRotation(s12, 0F, 0F, 0F);
+ s13 = new ModelRenderer(this, 0, 16);
+ s13.addBox(0F, 0F, 0F, 1, 1, 1);
+ s13.setRotationPoint(-5F, 13F, 0F);
+ s13.setTextureSize(64, 32);
+ s13.mirror = true;
+ setRotation(s13, 0F, 0F, 0F);
+ s14 = new ModelRenderer(this, 0, 16);
+ s14.addBox(0F, 0F, 0F, 1, 1, 1);
+ s14.setRotationPoint(-4F, 20F, 0F);
+ s14.setTextureSize(64, 32);
+ s14.mirror = true;
+ setRotation(s14, 0F, 0F, 0F);
+ s15 = new ModelRenderer(this, 0, 16);
+ s15.addBox(0F, 0F, 0F, 1, 1, 1);
+ s15.setRotationPoint(-6F, 14F, 0F);
+ s15.setTextureSize(64, 32);
+ s15.mirror = true;
+ setRotation(s15, 0F, 0F, 0F);
+ s16 = new ModelRenderer(this, 0, 16);
+ s16.addBox(0F, 0F, 0F, 1, 1, 1);
+ s16.setRotationPoint(-5F, 19F, 0F);
+ s16.setTextureSize(64, 32);
+ s16.mirror = true;
+ setRotation(s16, 0F, 0F, 0F);
+ s17 = new ModelRenderer(this, 0, 16);
+ s17.addBox(0F, 0F, 0F, 2, 1, 1);
+ s17.setRotationPoint(-1F, 14F, 0F);
+ s17.setTextureSize(64, 32);
+ s17.mirror = true;
+ setRotation(s17, 0F, 0F, 0F);
+ s18 = new ModelRenderer(this, 0, 16);
+ s18.addBox(0F, 0F, 0F, 1, 1, 1);
+ s18.setRotationPoint(2F, 21F, 0F);
+ s18.setTextureSize(64, 32);
+ s18.mirror = true;
+ setRotation(s18, 0F, 0F, 0F);
+ s19 = new ModelRenderer(this, 0, 16);
+ s19.addBox(0F, 0F, 0F, 1, 3, 1);
+ s19.setRotationPoint(6F, 15F, 0F);
+ s19.setTextureSize(64, 32);
+ s19.mirror = true;
+ setRotation(s19, 0F, 0F, 0F);
+ s20 = new ModelRenderer(this, 0, 16);
+ s20.addBox(0F, 0F, 0F, 1, 1, 1);
+ s20.setRotationPoint(3F, 20F, 0F);
+ s20.setTextureSize(64, 32);
+ s20.mirror = true;
+ setRotation(s20, 0F, 0F, 0F);
+ s21 = new ModelRenderer(this, 0, 16);
+ s21.addBox(0F, 0F, 0F, 1, 3, 1);
+ s21.setRotationPoint(-7F, 15F, 0F);
+ s21.setTextureSize(64, 32);
+ s21.mirror = true;
+ setRotation(s21, 0F, 0F, 0F);
+ s22 = new ModelRenderer(this, 0, 16);
+ s22.addBox(0F, 0F, 0F, 1, 1, 1);
+ s22.setRotationPoint(4F, 19F, 0F);
+ s22.setTextureSize(64, 32);
+ s22.mirror = true;
+ setRotation(s22, 0F, 0F, 0F);
+ f1 = new ModelRenderer(this, 0, 0);
+ f1.addBox(0F, 0F, 0F, 2, 1, 1);
+ f1.setRotationPoint(-1F, 22F, 1F);
+ f1.setTextureSize(64, 32);
+ f1.mirror = true;
+ setRotation(f1, 0F, 0F, 0F);
+ f2 = new ModelRenderer(this, 0, 0);
+ f2.addBox(0F, 0F, 0F, 2, 1, 1);
+ f2.setRotationPoint(2F, 13F, 1F);
+ f2.setTextureSize(64, 32);
+ f2.mirror = true;
+ setRotation(f2, 0F, 0F, 0F);
+ f3 = new ModelRenderer(this, 0, 0);
+ f3.addBox(0F, 0F, 0F, 12, 3, 1);
+ f3.setRotationPoint(-6F, 15F, 1F);
+ f3.setTextureSize(64, 32);
+ f3.mirror = true;
+ setRotation(f3, 0F, 0F, 0F);
+ f4 = new ModelRenderer(this, 0, 0);
+ f4.addBox(0F, 0F, 0F, 10, 1, 1);
+ f4.setRotationPoint(-5F, 18F, 1F);
+ f4.setTextureSize(64, 32);
+ f4.mirror = true;
+ setRotation(f4, 0F, 0F, 0F);
+ f5 = new ModelRenderer(this, 0, 0);
+ f5.addBox(0F, 0F, 0F, 8, 1, 1);
+ f5.setRotationPoint(-4F, 19F, 1F);
+ f5.setTextureSize(64, 32);
+ f5.mirror = true;
+ setRotation(f5, 0F, 0F, 0F);
+ f6 = new ModelRenderer(this, 0, 0);
+ f6.addBox(0F, 0F, 0F, 6, 1, 1);
+ f6.setRotationPoint(-3F, 20F, 1F);
+ f6.setTextureSize(64, 32);
+ f6.mirror = true;
+ setRotation(f6, 0F, 0F, 0F);
+ f7 = new ModelRenderer(this, 0, 0);
+ f7.addBox(0F, 0F, 0F, 4, 1, 1);
+ f7.setRotationPoint(-2F, 21F, 1F);
+ f7.setTextureSize(64, 32);
+ f7.mirror = true;
+ setRotation(f7, 0F, 0F, 0F);
+ f8 = new ModelRenderer(this, 0, 0);
+ f8.addBox(0F, 0F, 0F, 4, 1, 1);
+ f8.setRotationPoint(-5F, 14F, 1F);
+ f8.setTextureSize(64, 32);
+ f8.mirror = true;
+ setRotation(f8, 0F, 0F, 0F);
+ f9 = new ModelRenderer(this, 0, 0);
+ f9.addBox(0F, 0F, 0F, 2, 1, 1);
+ f9.setRotationPoint(-4F, 13F, 1F);
+ f9.setTextureSize(64, 32);
+ f9.mirror = true;
+ setRotation(f9, 0F, 0F, 0F);
+ f10 = new ModelRenderer(this, 0, 0);
+ f10.addBox(0F, 0F, 0F, 4, 1, 1);
+ f10.setRotationPoint(1F, 14F, 1F);
+ f10.setTextureSize(64, 32);
+ f10.mirror = true;
+ setRotation(f10, 0F, 0F, 0F);
+ f11 = new ModelRenderer(this, 0, 0);
+ f11.addBox(0F, 0F, 0F, 1, 1, 1);
+ f11.setRotationPoint(2F, 15F, 3F);
+ f11.setTextureSize(64, 32);
+ f11.mirror = true;
+ setRotation(f11, 0F, 0F, 0F);
+ f12 = new ModelRenderer(this, 0, 0);
+ f12.addBox(0F, 0F, 0F, 1, 1, 1);
+ f12.setRotationPoint(2F, 14F, 2F);
+ f12.setTextureSize(64, 32);
+ f12.mirror = true;
+ setRotation(f12, 0F, 0F, 0F);
+ f13 = new ModelRenderer(this, 0, 0);
+ f13.addBox(0F, 0F, 0F, 3, 1, 1);
+ f13.setRotationPoint(1F, 15F, 2F);
+ f13.setTextureSize(64, 32);
+ f13.mirror = true;
+ setRotation(f13, 0F, 0F, 0F);
+ f14 = new ModelRenderer(this, 0, 0);
+ f14.addBox(0F, 0F, 0F, 10, 1, 1);
+ f14.setRotationPoint(-5F, 16F, 2F);
+ f14.setTextureSize(64, 32);
+ f14.mirror = true;
+ setRotation(f14, 0F, 0F, 0F);
+ f15 = new ModelRenderer(this, 0, 0);
+ f15.addBox(0F, 0F, 0F, 10, 1, 1);
+ f15.setRotationPoint(-5F, 17F, 2F);
+ f15.setTextureSize(64, 32);
+ f15.mirror = true;
+ setRotation(f15, 0F, 0F, 0F);
+ f16 = new ModelRenderer(this, 0, 0);
+ f16.addBox(0F, 0F, 0F, 3, 1, 1);
+ f16.setRotationPoint(-4F, 15F, 2F);
+ f16.setTextureSize(64, 32);
+ f16.mirror = true;
+ setRotation(f16, 0F, 0F, 0F);
+ f17 = new ModelRenderer(this, 0, 0);
+ f17.addBox(0F, 0F, 0F, 1, 1, 1);
+ f17.setRotationPoint(-3F, 14F, 2F);
+ f17.setTextureSize(64, 32);
+ f17.mirror = true;
+ setRotation(f17, 0F, 0F, 0F);
+ f18 = new ModelRenderer(this, 0, 0);
+ f18.addBox(0F, 0F, 0F, 3, 1, 1);
+ f18.setRotationPoint(1F, 16F, 3F);
+ f18.setTextureSize(64, 32);
+ f18.mirror = true;
+ setRotation(f18, 0F, 0F, 0F);
+ f19 = new ModelRenderer(this, 0, 0);
+ f19.addBox(0F, 0F, 0F, 1, 1, 1);
+ f19.setRotationPoint(-3F, 15F, 3F);
+ f19.setTextureSize(64, 32);
+ f19.mirror = true;
+ setRotation(f19, 0F, 0F, 0F);
+ f20 = new ModelRenderer(this, 0, 0);
+ f20.addBox(0F, 0F, 0F, 3, 1, 1);
+ f20.setRotationPoint(-4F, 16F, 3F);
+ f20.setTextureSize(64, 32);
+ f20.mirror = true;
+ setRotation(f20, 0F, 0F, 0F);
+ f21 = new ModelRenderer(this, 0, 0);
+ f21.addBox(0F, 0F, 0F, 4, 1, 1);
+ f21.setRotationPoint(-2F, 20F, 2F);
+ f21.setTextureSize(64, 32);
+ f21.mirror = true;
+ setRotation(f21, 0F, 0F, 0F);
+ f22 = new ModelRenderer(this, 0, 0);
+ f22.addBox(0F, 0F, 0F, 6, 1, 1);
+ f22.setRotationPoint(-3F, 19F, 2F);
+ f22.setTextureSize(64, 32);
+ f22.mirror = true;
+ setRotation(f22, 0F, 0F, 0F);
+ f23 = new ModelRenderer(this, 0, 0);
+ f23.addBox(0F, 0F, 0F, 8, 1, 1);
+ f23.setRotationPoint(-4F, 18F, 2F);
+ f23.setTextureSize(64, 32);
+ f23.mirror = true;
+ setRotation(f23, 0F, 0F, 0F);
+ f24 = new ModelRenderer(this, 0, 0);
+ f24.addBox(0F, 0F, 0F, 6, 1, 1);
+ f24.setRotationPoint(-3F, 17F, 3F);
+ f24.setTextureSize(64, 32);
+ f24.mirror = true;
+ setRotation(f24, 0F, 0F, 0F);
+ f25 = new ModelRenderer(this, 0, 0);
+ f25.addBox(0F, 0F, 0F, 4, 1, 1);
+ f25.setRotationPoint(-2F, 18F, 3F);
+ f25.setTextureSize(64, 32);
+ f25.mirror = true;
+ setRotation(f25, 0F, 0F, 0F);
+ f26 = new ModelRenderer(this, 0, 0);
+ f26.addBox(0F, 0F, 0F, 2, 1, 1);
+ f26.setRotationPoint(-1F, 19F, 3F);
+ f26.setTextureSize(64, 32);
+ f26.mirror = true;
+ setRotation(f26, 0F, 0F, 0F);
+ b1 = new ModelRenderer(this, 0, 0);
+ b1.addBox(0F, 0F, 0F, 4, 1, 1);
+ b1.setRotationPoint(-2F, 20F, -2F);
+ b1.setTextureSize(64, 32);
+ b1.mirror = true;
+ setRotation(b1, 0F, 0F, 0F);
+ b2 = new ModelRenderer(this, 0, 0);
+ b2.addBox(0F, 0F, 0F, 1, 1, 1);
+ b2.setRotationPoint(-3F, 14F, -2F);
+ b2.setTextureSize(64, 32);
+ b2.mirror = true;
+ setRotation(b2, 0F, 0F, 0F);
+ b3 = new ModelRenderer(this, 0, 0);
+ b3.addBox(0F, 0F, 0F, 10, 1, 1);
+ b3.setRotationPoint(-5F, 17F, -2F);
+ b3.setTextureSize(64, 32);
+ b3.mirror = true;
+ setRotation(b3, 0F, 0F, 0F);
+ b4 = new ModelRenderer(this, 0, 0);
+ b4.addBox(0F, 0F, 0F, 8, 1, 1);
+ b4.setRotationPoint(-4F, 18F, -2F);
+ b4.setTextureSize(64, 32);
+ b4.mirror = true;
+ setRotation(b4, 0F, 0F, 0F);
+ b5 = new ModelRenderer(this, 0, 0);
+ b5.addBox(0F, 0F, 0F, 6, 1, 1);
+ b5.setRotationPoint(-3F, 19F, -2F);
+ b5.setTextureSize(64, 32);
+ b5.mirror = true;
+ setRotation(b5, 0F, 0F, 0F);
+ b6 = new ModelRenderer(this, 0, 0);
+ b6.addBox(0F, 0F, 0F, 3, 1, 1);
+ b6.setRotationPoint(-4F, 15F, -2F);
+ b6.setTextureSize(64, 32);
+ b6.mirror = true;
+ setRotation(b6, 0F, 0F, 0F);
+ b7 = new ModelRenderer(this, 0, 0);
+ b7.addBox(0F, 0F, 0F, 3, 1, 1);
+ b7.setRotationPoint(1F, 15F, -2F);
+ b7.setTextureSize(64, 32);
+ b7.mirror = true;
+ setRotation(b7, 0F, 0F, 0F);
+ b8 = new ModelRenderer(this, 0, 0);
+ b8.addBox(0F, 0F, 0F, 1, 1, 1);
+ b8.setRotationPoint(2F, 14F, -2F);
+ b8.setTextureSize(64, 32);
+ b8.mirror = true;
+ setRotation(b8, 0F, 0F, 0F);
+ b9 = new ModelRenderer(this, 0, 0);
+ b9.addBox(0F, 0F, 0F, 1, 1, 1);
+ b9.setRotationPoint(-3F, 15F, -3F);
+ b9.setTextureSize(64, 32);
+ b9.mirror = true;
+ setRotation(b9, 0F, 0F, 0F);
+ b10 = new ModelRenderer(this, 0, 0);
+ b10.addBox(0F, 0F, 0F, 4, 1, 1);
+ b10.setRotationPoint(-2F, 18F, -3F);
+ b10.setTextureSize(64, 32);
+ b10.mirror = true;
+ setRotation(b10, 0F, 0F, 0F);
+ b11 = new ModelRenderer(this, 0, 0);
+ b11.addBox(0F, 0F, 0F, 10, 1, 1);
+ b11.setRotationPoint(-5F, 16F, -2F);
+ b11.setTextureSize(64, 32);
+ b11.mirror = true;
+ setRotation(b11, 0F, 0F, 0F);
+ b12 = new ModelRenderer(this, 0, 0);
+ b12.addBox(0F, 0F, 0F, 3, 1, 1);
+ b12.setRotationPoint(-4F, 16F, -3F);
+ b12.setTextureSize(64, 32);
+ b12.mirror = true;
+ setRotation(b12, 0F, 0F, 0F);
+ b13 = new ModelRenderer(this, 0, 0);
+ b13.addBox(0F, 0F, 0F, 3, 1, 1);
+ b13.setRotationPoint(1F, 16F, -3F);
+ b13.setTextureSize(64, 32);
+ b13.mirror = true;
+ setRotation(b13, 0F, 0F, 0F);
+ b14 = new ModelRenderer(this, 0, 0);
+ b14.addBox(0F, 0F, 0F, 1, 1, 1);
+ b14.setRotationPoint(2F, 15F, -3F);
+ b14.setTextureSize(64, 32);
+ b14.mirror = true;
+ setRotation(b14, 0F, 0F, 0F);
+ b15 = new ModelRenderer(this, 0, 0);
+ b15.addBox(0F, 0F, 0F, 6, 1, 1);
+ b15.setRotationPoint(-3F, 17F, -3F);
+ b15.setTextureSize(64, 32);
+ b15.mirror = true;
+ setRotation(b15, 0F, 0F, 0F);
+ b16 = new ModelRenderer(this, 0, 0);
+ b16.addBox(0F, 0F, 0F, 2, 1, 1);
+ b16.setRotationPoint(-1F, 19F, -3F);
+ b16.setTextureSize(64, 32);
+ b16.mirror = true;
+ setRotation(b16, 0F, 0F, 0F);
+ b17 = new ModelRenderer(this, 0, 0);
+ b17.addBox(0F, 0F, 0F, 2, 1, 1);
+ b17.setRotationPoint(2F, 13F, -1F);
+ b17.setTextureSize(64, 32);
+ b17.mirror = true;
+ setRotation(b17, 0F, 0F, 0F);
+ b18 = new ModelRenderer(this, 0, 0);
+ b18.addBox(0F, 0F, 0F, 4, 1, 1);
+ b18.setRotationPoint(1F, 14F, -1F);
+ b18.setTextureSize(64, 32);
+ b18.mirror = true;
+ setRotation(b18, 0F, 0F, 0F);
+ b19 = new ModelRenderer(this, 0, 0);
+ b19.addBox(0F, 0F, 0F, 2, 1, 1);
+ b19.setRotationPoint(-4F, 13F, -1F);
+ b19.setTextureSize(64, 32);
+ b19.mirror = true;
+ setRotation(b19, 0F, 0F, 0F);
+ b20 = new ModelRenderer(this, 0, 0);
+ b20.addBox(0F, 0F, 0F, 2, 1, 1);
+ b20.setRotationPoint(-1F, 22F, -1F);
+ b20.setTextureSize(64, 32);
+ b20.mirror = true;
+ setRotation(b20, 0F, 0F, 0F);
+ b21 = new ModelRenderer(this, 0, 0);
+ b21.addBox(0F, 0F, 0F, 4, 1, 1);
+ b21.setRotationPoint(-5F, 14F, -1F);
+ b21.setTextureSize(64, 32);
+ b21.mirror = true;
+ setRotation(b21, 0F, 0F, 0F);
+ b22 = new ModelRenderer(this, 0, 0);
+ b22.addBox(0F, 0F, 0F, 12, 3, 1);
+ b22.setRotationPoint(-6F, 15F, -1F);
+ b22.setTextureSize(64, 32);
+ b22.mirror = true;
+ setRotation(b22, 0F, 0F, 0F);
+ b23 = new ModelRenderer(this, 0, 0);
+ b23.addBox(0F, 0F, 0F, 10, 1, 1);
+ b23.setRotationPoint(-5F, 18F, -1F);
+ b23.setTextureSize(64, 32);
+ b23.mirror = true;
+ setRotation(b23, 0F, 0F, 0F);
+ b24 = new ModelRenderer(this, 0, 0);
+ b24.addBox(0F, 0F, 0F, 8, 1, 1);
+ b24.setRotationPoint(-4F, 19F, -1F);
+ b24.setTextureSize(64, 32);
+ b24.mirror = true;
+ setRotation(b24, 0F, 0F, 0F);
+ b25 = new ModelRenderer(this, 0, 0);
+ b25.addBox(0F, 0F, 0F, 6, 1, 1);
+ b25.setRotationPoint(-3F, 20F, -1F);
+ b25.setTextureSize(64, 32);
+ b25.mirror = true;
+ setRotation(b25, 0F, 0F, 0F);
+ b26 = new ModelRenderer(this, 0, 0);
+ b26.addBox(0F, 0F, 0F, 4, 1, 1);
+ b26.setRotationPoint(-2F, 21F, -1F);
+ b26.setTextureSize(64, 32);
+ b26.mirror = true;
+ setRotation(b26, 0F, 0F, 0F);
+ }
+
+ public void render(Entity entity, float angle1, float angle2, float angle3, float angle4, float angle5, float angle6)
+ {
+ super.render(entity, angle1, angle2, angle3, angle4, angle5, angle6);
+ setRotationAngles(angle1, angle2, angle3, angle4, angle5, angle6);
+ s1.render(angle6); s2.render(angle6); s3.render(angle6); s4.render(angle6); s5.render(angle6); s6.render(angle6); s7.render(angle6); s8.render(angle6); s9.render(angle6); s10.render(angle6); s11.render(angle6); s12.render(angle6); s13.render(angle6); s14.render(angle6); s15.render(angle6); s16.render(angle6); s17.render(angle6); s18.render(angle6); s19.render(angle6); s20.render(angle6); s21.render(angle6); s22.render(angle6);
+ f1.render(angle6);
+ f2.render(angle6);
+ f3.render(angle6);
+ f4.render(angle6);
+ f5.render(angle6);
+ f6.render(angle6);
+ f7.render(angle6);
+ f8.render(angle6);
+ f9.render(angle6);
+ f10.render(angle6);
+ f11.render(angle6);
+ f12.render(angle6);
+ f13.render(angle6);
+ f14.render(angle6);
+ f15.render(angle6);
+ f16.render(angle6);
+ f17.render(angle6);
+ f18.render(angle6);
+ f19.render(angle6);
+ f20.render(angle6);
+ f21.render(angle6);
+ f22.render(angle6);
+ f23.render(angle6);
+ f24.render(angle6);
+ f25.render(angle6);
+ f26.render(angle6);
+ b1.render(angle6);
+ b2.render(angle6);
+ b3.render(angle6);
+ b4.render(angle6);
+ b5.render(angle6);
+ b6.render(angle6);
+ b7.render(angle6);
+ b8.render(angle6);
+ b9.render(angle6);
+ b10.render(angle6);
+ b11.render(angle6);
+ b12.render(angle6);
+ b13.render(angle6);
+ b14.render(angle6);
+ b15.render(angle6);
+ b16.render(angle6);
+ b17.render(angle6);
+ b18.render(angle6);
+ b19.render(angle6);
+ b20.render(angle6);
+ b21.render(angle6);
+ b22.render(angle6);
+ b23.render(angle6);
+ b24.render(angle6);
+ b25.render(angle6);
+ b26.render(angle6);
+ }
+
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java b/src/main/java/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java
new file mode 100644
index 0000000..66be543
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java
@@ -0,0 +1,165 @@
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+
+public class ModelJewlersCraftingBench extends ModelBase
+{
+ // fields
+ ModelRenderer Leg1;
+ ModelRenderer Leg2;
+ ModelRenderer Leg3;
+ ModelRenderer Leg4;
+ ModelRenderer Top;
+ ModelRenderer Support1;
+ ModelRenderer Support2;
+ ModelRenderer Support3;
+ ModelRenderer Support4;
+ ModelRenderer Support5;
+ ModelRenderer Support6;
+ ModelRenderer Support7;
+ ModelRenderer Support8;
+
+ /**
+ *
+ */
+ public ModelJewlersCraftingBench()
+ {
+ textureWidth = 64;
+ textureHeight = 32;
+ Leg1 = new ModelRenderer(this, 0, 0);
+ Leg1.addBox(0F, 0F, 0F, 2, 10, 2);
+ Leg1.setRotationPoint(-6F, 14F, 4F);
+ Leg1.setTextureSize(64, 32);
+ Leg1.mirror = true;
+ setRotation(Leg1, 0F, 0F, 0F);
+ Leg2 = new ModelRenderer(this, 0, 0);
+ Leg2.addBox(0F, 0F, 0F, 2, 10, 2);
+ Leg2.setRotationPoint(-6F, 14F, -6F);
+ Leg2.setTextureSize(64, 32);
+ Leg2.mirror = true;
+ setRotation(Leg2, 0F, 0F, 0F);
+ Leg3 = new ModelRenderer(this, 0, 0);
+ Leg3.addBox(0F, 0F, 0F, 2, 10, 2);
+ Leg3.setRotationPoint(4F, 14F, -6F);
+ Leg3.setTextureSize(64, 32);
+ Leg3.mirror = true;
+ setRotation(Leg3, 0F, 0F, 0F);
+ Leg4 = new ModelRenderer(this, 0, 0);
+ Leg4.addBox(0F, 0F, 0F, 2, 10, 2);
+ Leg4.setRotationPoint(4F, 14F, 4F);
+ Leg4.setTextureSize(64, 32);
+ Leg4.mirror = true;
+ setRotation(Leg4, 0F, 0F, 0F);
+ Top = new ModelRenderer(this, 0, 13);
+ Top.addBox(0F, 0F, 0F, 16, 1, 16);
+ Top.setRotationPoint(-8F, 13F, -8F);
+ Top.setTextureSize(64, 32);
+ Top.mirror = true;
+ setRotation(Top, 0F, 0F, 0F);
+ Support1 = new ModelRenderer(this, 0, 0);
+ Support1.addBox(0F, 0F, 0F, 3, 1, 1);
+ Support1.setRotationPoint(3F, 12F, 5F);
+ Support1.setTextureSize(64, 32);
+ Support1.mirror = true;
+ setRotation(Support1, 0F, 0F, 0F);
+ Support2 = new ModelRenderer(this, 0, 0);
+ Support2.addBox(0F, 0F, 0F, 1, 1, 3);
+ Support2.setRotationPoint(2F, 12F, 2F);
+ Support2.setTextureSize(64, 32);
+ Support2.mirror = true;
+ setRotation(Support2, 0F, 0F, 0F);
+ Support3 = new ModelRenderer(this, 0, 0);
+ Support3.addBox(0F, 0F, 0F, 1, 1, 3);
+ Support3.setRotationPoint(6F, 12F, 2F);
+ Support3.setTextureSize(64, 32);
+ Support3.mirror = true;
+ setRotation(Support3, 0F, 0F, 0F);
+ Support4 = new ModelRenderer(this, 0, 0);
+ Support4.addBox(0F, 0F, 0F, 3, 1, 1);
+ Support4.setRotationPoint(3F, 12F, 1F);
+ Support4.setTextureSize(64, 32);
+ Support4.mirror = true;
+ setRotation(Support4, 0F, 0F, 0F);
+ Support5 = new ModelRenderer(this, 0, 0);
+ Support5.addBox(0F, 0F, 0F, 1, 1, 3);
+ Support5.setRotationPoint(-3F, 12F, 2F);
+ Support5.setTextureSize(64, 32);
+ Support5.mirror = true;
+ setRotation(Support5, 0F, 0F, 0F);
+ Support6 = new ModelRenderer(this, 0, 0);
+ Support6.addBox(0F, 0F, 0F, 3, 1, 1);
+ Support6.setRotationPoint(-6F, 12F, 5F);
+ Support6.setTextureSize(64, 32);
+ Support6.mirror = true;
+ setRotation(Support6, 0F, 0F, 0F);
+ Support7 = new ModelRenderer(this, 0, 0);
+ Support7.addBox(0F, 0F, 0F, 1, 1, 3);
+ Support7.setRotationPoint(-7F, 12F, 2F);
+ Support7.setTextureSize(64, 32);
+ Support7.mirror = true;
+ setRotation(Support7, 0F, 0F, 0F);
+ Support8 = new ModelRenderer(this, 0, 0);
+ Support8.addBox(0F, 0F, 0F, 3, 1, 1);
+ Support8.setRotationPoint(-6F, 12F, 1F);
+ Support8.setTextureSize(64, 32);
+ Support8.mirror = true;
+ setRotation(Support8, 0F, 0F, 0F);
+ }
+
+ /**
+ * @param entity
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ @Override
+ public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.render(entity, f, f1, f2, f3, f4, f5);
+ setRotationAngles(f, f1, f2, f3, f4, f5);
+ Leg1.render(f5);
+ Leg2.render(f5);
+ Leg3.render(f5);
+ Leg4.render(f5);
+ Top.render(f5);
+ Support1.render(f5);
+ Support2.render(f5);
+ Support3.render(f5);
+ Support4.render(f5);
+ Support5.render(f5);
+ Support6.render(f5);
+ Support7.render(f5);
+ Support8.render(f5);
+ }
+
+ /**
+ * @param model
+ * @param x
+ * @param y
+ * @param z
+ */
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+
+ /**
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelMask.java b/src/main/java/darkknight/jewelrycraft/model/ModelMask.java
new file mode 100644
index 0000000..5e5edb0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelMask.java
@@ -0,0 +1,917 @@
+package darkknight.jewelrycraft.model;
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+public class ModelMask extends ModelBase
+{
+ ModelRenderer p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p27, p28, p29, p30, p31, p32, p33, p34, p35, p36, p37, p38, p39, p40, p41, p42, p43, p44, p45, p46, p47, p48, p49, p50, p51, p52, p53, p54, p55, p56, p57, p58, p59, p60, p61, p62, p63, p64, p65, p66, p67, p68, p69, p70, p71, p72, p73, p74, p75, p76, p77, p78, p79, p80, p81, p82, p83, p84, p85, p86, p87, p88, p89, p90, p91, p92, p93, p94, p95, p96, p97, p98, p99, p100, p101, p102, p103, p104, p105, p106, p107, p108, p109, p110, p111, p112, p113, p114, p115, p116, p117, p118, p119, p120, p121, p122, p123, p124, p125, p126;
+ public ModelMask()
+ {
+ textureWidth = 24;
+ textureHeight = 24;
+ p0 = new ModelRenderer(this, 5, 0);
+ p0.addBox(0F, 0F, 0F, 2, 1, 1);
+ p0.setRotationPoint(6F, 1F, 3F);
+ p0.setTextureSize(24, 24);
+ p0.mirror = true;
+
+ p1 = new ModelRenderer(this, 7, 0);
+ p1.addBox(0F, 0F, 0F, 3, 1, 1);
+ p1.setRotationPoint(8F, 1F, 2F);
+ p1.setTextureSize(24, 24);
+ p1.mirror = true;
+
+ p2 = new ModelRenderer(this, 10, 0);
+ p2.addBox(0F, 0F, 0F, 3, 1, 1);
+ p2.setRotationPoint(11F, 1F, 1F);
+ p2.setTextureSize(24, 24);
+ p2.mirror = true;
+
+ p3 = new ModelRenderer(this, 13, 0);
+ p3.addBox(0F, 0F, 0F, 3, 1, 1);
+ p3.setRotationPoint(14F, 1F, 2F);
+ p3.setTextureSize(24, 24);
+ p3.mirror = true;
+
+ p4 = new ModelRenderer(this, 16, 0);
+ p4.addBox(0F, 0F, 0F, 2, 1, 1);
+ p4.setRotationPoint(17F, 1F, 3F);
+ p4.setTextureSize(24, 24);
+ p4.mirror = true;
+
+ p5 = new ModelRenderer(this, 4, 1);
+ p5.addBox(0F, 0F, 0F, 3, 1, 1);
+ p5.setRotationPoint(5F, 2F, 3F);
+ p5.setTextureSize(24, 24);
+ p5.mirror = true;
+
+ p6 = new ModelRenderer(this, 7, 1);
+ p6.addBox(0F, 0F, 0F, 3, 1, 1);
+ p6.setRotationPoint(8F, 2F, 2F);
+ p6.setTextureSize(24, 24);
+ p6.mirror = true;
+
+ p7 = new ModelRenderer(this, 10, 1);
+ p7.addBox(0F, 0F, 0F, 3, 1, 1);
+ p7.setRotationPoint(11F, 2F, 1F);
+ p7.setTextureSize(24, 24);
+ p7.mirror = true;
+
+ p8 = new ModelRenderer(this, 13, 1);
+ p8.addBox(0F, 0F, 0F, 3, 1, 1);
+ p8.setRotationPoint(14F, 2F, 2F);
+ p8.setTextureSize(24, 24);
+ p8.mirror = true;
+
+ p9 = new ModelRenderer(this, 16, 1);
+ p9.addBox(0F, 0F, 0F, 3, 1, 1);
+ p9.setRotationPoint(17F, 2F, 3F);
+ p9.setTextureSize(24, 24);
+ p9.mirror = true;
+
+ p10 = new ModelRenderer(this, 3, 2);
+ p10.addBox(0F, 0F, 0F, 1, 1, 1);
+ p10.setRotationPoint(4F, 3F, 4F);
+ p10.setTextureSize(24, 24);
+ p10.mirror = true;
+
+ p11 = new ModelRenderer(this, 4, 2);
+ p11.addBox(0F, 0F, 0F, 3, 1, 1);
+ p11.setRotationPoint(5F, 3F, 3F);
+ p11.setTextureSize(24, 24);
+ p11.mirror = true;
+
+ p12 = new ModelRenderer(this, 7, 2);
+ p12.addBox(0F, 0F, 0F, 3, 1, 1);
+ p12.setRotationPoint(8F, 3F, 2F);
+ p12.setTextureSize(24, 24);
+ p12.mirror = true;
+
+ p13 = new ModelRenderer(this, 10, 2);
+ p13.addBox(0F, 0F, 0F, 3, 1, 1);
+ p13.setRotationPoint(11F, 3F, 1F);
+ p13.setTextureSize(24, 24);
+ p13.mirror = true;
+
+ p14 = new ModelRenderer(this, 13, 2);
+ p14.addBox(0F, 0F, 0F, 3, 1, 1);
+ p14.setRotationPoint(14F, 3F, 2F);
+ p14.setTextureSize(24, 24);
+ p14.mirror = true;
+
+ p15 = new ModelRenderer(this, 16, 2);
+ p15.addBox(0F, 0F, 0F, 3, 1, 1);
+ p15.setRotationPoint(17F, 3F, 3F);
+ p15.setTextureSize(24, 24);
+ p15.mirror = true;
+
+ p16 = new ModelRenderer(this, 19, 2);
+ p16.addBox(0F, 0F, 0F, 1, 1, 1);
+ p16.setRotationPoint(20F, 3F, 4F);
+ p16.setTextureSize(24, 24);
+ p16.mirror = true;
+
+ p17 = new ModelRenderer(this, 2, 3);
+ p17.addBox(0F, 0F, 0F, 2, 1, 1);
+ p17.setRotationPoint(3F, 4F, 4F);
+ p17.setTextureSize(24, 24);
+ p17.mirror = true;
+
+ p18 = new ModelRenderer(this, 4, 3);
+ p18.addBox(0F, 0F, 0F, 3, 1, 1);
+ p18.setRotationPoint(5F, 4F, 3F);
+ p18.setTextureSize(24, 24);
+ p18.mirror = true;
+
+ p19 = new ModelRenderer(this, 7, 3);
+ p19.addBox(0F, 0F, 0F, 3, 1, 1);
+ p19.setRotationPoint(8F, 4F, 2F);
+ p19.setTextureSize(24, 24);
+ p19.mirror = true;
+
+ p20 = new ModelRenderer(this, 10, 3);
+ p20.addBox(0F, 0F, 0F, 3, 1, 1);
+ p20.setRotationPoint(11F, 4F, 1F);
+ p20.setTextureSize(24, 24);
+ p20.mirror = true;
+
+ p21 = new ModelRenderer(this, 13, 3);
+ p21.addBox(0F, 0F, 0F, 3, 1, 1);
+ p21.setRotationPoint(14F, 4F, 2F);
+ p21.setTextureSize(24, 24);
+ p21.mirror = true;
+
+ p22 = new ModelRenderer(this, 16, 3);
+ p22.addBox(0F, 0F, 0F, 3, 1, 1);
+ p22.setRotationPoint(17F, 4F, 3F);
+ p22.setTextureSize(24, 24);
+ p22.mirror = true;
+
+ p23 = new ModelRenderer(this, 19, 3);
+ p23.addBox(0F, 0F, 0F, 2, 1, 1);
+ p23.setRotationPoint(20F, 4F, 4F);
+ p23.setTextureSize(24, 24);
+ p23.mirror = true;
+
+ p24 = new ModelRenderer(this, 2, 4);
+ p24.addBox(0F, 0F, 0F, 2, 1, 1);
+ p24.setRotationPoint(3F, 5F, 4F);
+ p24.setTextureSize(24, 24);
+ p24.mirror = true;
+
+ p25 = new ModelRenderer(this, 4, 4);
+ p25.addBox(0F, 0F, 0F, 3, 1, 1);
+ p25.setRotationPoint(5F, 5F, 3F);
+ p25.setTextureSize(24, 24);
+ p25.mirror = true;
+
+ p26 = new ModelRenderer(this, 7, 4);
+ p26.addBox(0F, 0F, 0F, 3, 1, 1);
+ p26.setRotationPoint(8F, 5F, 2F);
+ p26.setTextureSize(24, 24);
+ p26.mirror = true;
+
+ p27 = new ModelRenderer(this, 10, 4);
+ p27.addBox(0F, 0F, 0F, 3, 1, 1);
+ p27.setRotationPoint(11F, 5F, 1F);
+ p27.setTextureSize(24, 24);
+ p27.mirror = true;
+
+ p28 = new ModelRenderer(this, 13, 4);
+ p28.addBox(0F, 0F, 0F, 3, 1, 1);
+ p28.setRotationPoint(14F, 5F, 2F);
+ p28.setTextureSize(24, 24);
+ p28.mirror = true;
+
+ p29 = new ModelRenderer(this, 16, 4);
+ p29.addBox(0F, 0F, 0F, 3, 1, 1);
+ p29.setRotationPoint(17F, 5F, 3F);
+ p29.setTextureSize(24, 24);
+ p29.mirror = true;
+
+ p30 = new ModelRenderer(this, 19, 4);
+ p30.addBox(0F, 0F, 0F, 2, 1, 1);
+ p30.setRotationPoint(20F, 5F, 4F);
+ p30.setTextureSize(24, 24);
+ p30.mirror = true;
+
+ p31 = new ModelRenderer(this, 2, 5);
+ p31.addBox(0F, 0F, 0F, 2, 1, 1);
+ p31.setRotationPoint(3F, 6F, 4F);
+ p31.setTextureSize(24, 24);
+ p31.mirror = true;
+
+ p32 = new ModelRenderer(this, 4, 5);
+ p32.addBox(0F, 0F, 0F, 3, 1, 1);
+ p32.setRotationPoint(5F, 6F, 3F);
+ p32.setTextureSize(24, 24);
+ p32.mirror = true;
+
+ p33 = new ModelRenderer(this, 7, 5);
+ p33.addBox(0F, 0F, 0F, 3, 1, 1);
+ p33.setRotationPoint(8F, 6F, 2F);
+ p33.setTextureSize(24, 24);
+ p33.mirror = true;
+
+ p34 = new ModelRenderer(this, 10, 5);
+ p34.addBox(0F, 0F, 0F, 3, 1, 1);
+ p34.setRotationPoint(11F, 6F, 1F);
+ p34.setTextureSize(24, 24);
+ p34.mirror = true;
+
+ p35 = new ModelRenderer(this, 13, 5);
+ p35.addBox(0F, 0F, 0F, 3, 1, 1);
+ p35.setRotationPoint(14F, 6F, 2F);
+ p35.setTextureSize(24, 24);
+ p35.mirror = true;
+
+ p36 = new ModelRenderer(this, 16, 5);
+ p36.addBox(0F, 0F, 0F, 3, 1, 1);
+ p36.setRotationPoint(17F, 6F, 3F);
+ p36.setTextureSize(24, 24);
+ p36.mirror = true;
+
+ p37 = new ModelRenderer(this, 19, 5);
+ p37.addBox(0F, 0F, 0F, 2, 1, 1);
+ p37.setRotationPoint(20F, 6F, 4F);
+ p37.setTextureSize(24, 24);
+ p37.mirror = true;
+
+ p38 = new ModelRenderer(this, 2, 6);
+ p38.addBox(0F, 0F, 0F, 2, 1, 1);
+ p38.setRotationPoint(3F, 7F, 4F);
+ p38.setTextureSize(24, 24);
+ p38.mirror = true;
+
+ p39 = new ModelRenderer(this, 4, 6);
+ p39.addBox(0F, 0F, 0F, 3, 1, 1);
+ p39.setRotationPoint(5F, 7F, 3F);
+ p39.setTextureSize(24, 24);
+ p39.mirror = true;
+
+ p40 = new ModelRenderer(this, 7, 6);
+ p40.addBox(0F, 0F, 0F, 3, 1, 1);
+ p40.setRotationPoint(8F, 7F, 2F);
+ p40.setTextureSize(24, 24);
+ p40.mirror = true;
+
+ p41 = new ModelRenderer(this, 10, 6);
+ p41.addBox(0F, 0F, 0F, 3, 1, 1);
+ p41.setRotationPoint(11F, 7F, 1F);
+ p41.setTextureSize(24, 24);
+ p41.mirror = true;
+
+ p42 = new ModelRenderer(this, 13, 6);
+ p42.addBox(0F, 0F, 0F, 3, 1, 1);
+ p42.setRotationPoint(14F, 7F, 2F);
+ p42.setTextureSize(24, 24);
+ p42.mirror = true;
+
+ p43 = new ModelRenderer(this, 16, 6);
+ p43.addBox(0F, 0F, 0F, 3, 1, 1);
+ p43.setRotationPoint(17F, 7F, 3F);
+ p43.setTextureSize(24, 24);
+ p43.mirror = true;
+
+ p44 = new ModelRenderer(this, 19, 6);
+ p44.addBox(0F, 0F, 0F, 2, 1, 1);
+ p44.setRotationPoint(20F, 7F, 4F);
+ p44.setTextureSize(24, 24);
+ p44.mirror = true;
+
+ p45 = new ModelRenderer(this, 2, 7);
+ p45.addBox(0F, 0F, 0F, 2, 1, 1);
+ p45.setRotationPoint(3F, 8F, 4F);
+ p45.setTextureSize(24, 24);
+ p45.mirror = true;
+
+ p46 = new ModelRenderer(this, 4, 7);
+ p46.addBox(0F, 0F, 0F, 3, 1, 1);
+ p46.setRotationPoint(5F, 8F, 3F);
+ p46.setTextureSize(24, 24);
+ p46.mirror = true;
+
+ p47 = new ModelRenderer(this, 7, 7);
+ p47.addBox(0F, 0F, 0F, 3, 1, 1);
+ p47.setRotationPoint(8F, 8F, 2F);
+ p47.setTextureSize(24, 24);
+ p47.mirror = true;
+
+ p48 = new ModelRenderer(this, 10, 7);
+ p48.addBox(0F, 0F, 0F, 3, 1, 1);
+ p48.setRotationPoint(11F, 8F, 1F);
+ p48.setTextureSize(24, 24);
+ p48.mirror = true;
+
+ p49 = new ModelRenderer(this, 13, 7);
+ p49.addBox(0F, 0F, 0F, 3, 1, 1);
+ p49.setRotationPoint(14F, 8F, 2F);
+ p49.setTextureSize(24, 24);
+ p49.mirror = true;
+
+ p50 = new ModelRenderer(this, 16, 7);
+ p50.addBox(0F, 0F, 0F, 3, 1, 1);
+ p50.setRotationPoint(17F, 8F, 3F);
+ p50.setTextureSize(24, 24);
+ p50.mirror = true;
+
+ p51 = new ModelRenderer(this, 19, 7);
+ p51.addBox(0F, 0F, 0F, 2, 1, 1);
+ p51.setRotationPoint(20F, 8F, 4F);
+ p51.setTextureSize(24, 24);
+ p51.mirror = true;
+
+ p52 = new ModelRenderer(this, 2, 8);
+ p52.addBox(0F, 0F, 0F, 2, 1, 1);
+ p52.setRotationPoint(3F, 9F, 4F);
+ p52.setTextureSize(24, 24);
+ p52.mirror = true;
+
+ p53 = new ModelRenderer(this, 4, 8);
+ p53.addBox(0F, 0F, 0F, 3, 1, 1);
+ p53.setRotationPoint(5F, 9F, 3F);
+ p53.setTextureSize(24, 24);
+ p53.mirror = true;
+
+ p54 = new ModelRenderer(this, 7, 8);
+ p54.addBox(0F, 0F, 0F, 3, 1, 1);
+ p54.setRotationPoint(8F, 9F, 2F);
+ p54.setTextureSize(24, 24);
+ p54.mirror = true;
+
+ p55 = new ModelRenderer(this, 10, 8);
+ p55.addBox(0F, 0F, 0F, 3, 1, 1);
+ p55.setRotationPoint(11F, 9F, 1F);
+ p55.setTextureSize(24, 24);
+ p55.mirror = true;
+
+ p56 = new ModelRenderer(this, 13, 8);
+ p56.addBox(0F, 0F, 0F, 3, 1, 1);
+ p56.setRotationPoint(14F, 9F, 2F);
+ p56.setTextureSize(24, 24);
+ p56.mirror = true;
+
+ p57 = new ModelRenderer(this, 16, 8);
+ p57.addBox(0F, 0F, 0F, 3, 1, 1);
+ p57.setRotationPoint(17F, 9F, 3F);
+ p57.setTextureSize(24, 24);
+ p57.mirror = true;
+
+ p58 = new ModelRenderer(this, 19, 8);
+ p58.addBox(0F, 0F, 0F, 2, 1, 1);
+ p58.setRotationPoint(20F, 9F, 4F);
+ p58.setTextureSize(24, 24);
+ p58.mirror = true;
+
+ p59 = new ModelRenderer(this, 2, 9);
+ p59.addBox(0F, 0F, 0F, 2, 1, 1);
+ p59.setRotationPoint(3F, 10F, 4F);
+ p59.setTextureSize(24, 24);
+ p59.mirror = true;
+
+ p60 = new ModelRenderer(this, 4, 9);
+ p60.addBox(0F, 0F, 0F, 3, 1, 1);
+ p60.setRotationPoint(5F, 10F, 3F);
+ p60.setTextureSize(24, 24);
+ p60.mirror = true;
+
+ p61 = new ModelRenderer(this, 7, 9);
+ p61.addBox(0F, 0F, 0F, 3, 1, 1);
+ p61.setRotationPoint(8F, 10F, 2F);
+ p61.setTextureSize(24, 24);
+ p61.mirror = true;
+
+ p62 = new ModelRenderer(this, 10, 9);
+ p62.addBox(0F, 0F, 0F, 3, 1, 1);
+ p62.setRotationPoint(11F, 10F, 1F);
+ p62.setTextureSize(24, 24);
+ p62.mirror = true;
+
+ p63 = new ModelRenderer(this, 13, 9);
+ p63.addBox(0F, 0F, 0F, 3, 1, 1);
+ p63.setRotationPoint(14F, 10F, 2F);
+ p63.setTextureSize(24, 24);
+ p63.mirror = true;
+
+ p64 = new ModelRenderer(this, 16, 9);
+ p64.addBox(0F, 0F, 0F, 3, 1, 1);
+ p64.setRotationPoint(17F, 10F, 3F);
+ p64.setTextureSize(24, 24);
+ p64.mirror = true;
+
+ p65 = new ModelRenderer(this, 19, 9);
+ p65.addBox(0F, 0F, 0F, 2, 1, 1);
+ p65.setRotationPoint(20F, 10F, 4F);
+ p65.setTextureSize(24, 24);
+ p65.mirror = true;
+
+ p66 = new ModelRenderer(this, 2, 10);
+ p66.addBox(0F, 0F, 0F, 2, 1, 1);
+ p66.setRotationPoint(3F, 11F, 4F);
+ p66.setTextureSize(24, 24);
+ p66.mirror = true;
+
+ p67 = new ModelRenderer(this, 4, 10);
+ p67.addBox(0F, 0F, 0F, 3, 1, 1);
+ p67.setRotationPoint(5F, 11F, 3F);
+ p67.setTextureSize(24, 24);
+ p67.mirror = true;
+
+ p68 = new ModelRenderer(this, 7, 10);
+ p68.addBox(0F, 0F, 0F, 3, 1, 1);
+ p68.setRotationPoint(8F, 11F, 2F);
+ p68.setTextureSize(24, 24);
+ p68.mirror = true;
+
+ p69 = new ModelRenderer(this, 10, 10);
+ p69.addBox(0F, 0F, 0F, 3, 1, 1);
+ p69.setRotationPoint(11F, 11F, 1F);
+ p69.setTextureSize(24, 24);
+ p69.mirror = true;
+
+ p70 = new ModelRenderer(this, 13, 10);
+ p70.addBox(0F, 0F, 0F, 3, 1, 1);
+ p70.setRotationPoint(14F, 11F, 2F);
+ p70.setTextureSize(24, 24);
+ p70.mirror = true;
+
+ p71 = new ModelRenderer(this, 16, 10);
+ p71.addBox(0F, 0F, 0F, 3, 1, 1);
+ p71.setRotationPoint(17F, 11F, 3F);
+ p71.setTextureSize(24, 24);
+ p71.mirror = true;
+
+ p72 = new ModelRenderer(this, 19, 10);
+ p72.addBox(0F, 0F, 0F, 2, 1, 1);
+ p72.setRotationPoint(20F, 11F, 4F);
+ p72.setTextureSize(24, 24);
+ p72.mirror = true;
+
+ p73 = new ModelRenderer(this, 2, 11);
+ p73.addBox(0F, 0F, 0F, 2, 1, 1);
+ p73.setRotationPoint(3F, 12F, 4F);
+ p73.setTextureSize(24, 24);
+ p73.mirror = true;
+
+ p74 = new ModelRenderer(this, 4, 11);
+ p74.addBox(0F, 0F, 0F, 3, 1, 1);
+ p74.setRotationPoint(5F, 12F, 3F);
+ p74.setTextureSize(24, 24);
+ p74.mirror = true;
+
+ p75 = new ModelRenderer(this, 7, 11);
+ p75.addBox(0F, 0F, 0F, 3, 1, 1);
+ p75.setRotationPoint(8F, 12F, 2F);
+ p75.setTextureSize(24, 24);
+ p75.mirror = true;
+
+ p76 = new ModelRenderer(this, 10, 11);
+ p76.addBox(0F, 0F, 0F, 3, 1, 1);
+ p76.setRotationPoint(11F, 12F, 1F);
+ p76.setTextureSize(24, 24);
+ p76.mirror = true;
+
+ p77 = new ModelRenderer(this, 13, 11);
+ p77.addBox(0F, 0F, 0F, 3, 1, 1);
+ p77.setRotationPoint(14F, 12F, 2F);
+ p77.setTextureSize(24, 24);
+ p77.mirror = true;
+
+ p78 = new ModelRenderer(this, 16, 11);
+ p78.addBox(0F, 0F, 0F, 3, 1, 1);
+ p78.setRotationPoint(17F, 12F, 3F);
+ p78.setTextureSize(24, 24);
+ p78.mirror = true;
+
+ p79 = new ModelRenderer(this, 19, 11);
+ p79.addBox(0F, 0F, 0F, 2, 1, 1);
+ p79.setRotationPoint(20F, 12F, 4F);
+ p79.setTextureSize(24, 24);
+ p79.mirror = true;
+
+ p80 = new ModelRenderer(this, 3, 12);
+ p80.addBox(0F, 0F, 0F, 1, 1, 1);
+ p80.setRotationPoint(4F, 13F, 4F);
+ p80.setTextureSize(24, 24);
+ p80.mirror = true;
+
+ p81 = new ModelRenderer(this, 4, 12);
+ p81.addBox(0F, 0F, 0F, 3, 1, 1);
+ p81.setRotationPoint(5F, 13F, 3F);
+ p81.setTextureSize(24, 24);
+ p81.mirror = true;
+
+ p82 = new ModelRenderer(this, 7, 12);
+ p82.addBox(0F, 0F, 0F, 3, 1, 1);
+ p82.setRotationPoint(8F, 13F, 2F);
+ p82.setTextureSize(24, 24);
+ p82.mirror = true;
+
+ p83 = new ModelRenderer(this, 10, 12);
+ p83.addBox(0F, 0F, 0F, 3, 1, 1);
+ p83.setRotationPoint(11F, 13F, 1F);
+ p83.setTextureSize(24, 24);
+ p83.mirror = true;
+
+ p84 = new ModelRenderer(this, 13, 12);
+ p84.addBox(0F, 0F, 0F, 3, 1, 1);
+ p84.setRotationPoint(14F, 13F, 2F);
+ p84.setTextureSize(24, 24);
+ p84.mirror = true;
+
+ p85 = new ModelRenderer(this, 16, 12);
+ p85.addBox(0F, 0F, 0F, 3, 1, 1);
+ p85.setRotationPoint(17F, 13F, 3F);
+ p85.setTextureSize(24, 24);
+ p85.mirror = true;
+
+ p86 = new ModelRenderer(this, 19, 12);
+ p86.addBox(0F, 0F, 0F, 1, 1, 1);
+ p86.setRotationPoint(20F, 13F, 4F);
+ p86.setTextureSize(24, 24);
+ p86.mirror = true;
+
+ p87 = new ModelRenderer(this, 3, 13);
+ p87.addBox(0F, 0F, 0F, 1, 1, 1);
+ p87.setRotationPoint(4F, 14F, 4F);
+ p87.setTextureSize(24, 24);
+ p87.mirror = true;
+
+ p88 = new ModelRenderer(this, 4, 13);
+ p88.addBox(0F, 0F, 0F, 3, 1, 1);
+ p88.setRotationPoint(5F, 14F, 3F);
+ p88.setTextureSize(24, 24);
+ p88.mirror = true;
+
+ p89 = new ModelRenderer(this, 7, 13);
+ p89.addBox(0F, 0F, 0F, 3, 1, 1);
+ p89.setRotationPoint(8F, 14F, 2F);
+ p89.setTextureSize(24, 24);
+ p89.mirror = true;
+
+ p90 = new ModelRenderer(this, 10, 13);
+ p90.addBox(0F, 0F, 0F, 3, 1, 1);
+ p90.setRotationPoint(11F, 14F, 1F);
+ p90.setTextureSize(24, 24);
+ p90.mirror = true;
+
+ p91 = new ModelRenderer(this, 13, 13);
+ p91.addBox(0F, 0F, 0F, 3, 1, 1);
+ p91.setRotationPoint(14F, 14F, 2F);
+ p91.setTextureSize(24, 24);
+ p91.mirror = true;
+
+ p92 = new ModelRenderer(this, 16, 13);
+ p92.addBox(0F, 0F, 0F, 3, 1, 1);
+ p92.setRotationPoint(17F, 14F, 3F);
+ p92.setTextureSize(24, 24);
+ p92.mirror = true;
+
+ p93 = new ModelRenderer(this, 19, 13);
+ p93.addBox(0F, 0F, 0F, 1, 1, 1);
+ p93.setRotationPoint(20F, 14F, 4F);
+ p93.setTextureSize(24, 24);
+ p93.mirror = true;
+
+ p94 = new ModelRenderer(this, 3, 14);
+ p94.addBox(0F, 0F, 0F, 1, 1, 1);
+ p94.setRotationPoint(4F, 15F, 4F);
+ p94.setTextureSize(24, 24);
+ p94.mirror = true;
+
+ p95 = new ModelRenderer(this, 4, 14);
+ p95.addBox(0F, 0F, 0F, 3, 1, 1);
+ p95.setRotationPoint(5F, 15F, 3F);
+ p95.setTextureSize(24, 24);
+ p95.mirror = true;
+
+ p96 = new ModelRenderer(this, 7, 14);
+ p96.addBox(0F, 0F, 0F, 3, 1, 1);
+ p96.setRotationPoint(8F, 15F, 2F);
+ p96.setTextureSize(24, 24);
+ p96.mirror = true;
+
+ p97 = new ModelRenderer(this, 10, 14);
+ p97.addBox(0F, 0F, 0F, 3, 1, 1);
+ p97.setRotationPoint(11F, 15F, 1F);
+ p97.setTextureSize(24, 24);
+ p97.mirror = true;
+
+ p98 = new ModelRenderer(this, 13, 14);
+ p98.addBox(0F, 0F, 0F, 3, 1, 1);
+ p98.setRotationPoint(14F, 15F, 2F);
+ p98.setTextureSize(24, 24);
+ p98.mirror = true;
+
+ p99 = new ModelRenderer(this, 16, 14);
+ p99.addBox(0F, 0F, 0F, 3, 1, 1);
+ p99.setRotationPoint(17F, 15F, 3F);
+ p99.setTextureSize(24, 24);
+ p99.mirror = true;
+
+ p100 = new ModelRenderer(this, 19, 14);
+ p100.addBox(0F, 0F, 0F, 1, 1, 1);
+ p100.setRotationPoint(20F, 15F, 4F);
+ p100.setTextureSize(24, 24);
+ p100.mirror = true;
+
+ p101 = new ModelRenderer(this, 4, 15);
+ p101.addBox(0F, 0F, 0F, 3, 1, 1);
+ p101.setRotationPoint(5F, 16F, 3F);
+ p101.setTextureSize(24, 24);
+ p101.mirror = true;
+
+ p102 = new ModelRenderer(this, 7, 15);
+ p102.addBox(0F, 0F, 0F, 3, 1, 1);
+ p102.setRotationPoint(8F, 16F, 2F);
+ p102.setTextureSize(24, 24);
+ p102.mirror = true;
+
+ p103 = new ModelRenderer(this, 10, 15);
+ p103.addBox(0F, 0F, 0F, 3, 1, 1);
+ p103.setRotationPoint(11F, 16F, 1F);
+ p103.setTextureSize(24, 24);
+ p103.mirror = true;
+
+ p104 = new ModelRenderer(this, 13, 15);
+ p104.addBox(0F, 0F, 0F, 3, 1, 1);
+ p104.setRotationPoint(14F, 16F, 2F);
+ p104.setTextureSize(24, 24);
+ p104.mirror = true;
+
+ p105 = new ModelRenderer(this, 16, 15);
+ p105.addBox(0F, 0F, 0F, 3, 1, 1);
+ p105.setRotationPoint(17F, 16F, 3F);
+ p105.setTextureSize(24, 24);
+ p105.mirror = true;
+
+ p106 = new ModelRenderer(this, 4, 16);
+ p106.addBox(0F, 0F, 0F, 3, 1, 1);
+ p106.setRotationPoint(5F, 17F, 3F);
+ p106.setTextureSize(24, 24);
+ p106.mirror = true;
+
+ p107 = new ModelRenderer(this, 7, 16);
+ p107.addBox(0F, 0F, 0F, 3, 1, 1);
+ p107.setRotationPoint(8F, 17F, 2F);
+ p107.setTextureSize(24, 24);
+ p107.mirror = true;
+
+ p108 = new ModelRenderer(this, 10, 16);
+ p108.addBox(0F, 0F, 0F, 3, 1, 1);
+ p108.setRotationPoint(11F, 17F, 1F);
+ p108.setTextureSize(24, 24);
+ p108.mirror = true;
+
+ p109 = new ModelRenderer(this, 13, 16);
+ p109.addBox(0F, 0F, 0F, 3, 1, 1);
+ p109.setRotationPoint(14F, 17F, 2F);
+ p109.setTextureSize(24, 24);
+ p109.mirror = true;
+
+ p110 = new ModelRenderer(this, 16, 16);
+ p110.addBox(0F, 0F, 0F, 3, 1, 1);
+ p110.setRotationPoint(17F, 17F, 3F);
+ p110.setTextureSize(24, 24);
+ p110.mirror = true;
+
+ p111 = new ModelRenderer(this, 5, 17);
+ p111.addBox(0F, 0F, 0F, 2, 1, 1);
+ p111.setRotationPoint(6F, 18F, 3F);
+ p111.setTextureSize(24, 24);
+ p111.mirror = true;
+
+ p112 = new ModelRenderer(this, 7, 17);
+ p112.addBox(0F, 0F, 0F, 3, 1, 1);
+ p112.setRotationPoint(8F, 18F, 2F);
+ p112.setTextureSize(24, 24);
+ p112.mirror = true;
+
+ p113 = new ModelRenderer(this, 10, 17);
+ p113.addBox(0F, 0F, 0F, 3, 1, 1);
+ p113.setRotationPoint(11F, 18F, 1F);
+ p113.setTextureSize(24, 24);
+ p113.mirror = true;
+
+ p114 = new ModelRenderer(this, 13, 17);
+ p114.addBox(0F, 0F, 0F, 3, 1, 1);
+ p114.setRotationPoint(14F, 18F, 2F);
+ p114.setTextureSize(24, 24);
+ p114.mirror = true;
+
+ p115 = new ModelRenderer(this, 16, 17);
+ p115.addBox(0F, 0F, 0F, 2, 1, 1);
+ p115.setRotationPoint(17F, 18F, 3F);
+ p115.setTextureSize(24, 24);
+ p115.mirror = true;
+
+ p116 = new ModelRenderer(this, 6, 18);
+ p116.addBox(0F, 0F, 0F, 1, 1, 1);
+ p116.setRotationPoint(7F, 19F, 3F);
+ p116.setTextureSize(24, 24);
+ p116.mirror = true;
+
+ p117 = new ModelRenderer(this, 7, 18);
+ p117.addBox(0F, 0F, 0F, 3, 1, 1);
+ p117.setRotationPoint(8F, 19F, 2F);
+ p117.setTextureSize(24, 24);
+ p117.mirror = true;
+
+ p118 = new ModelRenderer(this, 10, 18);
+ p118.addBox(0F, 0F, 0F, 3, 1, 1);
+ p118.setRotationPoint(11F, 19F, 1F);
+ p118.setTextureSize(24, 24);
+ p118.mirror = true;
+
+ p119 = new ModelRenderer(this, 13, 18);
+ p119.addBox(0F, 0F, 0F, 3, 1, 1);
+ p119.setRotationPoint(14F, 19F, 2F);
+ p119.setTextureSize(24, 24);
+ p119.mirror = true;
+
+ p120 = new ModelRenderer(this, 16, 18);
+ p120.addBox(0F, 0F, 0F, 1, 1, 1);
+ p120.setRotationPoint(17F, 19F, 3F);
+ p120.setTextureSize(24, 24);
+ p120.mirror = true;
+
+ p121 = new ModelRenderer(this, 7, 19);
+ p121.addBox(0F, 0F, 0F, 3, 1, 1);
+ p121.setRotationPoint(8F, 20F, 2F);
+ p121.setTextureSize(24, 24);
+ p121.mirror = true;
+
+ p122 = new ModelRenderer(this, 10, 19);
+ p122.addBox(0F, 0F, 0F, 3, 1, 1);
+ p122.setRotationPoint(11F, 20F, 1F);
+ p122.setTextureSize(24, 24);
+ p122.mirror = true;
+
+ p123 = new ModelRenderer(this, 13, 19);
+ p123.addBox(0F, 0F, 0F, 3, 1, 1);
+ p123.setRotationPoint(14F, 20F, 2F);
+ p123.setTextureSize(24, 24);
+ p123.mirror = true;
+
+ p124 = new ModelRenderer(this, 8, 20);
+ p124.addBox(0F, 0F, 0F, 2, 1, 1);
+ p124.setRotationPoint(9F, 21F, 2F);
+ p124.setTextureSize(24, 24);
+ p124.mirror = true;
+
+ p125 = new ModelRenderer(this, 10, 20);
+ p125.addBox(0F, 0F, 0F, 3, 1, 1);
+ p125.setRotationPoint(11F, 21F, 1F);
+ p125.setTextureSize(24, 24);
+ p125.mirror = true;
+
+ p126 = new ModelRenderer(this, 13, 20);
+ p126.addBox(0F, 0F, 0F, 2, 1, 1);
+ p126.setRotationPoint(14F, 21F, 2F);
+ p126.setTextureSize(24, 24);
+ p126.mirror = true;
+
+ }
+ public void render(Entity entity, float f1, float f2, float f3, float f4, float f5, float f6)
+ {
+ super.render(entity, f1, f2, f3, f4, f5, f6);
+ setRotationAngles(f1, f2, f3, f4, f5, f6);
+ p0.render(f6);
+ p1.render(f6);
+ p2.render(f6);
+ p3.render(f6);
+ p4.render(f6);
+ p5.render(f6);
+ p6.render(f6);
+ p7.render(f6);
+ p8.render(f6);
+ p9.render(f6);
+ p10.render(f6);
+ p11.render(f6);
+ p12.render(f6);
+ p13.render(f6);
+ p14.render(f6);
+ p15.render(f6);
+ p16.render(f6);
+ p17.render(f6);
+ p18.render(f6);
+ p19.render(f6);
+ p20.render(f6);
+ p21.render(f6);
+ p22.render(f6);
+ p23.render(f6);
+ p24.render(f6);
+ p25.render(f6);
+ p26.render(f6);
+ p27.render(f6);
+ p28.render(f6);
+ p29.render(f6);
+ p30.render(f6);
+ p31.render(f6);
+ p32.render(f6);
+ p33.render(f6);
+ p34.render(f6);
+ p35.render(f6);
+ p36.render(f6);
+ p37.render(f6);
+ p38.render(f6);
+ p39.render(f6);
+ p40.render(f6);
+ p41.render(f6);
+ p42.render(f6);
+ p43.render(f6);
+ p44.render(f6);
+ p45.render(f6);
+ p46.render(f6);
+ p47.render(f6);
+ p48.render(f6);
+ p49.render(f6);
+ p50.render(f6);
+ p51.render(f6);
+ p52.render(f6);
+ p53.render(f6);
+ p54.render(f6);
+ p55.render(f6);
+ p56.render(f6);
+ p57.render(f6);
+ p58.render(f6);
+ p59.render(f6);
+ p60.render(f6);
+ p61.render(f6);
+ p62.render(f6);
+ p63.render(f6);
+ p64.render(f6);
+ p65.render(f6);
+ p66.render(f6);
+ p67.render(f6);
+ p68.render(f6);
+ p69.render(f6);
+ p70.render(f6);
+ p71.render(f6);
+ p72.render(f6);
+ p73.render(f6);
+ p74.render(f6);
+ p75.render(f6);
+ p76.render(f6);
+ p77.render(f6);
+ p78.render(f6);
+ p79.render(f6);
+ p80.render(f6);
+ p81.render(f6);
+ p82.render(f6);
+ p83.render(f6);
+ p84.render(f6);
+ p85.render(f6);
+ p86.render(f6);
+ p87.render(f6);
+ p88.render(f6);
+ p89.render(f6);
+ p90.render(f6);
+ p91.render(f6);
+ p92.render(f6);
+ p93.render(f6);
+ p94.render(f6);
+ p95.render(f6);
+ p96.render(f6);
+ p97.render(f6);
+ p98.render(f6);
+ p99.render(f6);
+ p100.render(f6);
+ p101.render(f6);
+ p102.render(f6);
+ p103.render(f6);
+ p104.render(f6);
+ p105.render(f6);
+ p106.render(f6);
+ p107.render(f6);
+ p108.render(f6);
+ p109.render(f6);
+ p110.render(f6);
+ p111.render(f6);
+ p112.render(f6);
+ p113.render(f6);
+ p114.render(f6);
+ p115.render(f6);
+ p116.render(f6);
+ p117.render(f6);
+ p118.render(f6);
+ p119.render(f6);
+ p120.render(f6);
+ p121.render(f6);
+ p122.render(f6);
+ p123.render(f6);
+ p124.render(f6);
+ p125.render(f6);
+ p126.render(f6);
+ }
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelMolder.java b/src/main/java/darkknight/jewelrycraft/model/ModelMolder.java
new file mode 100644
index 0000000..f2bc335
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelMolder.java
@@ -0,0 +1,101 @@
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+
+public class ModelMolder extends ModelBase
+{
+ // fields
+ ModelRenderer Base;
+ ModelRenderer Side;
+ ModelRenderer Side1;
+ ModelRenderer Side2;
+ ModelRenderer Side3;
+
+ /**
+ *
+ */
+ public ModelMolder()
+ {
+ textureWidth = 64;
+ textureHeight = 32;
+ Base = new ModelRenderer(this, 0, 0);
+ Base.addBox(0F, 0F, 0F, 10, 1, 10);
+ Base.setRotationPoint(-5F, 23F, -5F);
+ Base.setTextureSize(64, 32);
+ Base.mirror = true;
+ setRotation(Base, 0F, 0F, 0F);
+ Side = new ModelRenderer(this, 0, 13);
+ Side.addBox(0F, 0F, 0F, 10, 2, 1);
+ Side.setRotationPoint(-5F, 21F, 5F);
+ Side.setTextureSize(64, 32);
+ Side.mirror = true;
+ setRotation(Side, 0F, 0F, 0F);
+ Side1 = new ModelRenderer(this, 0, 13);
+ Side1.addBox(0F, 0F, 0F, 10, 2, 1);
+ Side1.setRotationPoint(-5F, 21F, -6F);
+ Side1.setTextureSize(64, 32);
+ Side1.mirror = true;
+ setRotation(Side1, 0F, 0F, 0F);
+ Side2 = new ModelRenderer(this, 41, 0);
+ Side2.addBox(0F, 0F, 0F, 1, 2, 10);
+ Side2.setRotationPoint(-6F, 21F, -5F);
+ Side2.setTextureSize(64, 32);
+ Side2.mirror = true;
+ setRotation(Side2, 0F, 0F, 0F);
+ Side3 = new ModelRenderer(this, 41, 0);
+ Side3.addBox(0F, 0F, 0F, 1, 2, 10);
+ Side3.setRotationPoint(5F, 21F, -5F);
+ Side3.setTextureSize(64, 32);
+ Side3.mirror = true;
+ setRotation(Side3, 0F, 0F, 0F);
+ }
+
+ /**
+ * @param entity
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ @Override
+ public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.render(entity, f, f1, f2, f3, f4, f5);
+ setRotationAngles(f, f1, f2, f3, f4, f5);
+ Base.render(f5);
+ Side.render(f5);
+ Side1.render(f5);
+ Side2.render(f5);
+ Side3.render(f5);
+ }
+
+ /**
+ * @param model
+ * @param x
+ * @param y
+ * @param z
+ */
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+
+ /**
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java b/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java
new file mode 100644
index 0000000..e396f72
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelShadowEye.java
@@ -0,0 +1,162 @@
+// Date: 9/26/2014 1:50:53 PM
+// Template version 1.1
+// Java generated by Techne
+// Keep in mind that you still need to fill in some blanks
+// - ZeuX
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+
+public class ModelShadowEye extends ModelBase
+{
+ // fields
+ ModelRenderer Eye;
+ ModelRenderer Platform1;
+ ModelRenderer Platform2;
+ ModelRenderer Atachement1;
+ ModelRenderer Atachement2;
+ ModelRenderer Cable1;
+ ModelRenderer Cable2;
+ ModelRenderer Cable3;
+ ModelRenderer Cable4;
+ float field_82221_e, field_82220_d;
+
+ /**
+ *
+ */
+ public ModelShadowEye()
+ {
+ textureWidth = 64;
+ textureHeight = 32;
+ Eye = new ModelRenderer(this, 0, 0);
+ Eye.addBox(-3.5F, -3.5F, -3.5F, 7, 7, 7);
+ Eye.setRotationPoint(0F, 17.5F, 0F);
+ Eye.setTextureSize(64, 32);
+ Eye.mirror = true;
+ setRotation(Eye, 0F, 0F, 0F);
+ Platform1 = new ModelRenderer(this, 0, 14);
+ Platform1.addBox(0F, 0F, 0F, 2, 2, 16);
+ Platform1.setRotationPoint(-1F, 11F, -8F);
+ Platform1.setTextureSize(64, 32);
+ Platform1.mirror = true;
+ setRotation(Platform1, 0F, 0F, 0F);
+ Platform2 = new ModelRenderer(this, 0, 14);
+ Platform2.addBox(0F, 0F, 0F, 2, 2, 16);
+ Platform2.setRotationPoint(-1F, 22F, -8F);
+ Platform2.setTextureSize(64, 32);
+ Platform2.mirror = true;
+ setRotation(Platform2, 0F, 0F, 0F);
+ Atachement1 = new ModelRenderer(this, 38, 0);
+ Atachement1.addBox(0F, 0F, 0F, 2, 2, 5);
+ Atachement1.setRotationPoint(-1F, 17F, -12F);
+ Atachement1.setTextureSize(64, 32);
+ Atachement1.mirror = true;
+ setRotation(Atachement1, 0F, 0F, 0F);
+ Atachement2 = new ModelRenderer(this, 38, 0);
+ Atachement2.addBox(0F, 0F, 0F, 2, 2, 5);
+ Atachement2.setRotationPoint(-1F, 17F, 7F);
+ Atachement2.setTextureSize(64, 32);
+ Atachement2.mirror = true;
+ setRotation(Atachement2, 0F, 0F, 0F);
+ Cable1 = new ModelRenderer(this, 29, 0);
+ Cable1.addBox(0F, 0F, 0F, 2, 6, 2);
+ Cable1.setRotationPoint(-1F, 12F, 4.2F);
+ Cable1.setTextureSize(64, 32);
+ Cable1.mirror = true;
+ setRotation(Cable1, 0.2617994F, 0F, 0F);
+ Cable2 = new ModelRenderer(this, 29, 0);
+ Cable2.addBox(0F, 0F, -1F, 2, 6, 2);
+ Cable2.setRotationPoint(-1F, 12F, -5.2F);
+ Cable2.setTextureSize(64, 32);
+ Cable2.mirror = true;
+ setRotation(Cable2, -0.2617994F, 0F, 0F);
+ Cable3 = new ModelRenderer(this, 29, 0);
+ Cable3.addBox(0F, 0F, 0F, 2, 6, 2);
+ Cable3.setRotationPoint(-1F, 23F, -3.9F);
+ Cable3.setTextureSize(64, 32);
+ Cable3.mirror = true;
+ setRotation(Cable3, -2.792527F, 0F, 0F);
+ Cable4 = new ModelRenderer(this, 29, 0);
+ Cable4.addBox(0F, 0F, -1F, 2, 6, 2);
+ Cable4.setRotationPoint(-1F, 23F, 4.9F);
+ Cable4.setTextureSize(64, 32);
+ Cable4.mirror = true;
+ setRotation(Cable4, 2.792527F, 0F, 0F);
+ }
+
+ /**
+ * @param entity
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ @Override
+ public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ Eye.render(f5);
+ Platform1.render(f5);
+ Platform2.render(f5);
+ Atachement1.render(f5);
+ Atachement2.render(f5);
+ Cable1.render(f5);
+ Cable2.render(f5);
+ Cable3.render(f5);
+ Cable4.render(f5);
+ if (entity != null){
+ float x = (float)(f - entity.posX);
+ float y = (float)(f1 - entity.posY);
+ float z = (float)(f2 - entity.posZ);
+ if (f4 == 4){
+ if (f3 == 0) if (z < 0){
+ Eye.rotateAngleY = (float)Math.asin(x / Math.sqrt(x * x + z * z)) + 135f;
+ Eye.rotateAngleZ = (float)-Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4));
+ }else{
+ Eye.rotateAngleY = (float)-Math.asin(x / Math.sqrt(x * x + z * z));
+ Eye.rotateAngleZ = (float)Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4));
+ }
+ if (f3 == 1) if (x < 0){
+ Eye.rotateAngleY = (float)-Math.asin(z / Math.sqrt(x * x + z * z));
+ Eye.rotateAngleZ = (float)Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4));
+ }else{
+ Eye.rotateAngleY = (float)Math.asin(z / Math.sqrt(x * x + z * z)) + 135f;
+ Eye.rotateAngleZ = (float)-Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4));
+ }
+ if (f3 == 2) if (z < 0){
+ Eye.rotateAngleY = (float)Math.asin(x / Math.sqrt(x * x + z * z));
+ Eye.rotateAngleZ = (float)Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4));
+ }else{
+ Eye.rotateAngleY = (float)-Math.asin(x / Math.sqrt(x * x + z * z)) + 135f;
+ Eye.rotateAngleZ = (float)-Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4));
+ }
+ if (f3 == 3) if (x < 0){
+ Eye.rotateAngleY = (float)-Math.asin(z / Math.sqrt(x * x + z * z)) + 135f;
+ Eye.rotateAngleZ = (float)-Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4));
+ }else{
+ Eye.rotateAngleY = (float)Math.asin(z / Math.sqrt(x * x + z * z));
+ Eye.rotateAngleZ = (float)Math.asin((y + 1) / Math.sqrt(y * y + 4 * 4));
+ }
+ }else{
+ Eye.rotateAngleY = 0f;
+ Eye.rotateAngleZ = 0f;
+ }
+ }
+ }
+
+ /**
+ * @param model
+ * @param x
+ * @param y
+ * @param z
+ */
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelShadowHand.java b/src/main/java/darkknight/jewelrycraft/model/ModelShadowHand.java
new file mode 100644
index 0000000..02d7eea
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelShadowHand.java
@@ -0,0 +1,29 @@
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.util.ResourceLocation;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class ModelShadowHand extends ModelHandPedestal
+{
+
+ /**
+ * @param resetResourceLocation
+ */
+ public ModelShadowHand(ResourceLocation resetResourceLocation)
+ {
+ super(resetResourceLocation);
+ }
+
+ /**
+ *
+ */
+ @Override
+ protected void initPedestalRenderers()
+ {
+ plinth = createModelRenderer(0, 0).addBox(-3, 6, -3, 6, 2, 6);
+ base = createModelRenderer(0, 15).addBox(-2, 0, -2, 4, 6, 4);
+ shaft = createModelRenderer(28, 0).addBox(-3, -4, -3, 6, 4, 6);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/model/ModelSmelter.java b/src/main/java/darkknight/jewelrycraft/model/ModelSmelter.java
new file mode 100644
index 0000000..8fc9c11
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/model/ModelSmelter.java
@@ -0,0 +1,301 @@
+package darkknight.jewelrycraft.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+
+public class ModelSmelter extends ModelBase
+{
+ // fields
+ ModelRenderer Support1;
+ ModelRenderer Support2;
+ ModelRenderer Hold1;
+ ModelRenderer Hold2;
+ ModelRenderer SmelterBase;
+ ModelRenderer SmelterSide1;
+ ModelRenderer SmelterSide2;
+ ModelRenderer SmelterSide3;
+ ModelRenderer SmelterSide4;
+ ModelRenderer SmelterSide5;
+ ModelRenderer SmelterSide6;
+ ModelRenderer SmelterSide7;
+ ModelRenderer SmelterSide8;
+ ModelRenderer SmelterSide9;
+ ModelRenderer SmelterSide10;
+ ModelRenderer SmelterSide11;
+ ModelRenderer SmelterSide12;
+ ModelRenderer HeatSourceSide1;
+ ModelRenderer HeatSourceSide2;
+ ModelRenderer HeatSourceSide3;
+ ModelRenderer HeatSourceSide4;
+ ModelRenderer HeatSourceSide5;
+ ModelRenderer HeatSourceBase;
+ ModelRenderer HeatSourceSide6;
+ ModelRenderer HeatSourceSide7;
+ ModelRenderer HeatSourceSide8;
+ ModelRenderer HeatSourceSide9;
+ ModelRenderer HeatSourceSide10;
+ ModelRenderer HeatSourceSide11;
+ ModelRenderer HeatSourceSide12;
+
+ /**
+ *
+ */
+ public ModelSmelter()
+ {
+ textureWidth = 64;
+ textureHeight = 32;
+ Support1 = new ModelRenderer(this, 0, 0);
+ Support1.addBox(0F, 0F, 0F, 2, 15, 3);
+ Support1.setRotationPoint(6F, 9F, -1F);
+ Support1.setTextureSize(64, 32);
+ Support1.mirror = true;
+ setRotation(Support1, 0F, 0F, 0F);
+ Support2 = new ModelRenderer(this, 0, 0);
+ Support2.addBox(0F, 0F, 0F, 2, 15, 3);
+ Support2.setRotationPoint(-8F, 9F, -1F);
+ Support2.setTextureSize(64, 32);
+ Support2.mirror = true;
+ setRotation(Support2, 0F, 0F, 0F);
+ Hold1 = new ModelRenderer(this, 0, 0);
+ Hold1.addBox(0F, 0F, 0F, 2, 1, 1);
+ Hold1.setRotationPoint(4F, 11F, 0F);
+ Hold1.setTextureSize(64, 32);
+ Hold1.mirror = true;
+ setRotation(Hold1, 0F, 0F, 0F);
+ Hold2 = new ModelRenderer(this, 0, 0);
+ Hold2.addBox(0F, 0F, 0F, 2, 1, 1);
+ Hold2.setRotationPoint(-6F, 11F, 0F);
+ Hold2.setTextureSize(64, 32);
+ Hold2.mirror = true;
+ setRotation(Hold2, 0F, 0F, 0F);
+ SmelterBase = new ModelRenderer(this, 0, 0);
+ SmelterBase.addBox(0F, 0F, 0F, 4, 1, 5);
+ SmelterBase.setRotationPoint(-2F, 18F, -2F);
+ SmelterBase.setTextureSize(64, 32);
+ SmelterBase.mirror = true;
+ setRotation(SmelterBase, 0F, 0F, 0F);
+ SmelterSide1 = new ModelRenderer(this, 0, 0);
+ SmelterSide1.addBox(0F, 0F, 0F, 4, 2, 1);
+ SmelterSide1.setRotationPoint(-2F, 16F, -3F);
+ SmelterSide1.setTextureSize(64, 32);
+ SmelterSide1.mirror = true;
+ setRotation(SmelterSide1, 0F, 0F, 0F);
+ SmelterSide2 = new ModelRenderer(this, 0, 0);
+ SmelterSide2.addBox(0F, 0F, 0F, 4, 2, 1);
+ SmelterSide2.setRotationPoint(-2F, 16F, 3F);
+ SmelterSide2.setTextureSize(64, 32);
+ SmelterSide2.mirror = true;
+ setRotation(SmelterSide2, 0F, 0F, 0F);
+ SmelterSide3 = new ModelRenderer(this, 0, 0);
+ SmelterSide3.addBox(0F, 0F, 0F, 1, 2, 5);
+ SmelterSide3.setRotationPoint(2F, 16F, -2F);
+ SmelterSide3.setTextureSize(64, 32);
+ SmelterSide3.mirror = true;
+ setRotation(SmelterSide3, 0F, 0F, 0F);
+ SmelterSide4 = new ModelRenderer(this, 0, 0);
+ SmelterSide4.addBox(0F, 0F, 0F, 1, 2, 5);
+ SmelterSide4.setRotationPoint(-3F, 16F, -2F);
+ SmelterSide4.setTextureSize(64, 32);
+ SmelterSide4.mirror = true;
+ setRotation(SmelterSide4, 0F, 0F, 0F);
+ SmelterSide5 = new ModelRenderer(this, 0, 0);
+ SmelterSide5.addBox(0F, 0F, 0F, 1, 7, 5);
+ SmelterSide5.setRotationPoint(3F, 9F, -2F);
+ SmelterSide5.setTextureSize(64, 32);
+ SmelterSide5.mirror = true;
+ setRotation(SmelterSide5, 0F, 0F, 0F);
+ SmelterSide6 = new ModelRenderer(this, 0, 0);
+ SmelterSide6.addBox(0F, 0F, 0F, 1, 7, 5);
+ SmelterSide6.setRotationPoint(-4F, 9F, -2F);
+ SmelterSide6.setTextureSize(64, 32);
+ SmelterSide6.mirror = true;
+ setRotation(SmelterSide6, 0F, 0F, 0F);
+ SmelterSide7 = new ModelRenderer(this, 0, 0);
+ SmelterSide7.addBox(0F, 0F, 0F, 1, 7, 1);
+ SmelterSide7.setRotationPoint(2F, 9F, 3F);
+ SmelterSide7.setTextureSize(64, 32);
+ SmelterSide7.mirror = true;
+ setRotation(SmelterSide7, 0F, 0F, 0F);
+ SmelterSide8 = new ModelRenderer(this, 0, 0);
+ SmelterSide8.addBox(0F, 0F, 0F, 1, 7, 1);
+ SmelterSide8.setRotationPoint(-3F, 9F, 3F);
+ SmelterSide8.setTextureSize(64, 32);
+ SmelterSide8.mirror = true;
+ setRotation(SmelterSide8, 0F, 0F, 0F);
+ SmelterSide9 = new ModelRenderer(this, 0, 0);
+ SmelterSide9.addBox(0F, 0F, 0F, 4, 7, 1);
+ SmelterSide9.setRotationPoint(-2F, 9F, 4F);
+ SmelterSide9.setTextureSize(64, 32);
+ SmelterSide9.mirror = true;
+ setRotation(SmelterSide9, 0F, 0F, 0F);
+ SmelterSide10 = new ModelRenderer(this, 0, 0);
+ SmelterSide10.addBox(0F, 0F, 0F, 4, 7, 1);
+ SmelterSide10.setRotationPoint(-2F, 9F, -4F);
+ SmelterSide10.setTextureSize(64, 32);
+ SmelterSide10.mirror = true;
+ setRotation(SmelterSide10, 0F, 0F, 0F);
+ SmelterSide11 = new ModelRenderer(this, 0, 0);
+ SmelterSide11.addBox(0F, 0F, 0F, 1, 7, 1);
+ SmelterSide11.setRotationPoint(2F, 9F, -3F);
+ SmelterSide11.setTextureSize(64, 32);
+ SmelterSide11.mirror = true;
+ setRotation(SmelterSide11, 0F, 0F, 0F);
+ SmelterSide12 = new ModelRenderer(this, 0, 0);
+ SmelterSide12.addBox(0F, 0F, 0F, 1, 7, 1);
+ SmelterSide12.setRotationPoint(-3F, 9F, -3F);
+ SmelterSide12.setTextureSize(64, 32);
+ SmelterSide12.mirror = true;
+ setRotation(SmelterSide12, 0F, 0F, 0F);
+ HeatSourceSide1 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide1.addBox(0F, 0F, 0F, 8, 2, 1);
+ HeatSourceSide1.setRotationPoint(-4F, 19F, 7F);
+ HeatSourceSide1.setTextureSize(64, 32);
+ HeatSourceSide1.mirror = true;
+ setRotation(HeatSourceSide1, 0F, 0F, 0F);
+ HeatSourceSide2 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide2.addBox(0F, 0F, 0F, 1, 2, 12);
+ HeatSourceSide2.setRotationPoint(-6F, 19F, -6F);
+ HeatSourceSide2.setTextureSize(64, 32);
+ HeatSourceSide2.mirror = true;
+ setRotation(HeatSourceSide2, 0F, 0F, 0F);
+ HeatSourceSide3 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide3.addBox(0F, 0F, 0F, 1, 2, 12);
+ HeatSourceSide3.setRotationPoint(5F, 19F, -6F);
+ HeatSourceSide3.setTextureSize(64, 32);
+ HeatSourceSide3.mirror = true;
+ setRotation(HeatSourceSide3, 0F, 0F, 0F);
+ HeatSourceSide4 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide4.addBox(0F, 0F, 0F, 1, 2, 12);
+ HeatSourceSide4.setRotationPoint(4F, 21F, -6F);
+ HeatSourceSide4.setTextureSize(64, 32);
+ HeatSourceSide4.mirror = true;
+ setRotation(HeatSourceSide4, 0F, 0F, 0F);
+ HeatSourceSide5 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide5.addBox(0F, 0F, 0F, 1, 2, 12);
+ HeatSourceSide5.setRotationPoint(-5F, 21F, -6F);
+ HeatSourceSide5.setTextureSize(64, 32);
+ HeatSourceSide5.mirror = true;
+ setRotation(HeatSourceSide5, 0F, 0F, 0F);
+ HeatSourceBase = new ModelRenderer(this, 0, 0);
+ HeatSourceBase.addBox(0F, 0F, 0F, 8, 1, 12);
+ HeatSourceBase.setRotationPoint(-4F, 23F, -6F);
+ HeatSourceBase.setTextureSize(64, 32);
+ HeatSourceBase.mirror = true;
+ setRotation(HeatSourceBase, 0F, 0F, 0F);
+ HeatSourceSide6 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide6.addBox(0F, 0F, 0F, 8, 2, 1);
+ HeatSourceSide6.setRotationPoint(-4F, 21F, -7F);
+ HeatSourceSide6.setTextureSize(64, 32);
+ HeatSourceSide6.mirror = true;
+ setRotation(HeatSourceSide6, 0F, 0F, 0F);
+ HeatSourceSide7 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide7.addBox(0F, 0F, 0F, 8, 2, 1);
+ HeatSourceSide7.setRotationPoint(-4F, 21F, 6F);
+ HeatSourceSide7.setTextureSize(64, 32);
+ HeatSourceSide7.mirror = true;
+ setRotation(HeatSourceSide7, 0F, 0F, 0F);
+ HeatSourceSide8 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide8.addBox(0F, 0F, 0F, 1, 2, 1);
+ HeatSourceSide8.setRotationPoint(-5F, 19F, 6F);
+ HeatSourceSide8.setTextureSize(64, 32);
+ HeatSourceSide8.mirror = true;
+ setRotation(HeatSourceSide8, 0F, 0F, 0F);
+ HeatSourceSide9 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide9.addBox(0F, 0F, 0F, 1, 2, 1);
+ HeatSourceSide9.setRotationPoint(4F, 19F, 6F);
+ HeatSourceSide9.setTextureSize(64, 32);
+ HeatSourceSide9.mirror = true;
+ setRotation(HeatSourceSide9, 0F, 0F, 0F);
+ HeatSourceSide10 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide10.addBox(0F, 0F, 0F, 1, 2, 1);
+ HeatSourceSide10.setRotationPoint(4F, 19F, -7F);
+ HeatSourceSide10.setTextureSize(64, 32);
+ HeatSourceSide10.mirror = true;
+ setRotation(HeatSourceSide10, 0F, 0F, 0F);
+ HeatSourceSide11 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide11.addBox(0F, 0F, 0F, 1, 2, 1);
+ HeatSourceSide11.setRotationPoint(-5F, 19F, -7F);
+ HeatSourceSide11.setTextureSize(64, 32);
+ HeatSourceSide11.mirror = true;
+ setRotation(HeatSourceSide11, 0F, 0F, 0F);
+ HeatSourceSide12 = new ModelRenderer(this, 0, 0);
+ HeatSourceSide12.addBox(0F, 0F, 0F, 8, 2, 1);
+ HeatSourceSide12.setRotationPoint(-4F, 19F, -8F);
+ HeatSourceSide12.setTextureSize(64, 32);
+ HeatSourceSide12.mirror = true;
+ setRotation(HeatSourceSide12, 0F, 0F, 0F);
+ }
+
+ /**
+ * @param entity
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ @Override
+ public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.render(entity, f, f1, f2, f3, f4, f5);
+ setRotationAngles(f, f1, f2, f3, f4, f5);
+ Support1.render(f5);
+ Support2.render(f5);
+ Hold1.render(f5);
+ Hold2.render(f5);
+ SmelterBase.render(f5);
+ SmelterSide1.render(f5);
+ SmelterSide2.render(f5);
+ SmelterSide3.render(f5);
+ SmelterSide4.render(f5);
+ SmelterSide5.render(f5);
+ SmelterSide6.render(f5);
+ SmelterSide7.render(f5);
+ SmelterSide8.render(f5);
+ SmelterSide9.render(f5);
+ SmelterSide10.render(f5);
+ SmelterSide11.render(f5);
+ SmelterSide12.render(f5);
+ HeatSourceSide1.render(f5);
+ HeatSourceSide2.render(f5);
+ HeatSourceSide3.render(f5);
+ HeatSourceSide4.render(f5);
+ HeatSourceSide5.render(f5);
+ HeatSourceBase.render(f5);
+ HeatSourceSide6.render(f5);
+ HeatSourceSide7.render(f5);
+ HeatSourceSide8.render(f5);
+ HeatSourceSide9.render(f5);
+ HeatSourceSide10.render(f5);
+ HeatSourceSide11.render(f5);
+ HeatSourceSide12.render(f5);
+ }
+
+ /**
+ * @param model
+ * @param x
+ * @param y
+ * @param z
+ */
+ private void setRotation(ModelRenderer model, float x, float y, float z)
+ {
+ model.rotateAngleX = x;
+ model.rotateAngleY = y;
+ model.rotateAngleZ = z;
+ }
+
+ /**
+ * @param f
+ * @param f1
+ * @param f2
+ * @param f3
+ * @param f4
+ * @param f5
+ */
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
+ {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketClearColorCache.java b/src/main/java/darkknight/jewelrycraft/network/PacketClearColorCache.java
new file mode 100644
index 0000000..4d8351c
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/network/PacketClearColorCache.java
@@ -0,0 +1,44 @@
+package darkknight.jewelrycraft.network;
+
+import io.netty.buffer.ByteBuf;
+import net.minecraft.nbt.NBTTagCompound;
+import cpw.mods.fml.common.network.simpleimpl.IMessage;
+import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import darkknight.jewelrycraft.JewelrycraftMod;
+
+public class PacketClearColorCache implements IMessage, IMessageHandler<PacketClearColorCache, IMessage>
+{
+
+ /**
+ *
+ */
+ public PacketClearColorCache()
+ {}
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketClearColorCache message, MessageContext ctx)
+ {
+ JewelrycraftMod.clientData = new NBTTagCompound();
+ return null;
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf)
+ {}
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketHandler.java b/src/main/java/darkknight/jewelrycraft/network/PacketHandler.java
new file mode 100644
index 0000000..3cbea83
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/network/PacketHandler.java
@@ -0,0 +1,4 @@
+package darkknight.jewelrycraft.network;
+
+public class PacketHandler
+{}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java b/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java
new file mode 100644
index 0000000..13d0969
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/network/PacketKeyPressEvent.java
@@ -0,0 +1,59 @@
+package darkknight.jewelrycraft.network;
+
+import io.netty.buffer.ByteBuf;
+import net.minecraft.entity.player.EntityPlayer;
+import cpw.mods.fml.common.network.simpleimpl.IMessage;
+import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import darkknight.jewelrycraft.JewelrycraftMod;
+
+public class PacketKeyPressEvent implements IMessage, IMessageHandler<PacketKeyPressEvent, IMessage>
+{
+ public int actionID;
+
+ /**
+ * @param id
+ */
+ public PacketKeyPressEvent(int id)
+ {
+ actionID = id;
+ }
+
+ /**
+ *
+ */
+ public PacketKeyPressEvent()
+ {}
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketKeyPressEvent message, MessageContext ctx)
+ {
+ EntityPlayer sender = ctx.getServerHandler().playerEntity;
+ // Jewelry inventory
+ if (message.actionID == 0) sender.openGui(JewelrycraftMod.instance, 2, sender.worldObj, (int)sender.posX, (int)sender.posY, (int)sender.posZ);
+ return null;
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf)
+ {
+ actionID = buf.readInt();
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf)
+ {
+ buf.writeInt(actionID);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketRequestLiquidData.java b/src/main/java/darkknight/jewelrycraft/network/PacketRequestLiquidData.java
new file mode 100644
index 0000000..ebcfdf4
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/network/PacketRequestLiquidData.java
@@ -0,0 +1,82 @@
+package darkknight.jewelrycraft.network;
+
+import io.netty.buffer.ByteBuf;
+import cpw.mods.fml.common.network.simpleimpl.IMessage;
+import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import darkknight.jewelrycraft.JewelrycraftMod;
+
+public class PacketRequestLiquidData implements IMessage, IMessageHandler<PacketRequestLiquidData, IMessage>
+{
+ int dimID, x, y, z;
+
+ /**
+ *
+ */
+ public PacketRequestLiquidData()
+ {}
+
+ /**
+ * @param dimID
+ * @param x
+ * @param y
+ * @param z
+ */
+ public PacketRequestLiquidData(int dimID, int x, int y, int z)
+ {
+ this.dimID = dimID;
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ }
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketRequestLiquidData message, MessageContext ctx)
+ {
+ String data = JewelrycraftMod.saveData.getString(message.x + " " + message.y + " " + message.z + " " + message.dimID);
+ String[] splitData = data.split(":");
+ IMessage replyPacket = null;
+ if (splitData.length == 3){
+ int itemID, itemDamage, color;
+ try{
+ itemID = Integer.parseInt(splitData[0]);
+ itemDamage = Integer.parseInt(splitData[1]);
+ color = Integer.parseInt(splitData[2]);
+ replyPacket = new PacketSendLiquidData(message, itemID, itemDamage, color);
+ }
+ catch(Exception e){
+ e.printStackTrace();
+ }
+ }
+ return replyPacket;
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf)
+ {
+ dimID = buf.readInt();
+ x = buf.readInt();
+ y = buf.readInt();
+ z = buf.readInt();
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf)
+ {
+ buf.writeInt(dimID);
+ buf.writeInt(x);
+ buf.writeInt(y);
+ buf.writeInt(z);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketRequestPlayerInfo.java b/src/main/java/darkknight/jewelrycraft/network/PacketRequestPlayerInfo.java
new file mode 100644
index 0000000..8491132
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/network/PacketRequestPlayerInfo.java
@@ -0,0 +1,42 @@
+package darkknight.jewelrycraft.network;
+
+import io.netty.buffer.ByteBuf;
+import cpw.mods.fml.common.network.simpleimpl.IMessage;
+import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class PacketRequestPlayerInfo implements IMessage, IMessageHandler<PacketRequestPlayerInfo, IMessage>
+{
+
+ /**
+ *
+ */
+ public PacketRequestPlayerInfo()
+ {}
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketRequestPlayerInfo message, MessageContext ctx)
+ {
+ return new PacketSendPlayerInfo(PlayerUtils.getModPlayerPersistTag(ctx.getServerHandler().playerEntity, "Jewelrycraft"));
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf)
+ {}
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketSendCurseStats.java b/src/main/java/darkknight/jewelrycraft/network/PacketSendCurseStats.java
new file mode 100644
index 0000000..3457235
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/network/PacketSendCurseStats.java
@@ -0,0 +1,71 @@
+/**
+ *
+ */
+package darkknight.jewelrycraft.network;
+
+import java.util.Iterator;
+import java.util.List;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.server.MinecraftServer;
+import io.netty.buffer.ByteBuf;
+import cpw.mods.fml.common.network.ByteBufUtils;
+import cpw.mods.fml.common.network.simpleimpl.IMessage;
+import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import darkknight.jewelrycraft.events.PlayerRenderHandler;
+import darkknight.jewelrycraft.lib.Reference;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+/**
+ * @author Sorin
+ *
+ */
+public class PacketSendCurseStats implements IMessage, IMessageHandler<PacketSendCurseStats, IMessage>
+{
+ public PacketSendCurseStats()
+ {
+
+ }
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketSendCurseStats message, MessageContext ctx)
+ {
+ return null;
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf)
+ {
+ String temp = ByteBufUtils.readUTF8String(buf);
+ if (temp != "")
+ PlayerRenderHandler.infamyCache = temp.split(";");
+ else
+ PlayerRenderHandler.infamyCache = new String[] { };
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf)
+ {
+ Iterator<EntityPlayer> players = MinecraftServer.getServer().getConfigurationManager().playerEntityList.iterator();
+ String infamyPlayers = "";
+ while (players.hasNext())
+ {
+ EntityPlayer current = players.next();
+ if(PlayerUtils.getModPlayerPersistTag(current, "Jewelrycraft").getInteger(Reference.MODNAME + ":" + "Infamy") > 0)
+ infamyPlayers = infamyPlayers + (infamyPlayers == "" ? "" : ";") + current.getDisplayName();
+ }
+ ByteBufUtils.writeUTF8String(buf, infamyPlayers);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketSendLiquidData.java b/src/main/java/darkknight/jewelrycraft/network/PacketSendLiquidData.java
new file mode 100644
index 0000000..bad14e7
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/network/PacketSendLiquidData.java
@@ -0,0 +1,100 @@
+package darkknight.jewelrycraft.network;
+
+import io.netty.buffer.ByteBuf;
+import net.minecraft.client.Minecraft;
+import cpw.mods.fml.common.network.simpleimpl.IMessage;
+import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import darkknight.jewelrycraft.JewelrycraftMod;
+
+public class PacketSendLiquidData implements IMessage, IMessageHandler<PacketSendLiquidData, IMessage>
+{
+ int dimID, x, y, z, itemID, itemMeta, color;
+
+ /**
+ *
+ */
+ public PacketSendLiquidData()
+ {}
+
+ /**
+ * @param packet
+ * @param itemID
+ * @param itemMeta
+ * @param color
+ */
+ public PacketSendLiquidData(PacketRequestLiquidData packet, int itemID, int itemMeta, int color)
+ {
+ dimID = packet.dimID;
+ x = packet.x;
+ y = packet.y;
+ z = packet.z;
+ this.itemID = itemID;
+ this.itemMeta = itemMeta;
+ this.color = color;
+ }
+
+ /**
+ * @param dimID
+ * @param x
+ * @param y
+ * @param z
+ * @param itemID
+ * @param itemMeta
+ * @param color
+ */
+ public PacketSendLiquidData(int dimID, int x, int y, int z, int itemID, int itemMeta, int color)
+ {
+ this.dimID = dimID;
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.itemID = itemID;
+ this.itemMeta = itemMeta;
+ this.color = color;
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf)
+ {
+ dimID = buf.readInt();
+ x = buf.readInt();
+ y = buf.readInt();
+ z = buf.readInt();
+ itemID = buf.readInt();
+ itemMeta = buf.readInt();
+ color = buf.readInt();
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf)
+ {
+ buf.writeInt(dimID);
+ buf.writeInt(x);
+ buf.writeInt(y);
+ buf.writeInt(z);
+ buf.writeInt(itemID);
+ buf.writeInt(itemMeta);
+ buf.writeInt(color);
+ }
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketSendLiquidData message, MessageContext ctx)
+ {
+ JewelrycraftMod.clientData.setString(message.x + " " + message.y + " " + message.z + " " + message.dimID, message.itemID + ":" + message.itemMeta + ":" + message.color);
+ Minecraft.getMinecraft().theWorld.getBlock(message.x, message.y, message.z);
+ Minecraft.getMinecraft().theWorld.markBlockForUpdate(message.x, message.y, message.z);
+ return null;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java b/src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java
new file mode 100644
index 0000000..e2f66a0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java
@@ -0,0 +1,58 @@
+package darkknight.jewelrycraft.network;
+
+import io.netty.buffer.ByteBuf;
+import net.minecraft.nbt.NBTTagCompound;
+import cpw.mods.fml.common.network.ByteBufUtils;
+import cpw.mods.fml.common.network.simpleimpl.IMessage;
+import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
+import cpw.mods.fml.common.network.simpleimpl.MessageContext;
+import darkknight.jewelrycraft.events.ScreenHandler;
+
+public class PacketSendPlayerInfo implements IMessage, IMessageHandler<PacketSendPlayerInfo, IMessage>
+{
+ public NBTTagCompound tagCompound;
+
+ /**
+ * @param tagCompound
+ */
+ public PacketSendPlayerInfo(NBTTagCompound tagCompound)
+ {
+ this.tagCompound = tagCompound;
+ }
+
+ /**
+ *
+ */
+ public PacketSendPlayerInfo()
+ {}
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketSendPlayerInfo message, MessageContext ctx)
+ {
+ ScreenHandler.tagCache = message.tagCompound;
+ return null;
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf)
+ {
+ tagCompound = ByteBufUtils.readTag(buf);
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf)
+ {
+ ByteBufUtils.writeTag(buf, tagCompound);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java b/src/main/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java
new file mode 100644
index 0000000..70e47b0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/particles/EntityFlatShadowFX.java
@@ -0,0 +1,91 @@
+package darkknight.jewelrycraft.particles;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+
+public class EntityFlatShadowFX extends EntityFX
+{
+ float moteParticleScale;
+ ResourceLocation texture;
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param size
+ * @param maxAge
+ * @param texture
+ */
+ public EntityFlatShadowFX(World world, double x, double y, double z, float size, float maxAge, ResourceLocation texture)
+ {
+ super(world, x, y, z, 0D, 0D, 0D);
+ particleMaxAge = (int)(28D / (Math.random() * 0.3D + 0.7D) * maxAge);
+ particleGravity = 0F;
+ motionX = motionY = motionZ = 0;
+ particleScale = size;
+ noClip = true;
+ this.texture = texture;
+ setSize(0.1F, 0.1F);
+ }
+
+ /**
+ * @param tessellator
+ * @param partialTicks
+ * @param minX
+ * @param minY
+ * @param minZ
+ * @param maxX
+ * @param maxZ
+ */
+ @Override
+ public void renderParticle(Tessellator tessellator, float partialTicks, float minX, float minY, float minZ, float maxX, float maxZ)
+ {
+ tessellator.draw();
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+ tessellator.startDrawingQuads();
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glDepthMask(false);
+ float scale = 1F * particleScale;
+ float x = (float)(posX - interpPosX);
+ float y = (float)(posX - interpPosY);
+ float z = (float)(posZ - interpPosZ);
+ tessellator.setColorRGBA_F(0F, 0F, 0F, 1F);
+ tessellator.addVertexWithUV(x - minX * scale - maxX * scale, y + minY * scale, z - minZ * scale - maxZ * scale, 0, 0);
+ tessellator.addVertexWithUV(x - minX * scale + maxX * scale, y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0);
+ tessellator.addVertexWithUV(x + minX * scale + maxX * scale, y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1);
+ tessellator.addVertexWithUV(x + minX * scale - maxX * scale, y + minY * scale, z + minZ * scale - maxZ * scale, 0, 1);
+ tessellator.draw();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glDepthMask(true);
+ tessellator.startDrawingQuads();
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void onUpdate()
+ {
+ prevPosX = posX;
+ prevPosY = posY;
+ prevPosZ = posZ;
+ motionX = motionY = motionZ = 0;
+ if (particleAge++ >= particleMaxAge) setDead();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getFXLayer()
+ {
+ return 0;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java b/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java
new file mode 100644
index 0000000..85dfae5
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/particles/EntityShadowsFX.java
@@ -0,0 +1,104 @@
+package darkknight.jewelrycraft.particles;
+
+import java.util.Iterator;
+import java.util.List;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.projectile.EntityThrowable;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.damage.DamageSourceList;
+
+public class EntityShadowsFX extends EntityFX
+{
+ float moteParticleScale;
+ ResourceLocation texture;
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param size
+ * @param maxAge
+ * @param texture
+ */
+ public EntityShadowsFX(World world, double x, double y, double z, float size, float maxAge, ResourceLocation texture)
+ {
+ super(world, x, y, z, 0D, 0D, 0D);
+ particleMaxAge = (int)(28D / (Math.random() * 0.3D + 0.7D) * maxAge);
+ particleGravity = 0F;
+ motionX = motionY = motionZ = 0;
+ particleScale *= size;
+ moteParticleScale = particleScale;
+ noClip = true;
+ this.texture = texture;
+ setSize(0.01F, 0.01F);
+ }
+
+ /**
+ * @param tessellator
+ * @param partialTicks
+ * @param minX
+ * @param minY
+ * @param minZ
+ * @param maxX
+ * @param maxZ
+ */
+ @Override
+ public void renderParticle(Tessellator tessellator, float partialTicks, float minX, float minY, float minZ, float maxX, float maxZ)
+ {
+ tessellator.draw();
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+ GL11.glColor4f(1, 1, 1, 1);
+ tessellator.startDrawingQuads();
+ tessellator.setBrightness(getBrightnessForRender(0));
+ float scale = 0.1F * particleScale;
+ float x = (float)(posX - interpPosX);
+ float y = (float)(posY - interpPosY);
+ float z = (float)(posZ - interpPosZ);
+ tessellator.setColorRGBA_F(0F, 0F, 0F, 0.5F);
+ tessellator.addVertexWithUV(x - minX * scale - maxX * scale, y - minY * scale, z - minZ * scale - maxZ * scale, 0, 0);
+ tessellator.addVertexWithUV(x - minX * scale + maxX * scale, y + minY * scale, z - minZ * scale + maxZ * scale, 1, 0);
+ tessellator.addVertexWithUV(x + minX * scale + maxX * scale, y + minY * scale, z + minZ * scale + maxZ * scale, 1, 1);
+ tessellator.addVertexWithUV(x + minX * scale - maxX * scale, y - minY * scale, z + minZ * scale - maxZ * scale, 0, 1);
+ tessellator.draw();
+ tessellator.startDrawingQuads();
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void onUpdate()
+ {
+ prevPosX = posX;
+ prevPosY = posY;
+ prevPosZ = posZ;
+ motionX = motionY = motionZ = 0;
+ if (particleAge++ >= particleMaxAge) setDead();
+ AxisAlignedBB axisalignedbb = boundingBox.expand(16.0D, 16.0D, 16.0D);
+ List list1 = worldObj.getEntitiesWithinAABB(Entity.class, axisalignedbb);
+ if (!worldObj.isRemote && list1 != null && !list1.isEmpty()){
+ Iterator iterator = list1.iterator();
+ while (iterator.hasNext()){
+ Entity entity = (Entity)iterator.next();
+ if (entity != null && posX <= entity.posX + 0.5F && posX >= entity.posX - 0.5F && posZ <= entity.posZ + 0.5F && posZ >= entity.posZ - 0.5F) entity.attackEntityFrom(DamageSourceList.shadows, 100F);
+ if (entity instanceof EntityThrowable) ((EntityThrowable)entity).setDead();
+ }
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getFXLayer()
+ {
+ return 2;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/recipes/CraftingRecipes.java b/src/main/java/darkknight/jewelrycraft/recipes/CraftingRecipes.java
new file mode 100644
index 0000000..ce88f5f
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/recipes/CraftingRecipes.java
@@ -0,0 +1,59 @@
+package darkknight.jewelrycraft.recipes;
+
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraftforge.oredict.ShapedOreRecipe;
+import cpw.mods.fml.common.event.FMLPreInitializationEvent;
+import cpw.mods.fml.common.registry.GameRegistry;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.item.ItemList;
+
+public class CraftingRecipes
+{
+ private static boolean isInitialized = false;
+
+ /**
+ * @param e
+ */
+ public static void preInit(FMLPreInitializationEvent e)
+ {
+ if (!isInitialized){
+ // Items
+ GameRegistry.addRecipe(new ItemStack(ItemList.thiefGloves), "x x", "yxy", "yxy", 'x', ItemList.shadowIngot, 'y', new ItemStack(Blocks.wool, 1, 15));
+ GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 0), "xx", 'x', Items.clay_ball);
+ GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 1), " x ", "x x", " x ", 'x', Items.clay_ball);
+ GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 2), "x x", "x x", " x ", 'x', Items.clay_ball);
+ GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 3), "xxx", "x x", "xxx", 'x', Items.clay_ball);
+ GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 4), "x x", 'x', Items.clay_ball);
+ GameRegistry.addRecipe(new ItemStack(BlockList.handPedestal, 1, 4), "bbb", " x ", "yxy", 'x', Blocks.stonebrick, 'y', new ItemStack(Blocks.stone_slab, 1, 5), 'b', Blocks.cobblestone_wall);
+ GameRegistry.addRecipe(new ItemStack(BlockList.shadowEye, 1, 4), "bcb", "cec", "bcb", 'b', Blocks.stonebrick, 'c', new ItemStack(Blocks.stained_hardened_clay, 1, 15), 'e', Items.ender_eye);
+ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ItemList.crystal, 1, 15), " x ", "x x", " x ", 'x', Blocks.glass));
+ for(int i = 0; i < 15; i++){
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.crystal, 1, i), new Object[]{new ItemStack(ItemList.crystal, 1, 15), new ItemStack(Items.dye, 1, i)});
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.crystal, 1, 15), new Object[]{new ItemStack(ItemList.crystal, 1, i), new ItemStack(Items.dye, 1, 15)});
+ }
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.shadowIngot, 9), new Object[]{new ItemStack(BlockList.shadowBlock)});
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide), new Object[]{new ItemStack(Items.book), new ItemStack(ItemList.molds, 1, 0)});
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide), new Object[]{new ItemStack(Items.book), new ItemStack(ItemList.molds, 1, 1)});
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide), new Object[]{new ItemStack(Items.book), new ItemStack(ItemList.molds, 1, 2)});
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide), new Object[]{new ItemStack(Items.book), new ItemStack(ItemList.molds, 1, 3)});
+ GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide), new Object[]{new ItemStack(Items.book), new ItemStack(ItemList.molds, 1, 4)});
+ // Blocks
+ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockList.molder), "x x", "xxx", 'x', Blocks.cobblestone));
+ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockList.smelter), "xyx", "x x", "xzx", 'x', Blocks.cobblestone, 'y', Items.bucket, 'z', Items.lava_bucket));
+ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockList.jewelCraftingTable), "xxx", "y y", "y y", 'x', Blocks.planks, 'y', Blocks.cobblestone));
+ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockList.displayer, 2), " x ", "xxx", "yyy", 'x', Items.iron_ingot, 'y', Blocks.emerald_block));
+ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(BlockList.shadowBlock, 1), "xxx", "xxx", "xxx", 'x', ItemList.shadowIngot));
+ GameRegistry.addRecipe(new ItemStack(BlockList.jewelAltar, 1), "sws", "bwb", "bbb", 's', Blocks.end_stone, 'w', new ItemStack(Blocks.wool, 1, 5), 'b', Blocks.nether_brick);
+ // Smelting
+ GameRegistry.addSmelting(BlockList.shadowOre, new ItemStack(ItemList.shadowIngot), 1.5f);
+ GameRegistry.addSmelting(new ItemStack(ItemList.clayMolds, 1, 0), new ItemStack(ItemList.molds, 1, 0), 0.2F);
+ GameRegistry.addSmelting(new ItemStack(ItemList.clayMolds, 1, 1), new ItemStack(ItemList.molds, 1, 1), 0.2F);
+ GameRegistry.addSmelting(new ItemStack(ItemList.clayMolds, 1, 2), new ItemStack(ItemList.molds, 1, 2), 0.2F);
+ GameRegistry.addSmelting(new ItemStack(ItemList.clayMolds, 1, 3), new ItemStack(ItemList.molds, 1, 3), 0.2F);
+ GameRegistry.addSmelting(new ItemStack(ItemList.clayMolds, 1, 4), new ItemStack(ItemList.molds, 1, 4), 0.2F);
+ isInitialized = true;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java
new file mode 100644
index 0000000..f490456
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityAltar.java
@@ -0,0 +1,90 @@
+package darkknight.jewelrycraft.tileentity;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+
+public class TileEntityAltar extends TileEntity
+{
+ public ItemStack object;
+ public boolean isDirty, hasObject;
+ public String playerName;
+
+ /**
+ *
+ */
+ public TileEntityAltar()
+ {
+ hasObject = false;
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ isDirty = false;
+ playerName = "";
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ NBTTagCompound tag = new NBTTagCompound();
+ object.writeToNBT(tag);
+ nbt.setTag("object", tag);
+ nbt.setBoolean("hasObject", hasObject);
+ nbt.setString("playerName", playerName);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ object.readFromNBT(nbt.getCompoundTag("object"));
+ hasObject = nbt.getBoolean("hasObject");
+ playerName = nbt.getString("playerName");
+ }
+
+ /**
+ *
+ */
+ @SuppressWarnings ("rawtypes")
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ if (isDirty){
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ isDirty = false;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java
new file mode 100644
index 0000000..b16ce31
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java
@@ -0,0 +1,88 @@
+package darkknight.jewelrycraft.tileentity;
+
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.EnumSkyBlock;
+
+public class TileEntityBlockShadow extends TileEntity
+{
+ public int metadata;
+
+ /**
+ *
+ */
+ public TileEntityBlockShadow()
+ {
+ metadata = -1;
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setInteger("metadata", metadata);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ metadata = nbt.getInteger("metadata");
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ int blockLight, realLight;
+ int lightValue = worldObj.getSavedLightValue(EnumSkyBlock.Sky, xCoord, yCoord, zCoord) - worldObj.skylightSubtracted;
+ float sunPosAngle = worldObj.getCelestialAngleRadians(1.0F);
+ if (sunPosAngle < (float)Math.PI) sunPosAngle += (0.0F - sunPosAngle) * 0.2F;
+ else sunPosAngle += ((float)Math.PI * 2F - sunPosAngle) * 0.2F;
+ lightValue = Math.round(lightValue * MathHelper.cos(sunPosAngle));
+ if (lightValue < 0) lightValue = 0;
+ if (lightValue > 15) lightValue = 15;
+ blockLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord).getSavedLightValue(EnumSkyBlock.Block, xCoord & 15, yCoord, zCoord & 15);
+ realLight = worldObj.getChunkFromBlockCoords(xCoord, zCoord).getBlockLightValue(xCoord & 15, yCoord, zCoord & 15, 0);
+ if (blockLight == 0 && worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord) || lightValue >= blockLight) metadata = 15 - lightValue;
+ else if (!worldObj.canBlockSeeTheSky(xCoord, yCoord, zCoord)) metadata = 15 - realLight;
+ else if (lightValue < blockLight) metadata = 15 - blockLight;
+ worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, metadata, 2);
+ worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java
new file mode 100644
index 0000000..047f254
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java
@@ -0,0 +1,133 @@
+package darkknight.jewelrycraft.tileentity;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+
+public class TileEntityDisplayer extends TileEntity
+{
+ public float ringTranslation1, ringTranslation2, ringTranslation3, rotAngle;
+ public boolean isDescending1, isDescending2, isDescending3, isDirty, hasObject;
+ public ItemStack object;
+ public int quantity, infoIndex, timer = 0;
+
+ /**
+ *
+ */
+ public TileEntityDisplayer()
+ {
+ ringTranslation1 = 0.6f;
+ ringTranslation2 = 0.3f;
+ ringTranslation3 = 0.0f;
+ rotAngle = 0;
+ quantity = 0;
+ infoIndex = 1;
+ isDescending1 = false;
+ isDescending2 = false;
+ isDescending3 = false;
+ isDirty = false;
+ hasObject = false;
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setFloat("translation1", ringTranslation1);
+ nbt.setFloat("translation2", ringTranslation2);
+ nbt.setFloat("translation3", ringTranslation3);
+ nbt.setFloat("angle", rotAngle);
+ nbt.setInteger("quantity", quantity);
+ nbt.setInteger("infoIndex", infoIndex);
+ nbt.setBoolean("descending1", isDescending1);
+ nbt.setBoolean("descending2", isDescending2);
+ nbt.setBoolean("descending3", isDescending3);
+ nbt.setBoolean("hasObject", hasObject);
+ NBTTagCompound tag = new NBTTagCompound();
+ object.writeToNBT(tag);
+ nbt.setTag("object", tag);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ ringTranslation1 = nbt.getFloat("translation1");
+ ringTranslation2 = nbt.getFloat("translation2");
+ ringTranslation3 = nbt.getFloat("translation3");
+ rotAngle = nbt.getFloat("angle");
+ quantity = nbt.getInteger("quantity");
+ infoIndex = nbt.getInteger("infoIndex");
+ isDescending1 = nbt.getBoolean("descending1");
+ isDescending2 = nbt.getBoolean("descending2");
+ isDescending3 = nbt.getBoolean("descending3");
+ hasObject = nbt.getBoolean("hasObject");
+ object = new ItemStack(Item.getItemById(0), 0, 0);
+ object.readFromNBT(nbt.getCompoundTag("object"));
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ if (isDirty){
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ isDirty = false;
+ }
+ if (ringTranslation1 >= 0.6) isDescending1 = true;
+ if (ringTranslation1 <= 0) isDescending1 = false;
+ if (!isDescending1) ringTranslation1 += 0.05;
+ if (isDescending1) ringTranslation1 -= 0.05;
+ if (ringTranslation2 >= 0.6) isDescending2 = true;
+ if (ringTranslation2 <= 0) isDescending2 = false;
+ if (!isDescending2) ringTranslation2 += 0.04;
+ if (isDescending2) ringTranslation2 -= 0.04;
+ if (ringTranslation3 >= 0.6) isDescending3 = true;
+ if (ringTranslation3 <= 0) isDescending3 = false;
+ if (!isDescending3) ringTranslation3 += 0.03;
+ if (isDescending3) ringTranslation3 -= 0.03;
+ if (rotAngle < 360F) rotAngle += 6F;
+ if (rotAngle >= 360F) rotAngle = 0F;
+ timer++;
+ if (timer >= 20){
+ infoIndex++;
+ timer = 0;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
new file mode 100644
index 0000000..ee48d08
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityHandPedestal.java
@@ -0,0 +1,182 @@
+package darkknight.jewelrycraft.tileentity;
+
+import net.minecraft.item.ItemBlock;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityHandPedestal extends TileEntity
+{
+ protected boolean isDirty;
+ protected ItemStack heldItemStack;
+ /**
+ * When the hand is open the grip is 0 and is 20 when closed.
+ */
+ private float grip;
+ private float prevGrip;
+ private float gripMax;
+ private float gripScale;
+ private boolean isHandOpen;
+
+ /**
+ *
+ */
+ public TileEntityHandPedestal()
+ {
+ isDirty = false;
+ heldItemStack = null;
+ grip = 0;
+ gripMax = 20;
+ gripScale = 1;
+ isHandOpen = true;
+ }
+
+ /**
+ * @param tagCompound
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound tagCompound)
+ {
+ super.writeToNBT(tagCompound);
+ if (heldItemStack != null){
+ NBTTagCompound objectCompound = new NBTTagCompound();
+ heldItemStack.writeToNBT(objectCompound);
+ tagCompound.setTag("object", objectCompound);
+ }
+ tagCompound.setBoolean("isHandOpen", isHandOpen);
+ }
+
+ /**
+ * @param tagCompound
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound tagCompound)
+ {
+ super.readFromNBT(tagCompound);
+ if (tagCompound.hasKey("object", 10)) setHeldItemStack(ItemStack.loadItemStackFromNBT(tagCompound.getCompoundTag("object")));
+ else removeHeldItemStack();
+ isHandOpen = tagCompound.getBoolean("isHandOpen");
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ updateGrip();
+ if (isDirty){
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ isDirty = false;
+ }
+ }
+
+ /**
+ *
+ */
+ private void updateGrip()
+ {
+ prevGrip = grip;
+ if (grip > 0 && isHandOpen) grip -= 1 / gripScale;
+ else if (grip < gripMax && !isHandOpen) grip += 1 / gripScale;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 0, nbttagcompound);
+ }
+
+ /**
+ * @param networkManager
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager networkManager, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void markDirty()
+ {
+ super.markDirty();
+ isDirty = true;
+ }
+
+ /**
+ * @return
+ */
+ public ItemStack getHeldItemStack()
+ {
+ return heldItemStack;
+ }
+
+ /**
+ * @param heldItemStack
+ */
+ public void setHeldItemStack(ItemStack heldItemStack)
+ {
+ heldItemStack.stackSize = 1;
+ this.heldItemStack = heldItemStack;
+ if (heldItemStack.getItem() instanceof ItemBlock) gripScale = 0.5f;
+ else gripScale = 1;
+ }
+
+ /**
+ *
+ */
+ public void removeHeldItemStack()
+ {
+ heldItemStack = null;
+ }
+
+ /**
+ *
+ */
+ public void openHand()
+ {
+ isHandOpen = true;
+ }
+
+ /**
+ *
+ */
+ public void closeHand()
+ {
+ isHandOpen = false;
+ }
+
+ /**
+ * @param t
+ * @return
+ */
+ public float getGrip(float t)
+ {
+ return (prevGrip * (1 - t) + grip * t) / gripMax;
+ }
+
+ /**
+ * @return
+ */
+ public float getGripScale()
+ {
+ return gripScale;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
new file mode 100644
index 0000000..c148bd0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java
@@ -0,0 +1,154 @@
+package darkknight.jewelrycraft.tileentity;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class TileEntityJewelrsCraftingTable extends TileEntity
+{
+ public boolean hasJewelry, hasEndItem, isDirty, hasGem, crafting;
+ public ItemStack jewelry, endItem, gem;
+ public int carving, effect;
+ public float angle;
+
+ /**
+ *
+ */
+ public TileEntityJewelrsCraftingTable()
+ {
+ jewelry = new ItemStack(Item.getItemById(0), 0, 0);
+ endItem = new ItemStack(Item.getItemById(0), 0, 0);
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
+ hasJewelry = false;
+ hasEndItem = false;
+ hasGem = false;
+ crafting = false;
+ carving = 0;
+ effect = 0;
+ angle = 0;
+ isDirty = false;
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setBoolean("hasJewelry", hasJewelry);
+ nbt.setBoolean("hasEndItem", hasEndItem);
+ nbt.setBoolean("hasJewel", hasGem);
+ nbt.setBoolean("crafting", crafting);
+ nbt.setInteger("timer", carving);
+ nbt.setInteger("effect", effect);
+ nbt.setFloat("angle", angle);
+ NBTTagCompound tag1 = new NBTTagCompound();
+ NBTTagCompound tag2 = new NBTTagCompound();
+ NBTTagCompound tag3 = new NBTTagCompound();
+ jewelry.writeToNBT(tag1);
+ nbt.setTag("jewelry", tag1);
+ endItem.writeToNBT(tag2);
+ nbt.setTag("endItem", tag2);
+ gem.writeToNBT(tag3);
+ nbt.setTag("jewel", tag3);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ hasJewelry = nbt.getBoolean("hasJewelry");
+ hasEndItem = nbt.getBoolean("hasEndItem");
+ hasGem = nbt.getBoolean("hasJewel");
+ crafting = nbt.getBoolean("crafting");
+ carving = nbt.getInteger("timer");
+ effect = nbt.getInteger("effect");
+ angle = nbt.getFloat("angle");
+ jewelry = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelry.readFromNBT(nbt.getCompoundTag("jewelry"));
+ endItem = new ItemStack(Item.getItemById(0), 0, 0);
+ endItem.readFromNBT(nbt.getCompoundTag("endItem"));
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
+ gem.readFromNBT(nbt.getCompoundTag("jewel"));
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ if (isDirty){
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ isDirty = false;
+ }
+ if (angle < 360F) angle += 3F;
+ else angle = 0F;
+ if (hasJewelry && hasGem && !hasEndItem && crafting){
+ if (carving > 0) carving--;
+ if (crafting) for(int l = 0; l < ConfigHandler.jewelryCraftingTime / (carving + 2); ++l){
+ if (worldObj.rand.nextInt(10) == 0) worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.orb", 0.05F, 1F);
+ if (getBlockMetadata() == 0) worldObj.spawnParticle("instantSpell", xCoord + 0.5F, (double)yCoord + 0.8F, zCoord + 0.2F, 0.0D, 0.0D, 0.0D);
+ if (getBlockMetadata() == 1) worldObj.spawnParticle("instantSpell", xCoord + 0.8F, (double)yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
+ if (getBlockMetadata() == 2) worldObj.spawnParticle("instantSpell", xCoord + 0.5F, (double)yCoord + 0.8F, zCoord + 0.8F, 0.0D, 0.0D, 0.0D);
+ if (getBlockMetadata() == 3) worldObj.spawnParticle("instantSpell", xCoord + 0.2F, (double)yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D);
+ }
+ if (carving == 0){
+ hasEndItem = true;
+ endItem = jewelry.copy();
+ if (hasGem && gem != new ItemStack(Item.getItemById(0), 0, 0)) if (!JewelryNBT.hasTag(jewelry, "gem")){
+ JewelryNBT.addGem(endItem, gem);
+ hasGem = false;
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
+ }else{
+ ItemStack aux = JewelryNBT.gem(jewelry);
+ JewelryNBT.addGem(endItem, gem);
+ if (JewelrycraftUtil.rand.nextBoolean()) gem = aux.copy();
+ else{
+ hasGem = false;
+ gem = new ItemStack(Item.getItemById(0), 0, 0);
+ }
+ }
+ hasJewelry = false;
+ jewelry = new ItemStack(Item.getItemById(0), 0, 0);
+ carving = -1;
+ crafting = false;
+ isDirty = true;
+ }
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
new file mode 100644
index 0000000..da8cc19
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityMolder.java
@@ -0,0 +1,144 @@
+package darkknight.jewelrycraft.tileentity;
+
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class TileEntityMolder extends TileEntity
+{
+ public int cooling;
+ public boolean hasMoltenMetal, hasJewelBase, hasMold, isDirty;
+ public ItemStack mold, jewelBase, moltenMetal, ringMetal;
+ public float quantity;
+
+ /**
+ *
+ */
+ public TileEntityMolder()
+ {
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
+ mold = new ItemStack(Item.getItemById(0), 0, 0);
+ ringMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ cooling = -1;
+ quantity = 0f;
+ hasJewelBase = false;
+ hasMoltenMetal = false;
+ hasMold = false;
+ isDirty = false;
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setInteger("cooling", cooling);
+ nbt.setFloat("quantity", quantity);
+ nbt.setBoolean("hasJewelBase", hasJewelBase);
+ nbt.setBoolean("hasMoltenMetal", hasMoltenMetal);
+ nbt.setBoolean("hasMold", hasMold);
+ NBTTagCompound tag = new NBTTagCompound();
+ NBTTagCompound tag1 = new NBTTagCompound();
+ NBTTagCompound tag2 = new NBTTagCompound();
+ NBTTagCompound tag3 = new NBTTagCompound();
+ mold.writeToNBT(tag);
+ nbt.setTag("mold", tag);
+ jewelBase.writeToNBT(tag1);
+ nbt.setTag("jewelBase", tag1);
+ moltenMetal.writeToNBT(tag2);
+ nbt.setTag("moltenMetal", tag2);
+ ringMetal.writeToNBT(tag3);
+ nbt.setTag("ringMetal", tag3);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ cooling = nbt.getInteger("cooling");
+ quantity = nbt.getFloat("quantity");
+ hasJewelBase = nbt.getBoolean("hasJewelBase");
+ hasMoltenMetal = nbt.getBoolean("hasMoltenMetal");
+ hasMold = nbt.getBoolean("hasMold");
+ mold = new ItemStack(Item.getItemById(0), 0, 0);
+ mold.readFromNBT(nbt.getCompoundTag("mold"));
+ jewelBase = new ItemStack(Item.getItemById(0), 0, 0);
+ jewelBase.readFromNBT(nbt.getCompoundTag("jewelBase"));
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal"));
+ ringMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ ringMetal.readFromNBT(nbt.getCompoundTag("ringMetal"));
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ if (isDirty){
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ isDirty = false;
+ }
+ if (hasMoltenMetal && moltenMetal.getItem() != Item.getItemById(0) && quantity > 0f){
+ if (worldObj.rand.nextInt(20) == 0) worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.fizz", 0.5F, 1F);
+ for(int l = 0; l < 2; ++l)
+ worldObj.spawnParticle("reddust", xCoord + Math.random(), (double)yCoord + 0.2F, zCoord + Math.random(), 0.0D, 1.0D, 1.0D);
+ }
+ if (hasMoltenMetal && !hasJewelBase && quantity >= 0.1f){
+ ringMetal = moltenMetal.copy();
+ if (cooling > 0) cooling--;
+ if (cooling <= 0f){
+ if (mold.getItemDamage() == 0) jewelBase = moltenMetal;
+ else if (mold.getItemDamage() == 1) jewelBase = new ItemStack(ItemList.ring);
+ else if (mold.getItemDamage() == 2) jewelBase = new ItemStack(ItemList.necklace);
+ else if (mold.getItemDamage() == 3) jewelBase = new ItemStack(ItemList.bracelet);
+ else if (mold.getItemDamage() == 4) jewelBase = new ItemStack(ItemList.earrings);
+ ringMetal.stackSize = 1;
+ jewelBase.stackSize = 1;
+ if (mold.getItemDamage() != 0 && jewelBase != new ItemStack(Item.getItemById(0), 0, 0)) JewelryNBT.addMetal(jewelBase, ringMetal);
+ hasMoltenMetal = false;
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ hasJewelBase = true;
+ cooling = -1;
+ quantity = 0f;
+ isDirty = true;
+ }
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java
new file mode 100644
index 0000000..e02cac2
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java
@@ -0,0 +1,273 @@
+package darkknight.jewelrycraft.tileentity;
+
+import java.util.ArrayList;
+import net.minecraft.client.Minecraft;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import darkknight.jewelrycraft.block.BlockHandPedestal;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.particles.EntityShadowsFX;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+public class TileEntityShadowEye extends TileEntity
+{
+ public int opening, timer, t = 20;
+ public boolean active;
+ public ArrayList<ItemStack> pedestalItems = new ArrayList<ItemStack>();
+ ResourceLocation particleTexture = new ResourceLocation("jewelrycraft", "textures/particle/shadows.png");
+
+ /**
+ *
+ */
+ public TileEntityShadowEye()
+ {
+ opening = 1;
+ timer = 20;
+ active = false;
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setInteger("opening", opening);
+ nbt.setInteger("timer", timer);
+ nbt.setBoolean("active", active);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ opening = nbt.getInteger("opening");
+ timer = nbt.getInteger("timer");
+ active = nbt.getBoolean("active");
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ boolean valid = isValidStructure(worldObj, xCoord, yCoord, zCoord, blockMetadata);
+ if (active) timer--;
+ if (opening == 4 && timer <= 0) active = false;
+ if (!active && timer <= 0 && opening != 1){
+ if (t > 0) t--;
+ if (t <= 0){
+ opening--;
+ t = 20;
+ }
+ }
+ if (opening == 2 && timer <= 0 && t == 10){
+ addData(worldObj, xCoord, yCoord, zCoord);
+ TileEntityHandPedestal target = (TileEntityHandPedestal)worldObj.getTileEntity(xCoord, yCoord - 3, zCoord);
+ if (target != null && target.getHeldItemStack() != null) JewelryNBT.addModifiers(target.getHeldItemStack(), pedestalItems);
+ }
+ if (active && timer <= 0){
+ if (opening < 4){
+ opening++;
+ timer = 20;
+ }
+ if (valid && opening == 4) timer = 1000;
+ else if (!valid){
+ active = false;
+ timer = -1;
+ }
+ }
+ EntityPlayer player1 = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 7F);
+ if (player1 != null){
+ NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player1, "Jewelrycraft");
+ persistTag.setBoolean("nearStartedRitual", false);
+ }
+ if (active && opening == 4){
+ float din = 6F;
+ int i = Minecraft.getMinecraft().gameSettings.particleSetting;
+ for(float x = -din; x <= din; x += 0.2F)
+ for(float z = -din; z <= din; z += 0.2F)
+ if (x * x + z * z >= din * din - 1 && x * x + z * z <= din * din + 1) Minecraft.getMinecraft().effectRenderer.addEffect(new EntityShadowsFX(worldObj, xCoord + x + 0.5F, yCoord - 0.5F, zCoord + z + 0.5F, 15F, 0.04F - 0.01F * i, particleTexture));
+ for(int l = 0; l <= 2 - i; l++)
+ worldObj.spawnParticle("depthsuspend", xCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), yCoord - 2F + worldObj.rand.nextFloat(), zCoord + 6.5F - worldObj.rand.nextInt(9) - worldObj.rand.nextFloat(), 0, 0, 0);
+ EntityPlayer player = worldObj.getClosestPlayer(xCoord, yCoord, zCoord, 6F);
+ if (player != null){
+ NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ persistTag.setBoolean("nearStartedRitual", true);
+ }
+ }
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @param metadata
+ * @return
+ */
+ public boolean isValidStructure(World world, int x, int y, int z, int metadata)
+ {
+ if (world.getBlockMetadata(x, y, z) == 0 || world.getBlockMetadata(x, y, z) == 2){
+ // Layers from top to bottom
+ // 1st Layer
+ if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false;
+ if (world.getBlock(x + 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x + 1, y + 1, z) != 5) return false;
+ if (world.getBlock(x - 1, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x - 1, y + 1, z) != 5) return false;
+ // 2nd Layer
+ if (world.getBlock(x + 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 2, y, z) != 1) return false;
+ if (world.getBlock(x + 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x + 1, y, z) != 4) return false;
+ if (world.getBlock(x - 1, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 1, y, z) != 5) return false;
+ if (world.getBlock(x - 2, y, z) != Blocks.stone_brick_stairs || world.getBlockMetadata(x - 2, y, z) != 0) return false;
+ // 3rd Layer
+ if (world.getBlock(x + 2, y - 1, z) != Blocks.stonebrick) return false;
+ if (world.getBlock(x - 2, y - 1, z) != Blocks.stonebrick) return false;
+ // 4th Layer
+ if (world.getBlock(x + 2, y - 2, z) != Blocks.stonebrick) return false;
+ if (world.getBlock(x - 2, y - 2, z) != Blocks.stonebrick) return false;
+ // 5th Layer
+ if (world.getBlock(x + 2, y - 3, z) != Blocks.stonebrick) return false;
+ if (world.getBlock(x - 2, y - 3, z) != Blocks.stonebrick) return false;
+ }else if (world.getBlockMetadata(x, y, z) == 1 || world.getBlockMetadata(x, y, z) == 3){
+ // Layers from top to bottom
+ // 1st Layer
+ if (world.getBlock(x, y + 1, z) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z) != 5) return false;
+ if (world.getBlock(x, y + 1, z + 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z + 1) != 5) return false;
+ if (world.getBlock(x, y + 1, z - 1) != Blocks.stone_slab || world.getBlockMetadata(x, y + 1, z - 1) != 5) return false;
+ // 2nd Layer
+ if (world.getBlock(x, y, z + 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 2) != 3) return false;
+ if (world.getBlock(x, y, z + 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z + 1) != 6) return false;
+ if (world.getBlock(x, y, z - 1) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 1) != 7) return false;
+ if (world.getBlock(x, y, z - 2) != Blocks.stone_brick_stairs || world.getBlockMetadata(x, y, z - 2) != 2) return false;
+ // 3rd Layer
+ if (world.getBlock(x, y - 1, z + 2) != Blocks.stonebrick) return false;
+ if (world.getBlock(x, y - 1, z - 2) != Blocks.stonebrick) return false;
+ // 4th Layer
+ if (world.getBlock(x, y - 2, z + 2) != Blocks.stonebrick) return false;
+ if (world.getBlock(x, y - 2, z - 2) != Blocks.stonebrick) return false;
+ // 5th Layer
+ if (world.getBlock(x, y - 3, z + 2) != Blocks.stonebrick) return false;
+ if (world.getBlock(x, y - 3, z - 2) != Blocks.stonebrick) return false;
+ }
+ // 3rd Layer
+ if (world.getBlock(x - 4, y - 1, z - 4) != BlockList.shadowBlock) return false;
+ if (world.getBlock(x - 4, y - 1, z + 4) != BlockList.shadowBlock) return false;
+ if (world.getBlock(x + 4, y - 1, z - 4) != BlockList.shadowBlock) return false;
+ if (world.getBlock(x + 4, y - 1, z + 4) != BlockList.shadowBlock) return false;
+ // 4th Layer
+ if (world.getBlock(x - 4, y - 2, z - 4) != Blocks.stonebrick) return false;
+ if (world.getBlock(x - 4, y - 2, z + 4) != Blocks.stonebrick) return false;
+ if (world.getBlock(x + 4, y - 2, z - 4) != Blocks.stonebrick) return false;
+ if (world.getBlock(x + 4, y - 2, z + 4) != Blocks.stonebrick) return false;
+ // 5th Layer
+ // Pillars
+ if (world.getBlock(x - 4, y - 3, z - 4) != Blocks.stonebrick) return false;
+ if (world.getBlock(x - 4, y - 3, z + 4) != Blocks.stonebrick) return false;
+ if (world.getBlock(x + 4, y - 3, z - 4) != Blocks.stonebrick) return false;
+ if (world.getBlock(x + 4, y - 3, z + 4) != Blocks.stonebrick) return false;
+ // Pedestals
+ if (!(world.getBlock(x, y - 3, z) instanceof BlockHandPedestal)) return false;
+ if (world.getBlock(x - 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z + 2) != 1) return false;
+ if (world.getBlock(x - 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x - 5, y - 3, z) != 2) return false;
+ if (world.getBlock(x - 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x - 4, y - 3, z - 2) != 3) return false;
+ if (world.getBlock(x - 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z - 4) != 3) return false;
+ if (world.getBlock(x, y - 3, z - 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z - 5) != 4) return false;
+ if (world.getBlock(x + 2, y - 3, z - 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z - 4) != 5) return false;
+ if (world.getBlock(x + 4, y - 3, z - 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z - 2) != 5) return false;
+ if (world.getBlock(x + 5, y - 3, z) != BlockList.handPedestal || world.getBlockMetadata(x + 5, y - 3, z) != 6) return false;
+ if (world.getBlock(x + 4, y - 3, z + 2) != BlockList.handPedestal || world.getBlockMetadata(x + 4, y - 3, z + 2) != 7) return false;
+ if (world.getBlock(x + 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x + 2, y - 3, z + 4) != 7) return false;
+ if (world.getBlock(x, y - 3, z + 5) != BlockList.handPedestal || world.getBlockMetadata(x, y - 3, z + 5) != 0) return false;
+ if (world.getBlock(x - 2, y - 3, z + 4) != BlockList.handPedestal || world.getBlockMetadata(x - 2, y - 3, z + 4) != 1) return false;
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ */
+ public void addData(World world, int x, int y, int z)
+ {
+ pedestalItems.clear();
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z - 4));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z + 2));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z - 5));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z - 4));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 4, y - 3, z - 2));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 5, y - 3, z));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z - 2));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 5, y - 3, z));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 4, y - 3, z + 2));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x + 2, y - 3, z + 4));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x, y - 3, z + 5));
+ addPedestalInfo((TileEntityHandPedestal)world.getTileEntity(x - 2, y - 3, z + 4));
+ }
+
+ /**
+ * @param pedestal
+ */
+ public void addPedestalInfo(TileEntityHandPedestal pedestal)
+ {
+ ItemStack heldItemStack;
+ if (pedestal != null && (heldItemStack = pedestal.getHeldItemStack()) != null){
+ if (pedestalItems.isEmpty()) pedestalItems.add(heldItemStack.copy());
+ else{
+ boolean hasItem = false;
+ int index = 0;
+ for(int ind = 0; ind < pedestalItems.size() && !hasItem; ind++)
+ if (heldItemStack.getItem().equals(pedestalItems.get(ind).getItem()) && heldItemStack.getItemDamage() == pedestalItems.get(ind).getItemDamage()){
+ index = ind;
+ hasItem = true;
+ if (heldItemStack.hasTagCompound() && pedestalItems.get(ind).hasTagCompound() && !heldItemStack.getTagCompound().equals(pedestalItems.get(ind).getTagCompound())) hasItem = false;
+ }
+ if (!hasItem) pedestalItems.add(heldItemStack.copy());
+ else{
+ ItemStack object = pedestalItems.get(index).copy();
+ object.stackSize++;
+ pedestalItems.set(index, object);
+ }
+ }
+ pedestal.removeHeldItemStack();
+ pedestal.openHand();
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java
new file mode 100644
index 0000000..b22602e
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowHand.java
@@ -0,0 +1,7 @@
+package darkknight.jewelrycraft.tileentity;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityShadowHand extends TileEntityHandPedestal
+{} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
new file mode 100644
index 0000000..83f2cb2
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java
@@ -0,0 +1,186 @@
+package darkknight.jewelrycraft.tileentity;
+
+import java.util.Random;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.network.NetworkManager;
+import net.minecraft.network.Packet;
+import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
+import net.minecraft.tileentity.TileEntity;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class TileEntitySmelter extends TileEntity
+{
+ public int melting, flow, n = 0, p = 0;
+ public boolean hasMetal, hasMoltenMetal, isDirty, pouring;
+ public ItemStack metal, moltenMetal;
+ public float quantity, pouredQuantity = 0.1f;
+
+ /**
+ *
+ */
+ public TileEntitySmelter()
+ {
+ melting = 0;
+ pouring = false;
+ flow = 0;
+ quantity = 0f;
+ hasMetal = false;
+ hasMoltenMetal = false;
+ metal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ isDirty = false;
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void writeToNBT(NBTTagCompound nbt)
+ {
+ super.writeToNBT(nbt);
+ nbt.setInteger("melting", melting);
+ nbt.setFloat("quantity", quantity);
+ nbt.setBoolean("hasMetal", hasMetal);
+ nbt.setBoolean("hasMoltenMetal", hasMoltenMetal);
+ nbt.setBoolean("pouring", pouring);
+ NBTTagCompound tag = new NBTTagCompound();
+ NBTTagCompound tag1 = new NBTTagCompound();
+ metal.writeToNBT(tag);
+ nbt.setTag("metal", tag);
+ moltenMetal.writeToNBT(tag1);
+ nbt.setTag("moltenMetal", tag1);
+ }
+
+ /**
+ * @param nbt
+ */
+ @Override
+ public void readFromNBT(NBTTagCompound nbt)
+ {
+ super.readFromNBT(nbt);
+ melting = nbt.getInteger("melting");
+ quantity = nbt.getFloat("quantity");
+ hasMetal = nbt.getBoolean("hasMetal");
+ hasMoltenMetal = nbt.getBoolean("hasMoltenMetal");
+ pouring = nbt.getBoolean("pouring");
+ metal = new ItemStack(Item.getItemById(0), 0, 0);
+ metal.readFromNBT(nbt.getCompoundTag("metal"));
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal"));
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void updateEntity()
+ {
+ super.updateEntity();
+ Random rand = new Random();
+ if (isDirty){
+ worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
+ isDirty = false;
+ }
+ if (p > 0) --p;
+ else p = 5;
+ if (n == 0 && p == 0){
+ flow += 16;
+ if (flow >= 16 * 20) n = 1;
+ }
+ if (n == 1 && p == 0){
+ flow -= 16;
+ if (flow <= 0) n = 0;
+ }
+ if (hasMetal) for(int l = 0; l < 2; ++l)
+ worldObj.spawnParticle("flame", xCoord + rand.nextFloat(), (double)yCoord + 0.3F, zCoord + rand.nextFloat(), 0.0D, 0.0D, 0.0D);
+ if (rand.nextInt(65) == 0){
+ double d5 = xCoord + rand.nextFloat();
+ double d7 = yCoord;
+ double d6 = zCoord + rand.nextFloat();
+ worldObj.playSound(d5, d7, d6, "liquid.lavapop", 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false);
+ }
+ if (hasMetal && !hasMoltenMetal){
+ boolean isOre = JewelrycraftUtil.isOre(metal);
+ if (melting > 0) melting--;
+ if (melting == 0){
+ hasMetal = false;
+ if (!isOre) moltenMetal = metal;
+ else{
+ moltenMetal = JewelrycraftUtil.getIngotFromOre(metal.getItem());
+ moltenMetal.stackSize *= 2;
+ }
+ hasMoltenMetal = true;
+ if (!isOre) quantity = 0.1f * metal.stackSize;
+ else quantity = 0.2f * metal.stackSize;
+ metal = new ItemStack(Item.getItemById(0), 0, 0);
+ melting = -1;
+ isDirty = true;
+ }
+ }else if (hasMoltenMetal){
+ boolean isOre = JewelrycraftUtil.isOre(metal);
+ if (melting > 0) melting--;
+ if (melting == 0){
+ hasMetal = false;
+ if (!isOre) moltenMetal.stackSize += metal.stackSize;
+ else moltenMetal.stackSize += metal.stackSize * 2;
+ if (!isOre) quantity += 0.1f * metal.stackSize;
+ else quantity += 0.2f * metal.stackSize;
+ metal = new ItemStack(Item.getItemById(0), 0, 0);
+ melting = -1;
+ isDirty = true;
+ }
+ }
+ TileEntityMolder me = null;
+ if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 0 && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) != null && worldObj.getTileEntity(xCoord, yCoord, zCoord - 1) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord, yCoord, zCoord - 1);
+ else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 1 && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) != null && worldObj.getTileEntity(xCoord + 1, yCoord, zCoord) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord + 1, yCoord, zCoord);
+ else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 2 && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) != null && worldObj.getTileEntity(xCoord, yCoord, zCoord + 1) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord, yCoord, zCoord + 1);
+ else if (worldObj.getBlockMetadata(xCoord, yCoord, zCoord) == 3 && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) != null && worldObj.getTileEntity(xCoord - 1, yCoord, zCoord) instanceof TileEntityMolder) me = (TileEntityMolder)worldObj.getTileEntity(xCoord - 1, yCoord, zCoord);
+ if (pouring && pouredQuantity > 0f){
+ quantity -= 0.01f;
+ pouredQuantity -= 0.01f;
+ me.quantity += 0.01f;
+ if (!me.hasMoltenMetal){
+ me.moltenMetal = moltenMetal;
+ me.hasMoltenMetal = true;
+ }
+ if (pouredQuantity <= 0f){
+ pouring = false;
+ pouredQuantity = 0.1f;
+ me.cooling = ConfigHandler.ingotCoolingTime;
+ }
+ if (quantity <= 0f){
+ quantity = 0f;
+ hasMoltenMetal = false;
+ moltenMetal = new ItemStack(Item.getItemById(0), 0, 0);
+ // pouring = false;
+ me.cooling = ConfigHandler.ingotCoolingTime;
+ }
+ me.isDirty = true;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Packet getDescriptionPacket()
+ {
+ NBTTagCompound nbttagcompound = new NBTTagCompound();
+ writeToNBT(nbttagcompound);
+ return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, 1, nbttagcompound);
+ }
+
+ /**
+ * @param net
+ * @param packet
+ */
+ @Override
+ public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity packet)
+ {
+ readFromNBT(packet.func_148857_g());
+ worldObj.func_147479_m(xCoord, yCoord, zCoord);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/ItemRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/ItemRender.java
new file mode 100644
index 0000000..31e5676
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/ItemRender.java
@@ -0,0 +1,65 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraftforge.client.IItemRenderer;
+import org.lwjgl.opengl.GL11;
+
+public class ItemRender implements IItemRenderer
+{
+ TileEntitySpecialRenderer render;
+ public TileEntity entity;
+ ModelBase model;
+
+ /**
+ * @param render
+ * @param entity
+ * @param model
+ */
+ public ItemRender(TileEntitySpecialRenderer render, TileEntity entity, ModelBase model)
+ {
+ this.entity = entity;
+ this.render = render;
+ this.model = model;
+ }
+
+ /**
+ * @param item
+ * @param type
+ * @return
+ */
+ @Override
+ public boolean handleRenderType(ItemStack item, ItemRenderType type)
+ {
+ return true;
+ }
+
+ /**
+ * @param type
+ * @param item
+ * @param helper
+ * @return
+ */
+ @Override
+ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper)
+ {
+ return true;
+ }
+
+ /**
+ * @param type
+ * @param item
+ * @param data
+ */
+ @Override
+ public void renderItem(ItemRenderType type, ItemStack item, Object ... data)
+ {
+ if (type == IItemRenderer.ItemRenderType.ENTITY){
+ GL11.glRotatef(180f, 0f, 1f, 0f);
+ GL11.glTranslatef(-0.5f, -0.5f, -0.4f);
+ }
+ render.renderTileEntityAt(entity, 0.0D, 0.0D, 0.0D, 0.0F);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/MaskRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/MaskRender.java
new file mode 100644
index 0000000..1e26107
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/MaskRender.java
@@ -0,0 +1,30 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelMask;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+
+public class MaskRender extends TileEntitySpecialRenderer
+{
+ ModelMask mask = new ModelMask();
+ ResourceLocation texture = new ResourceLocation("jewelrycraft", "textures/entities/Mask.png");
+
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
+ {
+ }
+
+ public void doRender(Entity entity, double x, double y, double z, float f, float g)
+ {
+ GL11.glPushMatrix();
+ Minecraft.getMinecraft().renderEngine.bindTexture(texture);
+ mask.render(entity, 0F, 0F, 0F, 0F, 0F, 0.02F);
+ GL11.glPopMatrix();
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java
new file mode 100644
index 0000000..8cff8bc
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityDisplayerRender.java
@@ -0,0 +1,262 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import java.awt.Color;
+import java.util.HashMap;
+import java.util.List;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelDisplayer;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+
+public class TileEntityDisplayerRender extends TileEntitySpecialRenderer
+{
+ ModelDisplayer displayer = new ModelDisplayer();
+ String texture = "textures/tileentities/Displayer.png";
+ HashMap<EnumChatFormatting, Integer> colors = new HashMap<EnumChatFormatting, Integer>(){
+ {
+ put(EnumChatFormatting.AQUA, 5636095);
+ put(EnumChatFormatting.BLACK, 0);
+ put(EnumChatFormatting.BLUE, 5592575);
+ put(EnumChatFormatting.DARK_AQUA, 43690);
+ put(EnumChatFormatting.DARK_BLUE, 170);
+ put(EnumChatFormatting.DARK_GRAY, 5592405);
+ put(EnumChatFormatting.DARK_GREEN, 43520);
+ put(EnumChatFormatting.DARK_PURPLE, 11141290);
+ put(EnumChatFormatting.DARK_RED, 11141120);
+ put(EnumChatFormatting.GOLD, 16755200);
+ put(EnumChatFormatting.GRAY, 11184810);
+ put(EnumChatFormatting.GREEN, 5635925);
+ put(EnumChatFormatting.LIGHT_PURPLE, 16733695);
+ put(EnumChatFormatting.RED, 16733525);
+ put(EnumChatFormatting.WHITE, 16777215);
+ put(EnumChatFormatting.YELLOW, 16777045);
+ }
+ };
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
+ {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
+ TileEntityDisplayer disp = (TileEntityDisplayer)te;
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ displayer.render((Entity)null, disp.ringTranslation1, disp.ringTranslation2, disp.ringTranslation3, 0.0F, 0.0F, 0.0625F);
+ try{
+ int block = disp.getBlockMetadata();
+ if (disp != null && disp.hasObject && disp.object != null && disp.object.getItem() != null && disp.object != new ItemStack(Item.getItemById(0), 0, 0)){
+ int ind = -3;
+ GL11.glPushMatrix();
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, disp.object);
+ entityitem.hoverStart = 0.0F;
+ disp.object.stackSize = 1;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glTranslatef(0.0F, -0.6F + disp.ringTranslation1 / 5, 0F);
+ GL11.glRotatef(disp.rotAngle, 0F, 1F, 0F);
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ int i = 15728880;
+ int j = i % 65536;
+ int k = i / 65536;
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ EntityPlayer player = te.getWorldObj().getClosestPlayer(te.xCoord, te.yCoord, te.zCoord, 5D);
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ if (player != null) renderLabel(disp.object.getDisplayName(), 0F, -0.171F * ind, 0F, block, disp, colors.get(disp.object.getRarity().rarityColor));
+ GL11.glPopMatrix();
+ ind++;
+ if (player != null && disp.quantity > 1){
+ GL11.glPushMatrix();
+ renderLabel("x" + Integer.toString(disp.quantity), 0F, -0.171F * ind, 0F, block, disp, Color.GRAY.getRGB());
+ GL11.glPopMatrix();
+ ind++;
+ }
+ if (disp.object.getItem() != Items.map && player != null && disp.object.getTooltip(player, true) != null){
+ List tooltips = disp.object.getTooltip(player, true);
+ if (disp.infoIndex + 5 > tooltips.size()) disp.infoIndex = 1;
+ if (tooltips.size() < 5) for(int i = 1; i < tooltips.size(); i++){
+ String tooltip = tooltips.get(i).toString();
+ RenderManager.instance.getFontRenderer();
+ if (tooltip != ""){
+ GL11.glPushMatrix();
+ renderLabel(tooltip, 0F, -0.171F * ind, 0F, block, disp, Color.GRAY.getRGB());
+ GL11.glPopMatrix();
+ ind++;
+ }
+ }
+ else for(int i = disp.infoIndex; i < disp.infoIndex + 5; i++){
+ String tooltip = tooltips.get(i).toString();
+ RenderManager.instance.getFontRenderer();
+ if (tooltip != ""){
+ GL11.glPushMatrix();
+ renderLabel(tooltip, 0F, -0.171F * ind, 0F, block, disp, Color.GRAY.getRGB());
+ GL11.glPopMatrix();
+ ind++;
+ }
+ }
+ }
+ }
+ }
+ catch(Exception e){}
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param par2Str
+ * @param x
+ * @param y
+ * @param z
+ * @param metadata
+ * @param te
+ * @param color
+ */
+ protected void renderLabel(String par2Str, double x, double y, double z, int metadata, TileEntity te, int color)
+ {
+ FontRenderer fontrenderer = RenderManager.instance.getFontRenderer();
+ float var14 = 0.01266667F * 1.5F;
+ float var17 = 0.015F;
+ GL11.glRotatef(180F, 0F, 0F, 1F);
+ if (metadata == 0) GL11.glRotatef(0F, 0F, 1F, 0F);
+ else if (metadata == 1) GL11.glRotatef(270F, 0F, 1F, 0F);
+ else if (metadata == 2) GL11.glRotatef(180F, 0F, 1F, 0F);
+ else if (metadata == 3) GL11.glRotatef(90F, 0F, 1F, 0F);
+ GL11.glTranslatef((float)x, (float)y, (float)z + 0.45F);
+ GL11.glScalef(-0.015F, -var14, 0.015F);
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ Tessellator tessellator = Tessellator.instance;
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ int j = fontrenderer.getStringWidth(par2Str) / 2;
+ tessellator.startDrawingQuads();
+ tessellator.setColorRGBA_F(0.0F, 0.2F, 0.2F, 0.9F);
+ tessellator.addVertex(-33.333 - 0, 0D, 0.1D);
+ tessellator.addVertex(-33.333 - 0, 9D, 0.1D);
+ tessellator.addVertex(33.333 + 0, 9D, 0.1D);
+ tessellator.addVertex(33.333 + 0, 0D, 0.1D);
+ tessellator.draw();
+ if (fontrenderer.getStringWidth(par2Str) / 2 > 20) var17 = 0.9F / fontrenderer.getStringWidth(par2Str);
+ else var17 = var14;
+ int red = color >> 16 & 0xFF;
+ int green = color >> 8 & 0xFF;
+ int blue = color & 0xFF;
+ GL11.glTranslatef((float)x + 1f, (float)y + 1f, (float)z);
+ GL11.glPushMatrix();
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ GL11.glScalef(var17 * 70F, 1F, 0F);
+ int i = 15728880;
+ int t = i % 65536;
+ int k = i / 65536;
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, t / 1.0F, k / 1.0F);
+ fontrenderer.drawString(par2Str.replaceFirst("§0", "§r").replaceFirst("§1", "§r").replaceFirst("§2", "§r").replaceFirst("§3", "§r").replaceFirst("§4", "§r").replaceFirst("§5", "§r").replaceFirst("§6", "§r").replaceFirst("§7", "§r").replaceFirst("§8", "§r").replaceFirst("§9", "§r").replaceFirst("§a", "§r").replaceFirst("§b", "§r").replaceFirst("§c", "§r").replaceFirst("§d", "§r").replaceFirst("§e", "§r").replaceFirst("§f", "§r"), -j, 0, 65536 * (red > 170 ? red - 170 : 0) + 256 * (green > 170 ? green - 170 : 0) + (blue > 170 ? blue - 170 : 0));
+ GL11.glPopMatrix();
+ GL11.glTranslatef((float)x - 1f, (float)y - 1f, (float)z - 1F);
+ GL11.glScalef(var17 * 70F, 1F, 0F);
+ fontrenderer.drawString(par2Str, -j, 0, color);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param str
+ * @param color
+ */
+ public void replaceEnumEnchValues(String str, int color)
+ {
+ if (str.contains("§0")){
+ color = Color.BLACK.getRGB();
+ str.replace("§0", "");
+ }
+ if (str.contains("§1")){
+ color = 85;
+ str.replace("§1", "");
+ }
+ if (str.contains("§2")){
+ color = 17920;
+ str.replace("§2", "");
+ }
+ if (str.contains("§3")){
+ color = 1336183;
+ str.replace("§3", "");
+ }
+ if (str.contains("§4")){
+ color = 4587520;
+ str.replace("§4", "");
+ }
+ if (str.contains("§5")){
+ color = 5701759;
+ str.replace("§5", "");
+ }
+ if (str.contains("§6")){
+ color = 16762880;
+ str.replace("§6", "");
+ }
+ if (str.contains("§7")){
+ color = Color.GRAY.getRGB();
+ str.replace("§7", "");
+ }
+ if (str.contains("§8")){
+ color = Color.DARK_GRAY.getRGB();
+ str.replace("§8", "");
+ }
+ if (str.contains("§9")){
+ color = Color.BLUE.getRGB();
+ str.replace("§9", "");
+ }
+ if (str.contains("§a")){
+ color = Color.GREEN.getRGB();
+ str.replace("§a", "");
+ }
+ if (str.contains("§b")){
+ color = Color.CYAN.getRGB();
+ str.replace("§b", "");
+ }
+ if (str.contains("§c")){
+ color = Color.RED.getRGB();
+ str.replace("§c", "");
+ }
+ if (str.contains("§d")){
+ color = 11665663;
+ str.replace("§d", "");
+ }
+ if (str.contains("§e")){
+ color = Color.YELLOW.getRGB();
+ str.replace("§e", "");
+ }
+ if (str.contains("§f")){
+ color = Color.WHITE.getRGB();
+ str.replace("§f", "");
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java
new file mode 100644
index 0000000..ac98ca6
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityHandPedestalRender.java
@@ -0,0 +1,47 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelHandPedestal;
+import darkknight.jewelrycraft.tileentity.TileEntityHandPedestal;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityHandPedestalRender extends TileEntitySpecialRenderer
+{
+ private ModelHandPedestal model;
+ private ResourceLocation texture;
+
+ /**
+ * @param model
+ * @param texture
+ */
+ public TileEntityHandPedestalRender(ModelHandPedestal model, ResourceLocation texture)
+ {
+ this.model = model;
+ this.texture = texture;
+ }
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param partialRenderTicks
+ */
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float partialRenderTicks)
+ {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
+ TileEntityHandPedestal pedestal = (TileEntityHandPedestal)te;
+ bindTexture(texture);
+ GL11.glRotatef(180, 0, 0, 1);
+ GL11.glRotatef(pedestal.getWorldObj() == null ? 180 : pedestal.getBlockMetadata() % 8 / 8F * 360, 0, 1, 0);
+ model.render(pedestal, partialRenderTicks, 0.0625F);
+ GL11.glPopMatrix();
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java
new file mode 100644
index 0000000..7a8e35b
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityJewelrsCraftingTableRender.java
@@ -0,0 +1,136 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelJewlersCraftingBench;
+import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable;
+
+public class TileEntityJewelrsCraftingTableRender extends TileEntitySpecialRenderer
+{
+ ModelJewlersCraftingBench modelTable = new ModelJewlersCraftingBench();
+ String texture = "textures/tileentities/JewelrsCraftingBench.png";
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
+ {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ TileEntityJewelrsCraftingTable jt = (TileEntityJewelrsCraftingTable)te;
+ GL11.glPushMatrix();
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = te.getBlockMetadata();
+ if (block == 1) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 3){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ catch(Exception e){}
+ modelTable.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
+ if (jt != null){
+ if (jt.hasJewelry && jt.jewelry.getIconIndex() != null && jt.jewelry.getIconIndex().getIconName() != ""){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.jewelry);
+ entityitem.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.55F, -1.5F, -0.45F);
+ GL11.glRotatef(jt.angle, 0F, 1F, 0F);
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ if (jt.hasEndItem && jt.endItem.getIconIndex().getIconName() != ""){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.endItem);
+ entityitem.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(0.0F, -1.6F, 0.6F);
+ GL11.glRotatef(jt.angle, 0F, 1F, 0F);
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ if (jt.hasGem && jt.gem.getIconIndex().getIconName() != ""){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, jt.gem);
+ entityitem.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(-0.55F, -1.5F, -0.45F);
+ GL11.glRotatef(jt.angle, 0F, 1F, 0F);
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else{
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ }
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param block
+ */
+ public void adjustLightFixture(World world, int i, int j, int k, Block block)
+ {
+ Tessellator tess = Tessellator.instance;
+ float brightness = block.getLightOpacity(world, i, j, k);
+ int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
+ int modulousModifier = skyLight % 65536;
+ int divModifier = skyLight / 65536;
+ tess.setColorOpaque_F(brightness, brightness, brightness);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java
new file mode 100644
index 0000000..9685e2e
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityMolderRender.java
@@ -0,0 +1,138 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.model.ModelMolder;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class TileEntityMolderRender extends TileEntitySpecialRenderer
+{
+ ModelMolder modelMolder = new ModelMolder();
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
+ {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
+ TileEntityMolder me = (TileEntityMolder)te;
+ String texture = "textures/tileentities/Molder.png";
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = me.getBlockMetadata();
+ if (block == 1) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 3){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ catch(Exception e){}
+ modelMolder.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
+ boolean fancyGraphics = Minecraft.getMinecraft().gameSettings.fancyGraphics;
+ if (me != null){
+ if (me.hasMold){
+ GL11.glPushMatrix();
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, me.mold);
+ entityitem.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glTranslatef(0F, 1.43F, -0.28F);
+ GL11.glScalef(1.25F, 1.0F, 1.25F);
+ GL11.glRotatef(90F, 1F, 0F, 0f);
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
+ if (entityitem != null){
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.03D, 0.0F, 0.0F);
+ }
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics;
+ GL11.glPopMatrix();
+ }
+ if (me.hasJewelBase && me.jewelBase.getIconIndex() != null && me.jewelBase.getIconIndex().getIconName() != ""){
+ GL11.glPushMatrix();
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, me.jewelBase);
+ entityitem.getEntityItem().stackSize = 1;
+ entityitem.hoverStart = 0.0F;
+ GL11.glTranslatef(0F, 1.4F, -0.28F);
+ GL11.glScalef(1.25F, 1.0F, 1.25F);
+ GL11.glRotatef(90F, 1F, 0F, 0f);
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
+ if (entityitem != null) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.01D, 0.0F, 0.0F);
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics;
+ GL11.glColor4f(1, 1F, 1F, 1.0F);
+ GL11.glPopMatrix();
+ }
+ if (me.hasMoltenMetal && me.moltenMetal != null && me.moltenMetal != new ItemStack(Item.getItemById(0), 0, 0)){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ if (JewelrycraftMod.fancyRender){
+ GL11.glEnable(GL11.GL_BLEND);
+ OpenGlHelper.glBlendFunc(1, 1, 0, 0);
+ }
+ ItemStack metal = new ItemStack(ItemList.metal);
+ ItemStack ingot = me.moltenMetal.copy();
+ if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage());
+ JewelryNBT.addMetal(metal, ingot);
+ EntityItem moltenMetal = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, metal);
+ moltenMetal.getEntityItem().stackSize = 1;
+ moltenMetal.hoverStart = 0.0F;
+ GL11.glTranslatef(-0F, 1.38f - 0.005f * me.quantity, -0.29F);
+ GL11.glScalef(1.1F, 1.0F, 1.4F);
+ GL11.glRotatef(90F, 1F, 0F, 0f);
+ RenderItem.renderInFrame = true;
+ RenderManager.instance.renderEntityWithPosYaw(moltenMetal, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderItem.renderInFrame = false;
+ if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ }
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param block
+ */
+ public void adjustLightFixture(World world, int i, int j, int k, Block block)
+ {
+ Tessellator tess = Tessellator.instance;
+ float brightness = block.getLightOpacity(world, i, j, k);
+ int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
+ int modulousModifier = skyLight % 65536;
+ int divModifier = skyLight / 65536;
+ tess.setColorOpaque_F(brightness, brightness, brightness);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java
new file mode 100644
index 0000000..7bf2363
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowEyeRender.java
@@ -0,0 +1,79 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.model.ModelShadowEye;
+import darkknight.jewelrycraft.tileentity.TileEntityShadowEye;
+
+public class TileEntityShadowEyeRender extends TileEntitySpecialRenderer
+{
+ ModelShadowEye eye = new ModelShadowEye();
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
+ {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)x + 0.5F, (float)y + 1.6F, (float)z + 0.5F);
+ TileEntityShadowEye eyeS = (TileEntityShadowEye)te;
+ String texture = "textures/tileentities/ShadowEye" + eyeS.opening + ".png";
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ GL11.glPushMatrix();
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = te.getBlockMetadata();
+ if (block == 0) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 1){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ catch(Exception e){}
+ try{
+ EntityPlayer player = te.getWorldObj().getClosestPlayer(te.xCoord, te.yCoord, te.zCoord, 16D);
+ if (player != null) eye.render(player, te.xCoord, te.yCoord, te.zCoord, te.blockMetadata, eyeS.opening, 0.0625F);
+ }
+ catch(Exception e){
+ eye.render((Entity)null, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F);
+ }
+ GL11.glPopMatrix();
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param block
+ */
+ public void adjustLightFixture(World world, int i, int j, int k, Block block)
+ {
+ Tessellator tess = Tessellator.instance;
+ float brightness = block.getLightOpacity(world, i, j, k);
+ int skyLight = world.getLightBrightnessForSkyBlocks(i, j, k, 0);
+ int modulousModifier = skyLight % 65536;
+ int divModifier = skyLight / 65536;
+ tess.setColorOpaque_F(brightness, brightness, brightness);
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, modulousModifier, divModifier);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java
new file mode 100644
index 0000000..d0e2799
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntityShadowHandRender.java
@@ -0,0 +1,20 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.util.ResourceLocation;
+import darkknight.jewelrycraft.model.ModelHandPedestal;
+
+/**
+ * @author Paul Fulham (pau101)
+ */
+public class TileEntityShadowHandRender extends TileEntityHandPedestalRender
+{
+
+ /**
+ * @param model
+ * @param texture
+ */
+ public TileEntityShadowHandRender(ModelHandPedestal model, ResourceLocation texture)
+ {
+ super(model, texture);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java
new file mode 100644
index 0000000..e6a92a5
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/tileentity/renders/TileEntitySmelterRender.java
@@ -0,0 +1,125 @@
+package darkknight.jewelrycraft.tileentity.renders;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.entity.RenderItem;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.model.ModelSmelter;
+import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+import darkknight.jewelrycraft.util.JewelryNBT;
+
+public class TileEntitySmelterRender extends TileEntitySpecialRenderer
+{
+ ModelSmelter modelSmelter = new ModelSmelter();
+ public static final float p = 1 / 16, p3 = 3 * p, p13 = 13 * p, p15 = 15 * p;
+
+ /**
+ * @param te
+ * @param x
+ * @param y
+ * @param z
+ * @param scale
+ */
+ @Override
+ public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale)
+ {
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F);
+ String texture = "textures/tileentities/Smelter.png";
+ ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture);
+ Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture);
+ TileEntitySmelter st = (TileEntitySmelter)te;
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ try{
+ int block = te.getBlockMetadata();
+ if (block == 1) GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
+ else if (block == 2){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F);
+ }else if (block == 3){
+ GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
+ GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F);
+ }
+ }
+ catch(Exception e){}
+ boolean fancyGraphics = Minecraft.getMinecraft().gameSettings.fancyGraphics;
+ modelSmelter.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
+ if (scale != 0){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ if (JewelrycraftMod.fancyRender){
+ GL11.glEnable(GL11.GL_BLEND);
+ OpenGlHelper.glBlendFunc(1, 1, 0, 0);
+ }
+ EntityItem entityitem = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, new ItemStack(Blocks.lava, 1, 1));
+ entityitem.hoverStart = 0.0F;
+ GL11.glTranslatef(-0F, 1.25F, -0.345F);
+ GL11.glScalef(1.2F, 1.0F, 1.7F);
+ GL11.glRotatef(90F, 1F, 0F, 0f);
+ RenderItem.renderInFrame = true;
+ int i = 15728880;
+ int j = i % 65536;
+ int k = i / 65536;
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderItem.renderInFrame = false;
+ if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ if (st != null){
+ if (st.hasMetal && st.metal != null && st.metal.getItem() != null){
+ GL11.glPushMatrix();
+ EntityItem metal = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, st.metal);
+ metal.getEntityItem().stackSize = 1;
+ metal.hoverStart = 0.0F;
+ GL11.glRotatef(-50F, 1F, 0F, 0F);
+ GL11.glRotatef(-50F, 0F, 0F, 1F);
+ GL11.glRotatef(180F, 1F, 0F, 0F);
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ GL11.glTranslatef(-0.9F, -0.9F, -1.6F);
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(metal, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ Minecraft.getMinecraft().gameSettings.fancyGraphics = fancyGraphics;
+ GL11.glPopMatrix();
+ }
+ if (st.hasMoltenMetal && st.moltenMetal != null && st.moltenMetal.getItem() != null){
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ if (JewelrycraftMod.fancyRender){
+ GL11.glEnable(GL11.GL_BLEND);
+ OpenGlHelper.glBlendFunc(1, 1, 0, 0);
+ }
+ ItemStack metal = new ItemStack(ItemList.metal);
+ ItemStack ingot = st.moltenMetal.copy();
+ if (Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_glass) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.stained_hardened_clay) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.wool) || Item.getIdFromItem(ingot.getItem()) == Block.getIdFromBlock(Blocks.carpet)) ingot.setItemDamage(15 - ingot.getItemDamage());
+ JewelryNBT.addMetal(metal, ingot);
+ EntityItem moltenMetal = new EntityItem(te.getWorldObj(), 0.0D, 0.0D, 0.0D, metal);
+ moltenMetal.getEntityItem().stackSize = 1;
+ moltenMetal.hoverStart = 0.0F;
+ GL11.glTranslatef(-0F, 1.00f - .4F * st.quantity, -0.14F);
+ GL11.glScalef(0.71F, 1F, 0.84F);
+ GL11.glRotatef(90F, 1F, 0F, 0f);
+ RenderItem.renderInFrame = true;
+ RenderManager.instance.renderEntityWithPosYaw(moltenMetal, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderItem.renderInFrame = false;
+ if (JewelrycraftMod.fancyRender) GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+ }
+ GL11.glPopMatrix();
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/util/BlockUtils.java b/src/main/java/darkknight/jewelrycraft/util/BlockUtils.java
new file mode 100644
index 0000000..18cb9eb
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/util/BlockUtils.java
@@ -0,0 +1,155 @@
+package darkknight.jewelrycraft.util;
+
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.MathHelper;
+import net.minecraft.util.MovingObjectPosition;
+import net.minecraft.world.World;
+import net.minecraftforge.common.util.ForgeDirection;
+
+public class BlockUtils
+{
+ public static final ForgeDirection DEFAULT_BLOCK_DIRECTION = ForgeDirection.WEST;
+
+ /**
+ * This method is used to get the direction an entity is facing (NORTH, SOUTH, EAST or WEST) based on the entity's rotationYaw.
+ *
+ * @param entity the living entity
+ * @return a direction
+ */
+ public static ForgeDirection get2dOrientation(EntityLivingBase entity)
+ {
+ int l = MathHelper.floor_double(entity.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3;
+ switch(l)
+ {
+ case 0:
+ return ForgeDirection.SOUTH;
+ case 1:
+ return ForgeDirection.WEST;
+ case 2:
+ return ForgeDirection.NORTH;
+ case 3:
+ return ForgeDirection.EAST;
+ }
+ return ForgeDirection.SOUTH;
+ }
+
+ /**
+ * This gets a float value depending on a direction
+ *
+ * @param direction the forge direction
+ * @return value depending on direction
+ */
+ public static float getRotationFromDirection(ForgeDirection direction)
+ {
+ switch(direction)
+ {
+ case NORTH:
+ return 0F;
+ case SOUTH:
+ return 180F;
+ case WEST:
+ return 90F;
+ case EAST:
+ return -90F;
+ case DOWN:
+ return -90f;
+ case UP:
+ return 90f;
+ default:
+ return 0f;
+ }
+ }
+
+ /**
+ * This method is used to get the direction an entity is looking at (UP or DOWN) based on the entitiy's rotationPitch
+ *
+ * @param entity the living entity
+ * @return a forge direction
+ */
+ public static ForgeDirection get3dOrientation(EntityLivingBase entity)
+ {
+ if (entity.rotationPitch > 45.5F) return ForgeDirection.DOWN;
+ else if (entity.rotationPitch < -45.5F) return ForgeDirection.UP;
+ return get2dOrientation(entity);
+ }
+
+ /**
+ * This spawns the item specified and returns the EntityItem it created
+ *
+ * @param worldObj the world
+ * @param x position of the item to drop on the X axis
+ * @param y position of the item to drop on the Y axis
+ * @param z position of the item to drop on the Z axis
+ * @param stack the item to spawn
+ * @return the EntityItem of the stack
+ */
+ public static EntityItem dropItemStackInWorld(World worldObj, double x, double y, double z, ItemStack stack)
+ {
+ float f = 0.7F;
+ float d0 = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5F;
+ float d1 = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5F;
+ float d2 = worldObj.rand.nextFloat() * f + (1.0F - f) * 0.5F;
+ EntityItem entityitem = new EntityItem(worldObj, x + d0, y + d1, z + d2, stack);
+ entityitem.delayBeforeCanPickup = 10;
+ if (stack.hasTagCompound()) entityitem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy());
+ worldObj.spawnEntityInWorld(entityitem);
+ return entityitem;
+ }
+
+ /**
+ * It spawns the item with momentum in a certain direction
+ *
+ * @param world the world to spawn the item
+ * @param x the X coordinate to spawn it in
+ * @param y the Y coordinate to spawn it in
+ * @param z the Z coordinate to spawn it in
+ * @param direction the direction towards which it should eject
+ * @param stack the item to spawn
+ * @return the spawned EntityItem
+ */
+ public static EntityItem ejectItemInDirection(World world, double x, double y, double z, ForgeDirection direction, ItemStack stack)
+ {
+ EntityItem item = BlockUtils.dropItemStackInWorld(world, x, y, z, stack);
+ item.motionX = direction.offsetX / 5F;
+ item.motionY = direction.offsetY / 5F;
+ item.motionZ = direction.offsetZ / 5F;
+ return item;
+ }
+
+ /**
+ * Drops the content of an inventory with doubles as coordinates
+ *
+ * @param inventory the inventory the items are contained in
+ * @param world the world in which to spawn
+ * @param x the X coordinate to spawn it in
+ * @param y the Y coordinate to spawn it in
+ * @param z the Z coordinate to spawn it in
+ */
+ public static void dropInventory(IInventory inventory, World world, double x, double y, double z)
+ {
+ if (inventory == null) return;
+ for(int i = 0; i < inventory.getSizeInventory(); ++i){
+ ItemStack itemStack = inventory.getStackInSlot(i);
+ if (itemStack != null) dropItemStackInWorld(world, x, y, z, itemStack);
+ }
+ }
+
+ /**
+ * Drops the content of an inventory with integer as coordinates
+ *
+ * @param inventory the inventory the items are contained in
+ * @param world the world in which to spawn
+ * @param x the X coordinate to spawn it in
+ * @param y the Y coordinate to spawn it in
+ * @param z the Z coordinate to spawn it in
+ */
+ public static void dropInventory(IInventory inventory, World world, int x, int y, int z)
+ {
+ dropInventory(inventory, world, x + 0.5, y + 0.5, z + 0.5);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/util/JewelryNBT.java b/src/main/java/darkknight/jewelrycraft/util/JewelryNBT.java
new file mode 100644
index 0000000..9526a4d
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/util/JewelryNBT.java
@@ -0,0 +1,728 @@
+package darkknight.jewelrycraft.util;
+
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.block.Block;
+import net.minecraft.entity.EntityList;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagList;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.world.World;
+
+public class JewelryNBT
+{
+ // TODO NBT Tag Adding
+ /**
+ * @param item The item you want to add the NBT data on
+ * @param metal The metal you want to add on the item
+ */
+ public static void addMetal(ItemStack item, ItemStack metal)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound ingotNBT = new NBTTagCompound();
+ metal.writeToNBT(ingotNBT);
+ itemStackData.setTag("ingot", ingotNBT);
+ }
+
+ /**
+ * @param item The item you want to add the NBT data on
+ * @param gem The gem you want to add on the item
+ */
+ public static void addGem(ItemStack item, ItemStack gem)
+ {
+ if (gem != null){
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound gemNBT = new NBTTagCompound();
+ gem.writeToNBT(gemNBT);
+ itemStackData.setTag("gem", gemNBT);
+ }
+ }
+
+ /**
+ * @param item The item you want to add the NBT data on
+ * @param modifier The modifier you want to add on the item
+ */
+ public static void addModifiers(ItemStack item, ArrayList<ItemStack> modifier)
+ {
+ if (modifier != null){
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ for(int i = 0; i < modifier.size(); i++){
+ NBTTagCompound modifierNBT = new NBTTagCompound();
+ modifier.get(i).writeToNBT(modifierNBT);
+ itemStackData.setTag("modifier" + i, modifierNBT);
+ }
+ itemStackData.setInteger("modifierSize", modifier.size());
+ }
+ }
+
+ /**
+ * @param item The item you want to add the NBT data on
+ * @param entity The entity to add on the item
+ */
+ public static void addEntity(ItemStack item, EntityLivingBase entity)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound entityNBT = new NBTTagCompound();
+ entity.writeToNBT(entityNBT);
+ itemStackData.setTag("entity", entityNBT);
+ }
+
+ /**
+ * @param item
+ * @param entity
+ */
+ public static void addEntityID(ItemStack item, EntityLivingBase entity)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound entityNBT = new NBTTagCompound();
+ int id = EntityList.getEntityID(entity);
+ entityNBT.setInteger("entityID", id);
+ itemStackData.setTag("entityID", entityNBT);
+ }
+
+ /**
+ * @param item
+ * @param x
+ * @param y
+ * @param z
+ */
+ public static void addCoordonates(ItemStack item, double x, double y, double z)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound coords = new NBTTagCompound();
+ coords.setDouble("x", x);
+ coords.setDouble("y", y);
+ coords.setDouble("z", z);
+ itemStackData.setTag("x", coords);
+ itemStackData.setTag("y", coords);
+ itemStackData.setTag("z", coords);
+ }
+
+ /**
+ * @param item
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ */
+ public static void addTileEntityBlock(ItemStack item, World world, int x, int y, int z)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound tileNBT = new NBTTagCompound();
+ NBTTagCompound block = new NBTTagCompound();
+ world.getTileEntity(x, y, z).writeToNBT(tileNBT);
+ itemStackData.setTag("tile", tileNBT);
+ block.setInteger("blockID", Block.getIdFromBlock(world.getBlock(x, y, z)));
+ block.setInteger("metadata", world.getBlockMetadata(x, y, z));
+ block.setInteger("blockX", x);
+ block.setInteger("blockY", y);
+ block.setInteger("blockZ", z);
+ itemStackData.setTag("metadata", block);
+ itemStackData.setTag("blockID", block);
+ itemStackData.setTag("blockX", block);
+ itemStackData.setTag("blockY", block);
+ itemStackData.setTag("blockZ", block);
+ }
+
+ /**
+ * @param item
+ * @param block
+ * @param metadata
+ */
+ public static void addBlock(ItemStack item, int block, int metadata)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound blockNBT = new NBTTagCompound();
+ blockNBT.setInteger("blockID", block);
+ itemStackData.setTag("blockID", blockNBT);
+ blockNBT.setInteger("metadata", metadata);
+ itemStackData.setTag("metadata", blockNBT);
+ }
+
+ /**
+ * @param item
+ * @param x
+ * @param y
+ * @param z
+ */
+ public static void addBlockCoordonates(ItemStack item, int x, int y, int z)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound coords = new NBTTagCompound();
+ coords.setInteger("blockX", x);
+ coords.setInteger("blockY", y);
+ coords.setInteger("blockZ", z);
+ itemStackData.setTag("blockX", coords);
+ itemStackData.setTag("blockY", coords);
+ itemStackData.setTag("blockZ", coords);
+ }
+
+ /**
+ * @param item
+ * @param x
+ * @param y
+ * @param z
+ * @param dim
+ * @param name
+ */
+ public static void addCoordonatesAndDimension(ItemStack item, double x, double y, double z, int dim, String name)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound coords = new NBTTagCompound();
+ coords.setDouble("x", x);
+ coords.setDouble("y", y);
+ coords.setDouble("z", z);
+ coords.setInteger("dimension", dim);
+ coords.setString("dimName", name);
+ itemStackData.setTag("x", coords);
+ itemStackData.setTag("y", coords);
+ itemStackData.setTag("z", coords);
+ itemStackData.setTag("dimension", coords);
+ itemStackData.setTag("dimName", coords);
+ }
+
+ /**
+ * @param item
+ */
+ public static void addFakeEnchantment(ItemStack item)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ itemStackData.setTag("ench", new NBTTagList());
+ }
+
+ /**
+ * @param item
+ * @param color
+ */
+ public static void addIngotColor(ItemStack item, int color)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound colors = new NBTTagCompound();
+ colors.setInteger("ingotColor", color);
+ itemStackData.setTag("ingotColor", colors);
+ }
+
+ // TODO
+ /**
+ * @param item
+ * @param color
+ */
+ public static void addGemColor(ItemStack item, int color)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound colors = new NBTTagCompound();
+ colors.setInteger("gemColor", color);
+ itemStackData.setTag("gemColor", colors);
+ }
+
+ /**
+ * @param item
+ * @param list
+ */
+ @SuppressWarnings ("rawtypes")
+ public static void addEntities(ItemStack item, List list)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ NBTTagCompound entityNBT = new NBTTagCompound();
+ for(int i = 0; i < list.size(); i++)
+ ((EntityLivingBase)list.get(i)).writeToNBT(entityNBT);
+ itemStackData.setTag("entities", entityNBT);
+ }
+
+ // TODO NBT Tag Removing
+ /**
+ * @param item
+ * @param tag
+ */
+ public static void removeNBT(ItemStack item, String tag)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ itemStackData.removeTag(tag);
+ }
+
+ /**
+ * @param item
+ */
+ public static void removeEntity(ItemStack item)
+ {
+ JewelryNBT.removeNBT(item, "entityID");
+ JewelryNBT.removeNBT(item, "entity");
+ JewelryNBT.removeNBT(item, "ench");
+ }
+
+ /**
+ * @param item
+ */
+ public static void removeBlock(ItemStack item)
+ {
+ JewelryNBT.removeNBT(item, "blockID");
+ JewelryNBT.removeNBT(item, "metadata");
+ JewelryNBT.removeNBT(item, "tile");
+ JewelryNBT.removeNBT(item, "blockX");
+ JewelryNBT.removeNBT(item, "blockY");
+ JewelryNBT.removeNBT(item, "blockZ");
+ }
+
+ // TODO NTB Tag Checking
+ /**
+ * @param item
+ * @param tag
+ * @return
+ */
+ public static boolean hasTag(ItemStack item, String tag)
+ {
+ NBTTagCompound itemStackData;
+ if (item.hasTagCompound()) itemStackData = item.getTagCompound();
+ else{
+ itemStackData = new NBTTagCompound();
+ item.setTagCompound(itemStackData);
+ }
+ if (itemStackData.hasKey(tag)) return true;
+ return false;
+ }
+
+ /**
+ * @param stack
+ * @param gem
+ * @return
+ */
+ public static boolean isGemX(ItemStack stack, ItemStack gem)
+ {
+ if (gem(stack) != null && gem(stack).getItem() == gem.getItem() && gem(stack).getItemDamage() == gem.getItemDamage()) return true;
+ return false;
+ }
+
+ /**
+ * @param stack
+ * @param modifier
+ * @return
+ */
+ public static int doesModifierExist(ItemStack stack, ItemStack modifier)
+ {
+ if (modifier(stack) != null){
+ ArrayList<ItemStack> list = modifier(stack);
+ for(int i = 0; i < list.size(); i++)
+ if (list.get(i).getItem() == modifier.getItem() && list.get(i).getItemDamage() == modifier.getItemDamage()) return i;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @param ingot
+ * @return
+ */
+ public static boolean isIngotX(ItemStack stack, ItemStack ingot)
+ {
+ if (ingot(stack) != null && ingot(stack).getItem() == ingot.getItem() && ingot(stack).getItemDamage() == ingot.getItemDamage()) return true;
+ return false;
+ }
+
+ /**
+ * @param stack
+ * @param player
+ * @param entity
+ * @return
+ */
+ public static boolean isEntityX(ItemStack stack, EntityPlayer player, EntityLivingBase entity)
+ {
+ if (entity != null && entity instanceof EntityLivingBase && entity(stack, player) != null && entity(stack, player).equals(entity)) return true;
+ return false;
+ }
+
+ /**
+ * @param stack
+ * @param dimName
+ * @return
+ */
+ public static boolean isDimNameX(ItemStack stack, String dimName)
+ {
+ if (ingot(stack) != null && dimName(stack).equals(dimName)) return true;
+ return false;
+ }
+
+ /**
+ * @param stack
+ * @param dimension
+ * @return
+ */
+ public static boolean isDimensionX(ItemStack stack, int dimension)
+ {
+ if (dimension(stack) != -2 && dimension(stack) == dimension) return true;
+ return false;
+ }
+
+ // TODO Return components based on NBT
+ /**
+ * @param stack
+ * @return
+ */
+ public static ItemStack gem(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gem")){
+ NBTTagCompound jewelNBT = (NBTTagCompound)stack.getTagCompound().getTag("gem");
+ ItemStack gem = new ItemStack(Item.getItemById(0), 0, 0);
+ gem.readFromNBT(jewelNBT);
+ return gem;
+ }
+ return null;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static ArrayList<ItemStack> modifier(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound()){
+ int size = stack.getTagCompound().getInteger("modifierSize");
+ ArrayList<ItemStack> list = new ArrayList<ItemStack>();
+ for(int i = 0; i < size; i++){
+ ItemStack modifier = new ItemStack(Item.getItemById(0), 0, 0);
+ NBTTagCompound modifierNBT = (NBTTagCompound)stack.getTagCompound().getTag("modifier" + i);
+ modifier.readFromNBT(modifierNBT);
+ list.add(modifier);
+ }
+ return list;
+ }
+ return null;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static ItemStack ingot(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingot")){
+ NBTTagCompound ingotNBT = (NBTTagCompound)stack.getTagCompound().getTag("ingot");
+ ItemStack ingot = new ItemStack(Item.getItemById(0), 0, 0);
+ ingot.readFromNBT(ingotNBT);
+ return ingot;
+ }
+ return null;
+ }
+
+ /**
+ * @param stack
+ * @param player
+ * @return
+ */
+ public static EntityLivingBase entity(ItemStack stack, EntityPlayer player)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("entityID") && stack.getTagCompound().hasKey("entity")){
+ NBTTagCompound enID = (NBTTagCompound)stack.getTagCompound().getTag("entityID");
+ NBTTagCompound en = (NBTTagCompound)stack.getTagCompound().getTag("entity");
+ int entityID = 0;
+ entityID = enID.getInteger("entityID");
+ EntityLivingBase entity = (EntityLivingBase)EntityList.createEntityByID(entityID, player.worldObj);
+ if (entity != null && entity instanceof EntityLivingBase){
+ entity.readFromNBT(en);
+ return entity;
+ }else return null;
+ }
+ return null;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static TileEntity tileEntity(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("tile")){
+ NBTTagCompound tileNBT = (NBTTagCompound)stack.getTagCompound().getTag("tile");
+ TileEntity tile = TileEntity.createAndLoadEntity(tileNBT);
+ if (tile != null && tile instanceof TileEntity){
+ tile.readFromNBT(tileNBT);
+ return tile;
+ }else return null;
+ }
+ return null;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static String dimName(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("dimName")){
+ NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("dimName");
+ String name = dim.getString("dimName");
+ return name;
+ }
+ return null;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static String modeName(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("mode")){
+ NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("mode");
+ String name = dim.getString("mode");
+ return name;
+ }
+ return null;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static int dimension(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("dimension")){
+ NBTTagCompound dim = (NBTTagCompound)stack.getTagCompound().getTag("dimension");
+ int dimension = dim.getInteger("dimension");
+ return dimension;
+ }
+ return -2;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static int blockCoordX(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockX")){
+ NBTTagCompound x = (NBTTagCompound)stack.getTagCompound().getTag("blockX");
+ int posX = x.getInteger("blockX");
+ return posX;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static int blockCoordY(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockY")){
+ NBTTagCompound y = (NBTTagCompound)stack.getTagCompound().getTag("blockY");
+ int posY = y.getInteger("blockY");
+ return posY;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static int blockCoordZ(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockZ")){
+ NBTTagCompound z = (NBTTagCompound)stack.getTagCompound().getTag("blockZ");
+ int posZ = z.getInteger("blockZ");
+ return posZ;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static int blockID(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("blockID")){
+ NBTTagCompound blockID = (NBTTagCompound)stack.getTagCompound().getTag("blockID");
+ int blockId = blockID.getInteger("blockID");
+ return blockId;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static int blockMetadata(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("metadata")){
+ NBTTagCompound metadataNBT = (NBTTagCompound)stack.getTagCompound().getTag("metadata");
+ int metadata = metadataNBT.getInteger("metadata");
+ return metadata;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static double playerPosX(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("x")){
+ NBTTagCompound x = (NBTTagCompound)stack.getTagCompound().getTag("x");
+ double posX = x.getDouble("x");
+ return posX;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static double playerPosY(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("y")){
+ NBTTagCompound y = (NBTTagCompound)stack.getTagCompound().getTag("y");
+ double posY = y.getDouble("y");
+ return posY;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static double playerPosZ(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("z")){
+ NBTTagCompound z = (NBTTagCompound)stack.getTagCompound().getTag("z");
+ double posZ = z.getDouble("z");
+ return posZ;
+ }
+ return -1;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ public static int ingotColor(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingotColor")){
+ NBTTagCompound colors = (NBTTagCompound)stack.getTagCompound().getTag("ingotColor");
+ int color = colors.getInteger("ingotColor");
+ return color;
+ }
+ return 16777215;
+ }
+
+ // TODO
+ /**
+ * @param stack
+ * @return
+ */
+ public static int gemColor(ItemStack stack)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("gemColor")){
+ NBTTagCompound colors = (NBTTagCompound)stack.getTagCompound().getTag("gemColor");
+ int color = colors.getInteger("gemColor");
+ return color;
+ }
+ return 16777215;
+ }
+
+ /**
+ * @param stack
+ * @param player
+ * @return
+ */
+ @SuppressWarnings ({"rawtypes", "unchecked", "null"})
+ public static List entities(ItemStack stack, EntityPlayer player)
+ {
+ if (stack != null && stack != new ItemStack(Item.getItemById(0), 0, 0) && stack.getTagCompound().hasKey("entities")){
+ NBTTagCompound enID = (NBTTagCompound)stack.getTagCompound().getTag("entitiesID");
+ List list = null;
+ int[] entityID;
+ EntityLivingBase entity;
+ entityID = enID.getIntArray("entitiesID");
+ for(int element: entityID){
+ entity = (EntityLivingBase)EntityList.createEntityByID(element, player.worldObj);
+ list.add(entity);
+ }
+ return list;
+ }
+ return null;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java b/src/main/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java
new file mode 100644
index 0000000..cd2328c
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/util/JewelrycraftUtil.java
@@ -0,0 +1,221 @@
+package darkknight.jewelrycraft.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Random;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraftforge.oredict.OreDictionary;
+import cpw.mods.fml.common.registry.GameData;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.events.EntityEventHandler;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.network.PacketRequestPlayerInfo;
+
+public class JewelrycraftUtil
+{
+ public static ArrayList<ItemStack> objects = new ArrayList<ItemStack>();
+ public static ArrayList<ItemStack> gem = new ArrayList<ItemStack>();
+ public static ArrayList<ItemStack> jewelry = new ArrayList<ItemStack>();
+ public static ArrayList<ItemStack> metal = new ArrayList<ItemStack>();
+ public static ArrayList<ItemStack> ores = new ArrayList<ItemStack>();
+ public static HashMap<Item, ItemStack> oreToIngot = new HashMap<Item, ItemStack>();
+ public static ArrayList<String> jamcraftPlayers = new ArrayList<String>();
+ public static Random rand = new Random();
+
+ /**
+ * Adds gems and jewelry to their appropriate list
+ */
+ public static void addStuff()
+ {
+ // Jewels
+ for(int i = 0; i < 16; i++)
+ gem.add(new ItemStack(ItemList.crystal, 1, i));
+ gem.add(new ItemStack(Blocks.redstone_block));
+ gem.add(new ItemStack(Blocks.lapis_block));
+ gem.add(new ItemStack(Blocks.obsidian));
+ gem.add(new ItemStack(Items.diamond));
+ gem.add(new ItemStack(Items.emerald));
+ gem.add(new ItemStack(Items.ender_pearl));
+ gem.add(new ItemStack(Items.nether_star));
+ // Jewelry
+ jewelry.add(new ItemStack(ItemList.ring));
+ jewelry.add(new ItemStack(ItemList.necklace));
+ jewelry.add(new ItemStack(ItemList.bracelet));
+ jewelry.add(new ItemStack(ItemList.earrings));
+ for(Object item: GameData.getItemRegistry()){
+ ArrayList<ItemStack> items = new ArrayList<ItemStack>();
+ if (item != null && ((Item)item).getHasSubtypes()) ((Item)item).getSubItems((Item)item, null, items);
+ else objects.add(new ItemStack((Item)item));
+
+ if (!items.isEmpty()) objects.addAll(items);
+ }
+ }
+
+ /**
+ * Adds curse points to a player
+ *
+ * @param player the player to add the points to
+ * @param points amount of curse points
+ */
+ public static void addCursePoints(EntityPlayer player, int points)
+ {
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ playerInfo.setInteger("cursePoints", playerInfo.hasKey("cursePoints") ? (playerInfo.getInteger("cursePoints") + points) : points);
+ playerInfo.setBoolean("playerCursePointsChanged", true);
+ }
+
+ public static int getCursePoints(EntityPlayer player)
+ {
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft");
+ return playerInfo.getInteger("cursePoints");
+ }
+
+ /**
+ * Adds the UUID's of the jamcrafters in a list
+ */
+ public static void jamcrafters()
+ {
+ jamcraftPlayers.add("d3214311-7550-4c9c-a372-d9292c10b8a6");
+ jamcraftPlayers.add("a690119f-c4a2-4bd6-a99d-d63679abb328");
+ jamcraftPlayers.add("de7c9903-51fa-4a24-88cd-48faf122ca36");
+ jamcraftPlayers.add("70aeb298-3a7b-46da-a393-ab10df9359f2");
+ jamcraftPlayers.add("6fbe603c-14bf-4085-afdd-abe592c26e7c");
+ jamcraftPlayers.add("b0d21306-36bf-4d85-84df-a956d183c45a");
+ jamcraftPlayers.add("1733a31f-01f9-4f4d-82aa-7de30ca810d3");
+ jamcraftPlayers.add("4833eacf-1d94-49a7-9f89-4cf88d69dcf9");
+ jamcraftPlayers.add("718cf671-9084-4e78-b91f-033e80aa11bf");
+ jamcraftPlayers.add("bea5e0c4-85c4-454d-a081-e1eaae6895ee");
+ jamcraftPlayers.add("7ecf3e2f-fedf-4f7e-8d24-6731d078db4f");
+ jamcraftPlayers.add("1b11ad3a-f0ca-4695-a019-2d7e5d83a5fd");
+ jamcraftPlayers.add("3ec9ac58-2f1b-4d3f-b4eb-3b875da877ae");
+ jamcraftPlayers.add("cf9fa23f-205e-4eed-aba3-9f2848cd6a4d");
+ jamcraftPlayers.add("91880caa-b032-48e3-bfe8-c2c7ed31824e");
+ jamcraftPlayers.add("8d0b3804-f71c-4219-897b-8c315448ea7c");
+ jamcraftPlayers.add("bbb87dbe-690f-4205-bdc5-72ffb8ebc29d");
+ }
+
+ /**
+ * Adds a random amount of modifiers to a list
+ *
+ * @param randValue maximum number of modifiers
+ * @return a list containing the random modifiers
+ */
+ public static ArrayList<ItemStack> addRandomModifiers(int randValue)
+ {
+ ArrayList<ItemStack> list = new ArrayList<ItemStack>();
+ for(int i = 0; i < 2 + randValue; i++){
+ ItemStack item = objects.get(new Random().nextInt(objects.size()));
+ item.stackSize = 1 + new Random().nextInt(2);
+ list.add(item);
+ }
+ return list;
+ }
+
+ /**
+ * Links ores with their appropriate ingot
+ */
+ public static void addMetals()
+ {
+ int index = 0;
+ while (index < OreDictionary.getOreNames().length){
+ Iterator<ItemStack> i = OreDictionary.getOres(OreDictionary.getOreNames()[index]).iterator();
+ while (i.hasNext()){
+ ItemStack nextStack = i.next();
+ if ((nextStack.getItem().getUnlocalizedName().toLowerCase().contains("ingot") || nextStack.getItem().getUnlocalizedName().toLowerCase().contains("alloy")) && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("powder") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("dust") && !nextStack.getItem().getUnlocalizedName().toLowerCase().contains("block") && !metal.contains(nextStack)){
+ metal.add(nextStack);
+ if (OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")) != null){
+ ores.addAll(OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")));
+ Iterator<ItemStack> ores = OreDictionary.getOres(OreDictionary.getOreNames()[index].replace("ingot", "ore")).iterator();
+ while (ores.hasNext()){
+ ItemStack ore = ores.next();
+ oreToIngot.put(ore.getItem(), nextStack);
+ }
+ }
+ }
+ }
+ index++;
+ }
+ }
+
+ /**
+ * Checks to see if the specified item is a gem
+ *
+ * @param item ItemStack containing the item
+ * @return is the item a gem
+ */
+ public static boolean isGem(ItemStack item)
+ {
+ Iterator<ItemStack> i = gem.iterator();
+ while (i.hasNext()){
+ ItemStack temp = i.next();
+ if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks to see if the specified item is a metal
+ *
+ * @param item ItemStack containing the item
+ * @return is the item a metal
+ */
+ public static boolean isMetal(ItemStack item)
+ {
+ Iterator<ItemStack> i = metal.iterator();
+ while (i.hasNext()){
+ ItemStack temp = i.next();
+ if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks to see if the specified item is a piece of jewelry
+ *
+ * @param item ItemStack containing the item
+ * @return is the item a piece of jewelry
+ */
+ public static boolean isJewelry(ItemStack item)
+ {
+ Iterator<ItemStack> i = jewelry.iterator();
+ while (i.hasNext()){
+ ItemStack temp = i.next();
+ if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Checks to see if the specified item is an ore
+ *
+ * @param item ItemStack containing the item
+ * @return is the item an ore
+ */
+ public static boolean isOre(ItemStack item)
+ {
+ Iterator<ItemStack> i = ores.iterator();
+ while (i.hasNext()){
+ ItemStack temp = i.next();
+ if (temp.getItem() == item.getItem() && temp.getItemDamage() == item.getItemDamage()) return true;
+ }
+ return false;
+ }
+
+ /**
+ * Gets the ingot from the ore
+ *
+ * @param ore the ore
+ * @return the ingot
+ */
+ public static ItemStack getIngotFromOre(Item ore)
+ {
+ return oreToIngot.get(ore);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/util/PlayerUtils.java b/src/main/java/darkknight/jewelrycraft/util/PlayerUtils.java
new file mode 100644
index 0000000..f1655c0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/util/PlayerUtils.java
@@ -0,0 +1,38 @@
+package darkknight.jewelrycraft.util;
+
+import darkknight.jewelrycraft.events.ScreenHandler;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.nbt.NBTTagCompound;
+
+/**
+ * Code taken from OpenBlocks
+ */
+public class PlayerUtils
+{
+ /**
+ * Returns the NBTTag of the player
+ *
+ * @param player the player
+ * @param modName the mod name
+ * @return appropriate NBTTag
+ */
+ public static NBTTagCompound getModPlayerPersistTag(EntityPlayer player, String modName)
+ {
+ if (player.worldObj.isRemote && ScreenHandler.tagCache != null) return ScreenHandler.tagCache;
+
+ NBTTagCompound tag = player.getEntityData();
+ NBTTagCompound persistTag = null;
+ if (tag.hasKey(EntityPlayer.PERSISTED_NBT_TAG)) persistTag = tag.getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG);
+ else{
+ persistTag = new NBTTagCompound();
+ tag.setTag(EntityPlayer.PERSISTED_NBT_TAG, persistTag);
+ }
+ NBTTagCompound modTag = null;
+ if (persistTag.hasKey(modName)) modTag = persistTag.getCompoundTag(modName);
+ else{
+ modTag = new NBTTagCompound();
+ persistTag.setTag(modName, modTag);
+ }
+ return modTag;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java b/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java
new file mode 100644
index 0000000..5992273
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/worldGen/Generation.java
@@ -0,0 +1,73 @@
+package darkknight.jewelrycraft.worldGen;
+
+import java.util.Random;
+import net.minecraft.init.Blocks;
+import net.minecraft.world.World;
+import net.minecraft.world.chunk.IChunkProvider;
+import cpw.mods.fml.common.IWorldGenerator;
+import darkknight.jewelrycraft.block.BlockList;
+
+public class Generation implements IWorldGenerator
+{
+
+ /**
+ * @param random
+ * @param chunkX
+ * @param chunkZ
+ * @param world
+ * @param chunkGenerator
+ * @param chunkProvider
+ */
+ @Override
+ public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)
+ {
+ switch(world.provider.dimensionId)
+ {
+ case -1:
+ generateNether(world, random, chunkX << 4, chunkZ << 4);
+ break;
+ case 0:
+ generateSurface(world, random, chunkX << 4, chunkZ << 4);
+ break;
+ case 1:
+ generateEnd(world, random, chunkX << 4, chunkZ << 4);
+ break;
+ }
+ }
+
+ /**
+ * @param world
+ * @param random
+ * @param i
+ * @param j
+ */
+ private void generateEnd(World world, Random random, int i, int j)
+ {}
+
+ /**
+ * @param world
+ * @param random
+ * @param i
+ * @param j
+ */
+ private void generateSurface(World world, Random random, int i, int j)
+ {
+ for(int k = 0; k < 1; k++){
+ int x = i + random.nextInt(16);
+ int y = 5 + random.nextInt(4);
+ int z = j + random.nextInt(16);
+ if (world.getBlock(x, y, z) == Blocks.stone) world.setBlock(x, y, z, BlockList.shadowOre);
+ int randX = random.nextInt(2), randY = random.nextInt(1), randZ = random.nextInt(2);
+ if (random.nextInt(3) == 0 && world.getBlock(x + randX, y + randY, z + randZ) == Blocks.stone) world.setBlock(x + randX, y + randY, z + randZ, BlockList.shadowOre);
+ }
+ }
+
+ /**
+ * @param world
+ * @param random
+ * @param i
+ * @param j
+ */
+ private void generateNether(World world, Random random, int i, int j)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java b/src/main/java/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java
new file mode 100644
index 0000000..c50e321
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java
@@ -0,0 +1,454 @@
+package darkknight.jewelrycraft.worldGen.village;
+
+import java.util.List;
+import java.util.Random;
+import net.minecraft.block.Block;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntityChest;
+import net.minecraft.tileentity.TileEntityFurnace;
+import net.minecraft.world.World;
+import net.minecraft.world.gen.structure.StructureBoundingBox;
+import net.minecraft.world.gen.structure.StructureComponent;
+import net.minecraft.world.gen.structure.StructureVillagePieces;
+import net.minecraft.world.gen.structure.StructureVillagePieces.Start;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.config.ConfigHandler;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.item.ItemMolds;
+import darkknight.jewelrycraft.tileentity.TileEntityDisplayer;
+import darkknight.jewelrycraft.tileentity.TileEntityMolder;
+import darkknight.jewelrycraft.tileentity.TileEntitySmelter;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class ComponentJewelry extends StructureVillagePieces.House1
+{
+ private int averageGroundLevel = -1;
+
+ /**
+ *
+ */
+ public ComponentJewelry()
+ {}
+
+ /**
+ * @param par1ComponentVillageStartPiece
+ * @param par2
+ * @param par3Random
+ * @param par4StructureBoundingBox
+ * @param par5
+ */
+ public ComponentJewelry(Start par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5)
+ {
+ super();
+ coordBaseMode = par5;
+ boundingBox = par4StructureBoundingBox;
+ }
+
+ /**
+ * @param villagePiece
+ * @param pieces
+ * @param random
+ * @param p1
+ * @param p2
+ * @param p3
+ * @param p4
+ * @param p5
+ * @return
+ */
+ @SuppressWarnings ("rawtypes")
+ public static ComponentJewelry buildComponent(Start villagePiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5)
+ {
+ StructureBoundingBox structureboundingbox = StructureBoundingBox.getComponentToAddBoundingBox(p1, p2, p3, 0, 0, 0, 11, 5, 12, p4);
+ return canVillageGoDeeper(structureboundingbox) && StructureComponent.findIntersecting(pieces, structureboundingbox) == null ? new ComponentJewelry(villagePiece, p5, random, structureboundingbox, p4) : null;
+ }
+
+ /**
+ * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes Mineshafts at the end, it adds Fences...
+ *
+ * @param world
+ * @param random
+ * @param sbb
+ * @return
+ */
+ @Override
+ public boolean addComponentParts(World world, Random random, StructureBoundingBox sbb)
+ {
+ if (averageGroundLevel < 0){
+ averageGroundLevel = getAverageGroundLevel(world, sbb);
+ if (averageGroundLevel < 0) return true;
+ boundingBox.offset(0, averageGroundLevel - boundingBox.maxY + 3, 0);
+ }
+ /**
+ * arguments: (World worldObj, StructureBoundingBox structBB, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, int placeBlockId, int replaceBlockId, boolean alwaysreplace)
+ */
+ fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, Block.getBlockById(0), Block.getBlockById(0), false);
+ fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, Block.getBlockById(0), Block.getBlockById(0), false);
+ // Pillars
+ fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Blocks.log, Blocks.log, false);
+ fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Blocks.log, Blocks.log, false);
+ fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Blocks.log, Blocks.log, false);
+ fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Blocks.log, Blocks.log, false);
+ // Walls
+ fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Blocks.planks, Blocks.planks, false);
+ fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Blocks.planks, Blocks.planks, false);
+ fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Blocks.planks, Blocks.planks, false);
+ fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Blocks.planks, Blocks.planks, false);
+ fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Blocks.planks, Blocks.planks, false);
+ fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Blocks.cobblestone, Blocks.cobblestone, false);
+ fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false);
+ fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false);
+ fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Blocks.cobblestone, Blocks.cobblestone, false);
+ // Roof
+ for(int i = 3; i <= 7; i++)
+ for(int j = 1; j <= 5; j++)
+ placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 2, i, 4, j, sbb);
+ for(int i = 3; i <= 7; i++)
+ for(int j = 6; j <= 6; j++)
+ placeBlockAtCurrentPosition(world, Blocks.stone_slab, 0, i, 4, j, sbb);
+ for(int i = 1; i <= 9; i++)
+ for(int j = 7; j <= 10; j++)
+ placeBlockAtCurrentPosition(world, Blocks.stone_slab, 3, i, 4, j, sbb);
+ for(int i = 2; i <= 8; i++)
+ placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, i, 4, 0, sbb);
+ for(int i = 1; i <= 5; i++){
+ placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 2, 4, i, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.double_wooden_slab, 2, 8, 4, i, sbb);
+ }
+ for(int i = 0; i <= 2; i++){
+ placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 6, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i + 8, 4, 6, sbb);
+ }
+ for(int i = 7; i <= 11; i++){
+ placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 0, 4, i, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 10, 4, i, sbb);
+ }
+ for(int i = 0; i <= 10; i++)
+ placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, i, 4, 11, sbb);
+ // Base
+ for(int i = 2; i <= 8; i++)
+ for(int j = 0; j <= 5; j++)
+ placeBlockAtCurrentPosition(world, Blocks.planks, 1, i, 0, j, sbb);
+ fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Blocks.stonebrick, Blocks.stonebrick, false);
+ for(int i = 6; i <= 10; i++)
+ placeBlockAtCurrentPosition(world, Blocks.double_stone_slab, 0, 5, 0, i, sbb);
+ for(int i = 7; i <= 10; i++){
+ placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 1, 0, i, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.stonebrick, 3, 9, 0, i, sbb);
+ }
+ // Decorations
+ placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1));
+ placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, getMetadataWithOffset(Blocks.wooden_door, 1));
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 3, 2, 0, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 4, 2, 0, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 1, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 2, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 4, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 2, 2, 5, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 1, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 2, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 4, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.glass_pane, 0, 8, 2, 5, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 3, 3, 3, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 7, 3, 3, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 5, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 7, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 5, 3, 10, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 8, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 1, 3, 9, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 8, sbb);
+ placeBlockAtCurrentPosition(world, Blocks.torch, 0, 9, 3, 9, sbb);
+ int bgCarpetColor = random.nextInt(16);
+ for(int i = 4; i <= 7; i++)
+ for(int j = 1; j <= 5; j++)
+ placeBlockAtCurrentPosition(world, Blocks.carpet, bgCarpetColor, i, 1, j, sbb);
+ generateChest(world, 3, 1, 1, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax);
+ generateDisplayer(world, 3, 1, 2, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb);
+ placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, 3, 1, 3, sbb);
+ generateDisplayer(world, 3, 1, 4, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb);
+ generateChest(world, 3, 1, 5, 0, random, sbb, ConfigHandler.jewelsChestMin, ConfigHandler.jewelsChestMax);
+ generateFurnace(world, 1, 1, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots);
+ generateFurnace(world, 1, 2, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots);
+ generateFurnace(world, 1, 3, 7, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots);
+ generateFurnace(world, 1, 1, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots);
+ generateFurnace(world, 1, 2, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots);
+ generateFurnace(world, 1, 3, 10, 0, random, sbb, ConfigHandler.furnacesIngotStackMin, ConfigHandler.furnacesIngotStackMax, ConfigHandler.canFurnacesGenerateIngots);
+ generateSmelter(world, 1, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean());
+ generateSmelter(world, 1, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean());
+ generateMolder(world, 2, 1, 8, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean());
+ generateMolder(world, 2, 1, 9, coordBaseMode == 0 || coordBaseMode == 2 ? 1 : 2, random, sbb, random.nextBoolean(), random.nextBoolean());
+ if (random.nextBoolean()) generateIngotChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack);
+ else generateOresChest(world, 9, 1, 7, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack);
+ if (random.nextBoolean()) generateIngotChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack);
+ else generateOresChest(world, 9, 1, 8, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.chest, ConfigHandler.ingotChestMaxStack);
+ if (random.nextBoolean()) generateIngotChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack);
+ else generateOresChest(world, 9, 1, 9, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack);
+ if (random.nextBoolean()) generateIngotChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack);
+ else generateOresChest(world, 9, 1, 10, 0, random, sbb, ConfigHandler.ingotChestMin, ConfigHandler.ingotChestMax, Blocks.trapped_chest, ConfigHandler.ingotChestMaxStack);
+ for(int l = 0; l < 6; ++l)
+ for(int i1 = 2; i1 < 9; ++i1){
+ clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
+ func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb);
+ }
+ for(int l = 6; l < 12; ++l)
+ for(int i1 = 0; i1 < 11; ++i1){
+ clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb);
+ func_151554_b(world, Blocks.cobblestone, 0, i1, -1, l, sbb);
+ }
+ spawnVillagers(world, sbb, 3, 1, 3, 1);
+ return true;
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param metadata
+ * @param random
+ * @param sbb
+ * @param min
+ * @param max
+ */
+ public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max)
+ {
+ int i1 = getXWithOffset(i, k);
+ int j1 = getYWithOffset(j);
+ int k1 = getZWithOffset(i, k);
+ int t = random.nextInt(max - min + 1) + min;
+ placeBlockAtCurrentPosition(world, Blocks.chest, metadata, i, j, k, sbb);
+ TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1);
+ while (chest != null && t > 0){
+ ItemStack jewels = JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size()));
+ chest.func_145976_a("Jeweler's Chest");
+ if (jewels.getItem() == Items.nether_star && ConfigHandler.generateVillageNetherstar) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels);
+ else if (random.nextBoolean() && jewels.getItem() != Items.nether_star) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), jewels);
+ t--;
+ }
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param metadata
+ * @param random
+ * @param sbb
+ * @param min
+ * @param max
+ * @param chestB
+ * @param randomAmount
+ */
+ public void generateIngotChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount)
+ {
+ int i1 = getXWithOffset(i, k);
+ int j1 = getYWithOffset(j);
+ int k1 = getZWithOffset(i, k);
+ int t = random.nextInt(max - min + 1) + min;
+ placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb);
+ TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1);
+ while (chest != null && t > 0){
+ chest.func_145976_a("Ingot Chest");
+ int metalID = random.nextInt(JewelrycraftUtil.metal.size());
+ ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy();
+ metal.stackSize = 2 + random.nextInt(randomAmount);
+ if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), metal);
+ t--;
+ }
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param metadata
+ * @param random
+ * @param sbb
+ * @param min
+ * @param max
+ * @param chestB
+ * @param randomAmount
+ */
+ public void generateOresChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, Block chestB, int randomAmount)
+ {
+ int i1 = getXWithOffset(i, k);
+ int j1 = getYWithOffset(j);
+ int k1 = getZWithOffset(i, k);
+ int t = random.nextInt(max - min + 1) + min;
+ placeBlockAtCurrentPosition(world, chestB, metadata, i, j, k, sbb);
+ TileEntityChest chest = (TileEntityChest)world.getTileEntity(i1, j1, k1);
+ while (chest != null && t > 0){
+ chest.func_145976_a("Ores Chest");
+ int oreID = random.nextInt(JewelrycraftUtil.ores.size());
+ ItemStack ores = JewelrycraftUtil.ores.get(oreID).copy();
+ ores.stackSize = 2 + random.nextInt(randomAmount);
+ if (random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), ores);
+ t--;
+ }
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param metadata
+ * @param random
+ * @param sbb
+ */
+ public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb)
+ {
+ int i1 = getXWithOffset(i, k);
+ int j1 = getYWithOffset(j);
+ int k1 = getZWithOffset(i, k);
+ placeBlockAtCurrentPosition(world, BlockList.displayer, metadata, i, j, k, sbb);
+ TileEntityDisplayer displayer = (TileEntityDisplayer)world.getTileEntity(i1, j1, k1);
+ if (displayer != null){
+ Item[] jewels = {ItemList.ring, ItemList.necklace};
+ ItemStack jewel = new ItemStack(jewels[random.nextInt(jewels.length)]);
+ JewelryNBT.addMetal(jewel, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())));
+ JewelryNBT.addModifiers(jewel, JewelrycraftUtil.addRandomModifiers(random.nextInt(4)));
+ JewelryNBT.addGem(jewel, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())));
+ displayer.object = jewel;
+ displayer.quantity = 1;
+ displayer.hasObject = true;
+ }
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param metadata
+ * @param random
+ * @param sbb
+ * @param isEmpty
+ */
+ public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty)
+ {
+ int i1 = getXWithOffset(i, k);
+ int j1 = getYWithOffset(j);
+ int k1 = getZWithOffset(i, k);
+ placeBlockAtCurrentPosition(world, BlockList.smelter, metadata, i, j, k, sbb);
+ TileEntitySmelter smelter = (TileEntitySmelter)world.getTileEntity(i1, j1, k1);
+ if (smelter != null && !isEmpty){
+ int metal = random.nextInt(JewelrycraftUtil.metal.size());
+ smelter.moltenMetal = JewelrycraftUtil.metal.get(metal).copy();
+ smelter.hasMoltenMetal = true;
+ int quantity = random.nextInt(9);
+ switch(quantity)
+ {
+ case 0:
+ smelter.quantity = 0.1f;
+ case 1:
+ smelter.quantity = 0.2f;
+ case 2:
+ smelter.quantity = 0.3f;
+ case 3:
+ smelter.quantity = 0.4f;
+ case 4:
+ smelter.quantity = 0.5f;
+ case 5:
+ smelter.quantity = 0.6f;
+ case 6:
+ smelter.quantity = 0.7f;
+ case 7:
+ smelter.quantity = 0.8f;
+ case 8:
+ smelter.quantity = 0.9f;
+ default:
+ smelter.quantity = 0.1f;
+ }
+ }
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param metadata
+ * @param random
+ * @param sbb
+ * @param hasMold
+ * @param hasStuff
+ */
+ public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff)
+ {
+ int i1 = getXWithOffset(i, k);
+ int j1 = getYWithOffset(j);
+ int k1 = getZWithOffset(i, k);
+ placeBlockAtCurrentPosition(world, BlockList.molder, metadata, i, j, k, sbb);
+ TileEntityMolder molder = (TileEntityMolder)world.getTileEntity(i1, j1, k1);
+ if (molder != null && !molder.hasMold) if (hasMold){
+ int meta = random.nextInt(ItemMolds.moldsItemNames.length);
+ molder.mold = new ItemStack(ItemList.molds, 1, meta);
+ molder.hasMold = true;
+ if (hasStuff){
+ ItemStack ring = new ItemStack(ItemList.ring);
+ JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy());
+ ItemStack necklace = new ItemStack(ItemList.necklace);
+ JewelryNBT.addMetal(necklace, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy());
+ ItemStack bracelet = new ItemStack(ItemList.bracelet);
+ JewelryNBT.addMetal(bracelet, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy());
+ ItemStack earrings = new ItemStack(ItemList.earrings);
+ JewelryNBT.addMetal(earrings, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).copy());
+ if (meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()));
+ else if (meta == 1) molder.jewelBase = ring;
+ else if (meta == 2) molder.jewelBase = necklace;
+ else if (meta == 3) molder.jewelBase = bracelet;
+ else if (meta == 4) molder.jewelBase = earrings;
+ molder.hasJewelBase = true;
+ }
+ }
+ }
+
+ /**
+ * @param world
+ * @param i
+ * @param j
+ * @param k
+ * @param metadata
+ * @param random
+ * @param sbb
+ * @param min
+ * @param max
+ * @param hasMetal
+ */
+ public void generateFurnace(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max, boolean hasMetal)
+ {
+ int i1 = getXWithOffset(i, k);
+ int j1 = getYWithOffset(j);
+ int k1 = getZWithOffset(i, k);
+ placeBlockAtCurrentPosition(world, Blocks.furnace, metadata, i, j, k, sbb);
+ TileEntityFurnace furnace = (TileEntityFurnace)world.getTileEntity(i1, j1, k1);
+ if (furnace != null){
+ if (random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Items.coal, 1 + random.nextInt(16)));
+ if (hasMetal){
+ int metalID = random.nextInt(JewelrycraftUtil.metal.size());
+ ItemStack metal = JewelrycraftUtil.metal.get(metalID).copy();
+ metal.stackSize = random.nextInt(max - min + 1) + min;
+ furnace.setInventorySlotContents(2, metal);
+ }
+ }
+ }
+
+ /**
+ * Returns the villager type to spawn in this component, based on the number of villagers already spawned.
+ *
+ * @param par1
+ * @return
+ */
+ @Override
+ protected int getVillagerType(int par1)
+ {
+ return 3000;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/village/JCTrades.java b/src/main/java/darkknight/jewelrycraft/worldGen/village/JCTrades.java
new file mode 100644
index 0000000..a3f7158
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/worldGen/village/JCTrades.java
@@ -0,0 +1,127 @@
+package darkknight.jewelrycraft.worldGen.village;
+
+import java.util.Random;
+import net.minecraft.entity.passive.EntityVillager;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.village.MerchantRecipe;
+import net.minecraft.village.MerchantRecipeList;
+import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.item.ItemMolds;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class JCTrades implements IVillageTradeHandler
+{
+
+ /**
+ *
+ */
+ public JCTrades()
+ {
+ super();
+ }
+
+ /**
+ * @param villager
+ * @param recipeList
+ * @param random
+ */
+ @Override
+ public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random)
+ {
+ if (villager.getProfession() == 3000){
+ ItemStack ingredient = null;
+ ItemStack ingredient2 = null;
+ ItemStack result;
+ int type = random.nextInt(12);
+ switch(type)
+ {
+ case 0:{
+ result = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()));
+ result.stackSize = 5 + random.nextInt(5);
+ ingredient = new ItemStack(Items.emerald, 2 + random.nextInt(7));
+ if (random.nextBoolean()) ingredient2 = new ItemStack(Items.emerald, 2 + random.nextInt(2));
+ break;
+ }
+ case 1:{
+ result = new ItemStack(ItemList.molds, 5 + random.nextInt(7), random.nextInt(ItemMolds.moldsItemNames.length));
+ ingredient = new ItemStack(Items.emerald, 1);
+ if (random.nextBoolean()) ingredient2 = new ItemStack(Items.emerald, 1 + random.nextInt(2));
+ break;
+ }
+ case 2:{
+ int number = random.nextInt(3);
+ result = new ItemStack(BlockList.displayer, 1 + number);
+ ingredient = new ItemStack(Blocks.emerald_block, 2 + number * 3 + random.nextInt(2));
+ ingredient2 = new ItemStack(Items.emerald, 3 + number + random.nextInt(8));
+ break;
+ }
+ case 3:{
+ result = new ItemStack(BlockList.jewelCraftingTable);
+ ingredient = new ItemStack(Items.emerald, 1 + random.nextInt(2));
+ if (random.nextBoolean()) ingredient2 = new ItemStack(Items.emerald, 1 + random.nextInt(2));
+ break;
+ }
+ case 4:{
+ result = new ItemStack(BlockList.shadowOre, 1 + random.nextInt(6));
+ ingredient = new ItemStack(Items.emerald, 3 + random.nextInt(4));
+ if (random.nextBoolean()) ingredient2 = new ItemStack(Items.emerald, 3 + random.nextInt(4));
+ break;
+ }
+ case 5:{
+ result = new ItemStack(BlockList.molder, 5 + random.nextInt(5));
+ ingredient = new ItemStack(Items.emerald, 1);
+ if (random.nextBoolean()) ingredient2 = new ItemStack(Items.emerald, 1);
+ break;
+ }
+ case 6:{
+ result = new ItemStack(BlockList.smelter);
+ ingredient = new ItemStack(Items.emerald, 1 + random.nextInt(2));
+ if (random.nextBoolean()) ingredient2 = new ItemStack(Items.emerald, 1 + random.nextInt(2));
+ break;
+ }
+ case 7:{
+ int end = random.nextInt(JewelrycraftUtil.gem.size());
+ result = JewelrycraftUtil.gem.get(end);
+ result.stackSize = 1 + random.nextInt(JewelrycraftUtil.gem.size() - end);
+ if (JewelrycraftUtil.gem.size() - 1 - end >= 1){
+ int value = end;
+ if (value > 64) value = 64;
+ ingredient = new ItemStack(Items.emerald, 2 + random.nextInt(value));
+ if (random.nextBoolean()) ingredient2 = new ItemStack(Items.emerald, 2 + random.nextInt(value));
+ }else{
+ ingredient = new ItemStack(Blocks.emerald_block, 16 + random.nextInt(32));
+ ingredient2 = new ItemStack(Blocks.emerald_block, 8 + random.nextInt(48));
+ }
+ break;
+ }
+ case 8:{
+ result = JewelrycraftUtil.ores.get(random.nextInt(JewelrycraftUtil.ores.size()));
+ result.stackSize = 3 + random.nextInt(3);
+ ingredient = new ItemStack(Items.emerald, 2 + random.nextInt(5));
+ if (random.nextBoolean()) ingredient2 = new ItemStack(Items.emerald, 2 + random.nextInt(6));
+ break;
+ }
+ case 9:{
+ result = new ItemStack(ItemList.guide, 1);
+ ingredient = new ItemStack(Items.emerald, 1);
+ break;
+ }
+ default:{
+ result = new ItemStack(ItemList.ring, 1, 0);
+ int randValue = random.nextInt(4);
+ JewelryNBT.addMetal(result, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())));
+ JewelryNBT.addModifiers(result, JewelrycraftUtil.addRandomModifiers(randValue));
+ JewelryNBT.addGem(result, JewelrycraftUtil.gem.get(random.nextInt(JewelrycraftUtil.gem.size())));
+ ingredient = new ItemStack(Items.emerald, 16 + random.nextInt(20));
+ ingredient2 = new ItemStack(Blocks.emerald_block, 2 + randValue);
+ }
+ }
+ recipeList.addToListWithCheck(new MerchantRecipe(ingredient, ingredient2, result));
+ }
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java b/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java
new file mode 100644
index 0000000..a2c3d62
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java
@@ -0,0 +1,50 @@
+package darkknight.jewelrycraft.worldGen.village;
+
+import java.util.List;
+import java.util.Random;
+import net.minecraft.world.gen.structure.StructureVillagePieces.PieceWeight;
+import net.minecraft.world.gen.structure.StructureVillagePieces.Start;
+import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler;
+import darkknight.jewelrycraft.config.ConfigHandler;
+
+public class VillageJewelryHandler implements IVillageCreationHandler
+{
+
+ /**
+ * @param random
+ * @param i
+ * @return
+ */
+ @Override
+ public PieceWeight getVillagePieceWeight(Random random, int i)
+ {
+ return new PieceWeight(ComponentJewelry.class, ConfigHandler.jewelerWeight, ConfigHandler.maxVillageJewelers);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public Class<?> getComponentClass()
+ {
+ return ComponentJewelry.class;
+ }
+
+ /**
+ * @param villagePiece
+ * @param startPiece
+ * @param pieces
+ * @param random
+ * @param p1
+ * @param p2
+ * @param p3
+ * @param p4
+ * @param p5
+ * @return
+ */
+ @Override
+ public Object buildComponent(PieceWeight villagePiece, Start startPiece, @SuppressWarnings ("rawtypes") List pieces, Random random, int p1, int p2, int p3, int p4, int p5)
+ {
+ return ComponentJewelry.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5);
+ }
+} \ No newline at end of file