diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-04-14 11:58:43 +0300 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2014-04-14 11:58:43 +0300 |
| commit | 1a692ab45df3d88a6cc247cc9f4c0a41c7715264 (patch) | |
| tree | 1854960d78be20ef09c9f098f5e2eb92837019dd | |
| parent | f965cf88704f1e5e674d98308cbe0f4451d7edeb (diff) | |
Updating to 1.7
120 files changed, 251 insertions, 8855 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd2a968 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +*.class + +# Package Files # +*.jar +*.war +*.ear + +includeCP/fmlbranding.properties +eclipse/* +build/* +bin/* +.gradle/* +.settings/* +.project +.classpath +*-fml.txt +MinecraftForge-*.txt +forge-*-changelog.txt +gradle-app.setting +*.iml +*.ipr +*.iws +gradlew.* +gradle/*
\ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index b6ed015..0000000 --- a/README.md +++ /dev/null @@ -1,5 +0,0 @@ -JewelryCraft -========== -bspkrs and TheDarkKnight's Modjam December 2013 submission. - -For more info: http://www.minecraftforum.net/topic/2210959-164smpssp-jewelrycraft-thiefing-gloves-steal-your-villagers-stuff diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..04038b9 --- /dev/null +++ b/build.gradle @@ -0,0 +1,47 @@ +buildscript { + repositories { + mavenCentral() + maven { + name = "forge" + url = "http://files.minecraftforge.net/maven" + } + maven { + name = "sonatype" + url = "https://oss.sonatype.org/content/repositories/snapshots/" + } + } + dependencies { + classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' + } +} + +apply plugin: 'forge' + +version = "1.0" +group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html +archivesBaseName = "modid" + +minecraft { + version = "1.7.2-10.12.0.1057" + assetDir = "eclipse/assets" +} + +processResources +{ + // this will ensure that this task is redone when the versions change. + inputs.property "version", project.version + inputs.property "mcversion", project.minecraft.version + + // replace stuff in mcmod.info, nothing else + from(sourceSets.main.resources.srcDirs) { + include 'mcmod.info' + + // replace version and mcversion + expand 'version':project.version, 'mcversion':project.minecraft.version + } + + // copy everything else, thats not the mcmod.info + from(sourceSets.main.resources.srcDirs) { + exclude 'mcmod.info' + } +} diff --git a/common/darkknight/jewelrycraft/CommonProxy.java b/common/darkknight/jewelrycraft/CommonProxy.java deleted file mode 100644 index 04c6a94..0000000 --- a/common/darkknight/jewelrycraft/CommonProxy.java +++ /dev/null @@ -1,9 +0,0 @@ -package darkknight.jewelrycraft; - -public class CommonProxy -{ - public void registerRenderers() - { - - } -} diff --git a/common/darkknight/jewelrycraft/CreativeTabNecklaces.java b/common/darkknight/jewelrycraft/CreativeTabNecklaces.java deleted file mode 100644 index 330b239..0000000 --- a/common/darkknight/jewelrycraft/CreativeTabNecklaces.java +++ /dev/null @@ -1,55 +0,0 @@ -package darkknight.jewelrycraft; -import java.util.ArrayList; -import java.util.List; - -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class CreativeTabNecklaces extends CreativeTabs -{ - public static ArrayList<ItemStack> metal = new ArrayList<ItemStack>(); - - public CreativeTabNecklaces(String par2Str) - { - super(par2Str); - metal.add(new ItemStack(Item.ingotGold)); - metal.add(new ItemStack(Item.ingotIron)); - } - - @Override - public ItemStack getIconItemStack() - { - ItemStack ring = new ItemStack(ItemList.necklace); - return ring; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public void displayAllReleventItems(List par1List) - { - int index = 0, index2 = 0; - while(index < OreDictionary.getOreNames().length) - { - while(index2 < OreDictionary.getOres(OreDictionary.getOreNames()[index]).size()) - { - if(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2).getUnlocalizedName().toLowerCase().contains("ingot") && !metal.contains(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2))) - metal.add(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2)); - index2++; - } - index2 = 0; - index++; - } - for(int i = 0; i < metal.size(); i++) - for(int j = 0; j < JewelrycraftUtil.modifiers.size(); j++) - for(int k = 0; k < JewelrycraftUtil.jewel.size(); k++) - { - par1List.add(ItemList.necklace.getModifiedItemStack(metal.get(i), null, JewelrycraftUtil.jewel.get(k))); - par1List.add(ItemList.necklace.getModifiedItemStack(metal.get(i), JewelrycraftUtil.modifiers.get(j), JewelrycraftUtil.jewel.get(k))); - } - } - -} diff --git a/common/darkknight/jewelrycraft/CreativeTabRings.java b/common/darkknight/jewelrycraft/CreativeTabRings.java deleted file mode 100644 index 7e2119f..0000000 --- a/common/darkknight/jewelrycraft/CreativeTabRings.java +++ /dev/null @@ -1,55 +0,0 @@ -package darkknight.jewelrycraft; -import java.util.ArrayList; -import java.util.List; - -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class CreativeTabRings extends CreativeTabs -{ - public static ArrayList<ItemStack> metal = new ArrayList<ItemStack>(); - - public CreativeTabRings(String par2Str) - { - super(par2Str); - metal.add(new ItemStack(Item.ingotGold)); - metal.add(new ItemStack(Item.ingotIron)); - } - - @Override - public ItemStack getIconItemStack() - { - ItemStack ring = new ItemStack(ItemList.ring); - return ring; - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - public void displayAllReleventItems(List par1List) - { - int index = 0, index2 = 0; - while(index < OreDictionary.getOreNames().length) - { - while(index2 < OreDictionary.getOres(OreDictionary.getOreNames()[index]).size()) - { - if(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2).getUnlocalizedName().toLowerCase().contains("ingot") && !metal.contains(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2))) - metal.add(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2)); - index2++; - } - index2 = 0; - index++; - } - for(int i = 0; i < metal.size(); i++) - for(int j = 0; j < JewelrycraftUtil.modifiers.size(); j++) - for(int k = 0; k < JewelrycraftUtil.jewel.size(); k++) - { - par1List.add(ItemList.ring.getModifiedItemStack(metal.get(i), null, JewelrycraftUtil.jewel.get(k))); - par1List.add(ItemList.ring.getModifiedItemStack(metal.get(i), JewelrycraftUtil.modifiers.get(j), JewelrycraftUtil.jewel.get(k))); - } - } - -} diff --git a/common/darkknight/jewelrycraft/JewelrycraftMod.java b/common/darkknight/jewelrycraft/JewelrycraftMod.java deleted file mode 100644 index 6f405ad..0000000 --- a/common/darkknight/jewelrycraft/JewelrycraftMod.java +++ /dev/null @@ -1,175 +0,0 @@ -/* - * Mod made by DarkKnight during the Modjam 3 - * It's an awesome mod - * I love me! :D - */ - -package darkknight.jewelrycraft; - -import java.util.ArrayList; -import java.util.List; -import java.util.logging.Logger; - -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.ItemStack; -import net.minecraft.network.INetworkManager; -import net.minecraft.network.NetLoginHandler; -import net.minecraft.network.packet.NetHandler; -import net.minecraft.network.packet.Packet1Login; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.gen.structure.MapGenStructureIO; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.oredict.OreDictionary; -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.Mod.Metadata; -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.network.IConnectionHandler; -import cpw.mods.fml.common.network.NetworkMod; -import cpw.mods.fml.common.network.NetworkMod.SidedPacketHandler; -import cpw.mods.fml.common.network.Player; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.common.registry.VillagerRegistry; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.client.JewelryCraftClient; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.container.GuiHandler; -import darkknight.jewelrycraft.events.EntityEventHandler; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.lib.Reference; -import darkknight.jewelrycraft.recipes.CraftingRecipes; -import darkknight.jewelrycraft.server.JewelryCraftServer; -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) -@NetworkMod(clientSideRequired = false, serverSideRequired = false, -clientPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftClient.class), -serverPacketHandlerSpec = @SidedPacketHandler(channels = { Reference.PACKET_CHANNEL }, packetHandler = JewelryCraftServer.class), -connectionHandler = JewelrycraftMod.class) -public class JewelrycraftMod implements IConnectionHandler -{ - @Instance(Reference.MODID) - public static JewelrycraftMod instance; - - @Metadata(Reference.MODID) - public static ModMetadata metadata; - - @SidedProxy(clientSide = "darkknight.jewelrycraft.client.ClientProxy", serverSide = "darkknight.jewelrycraft.CommonProxy") - public static CommonProxy proxy; - - public static final Logger logger = Logger.getLogger("Jewelrycraft"); - - public static CreativeTabs jewelrycraft = new CreativeTabs("JewelryCraft") - { - @Override - public ItemStack getIconItemStack() - { - return new ItemStack(BlockList.jewelCraftingTable); - } - }; - public static CreativeTabs rings = new CreativeTabRings("Rings"); - public static CreativeTabs necklaces = new CreativeTabNecklaces("Necklaces"); - - @EventHandler - public void preInit(FMLPreInitializationEvent e) - { - ConfigHandler.preInit(e); - ItemList.preInit(e); - BlockList.preInit(e); - CraftingRecipes.preInit(e); - OreDictionary.registerOre("ingotShadow", new ItemStack(ItemList.shadowIngot)); - OreDictionary.registerOre("oreShadow", new ItemStack(BlockList.shadowOre)); - MinecraftForge.setBlockHarvestLevel(BlockList.shadowOre, 0, "pickaxe", 3); - - 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.6.4"); - } - MinecraftForge.EVENT_BUS.register(new EntityEventHandler()); - - proxy.registerRenderers(); - - ModMetadata metadata = e.getModMetadata(); - - List<String> authorList = new ArrayList<String>(); - authorList.add("DarkKnight (or sor1n)"); - authorList.add("bspkrs"); - - metadata.autogenerated = false; - metadata.authorList = authorList; - metadata.url = "https://github.com/sor1n/Modjam-Mod"; - } - - @EventHandler - public void init(FMLInitializationEvent e) - { - GameRegistry.registerWorldGenerator(new Generation()); - new GuiHandler(); - } - - @EventHandler - public void postInit(FMLPostInitializationEvent e) - { - JewelrycraftUtil.addMetals(); - JewelrycraftUtil.addStuff(); - JewelrycraftUtil.jamcrafters(); - } - - @Override - // 2) Called when a player logs into the server SERVER SIDE - public void playerLoggedIn(Player player, NetHandler netHandler, INetworkManager manager) - { - - } - - @Override - // If you don't want the connection to continue, return a non-empty string here SERVER SIDE - public String connectionReceived(NetLoginHandler netHandler, INetworkManager manager) - { - return null; - } - - @Override - // 1) Fired when a remote connection is opened CLIENT SIDE - public void connectionOpened(NetHandler netClientHandler, String server, int port, INetworkManager manager) - { - - } - - @Override - // 1) Fired when a local connection is opened CLIENT SIDE - public void connectionOpened(NetHandler netClientHandler, MinecraftServer server, INetworkManager manager) - { - - } - - @Override - // Fired when a connection closes ALL SIDES - public void connectionClosed(INetworkManager manager) - { - - } - - @Override - // 3) Fired when the client established the connection to the server CLIENT SIDE - public void clientLoggedIn(NetHandler clientHandler, INetworkManager manager, Packet1Login login) - { - - } -} diff --git a/common/darkknight/jewelrycraft/block/BlockDisplayer.java b/common/darkknight/jewelrycraft/block/BlockDisplayer.java deleted file mode 100644 index 794e38c..0000000 --- a/common/darkknight/jewelrycraft/block/BlockDisplayer.java +++ /dev/null @@ -1,178 +0,0 @@ -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.IconRegister; -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.TileEntityDisplayer; - -public class BlockDisplayer extends BlockContainer -{ - Random rand = new Random(); - - protected BlockDisplayer(int par1, Material par2Material) - { - super(par1, par2Material); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityDisplayer(); - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @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 boolean onBlockActivated(World world, int i, int j, int k, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) - { - TileEntityDisplayer te = (TileEntityDisplayer) world.getBlockTileEntity(i, j, k); - ItemStack item = entityPlayer.inventory.getCurrentItem(); - if (te != null && item != null && item != new ItemStack(0, 0, 0) && !world.isRemote) - { - if(!te.hasObject) - { - te.object = item.copy(); - te.object.stackSize = 1; - te.quantity += item.stackSize; - te.hasObject = true; - if (!entityPlayer.capabilities.isCreativeMode) item.stackSize = 0; - te.isDirty = true; - } - else if(te.object.itemID == item.itemID && te.object != null && te.object != new ItemStack(0, 0, 0) && te.object.getItemDamage() == item.getItemDamage()) - { - if(te.object.hasTagCompound() && item.hasTagCompound() && te.object.getTagCompound().equals(item.getTagCompound())) - { - te.quantity += item.stackSize; - te.object.stackSize = 1; - if (!entityPlayer.capabilities.isCreativeMode) item.stackSize = 0; - te.isDirty = true; - } - else if(!te.object.hasTagCompound() && !item.hasTagCompound()) - { - te.quantity += item.stackSize; - te.object.stackSize = 1; - if (!entityPlayer.capabilities.isCreativeMode) item.stackSize = 0; - te.isDirty = true; - } - } - } - return true; - } - - @Override - public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) - { - TileEntityDisplayer te = (TileEntityDisplayer) world.getBlockTileEntity(i, j, k); - if (te != null && !world.isRemote) - { - if (te.hasObject && te.object != null && te.object != new ItemStack(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(); - } - else - { - te.object.stackSize = te.quantity - 1; - player.inventory.addItemStackToInventory(te.object); - te.hasObject = false; - te.object = new ItemStack(0, 0, 0); - te.quantity = 0; - } - te.isDirty = true; - } - else - { - if(te.quantity >= 2) - { - player.inventory.addItemStackToInventory(te.object); - te.object.stackSize = 1; - --te.quantity; - } - else - { - player.inventory.addItemStackToInventory(te.object); - te.object.stackSize = 1; - te.hasObject = false; - te.object = new ItemStack(0, 0, 0); - te.quantity = 0; - } - te.isDirty = true; - } - } - } - } - - 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); - } - - public void breakBlock(World world, int i, int j, int k, int par5, int par6) - { - TileEntityDisplayer te = (TileEntityDisplayer) world.getBlockTileEntity(i, j, k); - - if (te != null && te.hasObject) - { - te.object.stackSize = te.quantity; - dropItem(te.worldObj, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.object); - world.markTileEntityForDespawn(te); - } - - super.breakBlock(world, i, j, k, par5, par6); - } - - @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 void registerIcons(IconRegister icon) - { - this.blockIcon = icon.registerIcon("jewelrycraft:displayer"); - } -} diff --git a/common/darkknight/jewelrycraft/block/BlockGlow.java b/common/darkknight/jewelrycraft/block/BlockGlow.java deleted file mode 100644 index 9a34552..0000000 --- a/common/darkknight/jewelrycraft/block/BlockGlow.java +++ /dev/null @@ -1,39 +0,0 @@ -package darkknight.jewelrycraft.block; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -public class BlockGlow extends Block -{ - protected BlockGlow(int par1) - { - super(par1, Material.air); - } - - public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int i) - { - return null; - } - - public boolean isCollidable() - { - return false; - } - - public boolean isOpaqueCube() - { - return false; - } - - public boolean renderAsNormalBlock() - { - return false; - } - - public int getRenderType() - { - return -1; - } -} diff --git a/common/darkknight/jewelrycraft/block/BlockJewelAltar.java b/common/darkknight/jewelrycraft/block/BlockJewelAltar.java deleted file mode 100644 index 2fab829..0000000 --- a/common/darkknight/jewelrycraft/block/BlockJewelAltar.java +++ /dev/null @@ -1,115 +0,0 @@ -package darkknight.jewelrycraft.block; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.tileentity.*; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -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.Icon; -import net.minecraft.world.World; - -public class BlockJewelAltar extends BlockContainer -{ - @SideOnly(Side.CLIENT) - private Icon altarSide; - @SideOnly(Side.CLIENT) - private Icon altarBottom; - @SideOnly(Side.CLIENT) - private Icon altarTop; - - public BlockJewelAltar(int par1) - { - super(par1, Material.iron); - } - - public static boolean isNormalCube(int par0) - { - return true; - } - - public void registerIcons(IconRegister par1IconRegister) - { - this.altarSide = par1IconRegister.registerIcon(this.getTextureName() + "_" + "side"); - this.altarBottom = par1IconRegister.registerIcon(this.getTextureName() + "_" + "bottom"); - this.altarTop = par1IconRegister.registerIcon(this.getTextureName() + "_" + "top"); - } - - public Icon getIcon(int par1, int par2) - { - return par1 == 1 ? this.altarTop : (par1 == 0 ? this.altarBottom : this.altarSide); - } - - @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.getBlockTileEntity(i, j, k); - ItemStack item = entityPlayer.inventory.getCurrentItem(); - if (te != null && !world.isRemote) - { - if(item != null && item != new ItemStack(0, 0, 0) && (item.itemID == ItemList.ring.itemID || item.itemID == ItemList.necklace.itemID) && !te.hasObject) - { - te.object = item.copy(); - item.stackSize = 0; - te.playerName = entityPlayer.username; - te.isDirty = true; - te.hasObject = true; - } - - if(te.object != null && te.object != new ItemStack(0, 0, 0) && te.hasObject && entityPlayer.isSneaking()) - { - entityPlayer.inventory.addItemStackToInventory(te.object); - te.object = new ItemStack(0, 0, 0); - te.playerName = ""; - te.isDirty = true; - te.hasObject = false; - } - } - return true; - } - - @Override - public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) - { - TileEntityAltar te = (TileEntityAltar) world.getBlockTileEntity(i, j, k); - if (te != null && !world.isRemote) - { - if (te.object != null && te.object != new ItemStack(0, 0, 0)) - { - } - } - } - - 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); - } - - public void breakBlock(World world, int i, int j, int k, int par5, int par6) - { - TileEntityAltar te = (TileEntityAltar) world.getBlockTileEntity(i, j, k); - - if (te != null && te.object != null && te.object != new ItemStack(0, 0, 0)) - { - dropItem(te.worldObj, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.object); - world.markTileEntityForDespawn(te); - } - - super.breakBlock(world, i, j, k, par5, par6); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityAltar(); - } -} diff --git a/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java b/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java deleted file mode 100644 index bf1d82f..0000000 --- a/common/darkknight/jewelrycraft/block/BlockJewelrsCraftingTable.java +++ /dev/null @@ -1,212 +0,0 @@ -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.IconRegister; -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.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(); - - protected BlockJewelrsCraftingTable(int par1, Material par2Material) - { - super(par1, par2Material); - this.setBlockBounds(0.0F, 0F, 0.0F, 1.0F, 0.8F, 1.0F); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityJewelrsCraftingTable(); - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @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.getBlockTileEntity(i, j, k); - ItemStack item = entityPlayer.inventory.getCurrentItem(); - if (te != null && !world.isRemote) - { - if (!te.hasEndItem && !te.hasJewelry && item != null && JewelrycraftUtil.isJewelry(item)) - { - if(te.hasModifier && te.hasJewel && item.hasTagCompound() && item.getTagCompound().hasKey("modifier") && item.getTagCompound().hasKey("jewel")) - entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.jewelrymodifiedfull")); - else if(te.hasJewel && item.hasTagCompound() && item.getTagCompound().hasKey("jewel")) - entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.jewelrycontainsjewel")); - else if(te.hasModifier && item.hasTagCompound() && item.getTagCompound().hasKey("modifier")) - entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.jewelrycontainsmodifier")); - else - { - te.jewelry = item.copy(); - te.hasJewelry = true; - if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; - entityPlayer.inventory.onInventoryChanged(); - world.setBlockTileEntity(i, j, k, te); - te.isDirty = true; - } - } - if (!te.hasEndItem && !te.hasModifier && item != null && JewelrycraftUtil.isModifier(item)) - { - if(te.hasJewelry && te.jewelry.hasTagCompound() && te.jewelry.getTagCompound().hasKey("modifier")) - entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.jewelrycontainsmodifier")); - else - { - te.modifier = item.copy(); - te.modifier.stackSize = 1; - te.hasModifier = true; - if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; - entityPlayer.inventory.onInventoryChanged(); - world.setBlockTileEntity(i, j, k, te); - te.isDirty = true; - } - } - if (!te.hasEndItem && !te.hasJewel && item != null && JewelrycraftUtil.isJewel(item)) - { - if(te.hasJewelry && te.jewelry.hasTagCompound() && te.jewelry.getTagCompound().hasKey("jewel")) - entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.jewelrycontainsjewel")); - else - { - te.jewel = item.copy(); - te.jewel.stackSize = 1; - te.hasJewel = true; - if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; - entityPlayer.inventory.onInventoryChanged(); - world.setBlockTileEntity(i, j, k, te); - te.isDirty = true; - } - } - if (te.timer <= 0 && !te.hasEndItem && te.hasJewelry && (te.hasModifier || te.hasJewel)){ te.timer = ConfigHandler.jewelryCraftingTime; te.angle = 0;} - if (te.hasEndItem && item != null) entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.hasenditem")); - - if (te.hasModifier && entityPlayer.isSneaking()) - { - dropItem(world, (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.modifier.copy()); - te.modifier = new ItemStack(0, 0, 0); - te.hasModifier = false; - te.timer = 0; - te.angle = 0F; - te.isDirty = true; - world.markTileEntityForDespawn(te); - world.setBlockTileEntity(i, j, k, te); - } - if (te.hasJewelry && entityPlayer.isSneaking()) - { - dropItem(world, (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.jewelry.copy()); - te.jewelry = new ItemStack(0, 0, 0); - te.hasJewelry = false; - te.timer = 0; - te.angle = 0F; - te.isDirty = true; - world.markTileEntityForDespawn(te); - world.setBlockTileEntity(i, j, k, te); - } - if (te.hasJewel && entityPlayer.isSneaking()) - { - dropItem(world, (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.jewel.copy()); - te.jewel = new ItemStack(0, 0, 0); - te.hasJewel = false; - te.timer = 0; - te.angle = 0F; - te.isDirty = true; - world.markTileEntityForDespawn(te); - world.setBlockTileEntity(i, j, k, te); - } - } - return true; - } - - 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); - } - - public void breakBlock(World world, int i, int j, int k, int par5, int par6) - { - TileEntityJewelrsCraftingTable te = (TileEntityJewelrsCraftingTable) world.getBlockTileEntity(i, j, k); - if (te != null) - { - if (te.hasModifier) dropItem(world, (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.modifier.copy()); - if (te.hasJewelry) dropItem(world, (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.jewelry.copy()); - if (te.hasJewel) dropItem(world, (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.jewel.copy()); - if (te.hasEndItem) dropItem(te.worldObj, (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.endItem.copy()); - world.markTileEntityForDespawn(te); - } - super.breakBlock(world, i, j, k, par5, par6); - } - - @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 void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) - { - TileEntityJewelrsCraftingTable te = (TileEntityJewelrsCraftingTable) world.getBlockTileEntity(i, j, k); - if (te != null && !world.isRemote) - { - if (te.hasEndItem) - { - dropItem(te.worldObj, (double) te.xCoord, (double) te.yCoord, (double) te.zCoord, te.endItem.copy()); - te.endItem = new ItemStack(0, 0, 0); - te.hasEndItem = false; - te.isDirty = true; - world.markTileEntityForDespawn(te); - world.setBlockTileEntity(i, j, k, te); - } - else if (te.hasJewelry && (te.hasModifier || te.hasJewel) && te.timer > 0 && te.jewelry != null) player.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.table.iscrafting", te.jewelry.getDisplayName()) + " (" + ((ConfigHandler.jewelryCraftingTime - te.timer) * 100 / ConfigHandler.jewelryCraftingTime) + "%)"); - else if ((!te.hasModifier || !te.hasJewel) && !te.hasJewelry) player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.missingjewelryandmodifierorjewel")); - else if (!te.hasJewelry) player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.missingjewelry")); - else if (!te.hasModifier || !te.hasJewel) player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.table.missingmodifierorjewel")); - } - } - - @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 registerIcons(IconRegister icon) - { - this.blockIcon = icon.registerIcon("jewelrycraft:jewelrsCraftingTable"); - } -} diff --git a/common/darkknight/jewelrycraft/block/BlockList.java b/common/darkknight/jewelrycraft/block/BlockList.java deleted file mode 100644 index 5f7cbe6..0000000 --- a/common/darkknight/jewelrycraft/block/BlockList.java +++ /dev/null @@ -1,55 +0,0 @@ -package darkknight.jewelrycraft.block; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.tileentity.*; - -public class BlockList -{ - public static Block shadowOre; - public static Block glow; - public static Block smelter; - public static Block molder; - public static Block displayer; - public static Block jewelCraftingTable; - public static Block shadowBlock; - public static Block jewelAltar; - - private static boolean isInitialized = false; - - public static void preInit(FMLPreInitializationEvent e) - { - if (!isInitialized) - { - shadowOre = new Block(ConfigHandler.idShadowOre, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setTextureName("jewelrycraft:oreShadow").setUnlocalizedName("Jewelrycraft.oreShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); - glow = new BlockGlow(ConfigHandler.idGlow).setUnlocalizedName("Jewelrycraft.glow").setLightValue(1F); - smelter = new BlockSmelter(ConfigHandler.idSmelter, Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Jewelrycraft.smelter").setCreativeTab(JewelrycraftMod.jewelrycraft); - molder = new BlockMolder(ConfigHandler.idMolder, Material.rock).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Jewelrycraft.molder").setCreativeTab(JewelrycraftMod.jewelrycraft); - displayer = new BlockDisplayer(ConfigHandler.idDisplayer, Material.iron).setHardness(5.0F).setResistance(6.0F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("Jewelrycraft.displayer").setCreativeTab(JewelrycraftMod.jewelrycraft); - jewelCraftingTable = new BlockJewelrsCraftingTable(ConfigHandler.idJewelCraftingTable, Material.rock).setHardness(3.0F).setResistance(5.0F).setStepSound(Block.soundStoneFootstep).setUnlocalizedName("Jewelrycraft.jewelCraftingTable").setCreativeTab(JewelrycraftMod.jewelrycraft); - shadowBlock = new BlockShadow(ConfigHandler.idShadowBlock).setHardness(5.0F).setResistance(7.0F).setStepSound(Block.soundMetalFootstep).setTextureName("jewelrycraft:blockShadow").setUnlocalizedName("Jewelrycraft.blockShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); - jewelAltar = new BlockJewelAltar(ConfigHandler.idAltar).setHardness(5.0F).setResistance(2.0F).setStepSound(Block.soundMetalFootstep).setTextureName("jewelrycraft:altar").setUnlocalizedName("Jewelrycraft.altar").setCreativeTab(JewelrycraftMod.jewelrycraft); - - 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.registerTileEntity(TileEntitySmelter.class, "30"); - GameRegistry.registerTileEntity(TileEntityMolder.class, "31"); - GameRegistry.registerTileEntity(TileEntityJewelrsCraftingTable.class, "32"); - GameRegistry.registerTileEntity(TileEntityDisplayer.class, "33"); - GameRegistry.registerTileEntity(TileEntityBlockShadow.class, "34"); - GameRegistry.registerTileEntity(TileEntityAltar.class, "35"); - - isInitialized = true; - } - } -} diff --git a/common/darkknight/jewelrycraft/block/BlockMolder.java b/common/darkknight/jewelrycraft/block/BlockMolder.java deleted file mode 100644 index f64b122..0000000 --- a/common/darkknight/jewelrycraft/block/BlockMolder.java +++ /dev/null @@ -1,145 +0,0 @@ -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.IconRegister; -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.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(); - - protected BlockMolder(int par1, Material par2Material) - { - super(par1, par2Material); - this.setBlockBounds(0.1F, 0F, 0.1F, 0.9F, 0.2F, 0.9F); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityMolder(); - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - @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.getBlockTileEntity(i, j, k); - ItemStack item = entityPlayer.inventory.getCurrentItem(); - if (te != null && !world.isRemote) - { - if(item != null && !te.hasMold && item.itemID == ItemList.molds.itemID) - { - te.mold = item.copy(); - te.hasMold = true; - if (!entityPlayer.capabilities.isCreativeMode) --item.stackSize; - entityPlayer.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.molder.addedmold", te.mold.getDisplayName())); - te.isDirty = true; - } - if (te.hasMold && entityPlayer.isSneaking() && !te.hasMoltenMetal) - { - dropItem(world, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.mold.copy()); - te.mold = new ItemStack(0, 0, 0); - te.hasMold = false; - te.isDirty = true; - } - else if(te.hasMoltenMetal) entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.molder.hasmoltenmetal")); - } - return true; - } - - 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); - } - - public void breakBlock(World world, int i, int j, int k, int par5, int par6) - { - TileEntityMolder te = (TileEntityMolder) world.getBlockTileEntity(i, j, k); - - if (te != null) - { - if(te.hasJewelBase) dropItem(te.worldObj, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.jewelBase.copy()); - if(te.hasMold) dropItem(world, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.mold.copy()); - world.markTileEntityForDespawn(te); - } - - super.breakBlock(world, i, j, k, par5, par6); - } - - @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 void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) - { - TileEntityMolder me = (TileEntityMolder) world.getBlockTileEntity(i, j, k); - if (me != null && !world.isRemote) - { - if (me.hasJewelBase) - { - dropItem(me.worldObj, (double)me.xCoord, (double)me.yCoord, (double)me.zCoord, me.jewelBase.copy()); - me.jewelBase = new ItemStack(0, 0, 0); - me.hasJewelBase = false; - } - else if (me.hasMoltenMetal && me.cooling > 0) - player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.molder.metaliscooling") + " (" + ((ConfigHandler.ingotCoolingTime - me.cooling)*100/ConfigHandler.ingotCoolingTime) + "%)"); - else if (me.mold.itemID == ItemList.molds.itemID && !me.hasMoltenMetal) - player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.molder.moldisempty")); - else if (me.mold.itemID != ItemList.molds.itemID) - player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.molder.moldismissing")); - me.isDirty = true; - } - } - - @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 registerIcons(IconRegister icon) - { - this.blockIcon = icon.registerIcon("jewelrycraft:molder"); - } -} diff --git a/common/darkknight/jewelrycraft/block/BlockShadow.java b/common/darkknight/jewelrycraft/block/BlockShadow.java deleted file mode 100644 index 1e58d54..0000000 --- a/common/darkknight/jewelrycraft/block/BlockShadow.java +++ /dev/null @@ -1,100 +0,0 @@ -package darkknight.jewelrycraft.block; - -import darkknight.jewelrycraft.tileentity.TileEntityBlockShadow; -import net.minecraft.block.BlockContainer; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.Icon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; - -public class BlockShadow extends BlockContainer -{ - private Icon[] iconArray; - - public BlockShadow(int par1) - { - super(par1, Material.iron); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - - public int getRenderBlockPass() - { - return 1; - } - - public boolean isBeaconBase(World worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) - { - return true; - } - - public boolean isOpaqueCube() - { - return false; - } - - public boolean renderAsNormalBlock() - { - return false; - } - - public boolean isBlockSolidOnSide(World world, int x, int y, int z, ForgeDirection side) - { - return false; - } - - public static boolean isNormalCube(int par0) - { - return true; - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntityBlockShadow(); - } - - public void registerIcons(IconRegister par1IconRegister) - { - this.iconArray = new Icon[16]; - - for (int i = 0; i < this.iconArray.length; ++i) - { - this.iconArray[i] = par1IconRegister.registerIcon(this.getTextureName() + (15 - i)); - } - } - - 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); - } - - public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) - { - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); - } - - public boolean shouldSideBeRendered(IBlockAccess iBlockAccess, int par2, int par3, int par4, int par5) - { - return iBlockAccess.isAirBlock(par2, par3, par4)?true:iBlockAccess.isBlockNormalCube(par2, par3, par4)?false:(iBlockAccess.getBlockId(par2, par3, par4) == BlockList.shadowBlock.blockID)?false:true; - } - - public boolean hasComparatorInputOverride() - { - return true; - } - - public int getComparatorInputOverride(World world, int x, int y, int z, int meta) - { - return world.getBlockMetadata(x, y, z); - } - - public Icon getIcon(int par1, int par2) - { - return this.iconArray[par2]; - } -} diff --git a/common/darkknight/jewelrycraft/block/BlockSmelter.java b/common/darkknight/jewelrycraft/block/BlockSmelter.java deleted file mode 100644 index 79fe7d6..0000000 --- a/common/darkknight/jewelrycraft/block/BlockSmelter.java +++ /dev/null @@ -1,191 +0,0 @@ -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.IconRegister; -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.util.StatCollector; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.tileentity.TileEntityMolder; -import darkknight.jewelrycraft.tileentity.TileEntitySmelter; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -public class BlockSmelter extends BlockContainer -{ - Random rand = new Random(); - - protected BlockSmelter(int par1, Material par2Material) - { - super(par1, par2Material); - } - - @Override - public TileEntity createNewTileEntity(World world) - { - return new TileEntitySmelter(); - } - - @Override - public boolean renderAsNormalBlock() - { - return false; - } - - 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; - world.spawnEntityInWorld(entityitem); - } - - public void breakBlock(World world, int i, int j, int k, int par5, int par6) - { - TileEntitySmelter te = (TileEntitySmelter) world.getBlockTileEntity(i, j, k); - if (te != null && te.hasMetal){ - dropItem(world, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.metal.copy()); - world.markTileEntityForDespawn(te); - } - 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.getBlockTileEntity(i, j, k); - ItemStack item = entityPlayer.inventory.getCurrentItem(); - if (te != null && !world.isRemote) - { - int index = -1; - for(int a = 0; a < JewelrycraftUtil.jamcraftPlayers.size(); a++) if(entityPlayer.username.equals(JewelrycraftUtil.jamcraftPlayers.get(a))) index = a; - if (!te.hasMetal && !te.hasMoltenMetal && item != null && (item.getUnlocalizedName().toLowerCase().contains("ingot") || index != -1) && !item.getUnlocalizedName().toLowerCase().contains("mold")) - { - entityPlayer.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.smelter.nowsmeltingingot", item.getDisplayName())); - te.metal = item.copy(); - 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 && item != null && item.getDisplayName().contains("Ingot") && !item.getDisplayName().contains("Mold")) - entityPlayer.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.smelter.alreadyhasingot", te.metal.getDisplayName())); - else if (te.hasMoltenMetal) - entityPlayer.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.smelter.hasmolteningot", te.moltenMetal.getDisplayName())); - else if (item != null && !item.getUnlocalizedName().toLowerCase().contains("ingot") && item.getDisplayName().contains("Ingot")) - entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.itemrenamedtoingot")); - else if (item != null && (!item.getUnlocalizedName().toLowerCase().contains("ingot") || item.getUnlocalizedName().toLowerCase().contains("mold"))) - entityPlayer.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.itemneedstobeingot")); - - if (te.hasMetal && entityPlayer.isSneaking()) - { - dropItem(world, (double)te.xCoord, (double)te.yCoord, (double)te.zCoord, te.metal.copy()); - te.hasMetal = false; - te.melting = -1; - world.markTileEntityForDespawn(te); - world.setBlockTileEntity(i, j, k, te); - } - if(te != null) world.setBlockTileEntity(i, j, k, te); - } - return true; - } - - @Override - public void onBlockClicked(World world, int i, int j, int k, EntityPlayer player) - { - TileEntitySmelter te = (TileEntitySmelter) world.getBlockTileEntity(i, j, k); - TileEntityMolder me = null; - if (world.getBlockMetadata(i, j, k) == 0 && world.getBlockTileEntity(i, j, k - 1) != null && world.getBlockTileEntity(i, j, k - 1) instanceof TileEntityMolder) - me = (TileEntityMolder) world.getBlockTileEntity(i, j, k - 1); - else if (world.getBlockMetadata(i, j, k) == 1 && world.getBlockTileEntity(i + 1, j, k) != null && world.getBlockTileEntity(i + 1, j, k) instanceof TileEntityMolder) - me = (TileEntityMolder) world.getBlockTileEntity(i + 1, j, k); - else if (world.getBlockMetadata(i, j, k) == 2 && world.getBlockTileEntity(i, j, k + 1) != null && world.getBlockTileEntity(i, j, k + 1) instanceof TileEntityMolder) - me = (TileEntityMolder) world.getBlockTileEntity(i, j, k + 1); - else if (world.getBlockMetadata(i, j, k) == 3 && world.getBlockTileEntity(i - 1, j, k) != null && world.getBlockTileEntity(i - 1, j, k) instanceof TileEntityMolder) - me = (TileEntityMolder) world.getBlockTileEntity(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) - { - me.moltenMetal = te.moltenMetal; - me.hasMoltenMetal = true; - me.cooling = ConfigHandler.ingotCoolingTime; - te.moltenMetal = new ItemStack(0, 0, 0); - te.hasMoltenMetal = false; - me.isDirty = true; - world.markTileEntityForDespawn(te); - world.setBlockTileEntity(i, j, k, te); - } - else if (te.hasMetal && te.melting > 0) - player.addChatMessage(StatCollector.translateToLocalFormatted("chatmessage.Jewelrycraft.smelter.metalismelting", te.metal.getDisplayName()) + " (" + ((ConfigHandler.ingotMeltingTime - te.melting)*100/ConfigHandler.ingotMeltingTime) + "%)"); - else if (te.hasMoltenMetal && !isConnectedToMolder(world, i, j, k)) - player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.molderismissing")); - else if (!me.hasMold && te.hasMoltenMetal) - player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.molderhasnomold")); - else if (me.hasMoltenMetal && te.hasMoltenMetal) - player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.molderhasmoltenmetal")); - else if (me.hasJewelBase && te.hasMoltenMetal) - player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.modlerhasitem")); - else - player.addChatMessage(StatCollector.translateToLocal("chatmessage.Jewelrycraft.smelter.empty")); - } - - } - - public boolean isConnectedToMolder(World world, int i, int j, int k) - { - int blockMeta = world.getBlockMetadata(i, j, k); - if (blockMeta == 0 && world.getBlockId(i, j, k - 1) == BlockList.molder.blockID) - return true; - else if (blockMeta == 1 && world.getBlockId(i + 1, j, k) == BlockList.molder.blockID) - return true; - else if (blockMeta == 2 && world.getBlockId(i, j, k + 1) == BlockList.molder.blockID) - return true; - else if (blockMeta == 3 && world.getBlockId(i - 1, j, k) == BlockList.molder.blockID) - 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 registerIcons(IconRegister icon) - { - this.blockIcon = icon.registerIcon("jewelrycraft:smelter"); - } - -} diff --git a/common/darkknight/jewelrycraft/client/ClientProxy.java b/common/darkknight/jewelrycraft/client/ClientProxy.java deleted file mode 100644 index e086e94..0000000 --- a/common/darkknight/jewelrycraft/client/ClientProxy.java +++ /dev/null @@ -1,21 +0,0 @@ -package darkknight.jewelrycraft.client; - -import net.minecraft.util.ResourceLocation; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.common.registry.VillagerRegistry; -import darkknight.jewelrycraft.CommonProxy; -import darkknight.jewelrycraft.renders.*; -import darkknight.jewelrycraft.tileentity.*; - -public class ClientProxy extends CommonProxy -{ - @Override - public void registerRenderers() - { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySmelter.class, new TileEntitySmelterRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMolder.class, new TileEntityMolderRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityJewelrsCraftingTable.class, new TileEntityJewelrsCraftingTableRender()); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityDisplayer.class, new TileEntityDisplayerRender()); - VillagerRegistry.instance().registerVillagerSkin(3000, new ResourceLocation("jewelrycraft", "textures/entities/jeweler.png")); - } -} diff --git a/common/darkknight/jewelrycraft/client/GuiGuide.java b/common/darkknight/jewelrycraft/client/GuiGuide.java deleted file mode 100644 index 64aed20..0000000 --- a/common/darkknight/jewelrycraft/client/GuiGuide.java +++ /dev/null @@ -1,215 +0,0 @@ -package darkknight.jewelrycraft.client; - -import java.util.ArrayList; -import java.util.List; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.inventory.GuiContainer; -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.container.GuiRectangle; -import darkknight.jewelrycraft.container.GuiTab; -import darkknight.jewelrycraft.container.GuiTabBlocks; -import darkknight.jewelrycraft.container.GuiTabItems; -import darkknight.jewelrycraft.container.GuiTabJewelsAndModifiers; -import darkknight.jewelrycraft.container.GuiTabNecklaces; -import darkknight.jewelrycraft.container.GuiTabRings; - -public class GuiGuide extends GuiContainer -{ - public int page, rot, del; - public boolean prevHover, nextHover; - World world; - private final GuiTab[] tabs; - private GuiTab activeTab; - - public GuiGuide(Container container, World world) - { - super(container); - page = 1; - rot = 0; - del = 0; - this.world = world; - - tabs = new GuiTab[] { - new GuiTabBlocks(0), - new GuiTabItems(1), - new GuiTabJewelsAndModifiers(2), - new GuiTabRings(3), - new GuiTabNecklaces(4) - }; - - activeTab = tabs[0]; - } - - @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(new ResourceLocation("jewelrycraft", "textures/gui/guidePage.png")); - drawTexturedModalRect(guiLeft + 147/2 + 20, guiTop - 10, 0, 0, 145, 180); - Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png")); - 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)); - this.drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 20, fontRenderer); - text.remove(Integer.toString(page)); - text.add(Integer.toString(page + 1)); - this.drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 20, fontRenderer); - - for(int tab = 0; tab < tabs.length; tab++) - renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab*19, activeTab.getIcon()); - - } - - 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()); - } - } - - @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; - } - } - } - } - - 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 GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.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(); - - } - - public void renderItem(ItemStack item, float x, float y, float scale) - { - 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); - GL11.glRotatef(45.0F, 0.0F, 1.0F, 0.0F); - GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F); - 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; - } - GL11.glPopMatrix(); - } - - public int getLeft() - { - return guiLeft; - } - - public int getTop() - { - return guiTop; - } - - public FontRenderer getFont() - { - return fontRenderer; - } - - @SuppressWarnings("rawtypes") - public void drawHoverString(List lst, int x, int y) - { - drawHoveringText(lst, x, y, fontRenderer); - } -}
\ No newline at end of file diff --git a/common/darkknight/jewelrycraft/client/GuiRingChest.java b/common/darkknight/jewelrycraft/client/GuiRingChest.java deleted file mode 100644 index 3aa4cf6..0000000 --- a/common/darkknight/jewelrycraft/client/GuiRingChest.java +++ /dev/null @@ -1,39 +0,0 @@ -package darkknight.jewelrycraft.client; - -import org.lwjgl.opengl.GL11; - -import darkknight.jewelrycraft.container.ContainerRingChest; - -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.ResourceLocation; - -public class GuiRingChest extends GuiContainer -{ - public ContainerRingChest container; - - public GuiRingChest(ContainerRingChest container) - { - super(container); - this.container = container; - xSize = 176; - ySize = 166; - } - - @Override - public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) - { - GL11.glColor3f(1, 1, 1); - - Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/chest_ring.png")); - - drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - } - - @Override - public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) - { - fontRenderer.drawString("Linked Chest", 8, 6, 0x404040); - fontRenderer.drawString("Inventory", 8, 72, 0x404040); - } -} diff --git a/common/darkknight/jewelrycraft/client/JewelryCraftClient.java b/common/darkknight/jewelrycraft/client/JewelryCraftClient.java deleted file mode 100644 index 734e9d5..0000000 --- a/common/darkknight/jewelrycraft/client/JewelryCraftClient.java +++ /dev/null @@ -1,16 +0,0 @@ -package darkknight.jewelrycraft.client; - -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet250CustomPayload; -import cpw.mods.fml.common.network.IPacketHandler; -import cpw.mods.fml.common.network.Player; - -public class JewelryCraftClient implements IPacketHandler -{ - @Override - public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) - { - // TODO Auto-generated method stub - - } -} diff --git a/common/darkknight/jewelrycraft/config/ConfigHandler.java b/common/darkknight/jewelrycraft/config/ConfigHandler.java deleted file mode 100644 index 80309af..0000000 --- a/common/darkknight/jewelrycraft/config/ConfigHandler.java +++ /dev/null @@ -1,68 +0,0 @@ -package darkknight.jewelrycraft.config; - -import net.minecraftforge.common.Configuration; -import cpw.mods.fml.common.event.FMLPreInitializationEvent; - -public class ConfigHandler -{ - private static Configuration config; - public static int idThiefGloves = 17493; - public static int idShadowIngot = 17494; - public static int idMolds = 17495; - public static int idRing = 17496; - public static int idClayMolds = 17497; - public static int idCrystal = 17498; - public static int idNecklace = 17499; - public static int idGuide = 17500; - - public static int idShadowOre = 1750; - public static int idSmelter = 1751; - public static int idDisplayer = 1752; - public static int idJewelCraftingTable = 1753; - public static int idMolder = 1754; - public static int idGlow = 1755; - public static int idShadowBlock = 1756; - public static int idAltar = 1757; - - public static int ingotCoolingTime = 200; - public static int ingotMeltingTime = 1500; - public static int jewelryCraftingTime = 2000; - - private static boolean isInitialized = false; - - public static void preInit(FMLPreInitializationEvent e) - { - if (!isInitialized) - { - config = new Configuration(e.getSuggestedConfigurationFile()); - - config.load(); - - idThiefGloves = config.getItem("Thief Gloves", idThiefGloves).getInt(); - idShadowIngot = config.getItem("Shadow Ingot", idShadowIngot).getInt(); - idMolds = config.getItem("Molds", idMolds).getInt(); - idClayMolds = config.getItem("Clay Molds", idClayMolds).getInt(); - idRing = config.getItem("Ring", idRing).getInt(); - idNecklace = config.getItem("Necklace", idNecklace).getInt(); - idCrystal = config.getItem("Crystal", idCrystal).getInt(); - idGuide = config.getItem("Guide", idGuide).getInt(); - - idShadowOre = config.getBlock("Shadow Ore", idShadowOre).getInt(); - idShadowBlock = config.getBlock("Shadow Block", idShadowBlock).getInt(); - idSmelter = config.getBlock("Smelter", idSmelter).getInt(); - idMolder = config.getBlock("Molder", idMolder).getInt(); - idDisplayer = config.getBlock("Displayer", idDisplayer).getInt(); - idJewelCraftingTable = config.getBlock("Jeweler's Crafting Table", idJewelCraftingTable).getInt(); - idGlow = config.getBlock("Glow", idGlow).getInt(); - idAltar = config.getBlock("Jewel Altar", idAltar).getInt(); - - ingotCoolingTime = config.get("timers", "Molder Ingot Cooling Time", ingotCoolingTime).getInt(); - ingotMeltingTime = config.get("timers", "Ingot Melting Time", ingotMeltingTime).getInt(); - jewelryCraftingTime = config.get("timers", "Jewelry Crafting Time", jewelryCraftingTime).getInt(); - - config.save(); - - isInitialized = true; - } - } -} diff --git a/common/darkknight/jewelrycraft/container/ContainerGuide.java b/common/darkknight/jewelrycraft/container/ContainerGuide.java deleted file mode 100644 index ef05cc4..0000000 --- a/common/darkknight/jewelrycraft/container/ContainerGuide.java +++ /dev/null @@ -1,18 +0,0 @@ -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() { - } - - @Override - public boolean canInteractWith(EntityPlayer entityplayer) { - return true; - } -}
\ No newline at end of file diff --git a/common/darkknight/jewelrycraft/container/ContainerRingChest.java b/common/darkknight/jewelrycraft/container/ContainerRingChest.java deleted file mode 100644 index 2728941..0000000 --- a/common/darkknight/jewelrycraft/container/ContainerRingChest.java +++ /dev/null @@ -1,71 +0,0 @@ -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; - - 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)); - } - @Override - public boolean canInteractWith(EntityPlayer player) - { - return true; - } - - @Override - public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) - { - ItemStack itemstack = null; - Slot slot = (Slot)this.inventorySlots.get(par2); - - if (slot != null && slot.getHasStack()) - { - ItemStack itemstack1 = slot.getStack(); - itemstack = itemstack1.copy(); - - if (par2 < 27) - { - if (!this.mergeItemStack(itemstack1, 27, this.inventorySlots.size(), true)) - { - return null; - } - } - else if (!this.mergeItemStack(itemstack1, 0, 27, false)) - { - return null; - } - - if (itemstack1.stackSize == 0) - { - slot.putStack((ItemStack)null); - } - else - { - slot.onSlotChanged(); - } - } - - return itemstack; - } -} diff --git a/common/darkknight/jewelrycraft/container/GuiHandler.java b/common/darkknight/jewelrycraft/container/GuiHandler.java deleted file mode 100644 index 70ff5f7..0000000 --- a/common/darkknight/jewelrycraft/container/GuiHandler.java +++ /dev/null @@ -1,40 +0,0 @@ -package darkknight.jewelrycraft.container; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntityChest; -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.GuiRingChest; - -public class GuiHandler implements IGuiHandler -{ - public GuiHandler() - { - NetworkRegistry.instance().registerGuiHandler(JewelrycraftMod.instance, this); - } - - @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.getBlockTileEntity(x, y, z)); - case 1: return new ContainerGuide(); - default: return null; - } - } - - @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)); - case 1: return new GuiGuide((ContainerGuide) getServerGuiElement(ID, player, world, x, y, z), world); - default: return null; - } - } -} diff --git a/common/darkknight/jewelrycraft/container/GuiRectangle.java b/common/darkknight/jewelrycraft/container/GuiRectangle.java deleted file mode 100644 index 76dee04..0000000 --- a/common/darkknight/jewelrycraft/container/GuiRectangle.java +++ /dev/null @@ -1,66 +0,0 @@ -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; - - public GuiRectangle(int x, int y, int w, int h) - { - this.x = x; - this.y = y; - this.w = w; - this.h = h; - } - - 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; - } - - public void setX(int x) - { - this.x = x; - } - - public void setY(int y) - { - this.y = y; - } - - - public void draw(GuiGuide gui, int srcX, int srcY) - { - gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, w, h); - } - - - 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); - } - - 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()); - } - } - - public ItemStack getIcon() - { - return null; - } -} diff --git a/common/darkknight/jewelrycraft/container/GuiTab.java b/common/darkknight/jewelrycraft/container/GuiTab.java deleted file mode 100644 index c092ba6..0000000 --- a/common/darkknight/jewelrycraft/container/GuiTab.java +++ /dev/null @@ -1,37 +0,0 @@ -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; - - public GuiTab(String name, int id) - { - super(-62, 10 + 19*id, 19, 18); - this.name = name; - values = 0; - del = 0; - } - - public String getName() - { - return name; - } - - public abstract void drawBackground(GuiGuide gui, int x, int y, int page); - public abstract void drawForeground(GuiGuide gui, int x, int y, int page); - public void mouseClick(GuiGuide gui, int x, int y, int button) {} - public void mouseMoveClick(GuiGuide gui, int x, int y, int button, long timeSinceClicked) {} - public void mouseReleased(GuiGuide gui, int x, int y, int button) {} - - public int getMaxPages() - { - return 1; - } - -} diff --git a/common/darkknight/jewelrycraft/container/GuiTabBlocks.java b/common/darkknight/jewelrycraft/container/GuiTabBlocks.java deleted file mode 100644 index 5c24ad2..0000000 --- a/common/darkknight/jewelrycraft/container/GuiTabBlocks.java +++ /dev/null @@ -1,295 +0,0 @@ -package darkknight.jewelrycraft.container; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -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 -{ - - public GuiTabBlocks(int id) - { - super("Blocks", id); - } - - public ItemStack getIcon() - { - return new ItemStack(BlockList.jewelAltar); - } - - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - ArrayList<String> text = new ArrayList<String>(); - ArrayList<ItemStack> items = new ArrayList<ItemStack>(); - int xPos = (page%2==0)?107:-35; - switch(page) - { - case 1: - text.add(" This ore is extremely"); - text.add("rare and can be found"); - text.add("only between Y level 5"); - text.add("and 8. It can only be"); - text.add("mined using a diamond"); - text.add("pickaxe."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.shadowOre), text, 90f); - break; - case 2: - text.add(" The Shadow Block is"); - text.add("crafted using 9 shadow"); - text.add("ingots. It has been"); - text.add("discovered that it"); - text.add("poseses abnormal"); - text.add("properties in the"); - text.add("shadow. The darker it"); - items.add(new ItemStack(BlockList.shadowBlock)); - for(int i = 1; i <= 9; i++) items.add(new ItemStack(ItemList.shadowIngot)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 3: - text.add("is, the more"); - text.add("transparent it will be,"); - text.add("until it becomes"); - text.add("walkable through. If a"); - text.add("comparator is attached"); - text.add("to it, the output"); - text.add("strength will be equal"); - text.add("to the value of"); - text.add("darkness it is in."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 4: - text.add(" The smelter is one of"); - text.add("the first blocks needed"); - text.add("to get started with"); - text.add("Jewelrycraft. Requiring"); - text.add("just some cobble and"); - text.add("a couple buckets, it's"); - text.add("the most important"); - items.add(new ItemStack(BlockList.smelter)); - items.add(new ItemStack(Block.cobblestone)); - items.add(new ItemStack(Item.bucketEmpty)); - items.add(new ItemStack(Block.cobblestone)); - items.add(new ItemStack(Block.cobblestone)); - items.add(null); - items.add(new ItemStack(Block.cobblestone)); - items.add(new ItemStack(Block.cobblestone)); - items.add(new ItemStack(Item.bucketLava)); - items.add(new ItemStack(Block.cobblestone)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 5: - text.add("block as it can melt"); - text.add("ingots which can be"); - text.add("made into pieces of"); - text.add("jewellery, like rings"); - text.add("or necklaces. To use"); - text.add("the block all you need"); - text.add("to do is right click"); - text.add("on it with any ingot."); - text.add("If left clicked while"); - text.add("smelting, a message"); - text.add("will appear saying the"); - text.add("percentage it is done."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 6: - text.add("If left clicked when"); - text.add("it's done smelting,"); - text.add("a message will be"); - text.add("displayed, mentioning"); - text.add("the contents of the"); - text.add("block."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 7: - text.add(" The molder is a key"); - text.add("piece in creating"); - text.add("jewellery. You need"); - text.add("to pour the molten"); - text.add("metal out of the"); - text.add("smelter somewhere."); - text.add("That somewhere is the"); - - items.add(new ItemStack(BlockList.molder)); - items.add(new ItemStack(Block.cobblestone)); - items.add(null); - items.add(new ItemStack(Block.cobblestone)); - for(int i = 1; i <= 3; i++) items.add(new ItemStack(Block.cobblestone)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 8: - text.add("molder. But before"); - text.add("pouring the molten"); - text.add("metal in it, you must"); - text.add("first add a mold."); - text.add("You can do that by"); - text.add("simply right clicking"); - text.add("the block with the"); - text.add("mold of your choice."); - text.add("If you want to get the"); - text.add("mold out, simply crouch"); - text.add("and right click it with"); - text.add("an empty hand."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 9: - text.add(" Once you have a mold"); - text.add("inside, left click on"); - text.add("the smelter and wait"); - text.add("for the metal to cool"); - text.add("down. When it's done,"); - text.add("left click on the"); - text.add("molder to get the"); - text.add("jewellery. " + EnumChatFormatting.DARK_RED + "Be aware"); - text.add(EnumChatFormatting.DARK_RED + "that this block must be"); - text.add(EnumChatFormatting.DARK_RED + "placed directly in front"); - text.add(EnumChatFormatting.DARK_RED + "of the smelter,"); - text.add(EnumChatFormatting.DARK_RED + "otherwise it won't work!"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 10: - text.add(" Your jewellery on"); - text.add("their own don't do"); - text.add("much. They need to be"); - text.add("modified a bit and the"); - text.add("only way to do that is"); - text.add("by using this block."); - text.add("Simply right click the"); - if(del == 0) values++; - del++; - if(del >= 300) del = 0; - if(values >= 4) values = 0; - items.add(new ItemStack(BlockList.jewelCraftingTable)); - for(int i = 1; i <= 3; i++)items.add(new ItemStack(Block.planks, 1, values)); - items.add(new ItemStack(Block.cobblestone)); - items.add(null); - items.add(new ItemStack(Block.cobblestone)); - items.add(new ItemStack(Block.cobblestone)); - items.add(null); - items.add(new ItemStack(Block.cobblestone)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 11: - text.add("block while holding the"); - text.add("jewellery to place it in."); - text.add("After that just add in"); - text.add("a jewel or a modifier,"); - text.add("or even both, to the"); - text.add("block. To do that simply"); - text.add("right click with them on"); - text.add("the block. Once it's"); - text.add("done modifying, left"); - text.add("click on it to retrieve"); - text.add("the modified item. If"); - text.add("you wish to know how"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 12: - text.add("much is left before the"); - text.add("transformation is done,"); - text.add("simply left click on the"); - text.add("table in the process."); - text.add(" A list with all the"); - text.add("possible modifiers is"); - text.add("located in a separate"); - text.add("tab."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 13: - text.add(" This block can store"); - text.add("any jewellery in it"); - text.add("and activate their"); - text.add("effects as it were a"); - text.add("player. However, it"); - text.add("does not work with"); - text.add("everything. You can"); - items.add(new ItemStack(BlockList.jewelAltar)); - items.add(new ItemStack(Block.whiteStone)); - items.add(new ItemStack(Block.cloth, 1, 5)); - items.add(new ItemStack(Block.whiteStone)); - items.add(new ItemStack(Block.netherBrick)); - items.add(new ItemStack(Block.cloth, 1, 5)); - items.add(new ItemStack(Block.netherBrick)); - items.add(new ItemStack(Block.netherBrick)); - items.add(new ItemStack(Block.netherBrick)); - items.add(new ItemStack(Block.netherBrick)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 14: - text.add("find out which jewellery"); - text.add("works by looking in"); - text.add("their apropriate tab."); - text.add(" Each item will have a"); - text.add("note where it is"); - text.add("mentioned their effect"); - text.add("when placed in this"); - text.add("block."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 15: - text.add(" The Storage"); - text.add("Displayer, as the"); - text.add("name suggests, can"); - text.add("store a large amount"); - text.add("of a single item/block"); - text.add("placed in it. This will"); - text.add("display all possible"); - items.add(new ItemStack(BlockList.displayer)); - items.add(null); - items.add(new ItemStack(Item.ingotIron)); - items.add(null); - items.add(new ItemStack(Item.ingotIron)); - items.add(new ItemStack(Item.ingotIron)); - items.add(new ItemStack(Item.ingotIron)); - items.add(new ItemStack(Block.blockEmerald)); - items.add(new ItemStack(Block.blockEmerald)); - items.add(new ItemStack(Block.blockEmerald)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 16: - text.add("infromation about the"); - text.add("object in it, such as"); - text.add("the name, durability,"); - text.add("enchantments and many"); - text.add("more. Below the name"); - text.add("is shown the amount"); - text.add("stored. To store"); - text.add("something in it simply"); - text.add("right click with that"); - text.add("object on it and the"); - text.add("whole amount of items"); - text.add("or blocks will be"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 17: - text.add("immediately stored"); - text.add("inside. To retrieve"); - text.add("a single item just"); - text.add("left click the block."); - text.add("If you wish to get"); - text.add("a whole stack, just"); - text.add("crouch and left click."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - default:; - } - } - - public int getMaxPages() - { - return 17; - } - - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - { - } - -} diff --git a/common/darkknight/jewelrycraft/container/GuiTabItems.java b/common/darkknight/jewelrycraft/container/GuiTabItems.java deleted file mode 100644 index 685d7dd..0000000 --- a/common/darkknight/jewelrycraft/container/GuiTabItems.java +++ /dev/null @@ -1,278 +0,0 @@ -package darkknight.jewelrycraft.container; - -import java.awt.Desktop; -import java.net.URL; -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -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 GuiTabItems extends GuiTab -{ - - public GuiTabItems(int id) - { - super("Items", id); - } - - public ItemStack getIcon() - { - return new ItemStack(ItemList.thiefGloves); - } - - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - ArrayList<String> text = new ArrayList<String>(); - ArrayList<ItemStack> items = new ArrayList<ItemStack>(); - int xPos = (page%2==0)?107:-35; - switch(page) - { - case 1: - text.add(" Shadow ingots are"); - text.add("obtained by smelting"); - text.add("shadow ore. They are"); - text.add("used in a few recipes"); - text.add("and an important key"); - text.add("for making some"); - text.add("jewellery work."); - items.add(new ItemStack(BlockList.shadowOre)); - items.add(new ItemStack(ItemList.shadowIngot)); - Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y); - break; - case 2: - text.add(" These gloves allow"); - text.add("you to steal the trades"); - text.add("the pesky Testificates"); - text.add("have to offer."); - text.add(" To use these simply"); - text.add("open their gui at least"); - text.add("once, then crouch and"); - items.add(new ItemStack(ItemList.thiefGloves)); - items.add(new ItemStack(ItemList.shadowIngot)); - items.add(null); - items.add(new ItemStack(ItemList.shadowIngot)); - items.add(new ItemStack(Block.cloth, 1, 15)); - items.add(new ItemStack(ItemList.shadowIngot)); - items.add(new ItemStack(Block.cloth, 1, 15)); - items.add(new ItemStack(Block.cloth, 1, 15)); - items.add(new ItemStack(ItemList.shadowIngot)); - items.add(new ItemStack(Block.cloth, 1, 15)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 3: - text.add("right click on the them"); - text.add("to steal the trades."); - text.add("A villager has 7 of the"); - text.add("same trade item. So, for"); - text.add("example, if he wants 2"); - text.add("emeralds in exchange"); - text.add("for 4 diamonds, you will"); - text.add("get 28 diamonds from"); - text.add("him, because 7*4=28."); - text.add("However, if you have"); - text.add("traded with him before,"); - text.add("then he will have that"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 4: - text.add("many times less of the"); - text.add("item. This has a maximum"); - text.add("of 10 uses before it"); - text.add("breaks."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 5: - text.add(" In order to get the"); - text.add("ingot back from the"); - text.add("smelter you need a"); - text.add("mold for it. However,"); - text.add("this mold can't be used."); - text.add("It is too soft. It needs"); - text.add("to be hardened in"); - text.add("order for it to be used."); - items.add(new ItemStack(ItemList.clayMolds, 1, 0)); - items.add(new ItemStack(Item.clay)); - items.add(new ItemStack(Item.clay)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y); - break; - case 6: - text.add(" By smelting the clay"); - text.add("mold you get a harder"); - text.add("version which can be"); - text.add("used to create ingots."); - text.add("Simply right click with"); - text.add("this on a molder to"); - text.add("attach it and you're"); - text.add("ready to go."); - items.add(new ItemStack(ItemList.clayMolds, 1, 0)); - items.add(new ItemStack(ItemList.molds, 1, 0)); - Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y); - break; - case 7: - text.add(" In order to create a"); - text.add("ring you need a mold"); - text.add("for it. However, this"); - text.add("one can't be used. It is"); - text.add("too soft. It needs to be"); - text.add("hardened in order for"); - text.add("it to be used."); - items.add(new ItemStack(ItemList.clayMolds, 1, 1)); - items.add(null); - items.add(new ItemStack(Item.clay)); - items.add(null); - items.add(new ItemStack(Item.clay)); - items.add(null); - items.add(new ItemStack(Item.clay)); - items.add(null); - items.add(new ItemStack(Item.clay)); - items.add(null); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 8: - text.add(" By smelting the clay"); - text.add("mold you get a harder"); - text.add("version which can be"); - text.add("used to create rings."); - text.add("Simply right click with"); - text.add("this on a molder to"); - text.add("attach it and you're"); - text.add("ready to go."); - items.add(new ItemStack(ItemList.clayMolds, 1, 1)); - items.add(new ItemStack(ItemList.molds, 1, 1)); - Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y); - break; - case 9: - text.add(" In order to create a"); - text.add("necklace you need a"); - text.add("mold for it. However,"); - text.add("this one can't be used."); - text.add("It is too soft. It needs"); - text.add("to be hardened in"); - text.add("order for it to be used."); - items.add(new ItemStack(ItemList.clayMolds, 1, 2)); - items.add(new ItemStack(Item.clay)); - items.add(null); - items.add(new ItemStack(Item.clay)); - items.add(new ItemStack(Item.clay)); - items.add(null); - items.add(new ItemStack(Item.clay)); - items.add(null); - items.add(new ItemStack(Item.clay)); - items.add(null); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 10: - text.add(" By smelting the clay"); - text.add("mold you get a harder"); - text.add("version which can be"); - text.add("used to create"); - text.add("necklaces. Simply right"); - text.add("click with this on a"); - text.add("molder to attach it and"); - text.add("you're ready to go."); - items.add(new ItemStack(ItemList.clayMolds, 1, 2)); - items.add(new ItemStack(ItemList.molds, 1, 2)); - Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y); - break; - case 11: - text.add(" Crystals don't do"); - text.add("much. They can be dyed"); - text.add("in any color and used"); - text.add("as jewels to create a"); - text.add("nice jewellery."); - items.add(new ItemStack(ItemList.crystal, 1, 15)); - items.add(null); - items.add(new ItemStack(Block.glass)); - items.add(null); - items.add(new ItemStack(Block.glass)); - items.add(null); - items.add(new ItemStack(Block.glass)); - items.add(null); - items.add(new ItemStack(Block.glass)); - items.add(null); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); - break; - case 12: - if(del == 0) values++; - del++; - if(del >= 300) del = 0; - if(values >= 15) values = 0; - items.add(new ItemStack(ItemList.crystal, 1, values)); - items.add(new ItemStack(Item.dyePowder, 1, values)); - items.add(new ItemStack(ItemList.crystal, 1, 15)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y); - items.removeAll(items); - items.add(new ItemStack(ItemList.crystal, 1, 15)); - items.add(new ItemStack(Item.dyePowder, 1, 15)); - items.add(new ItemStack(ItemList.crystal, 1, values)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop() + 60, true, text, items, x, y); - break; - case 13: - if(del == 0) values++; - del++; - if(del >= 300) del = 0; - if(values >= 3) values = 0; - text.add(" It's this exact guide."); - text.add("I don't even know why"); - text.add("you're reading this."); - text.add("I added this recipe in"); - text.add("case you lose the"); - text.add("original. In case you"); - text.add("don't have it, I suggest"); - text.add("adding NEI so you can"); - items.add(new ItemStack(ItemList.guide)); - items.add(new ItemStack(ItemList.molds, 1, values)); - items.add(new ItemStack(Item.book)); - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y); - break; - case 14: - String link = "HERE"; - if(x >= gui.getLeft() + 138 && x <= gui.getLeft() + 168 && y >= gui.getTop() + 98 && y <= gui.getTop() + 108) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK; - text.add("see all the recipes."); - text.add("Since you are reading"); - text.add("this, how about making"); - text.add("a youtube video"); - text.add("spotlighting this mod."); - text.add("I'd really appreciate it."); - text.add("After that you can"); - text.add("share it in the main"); - text.add("thread " + link + "."); - text.add(" This mod was made by"); - text.add("DarkKnight (or sor1n"); - text.add("depending from where"); - text.add("you got this)"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - default:; - } - } - - public int getMaxPages() - { - return 13; - } - - public void mouseClick(GuiGuide gui, int x, int y, int button) - { - if(gui.page == 13 && x >= gui.getLeft() + 138 && x <= gui.getLeft() + 168 && y >= gui.getTop() + 98 && y <= gui.getTop() + 108) - { - try - { - Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/topic/2210959-164smp-ssp-jewelrycraft-version-12/").toURI()); - } - catch (Exception e) {} - } - } - - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - { - } - -} diff --git a/common/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java b/common/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java deleted file mode 100644 index 6a64046..0000000 --- a/common/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java +++ /dev/null @@ -1,86 +0,0 @@ -package darkknight.jewelrycraft.container; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.client.GuiGuide; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -public class GuiTabJewelsAndModifiers extends GuiTab -{ - public GuiTabJewelsAndModifiers(int id) - { - super("Jewels and modifiers", id); - } - - public ItemStack getIcon() - { - return new ItemStack(Item.emerald); - } - - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - int xPos = (page%2==0)?107:-35; - switch(page) - { - case 1: - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Jewels", gui.getLeft() + xPos + 40, gui.getTop(), 0); - for(int i = 0; i <= 8; i++){ - gui.renderItem(JewelrycraftUtil.jewel.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); - gui.getFont().drawString(JewelrycraftUtil.jewel.get(i).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); - } - break; - case 2: - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Jewels", gui.getLeft() + xPos + 40, gui.getTop(), 0); - for(int i = 0; i <= 8; i++){ - gui.renderItem(JewelrycraftUtil.jewel.get(i+9), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); - gui.getFont().drawString(JewelrycraftUtil.jewel.get(i+9).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); - } - break; - case 3: - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Jewels", gui.getLeft() + xPos + 40, gui.getTop(), 0); - for(int i = 0; i <= 8; i++) - if(i+18 < JewelrycraftUtil.jewel.size()){ - gui.renderItem(JewelrycraftUtil.jewel.get(i+18), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); - gui.getFont().drawString(JewelrycraftUtil.jewel.get(i+18).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); - GL11.glDisable(GL11.GL_LIGHTING); - } - break; - case 4: - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Modifiers", gui.getLeft() + xPos + 40, gui.getTop(), 0); - for(int i = 0; i <= 8; i++){ - if(i < JewelrycraftUtil.modifiers.size()) - { - gui.renderItem(JewelrycraftUtil.modifiers.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); - gui.getFont().drawString(JewelrycraftUtil.modifiers.get(i).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); - } - } - break; - case 5: - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Modifiers", gui.getLeft() + xPos + 40, gui.getTop(), 0); - for(int i = 0; i <= 8; i++){ - if(i+9 < JewelrycraftUtil.modifiers.size()){ - gui.renderItem(JewelrycraftUtil.modifiers.get(i + 9), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); - gui.getFont().drawString(JewelrycraftUtil.modifiers.get(i + 9).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); - GL11.glDisable(GL11.GL_LIGHTING); - } - } - break; - default:; - } - } - - public int getMaxPages() - { - return 5; - } - - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - { - } - -} diff --git a/common/darkknight/jewelrycraft/container/GuiTabNecklaces.java b/common/darkknight/jewelrycraft/container/GuiTabNecklaces.java deleted file mode 100644 index 1d1e233..0000000 --- a/common/darkknight/jewelrycraft/container/GuiTabNecklaces.java +++ /dev/null @@ -1,379 +0,0 @@ -package darkknight.jewelrycraft.container; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.client.GuiGuide; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -public class GuiTabNecklaces extends GuiTab -{ - int jValues; - public GuiTabNecklaces(int id) - { - super("Necklaces", id); - jValues = 0; - } - - public ItemStack getIcon() - { - ItemStack it = new ItemStack(ItemList.necklace); - JewelryNBT.addMetal(it, new ItemStack(Item.ingotIron)); - JewelryNBT.addJewel(it, new ItemStack(Block.blockRedstone)); - return it; - } - - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - ArrayList<String> text = new ArrayList<String>(); - ArrayList<ItemStack> jewels = new ArrayList<ItemStack>(); - ItemStack item = new ItemStack(ItemList.necklace); - int xPos = (page%2==0)?107:-35; - switch(page) - { - case 1: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "None"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring teleports"); - text.add("you and anyone around "); - text.add("in any location from the"); - text.add("same dimension. Just"); - text.add("right click once in a"); - text.add("location to se the "); - text.add("position. Then right "); - text.add("click any time you want"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 2: - text.add("to teleport there."); - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" This teleports anyone"); - text.add("or anything that steps"); - text.add("or goes near the altar"); - text.add("to the necklaces"); - text.add("coordonates, as long"); - text.add("as that is in the same"); - text.add("dimension."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 3: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); - JewelryNBT.addModifier(item, new ItemStack(Item.bed)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bed"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" Just like the other"); - text.add("necklace this teleports"); - text.add("you and anybody close"); - text.add("to you to the set"); - text.add("destination. The only"); - text.add("difference is that you"); - text.add("can travel between"); - text.add("dimensions with this."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 4: - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" This teleports anyone"); - text.add("or anything that step"); - text.add("on or around the altar"); - text.add("to the set location, with"); - text.add("the benefit of it being"); - text.add("capable of"); - text.add("inter-dimensional"); - text.add("travels."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 5: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.blazePowder)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Blaze Powder"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Fire Resistance"); - text.add("when activated and in"); - text.add("your inventory. To"); - text.add("deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 6: - text.add("Depending on the jewel"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Fire"); - text.add(EnumChatFormatting.DARK_RED + "Resistance" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any jewel,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 7: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.sugar)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Sugar"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To"); - text.add("deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 8: - text.add("Depending on the jewel"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " I"); - text.add("if you haven't got any"); - text.add("jewel, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 9: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeIron)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Iron Pickaxe"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To"); - text.add("deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 10: - text.add("Depending on the jewel"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " I"); - text.add("if you haven't got any"); - text.add("jewel, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 11: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.feather)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Feather"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To"); - text.add("deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 12: - text.add("Depending on the jewel"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Jump Boost"); - text.add("I if you haven't got any"); - text.add("jewel, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 13: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.potion, 1, 8270)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "8min Potion of"); - text.add("Invisibility"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To"); - text.add("deactivate it simply"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 14: - text.add("right click with it."); - text.add("Depending on the jewel"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " I"); - text.add("if you haven't got any"); - text.add("jewel, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 15: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0){values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.dyePowder, 1, 15)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bone Meal"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This hydrates the"); - text.add("farm blocks under you"); - text.add("in a defined area. If"); - text.add("you right click with this,"); - text.add("it will help plants in"); - text.add("that area grow faster."); - text.add("The are it affects is"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 16: - text.add("determined by the jewel"); - text.add("used. For none, the"); - text.add("area is a block, diamond"); - text.add("is 3x3, emerald 5x5 and"); - text.add("nether star 11x11."); - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" In the altar, this"); - text.add("has the ability to"); - text.add("hydrate any tilted land"); - text.add("and speed up the"); - text.add("growth of plants in a"); - text.add("7x3x7 area."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 17: - JewelryNBT.addMetal(item, new ItemStack(ItemList.shadowIngot)); - JewelryNBT.addJewel(item, new ItemStack(Item.netherStar)); - JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeDiamond)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Shadow Ingot"); - text.add(" This will break all"); - text.add("blocks in a 3x3x1 area."); - text.add("Just right click on a"); - text.add("block and let the mining"); - text.add("begin."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - default:; - } - } - - public int getMaxPages() - { - return 17; - } - - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - { - } - -} diff --git a/common/darkknight/jewelrycraft/container/GuiTabRings.java b/common/darkknight/jewelrycraft/container/GuiTabRings.java deleted file mode 100644 index 5357531..0000000 --- a/common/darkknight/jewelrycraft/container/GuiTabRings.java +++ /dev/null @@ -1,587 +0,0 @@ -package darkknight.jewelrycraft.container; - -import java.util.ArrayList; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.client.GuiGuide; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -public class GuiTabRings extends GuiTab -{ - int jValues; - public GuiTabRings(int id) - { - super("Rings", id); - jValues = 0; - } - - public ItemStack getIcon() - { - ItemStack it = new ItemStack(ItemList.ring); - JewelryNBT.addMetal(it, new ItemStack(Item.ingotGold)); - JewelryNBT.addJewel(it, new ItemStack(Item.enderPearl)); - return it; - } - - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - ArrayList<String> text = new ArrayList<String>(); - ArrayList<ItemStack> jewels = new ArrayList<ItemStack>(); - ItemStack item = new ItemStack(ItemList.ring); - int xPos = (page%2==0)?107:-35; - switch(page) - { - case 1: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "None"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring allows you"); - text.add("to teleport in any"); - text.add("location from the same"); - text.add("dimension. Simply right"); - text.add("click once in a location"); - text.add("to se the position. Then"); - text.add("right click any time you"); - text.add("want to teleport there."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 2: - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" If this ring is placed"); - text.add("in the altar and if the"); - text.add("ring has coordonates"); - text.add("memorized, then anyone"); - text.add("who steps on the block"); - text.add("will get teleported in"); - text.add("that location, as long"); - text.add("as it is in the same"); - text.add("dimension. This works"); - text.add("for other entities as"); - text.add("well, not just players."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 3: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); - JewelryNBT.addModifier(item, new ItemStack(Item.bed)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bed"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" Just like the other"); - text.add("ring that had only an"); - text.add("ender pearl as a jewel,"); - text.add("by adding a bed as a"); - text.add("modifier to it you can"); - text.add("travel between"); - text.add("dimensions."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 4: - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" Just like the other"); - text.add("one, when in the altar"); - text.add("if somebody steps on"); - text.add("the block they get"); - text.add("teleported in that spot."); - text.add("The only difference is"); - text.add("that you can teleport"); - text.add("between dimesnions with"); - text.add("this. It works for mobs"); - text.add("and other entities as"); - text.add("well."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 5: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.blazePowder)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Blaze Powder"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Fire Resistance" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To deactivate"); - text.add("it simply right click with"); - text.add("it. Depending on the"); - text.add("jewel you used, you"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 6: - text.add("get " + EnumChatFormatting.DARK_RED + "Fire Resistance" + EnumChatFormatting.BLACK + " I"); - text.add("if you haven't got any"); - text.add("jewel, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 7: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.sugar)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Sugar"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " when activated"); - text.add("and in your inventory."); - text.add("To deactivate it simply"); - text.add("right click with it."); - text.add("Depending on the"); - text.add("jewel you used, you"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 8: - text.add("get " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any jewel,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 9: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeIron)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Iron Pickaxe"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " when activated"); - text.add("and in your inventory."); - text.add("To deactivate it simply"); - text.add("right click with it."); - text.add("Depending on the"); - text.add("jewel you used, you"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 10: - text.add("get " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any jewel,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 11: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.feather)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Feather"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory, as well as"); - text.add("remove any fall damage."); - text.add("To deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 12: - text.add("Depending on the jewel"); - text.add("you used, you get"); - text.add(EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any jewel,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 13: - jewels.add(null); - jewels.add(new ItemStack(Item.diamond)); - jewels.add(new ItemStack(Item.emerald)); - jewels.add(new ItemStack(Item.netherStar)); - - if(del == 0) { values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > jewels.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, jewels.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.potion, 1, 8270)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "8min Potion of"); - text.add("Invisibility"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory, as well as"); - text.add("remove any fall damage."); - text.add("To deactivate it simply"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 14: - text.add("right click with it."); - text.add("Depending on the jewel"); - text.add("you used, you get"); - text.add(EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any jewel,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 15: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Item.netherStar)); - JewelryNBT.addModifier(item, new ItemStack(Item.book)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Book"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This has the power"); - text.add("to " + EnumChatFormatting.DARK_PURPLE + "Enchant" + EnumChatFormatting.BLACK + ", " + EnumChatFormatting.DARK_PURPLE + "Disenchant" + EnumChatFormatting.BLACK + ""); - text.add("or even" + EnumChatFormatting.DARK_PURPLE + " Transfer"); - text.add(EnumChatFormatting.DARK_PURPLE + "Enchantments" + EnumChatFormatting.BLACK + ". To"); - text.add("change its mode simply"); - text.add("right click it. However,"); - text.add("this ring only works"); - text.add("when it is being held."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 16: - text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nDisenchanting" + EnumChatFormatting.BLACK + ""); - text.add(" If the ring is held"); - text.add("and an enchanted item"); - text.add("is placed beside it in"); - text.add("the hotbar, the ring"); - text.add("will remove all the"); - text.add("enchantments from the"); - text.add("item and store them in"); - text.add("enchanted books, which"); - text.add("are placed in your"); - text.add("inventory. Be careful"); - text.add("however, because if"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 17: - text.add("there is no room in"); - text.add("your inventory for the"); - text.add("books, the enchantments"); - text.add("will go in the void with"); - text.add("no way of recovering"); - text.add("them. Unfortunately,"); - text.add("disenchanting is not"); - text.add("free. It requires 2"); - text.add("levels of experience"); - text.add("per ench and some of"); - text.add("your blood. It will also"); - text.add("damage the item a bit."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 18: - text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nEnchanting" + EnumChatFormatting.BLACK + ""); - text.add(" This mode allows you"); - text.add("to give a random"); - text.add("enchantment to an item"); - text.add("that can hold"); - text.add("enchantments in the"); - text.add("first place. However,"); - text.add("each enchanting comes"); - text.add("with a cost. The player"); - text.add("is required to have at"); - text.add("least 1 level of xp."); - text.add("The higher the number"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 19: - text.add("the better, as the level"); - text.add("of the enchantment will"); - text.add("be equal with the amount"); - text.add("of levels, but this value"); - text.add("can never go over 6."); - text.add("This gives allows people"); - text.add("to get an enchantment"); - text.add("of a higher value than"); - text.add("normal (5 being the"); - text.add("limit normally)."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 20: - text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nEnchantment Transfer" + EnumChatFormatting.BLACK + ""); - text.add(" This mode is very"); - text.add("special as it lets you"); - text.add("transfer enchantments"); - text.add("from an item or block to"); - text.add("another, not caring if"); - text.add("the item/block can"); - text.add("actually hold enchants."); - text.add("Just place the ench"); - text.add("item on the left of the"); - text.add("ring and to the right of"); - text.add("the ring, the item you"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 21: - text.add("want to transfer the"); - text.add("enchs to. The ring can"); - text.add("only transfer an ench"); - text.add("at a time, after each"); - text.add("transfer it requiring a"); - text.add("cooldown."); - text.add(EnumChatFormatting.DARK_RED + " Again, this ring only"); - text.add(EnumChatFormatting.DARK_RED + "works when it is in the"); - text.add(EnumChatFormatting.DARK_RED + "players hotbar and"); - text.add(EnumChatFormatting.DARK_RED + "being held!"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 22: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); - JewelryNBT.addModifier(item, new ItemStack(Block.chest)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Chest"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring can link"); - text.add("to any chest and"); - text.add("access its inventory."); - text.add("To link to a chest just"); - text.add("crouch and right click"); - text.add("on the one you want."); - text.add("Then right click again"); - text.add("to open that inventory."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 23: - text.add("This only works if you"); - text.add("are in range to the"); - text.add("chest. You can go"); - text.add("about 128 blocks"); - text.add("before it stops"); - text.add("working. After that"); - text.add("a message will be"); - text.add("displayed saying the"); - text.add("amount of blocks you"); - text.add("need to be closer in"); - text.add("order for it to work"); - text.add("again."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 24: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Block.obsidian)); - JewelryNBT.addModifier(item, new ItemStack(Item.eyeOfEnder)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Obsidian"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Eye of Ender"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring is connected"); - text.add("to your ender chest."); - text.add("Just right click it"); - text.add("anywhere to open the"); - text.add("ender chest gui."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 25: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Item.netherStar)); - JewelryNBT.addModifier(item, new ItemStack(Block.chest)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Chest"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring can store"); - text.add("any entity in it. To do"); - text.add("that right click an"); - text.add("to store it in the ring"); - text.add("(crouch and right click"); - text.add("if right clicking the"); - text.add("entity opens a GUI,"); - text.add("such as villagers)."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 26: - text.add("Right click again on the"); - text.add("ground to release the"); - text.add("entity in that spot."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 27: - if(del == 0){values++; jValues++;} - del++; - if(del >= 300) del = 0; - if(values > JewelrycraftUtil.metal.size() - 1) values = 0; - if(jValues > JewelrycraftUtil.jewel.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); - JewelryNBT.addJewel(item, JewelrycraftUtil.jewel.get(jValues)); - JewelryNBT.addModifier(item, new ItemStack(Item.dyePowder, 1, 15)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Any"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bone Meal"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" While having it in"); - text.add("the inventory it will"); - text.add("hydrate any farmland"); - text.add("you step on. If you"); - text.add("right click with this"); - text.add("on a plant, it will"); - text.add("speed up the growth a"); - text.add("bit. Better keep right"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 28: - text.add("clicking if you want to"); - text.add("see an actual effect."); - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" In the altar, the ring"); - text.add("has the ability to"); - text.add("hydrate any tilted land"); - text.add("and speed up the"); - text.add("growth of plants in a"); - text.add("3x3x3 area."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 29: - 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)); - JewelryNBT.addJewel(item, new ItemStack(Item.enderPearl)); - JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeDiamond)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" You can right click"); - text.add("any block (or crouch"); - text.add("right click) to store"); - text.add("that block inside it."); - text.add("Right click on the"); - text.add("ground to place it"); - text.add("there. It can also"); - text.add("create golems/withers."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 30: - JewelryNBT.addMetal(item, new ItemStack(ItemList.shadowIngot)); - JewelryNBT.addJewel(item, new ItemStack(Item.netherStar)); - JewelryNBT.addModifier(item, new ItemStack(Item.pickaxeDiamond)); - - text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + EnumChatFormatting.BLACK + "Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Shadow Ingot"); - text.add(" Right clicking with"); - text.add("this on any block will"); - text.add("cause that block to"); - text.add("break instantly."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - default:; - } - } - - public int getMaxPages() - { - return 30; - } - - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - { - } - -} diff --git a/common/darkknight/jewelrycraft/container/Page.java b/common/darkknight/jewelrycraft/container/Page.java deleted file mode 100644 index da12663..0000000 --- a/common/darkknight/jewelrycraft/container/Page.java +++ /dev/null @@ -1,172 +0,0 @@ -package darkknight.jewelrycraft.container; - -import java.util.ArrayList; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; -import darkknight.jewelrycraft.client.GuiGuide; - -public class Page -{ - public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, ArrayList<String> text, ArrayList<ItemStack> items, int mouseX, int mouseY) - { - y+=5; - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items.get(0).getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items.get(0).getDisplayName())/2) - 10, y - 2, 0); - GL11.glColor4f(1, 1, 1, 1); - Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png")); - ArrayList<String> name = new ArrayList<String>(); - if(isSmall){ - gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); - gui.renderItem(items.get(0), x + 89, y + 22 + 10, 30f); -// gui.drawRect(x, y + 10, x + 111, y + 46, 325325); - if(items.size() > 1 && items.get(1) != null){ - gui.renderItem(items.get(1), x + 8, y + 16 + 10, 30f); - if(x - gui.getLeft() >= x + 8) gui.drawHoverString(text, x, y); - name.add(items.get(1).getDisplayName()); - if(mouseX >= x && mouseX <= x + 16 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x - 8, y + 10); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 2 && items.get(2) != null){ - gui.renderItem(items.get(2), x + 30, y + 16 + 10, 30f); - name.add(items.get(2).getDisplayName()); - if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x + 15, y + 10); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 3 && items.get(3) != null){ - gui.renderItem(items.get(3), x + 8, y + 40 + 10, 30f); - name.add(items.get(3).getDisplayName()); - if(mouseX >= x && mouseX <= x + 16 && mouseY >= y + 36 && mouseY <= y + 36 + 16) gui.drawHoverString(name, x - 8, y + 35); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 4 && items.get(4) != null){ - gui.renderItem(items.get(4), x + 30, y + 40 + 10, 30f); - name.add(items.get(4).getDisplayName()); - if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 36 && mouseY <= y + 36 + 16) gui.drawHoverString(name, x + 15, y + 35); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x, y + 55 + i*12, 0); - } - else{ - gui.drawTexturedModalRect(x, y + 10, 145, 0, 111, 54); - gui.renderItem(items.get(0), x + 91, y + 28 + 10, 30f); - if(items.size() > 1 && items.get(1) != null){ - gui.renderItem(items.get(1), x + 8, y + 20, 30f); - name.add(items.get(1).getDisplayName()); - if(mouseX >= x && mouseX <= x + 16 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x + 8, y + 10); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 2 && items.get(2) != null){ - gui.renderItem(items.get(2), x + 28, y + 20, 30f); - name.add(items.get(2).getDisplayName()); - if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x + 28, y + 10); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 3 && items.get(3) != null){ - gui.renderItem(items.get(3), x + 45, y + 20, 30f); - name.add(items.get(3).getDisplayName()); - if(mouseX >= x + 40 && mouseX <= x + 16 + 40 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x + 45, y + 10); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 4 && items.get(4) != null){ - gui.renderItem(items.get(4), x + 8, y + 37, 30f); - name.add(items.get(4).getDisplayName()); - if(mouseX >= x && mouseX <= x + 16 && mouseY >= y + 27 && mouseY <= y + 27 + 16) gui.drawHoverString(name, x + 8, y + 27); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 5 && items.get(5) != null){ - gui.renderItem(items.get(5), x + 28, y + 37, 30f); - name.add(items.get(5).getDisplayName()); - if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 27 && mouseY <= y + 27 + 16) gui.drawHoverString(name, x + 28, y + 27); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 6 && items.get(6) != null){ - gui.renderItem(items.get(6), x + 45, y + 37, 30f); - name.add(items.get(6).getDisplayName()); - if(mouseX >= x + 40 && mouseX <= x + 16 + 40 && mouseY >= y + 27 && mouseY <= y + 27 + 16) gui.drawHoverString(name, x + 45, y + 27); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 7 && items.get(7) != null){ - gui.renderItem(items.get(7), x + 8, y + 57, 30f); - name.add(items.get(7).getDisplayName()); - if(mouseX >= x && mouseX <= x + 16 && mouseY >= y + 47 && mouseY <= y + 47 + 16) gui.drawHoverString(name, x + 8, y + 47); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 8 && items.get(8) != null){ - gui.renderItem(items.get(8), x + 28, y + 57, 30f); - name.add(items.get(8).getDisplayName()); - if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 47 && mouseY <= y + 47 + 16) gui.drawHoverString(name, x + 28, y + 47); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - if(items.size() > 9 && items.get(9) != null){ - gui.renderItem(items.get(9), x + 45, y + 57, 30f); - name.add(items.get(9).getDisplayName()); - if(mouseX >= x + 40 && mouseX <= x + 16 + 40 && mouseY >= y + 47 && mouseY <= y + 47 + 16) gui.drawHoverString(name, x + 45, y + 47); - name.removeAll(name); - GL11.glDisable(GL11.GL_LIGHTING); - } - for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x, y + 62 + i*12, 0); - GL11.glColor4f(1, 1, 1, 1); - } - } - - public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, ArrayList<String> text, ArrayList<ItemStack> items, int mouseX, int mouseY) - { - ArrayList<String> name = new ArrayList<String>(); - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items.get(1).getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items.get(0).getDisplayName())/2), y + 2, 0); - GL11.glColor4f(1, 1, 1, 1); - Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip" + ".png")); - gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 46); - - gui.renderItem(items.get(0), x + 13, y + 20 + 10, 50f); - name.add(items.get(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.get(1), x + 77, y + 28 + 10, 50f); - - for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x, y + 60 + i*12, 0); - GL11.glColor4f(1, 1, 1, 1); - } - - public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, ArrayList<String> text, float size) - { - y+=5; - 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, y + 18, size); - for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x, y + 30 + i*12, 0); - } - - public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, ArrayList<String> text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY) - { - y+=5; - 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); - for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x + txtX, y + 30 + txtY + i*12, 0); - } - - public static void addTextPage(GuiGuide gui, int x, int y, ArrayList<String> text) - { - y-=25; - for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x, y + 30 + i*12, 0); - GL11.glColor4f(1, 1, 1, 1); - } -} diff --git a/common/darkknight/jewelrycraft/container/SlotRingChest.java b/common/darkknight/jewelrycraft/container/SlotRingChest.java deleted file mode 100644 index 576dee7..0000000 --- a/common/darkknight/jewelrycraft/container/SlotRingChest.java +++ /dev/null @@ -1,39 +0,0 @@ -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; - - public SlotRingChest(IInventory tile, int slotID, int x, int y, boolean locked) - { - super(tile, slotID, x, y); - this.locked = locked; - } - - @Override - public boolean isItemValid(ItemStack stack) - { - return !locked; - } - - @Override - public ItemStack decrStackSize(int amount) - { - if (!locked) - { - return super.decrStackSize(amount); - } - return null; - } - - @Override - public boolean canTakeStack(EntityPlayer player) - { - return !locked; - } -} diff --git a/common/darkknight/jewelrycraft/events/EntityEventHandler.java b/common/darkknight/jewelrycraft/events/EntityEventHandler.java deleted file mode 100644 index a3af5f9..0000000 --- a/common/darkknight/jewelrycraft/events/EntityEventHandler.java +++ /dev/null @@ -1,48 +0,0 @@ -package darkknight.jewelrycraft.events; - -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.event.ForgeSubscribe; -import net.minecraftforge.event.entity.EntityJoinWorldEvent; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.BlockUtils; -import darkknight.jewelrycraft.util.PlayerUtils; - -/** - * Code taken from OpenBlocks - */ -public class EntityEventHandler -{ - - public static final String OPENBLOCKS_PERSIST_TAG = "Jewelrycraft"; - public static final String GIVEN_GUIDE_TAG = "givenGuive"; - - @ForgeSubscribe - public void onEntityJoinWorld(EntityJoinWorldEvent event) - { - - final Entity entity = event.entity; - /** - * If the player hasn't been given a manual, we'll give him one! (or - * throw it on the floor..) - */ - if (!event.world.isRemote && entity instanceof EntityPlayer) - { - EntityPlayer player = (EntityPlayer)entity; - NBTTagCompound persistTag = PlayerUtils.getModPlayerPersistTag(player, "Jewelrycraft"); - - boolean shouldGiveManual = ItemList.guide != null && !persistTag.getBoolean(GIVEN_GUIDE_TAG); - 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(GIVEN_GUIDE_TAG, true); - } - } - } -}
\ No newline at end of file diff --git a/common/darkknight/jewelrycraft/item/ItemClayMolds.java b/common/darkknight/jewelrycraft/item/ItemClayMolds.java deleted file mode 100644 index 05a684c..0000000 --- a/common/darkknight/jewelrycraft/item/ItemClayMolds.java +++ /dev/null @@ -1,72 +0,0 @@ -package darkknight.jewelrycraft.item; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; - -public class ItemClayMolds extends Item -{ - /** List of molds color names */ - public static final String[] moldsItemNames = new String[] { "clayIngot", "clayRing", "clayNecklace" }; - @SideOnly(Side.CLIENT) - private Icon[] moldsIcons; - - public ItemClayMolds(int par1) - { - super(par1); - this.setHasSubtypes(true); - this.setMaxDamage(0); - this.setMaxStackSize(1); - } - - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value - */ - public Icon getIconFromDamage(int par1) - { - int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1); - return this.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. - */ - public String getUnlocalizedName(ItemStack par1ItemStack) - { - int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, moldsItemNames.length - 1); - return super.getUnlocalizedName() + "." + moldsItemNames[i]; - } - - @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(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (int j = 0; j < moldsItemNames.length; ++j) - { - par3List.add(new ItemStack(par1, 1, j)); - } - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - this.moldsIcons = new Icon[moldsItemNames.length]; - - for (int i = 0; i < moldsItemNames.length; ++i) - { - this.moldsIcons[i] = par1IconRegister.registerIcon("jewelrycraft:" + moldsItemNames[i] + this.getIconString()); - } - } -} diff --git a/common/darkknight/jewelrycraft/item/ItemCrystal.java b/common/darkknight/jewelrycraft/item/ItemCrystal.java deleted file mode 100644 index 325c2ce..0000000 --- a/common/darkknight/jewelrycraft/item/ItemCrystal.java +++ /dev/null @@ -1,59 +0,0 @@ -package darkknight.jewelrycraft.item; - -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; - -public class ItemCrystal extends Item -{ - public Icon 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(int par1) - { - super(par1); - this.setHasSubtypes(true); - this.setMaxDamage(0); - } - - public void registerIcons(IconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("jewelrycraft:crystal"); - overlay = iconRegister.registerIcon("jewelrycraft:crystalOverlay"); - } - - @Override - public boolean requiresMultipleRenderPasses() - { - return true; - } - - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - if(pass == 1 && this.getDamage(stack) != 16) return dyeColors[this.getDamage(stack)]; - return 16777215; - } - - public Icon getIcon(ItemStack stack, int pass) - { - return pass == 0 ? itemIcon : overlay; - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (int j = 0; j < 16; ++j) - { - par3List.add(new ItemStack(par1, 1, j)); - } - } - -} diff --git a/common/darkknight/jewelrycraft/item/ItemGuide.java b/common/darkknight/jewelrycraft/item/ItemGuide.java deleted file mode 100644 index 383ef7b..0000000 --- a/common/darkknight/jewelrycraft/item/ItemGuide.java +++ /dev/null @@ -1,27 +0,0 @@ -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(int id) - { - super(id); - } - - @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/common/darkknight/jewelrycraft/item/ItemList.java b/common/darkknight/jewelrycraft/item/ItemList.java deleted file mode 100644 index 8178763..0000000 --- a/common/darkknight/jewelrycraft/item/ItemList.java +++ /dev/null @@ -1,47 +0,0 @@ -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; -import darkknight.jewelrycraft.config.ConfigHandler; - -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 Item guide; - - private static boolean isInitialized = false; - - public static void preInit(FMLPreInitializationEvent e) - { - if (!isInitialized) - { - thiefGloves = new ItemThiefGloves(ConfigHandler.idThiefGloves - 256).setUnlocalizedName("Jewelrycraft.thiefGloves").setTextureName("jewelrycraft:thiefGloves").setCreativeTab(JewelrycraftMod.jewelrycraft); - shadowIngot = new Item(ConfigHandler.idShadowIngot - 256).setUnlocalizedName("Jewelrycraft.ingotShadow").setTextureName("jewelrycraft:ingotShadow").setCreativeTab(JewelrycraftMod.jewelrycraft); - molds = new ItemMolds(ConfigHandler.idMolds - 256).setUnlocalizedName("Jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); - clayMolds = new ItemClayMolds(ConfigHandler.idClayMolds - 256).setUnlocalizedName("Jewelrycraft.mold").setTextureName("Mold").setCreativeTab(JewelrycraftMod.jewelrycraft); - ring = (ItemRing) new ItemRing(ConfigHandler.idRing - 256).setUnlocalizedName("Jewelrycraft.ring").setTextureName("jewelrycraft:ring"); - crystal = new ItemCrystal(ConfigHandler.idCrystal - 256).setUnlocalizedName("Jewelrycraft.crystal").setTextureName("jewelrycraft:crystal").setCreativeTab(JewelrycraftMod.jewelrycraft); - necklace = (ItemNecklace) new ItemNecklace(ConfigHandler.idNecklace - 256).setUnlocalizedName("Jewelrycraft.necklace").setTextureName("jewelrycraft:necklace"); - guide = new ItemGuide(ConfigHandler.idGuide - 256).setUnlocalizedName("Jewelrycraft.guide").setTextureName("jewelrycraft:guide").setCreativeTab(JewelrycraftMod.jewelrycraft); - - 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(crystal, "crystal"); - GameRegistry.registerItem(guide, "guide"); - - isInitialized = true; - } - } -} diff --git a/common/darkknight/jewelrycraft/item/ItemMolds.java b/common/darkknight/jewelrycraft/item/ItemMolds.java deleted file mode 100644 index a62d193..0000000 --- a/common/darkknight/jewelrycraft/item/ItemMolds.java +++ /dev/null @@ -1,72 +0,0 @@ -package darkknight.jewelrycraft.item; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.util.List; - -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.Icon; -import net.minecraft.util.MathHelper; - -public class ItemMolds extends Item -{ - /** List of molds color names */ - public static final String[] moldsItemNames = new String[] { "ingot", "ring", "necklace" }; - @SideOnly(Side.CLIENT) - private Icon[] moldsIcons; - - public ItemMolds(int par1) - { - super(par1); - this.setHasSubtypes(true); - this.setMaxDamage(0); - this.setMaxStackSize(1); - } - - @SideOnly(Side.CLIENT) - /** - * Gets an icon index based on an item's damage value - */ - public Icon getIconFromDamage(int par1) - { - int j = MathHelper.clamp_int(par1, 0, moldsItemNames.length - 1); - return this.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. - */ - public String getUnlocalizedName(ItemStack par1ItemStack) - { - int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, moldsItemNames.length - 1); - return super.getUnlocalizedName() + "." + moldsItemNames[i]; - } - - @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(int par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (int j = 0; j < moldsItemNames.length; ++j) - { - par3List.add(new ItemStack(par1, 1, j)); - } - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IconRegister par1IconRegister) - { - this.moldsIcons = new Icon[moldsItemNames.length]; - - for (int i = 0; i < moldsItemNames.length; ++i) - { - this.moldsIcons[i] = par1IconRegister.registerIcon("jewelrycraft:" + moldsItemNames[i] + this.getIconString()); - } - } -} diff --git a/common/darkknight/jewelrycraft/item/ItemNecklace.java b/common/darkknight/jewelrycraft/item/ItemNecklace.java deleted file mode 100644 index 1218191..0000000 --- a/common/darkknight/jewelrycraft/item/ItemNecklace.java +++ /dev/null @@ -1,268 +0,0 @@ -package darkknight.jewelrycraft.item; - -import java.io.IOException; -import java.util.List; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.util.JewelryNBT; - -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.*; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.*; -import net.minecraft.potion.*; -import net.minecraft.tileentity.*; -import net.minecraft.util.*; -import net.minecraft.world.World; - -public class ItemNecklace extends Item -{ - public Icon jewel; - private double amplifier; - int index = 0; - - public ItemNecklace(int par1) - { - super(par1); - this.setMaxStackSize(1); - } - - public void registerIcons(IconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("jewelrycraft:necklace"); - jewel = iconRegister.registerIcon("jewelrycraft:jewelNecklace"); - } - - @Override - public boolean requiresMultipleRenderPasses() - { - return true; - } - - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack stack, int pass) - { - try - { - return ItemRing.color(stack, pass); - } - catch (IOException e) - { - e.printStackTrace(); - } - return 16777215; - } - - public Icon getIcon(ItemStack stack, int pass) - { - if(pass == 0) return itemIcon; - if(pass == 1 && JewelryNBT.jewel(stack) != null) return jewel; - return itemIcon; - } - - public String getItemDisplayName(ItemStack stack) - { - if(JewelryNBT.ingot(stack) != null) return JewelryNBT.ingot(stack).getDisplayName().replace("Ingot", " ").trim() + " " + ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); - return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); - } - - @SuppressWarnings({ "rawtypes" }) - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) - { - if (!world.isRemote) - { - List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(player.posX - 1.5D, player.posY, player.posZ - 1.5D, player.posX + 1.5D, player.posY + 2D, player.posZ + 1.5D)); - if (JewelryNBT.playerPosX(stack) != -1 && JewelryNBT.playerPosY(stack) != -1 && JewelryNBT.playerPosZ(stack) != -1) - { - double posX = JewelryNBT.playerPosX(stack), posY = JewelryNBT.playerPosY(stack), posZ = JewelryNBT.playerPosZ(stack); - if (JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl)) && JewelryNBT.isModifierX(stack, new ItemStack(Item.bed)) && JewelryNBT.dimension(stack) != -2 && JewelryNBT.dimName(stack) != null) - { - int dimension = JewelryNBT.dimension(stack); - for (int i = 1; i <= 20; i++) world.spawnParticle("largesmoke", player.posX - 0.5D + Math.random(), player.posY - 1.5D + Math.random(), player.posZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); - if (!JewelryNBT.isDimensionX(stack, player.dimension)) player.travelToDimension(dimension); - for (int i = 0; i < entities.size(); i++) ((EntityLivingBase)entities.get(i)).setPositionAndUpdate(posX, posY, posZ); - for (int i = 1; i <= 300; i++) world.spawnParticle("portal", posX - 0.5D + Math.random(), posY + Math.random(), posZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); - } - else if(JewelryNBT.isDimensionX(stack, player.dimension)) - { - for (int i = 1; i <= 20; i++) world.spawnParticle("largesmoke", player.posX - 0.5D + Math.random(), player.posY - 1.5D + Math.random(), player.posZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); - for (int i = 0; i < entities.size(); i++) ((EntityLivingBase)entities.get(i)).setPositionAndUpdate(posX, posY, posZ); - for (int i = 1; i <= 300; i++) world.spawnParticle("portal", posX - 0.5D + Math.random(), posY + Math.random(), posZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); - } - else player.addChatMessage("You can't teleport to these coordonates! You need to be in the same dimension they were set!"); - } - else if(JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl)) && JewelryNBT.isModifierX(stack, new ItemStack(Item.bed)) && JewelryNBT.dimension(stack) == -2 && JewelryNBT.playerPosX(stack) == -1 && JewelryNBT.playerPosY(stack) == -1 && JewelryNBT.playerPosZ(stack) == -1){ - JewelryNBT.addCoordonatesAndDimension(stack, player.posX, player.posY, player.posZ, world.provider.dimensionId, world.provider.getDimensionName()); - JewelryNBT.addFakeEnchantment(stack); - } - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl)) && !JewelryNBT.hasTag(stack, "modifier") && JewelryNBT.playerPosX(stack) == -1 && JewelryNBT.playerPosY(stack) == -1 && JewelryNBT.playerPosZ(stack) == -1){ - JewelryNBT.addCoordonatesAndDimension(stack, player.posX, player.posY, player.posZ, world.provider.dimensionId, world.provider.getDimensionName()); - JewelryNBT.addFakeEnchantment(stack); - } - - if(JewelryNBT.hasTag(stack, "mode")) - { - String mode = ""; - if(JewelryNBT.isModeX(stack, "Activated")) mode = "Deactivated"; - else if(JewelryNBT.isModeX(stack, "Deactivated")) mode = "Activated"; - if(mode != "") - { - player.addChatMessage("The Necklace has been " + mode); - JewelryNBT.addMode(stack, mode); - } - } - } - return stack; - } - -// @Override -// public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) -// { -// if (!player.worldObj.isRemote && entity instanceof EntityLivingBase && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(stack, new ItemStack(Block.chest)) && JewelryNBT.entity(stack, player) == null){ -// JewelryNBT.addEntity(stack, entity); -// JewelryNBT.addEntityID(stack, entity); -// entity.setDead(); -// JewelryNBT.addFakeEnchantment(stack); -// } -// return true; -// } - - /** - * allows items to add custom lines of information to the mouseover - * description - */ - @Override - @SuppressWarnings( - { "rawtypes", "unchecked" }) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) - { - if (stack.hasTagCompound() && Minecraft.getMinecraft().gameSettings.advancedItemTooltips) - { - ItemStack ingot = JewelryNBT.ingot(stack); - if (ingot != null) list.add("Ingot: " + EnumChatFormatting.YELLOW + ingot.getDisplayName()); - - ItemStack jewel = JewelryNBT.jewel(stack); - if (jewel != null) list.add("Jewel: " + EnumChatFormatting.BLUE + jewel.getDisplayName()); - - ItemStack modifier = JewelryNBT.modifier(stack); - if(modifier != null) list.add("Modifier: " + EnumChatFormatting.DARK_PURPLE + modifier.getDisplayName()); - - double playerPosX = JewelryNBT.playerPosX(stack), playerPosY = JewelryNBT.playerPosY(stack), playerPosZ = JewelryNBT.playerPosZ(stack); - if(playerPosX != -1 && playerPosY != -1 && playerPosZ != -1) list.add(EnumChatFormatting.YELLOW + "X: " + EnumChatFormatting.GRAY + (int) playerPosX + EnumChatFormatting.YELLOW + " Y: " + EnumChatFormatting.GRAY + (int) playerPosY + EnumChatFormatting.YELLOW + " Z: " + EnumChatFormatting.GRAY + (int) playerPosZ); - - int posX = JewelryNBT.blockCoordX(stack), posY = JewelryNBT.blockCoordY(stack), posZ = JewelryNBT.blockCoordZ(stack); - if(posX != -1 && posY != -1 && posZ != -1) list.add(EnumChatFormatting.YELLOW + "X: " + EnumChatFormatting.GRAY + (int) posX + EnumChatFormatting.YELLOW + " Y: " + EnumChatFormatting.GRAY + (int) posY + EnumChatFormatting.YELLOW + " Z: " + EnumChatFormatting.GRAY + (int) posZ); - - String name = JewelryNBT.dimName(stack); - if(name != null) list.add("Dimension: " + EnumChatFormatting.DARK_GREEN + name); - - EntityLivingBase entity = JewelryNBT.entity(stack, player); - if (entity != null) list.add("Entity: " + EnumChatFormatting.GOLD + entity.getEntityName()); - - String modeN = JewelryNBT.modeName(stack); - if(modeN != null) list.add("Mode: " + modeN); - - int block = JewelryNBT.blockID(stack); - if(block != -1) list.add("Block: " + StatCollector.translateToLocalFormatted(Block.blocksList[block].getUnlocalizedName())); - - int blockmeta = JewelryNBT.blockMetadata(stack); - if(blockmeta != -1) list.add("Block Metadata: " + blockmeta); - - TileEntity tile = JewelryNBT.tileEntity(stack); - if(tile != null) list.add(EnumChatFormatting.RED + "Contains a tile entity"); - - int blockX = JewelryNBT.blockCoordX(stack); - if(blockX != -1) list.add("Block Coords X: " + blockX); - - int blockY = JewelryNBT.blockCoordY(stack); - if(blockY != -1) list.add("Block Coords Y: " + blockY); - - int blockZ = JewelryNBT.blockCoordZ(stack); - if(blockZ != -1) list.add("Block Coords Z: " + blockZ); - - // int colorI = JewelryNBT.ingotColor(stack); - // if(colorI != -1) list.add("Ingot Color: " + colorI); - // - // int colorJ = JewelryNBT.jewelColor(stack); - // if(colorJ != -1) list.add("Jewel Color: " + colorJ); - } - } - - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int i, int j, int k, int side, float par8, float par9, float par10) - { - amplifier = 0; - if (JewelryNBT.isJewelX(stack, new ItemStack(Item.diamond))) amplifier = 1D; - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.emerald))) amplifier = 2D; - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar))) amplifier = 5D; - - if (!world.isRemote) - { - onItemRightClick(stack, world, player); - if(JewelryNBT.isModifierX(stack, new ItemStack(Item.dyePowder, 1, 15))) - for(int x = (int) - amplifier; x <= amplifier; x++) - for(int z = (int) - amplifier; z <= amplifier; z++) - world.scheduleBlockUpdate(i + x, j, k + z, world.getBlockId(i + x, j, k + z), 7 - (int)amplifier); - - for(int x = (int) - 1; x <= 1; x++) - for(int z = (int) - 1; z <= 1; z++) - if(JewelryNBT.isModifierX(stack, new ItemStack(Item.pickaxeDiamond)) && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isIngotX(stack, new ItemStack(ItemList.shadowIngot))) - if((side == 0 || side == 1) && j > 0 && world.getBlockId(i + x, j, k + z) != Block.bedrock.blockID) world.destroyBlock(i + x, j, k + z, true); - else if((side == 2 || side == 3) && j + x > 0 && world.getBlockId(i + z, j + x, k) != Block.bedrock.blockID) world.destroyBlock(i + z, j + x, k, true); - else if((side == 4 || side == 5) && j + x > 0 && world.getBlockId(i, j + x, k + z) != Block.bedrock.blockID) world.destroyBlock(i, j + x, k + z, true); - } - return true; - } - - @SuppressWarnings({"rawtypes" }) - @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) - { - amplifier = 0D; - if (!world.isRemote) - { - EntityPlayer entityplayer = (EntityPlayer) entity; - int posX = (int)Math.floor(entityplayer.posX), posY = (int)Math.floor(entityplayer.posY), posZ = (int)Math.floor(entityplayer.posZ); - - if (JewelryNBT.isJewelX(stack, new ItemStack(Item.diamond))) amplifier = 1D; - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.emerald))) amplifier = 2D; - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar))) amplifier = 5D; - - if(JewelryNBT.isModifierX(stack, new ItemStack(Item.dyePowder, 1, 15)) && world.getBlockId(posX, posY - 1, posZ) == Block.tilledField.blockID) - for(int i = (int) - amplifier; i <= amplifier; i++) - for(int j = (int) - amplifier; j <= amplifier; j++) - world.setBlockMetadataWithNotify(posX + i, posY - 1, posZ + j, 1, 7); - - List entities = world.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(entityplayer.posX - amplifier, entityplayer.posY - amplifier, entityplayer.posZ - amplifier, entityplayer.posX + amplifier, entityplayer.posY + 2*amplifier, entityplayer.posZ + amplifier)); - if(JewelryNBT.isModeX(stack, "Activated")) - { - for(int i = 0; i < entities.size(); i++) - { - if (JewelryNBT.isModifierX(stack, new ItemStack(Item.blazePowder))) ((EntityLivingBase) entities.get(i)).addPotionEffect(new PotionEffect(Potion.fireResistance.id, 4, 0, true)); - else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.sugar))) ((EntityLivingBase) entities.get(i)).addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 4, 0, true)); - else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.pickaxeIron)) && !JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl))) ((EntityLivingBase) entities.get(i)).addPotionEffect(new PotionEffect(Potion.digSpeed.id, 4, 0, true)); - else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.feather))) - { - ((EntityLivingBase) entities.get(i)).addPotionEffect(new PotionEffect(Potion.jump.id, 4, 0, true)); - entityplayer.fallDistance = 0; - } - else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.potion, 1, 8270))) ((EntityLivingBase) entities.get(i)).addPotionEffect(new PotionEffect(Potion.invisibility.id, 4, 0, true)); - } - } - } - } - - public ItemStack getModifiedItemStack(ItemStack ingot, ItemStack modifier, ItemStack jewel) - { - ItemStack itemstack = new ItemStack(this); - JewelryNBT.addMetal(itemstack, ingot); - JewelryNBT.addModifier(itemstack, modifier); - JewelryNBT.addJewel(itemstack, jewel); - if(JewelryNBT.isModifierEffectType(itemstack) && !(JewelryNBT.isJewelX(itemstack, new ItemStack(Item.enderPearl)) && JewelryNBT.isModifierX(itemstack, new ItemStack(Item.pickaxeIron)))) JewelryNBT.addMode(itemstack, "Activated"); - if(JewelryNBT.isJewelX(itemstack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(itemstack, new ItemStack(Item.book))) - JewelryNBT.addMode(itemstack, "Disenchant"); - return itemstack; - } -} diff --git a/common/darkknight/jewelrycraft/item/ItemRing.java b/common/darkknight/jewelrycraft/item/ItemRing.java deleted file mode 100644 index b27e8ac..0000000 --- a/common/darkknight/jewelrycraft/item/ItemRing.java +++ /dev/null @@ -1,588 +0,0 @@ -package darkknight.jewelrycraft.item; - -import java.awt.image.BufferedImage; -import java.io.IOException; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Random; - -import javax.imageio.ImageIO; - -import cpw.mods.fml.common.network.FMLNetworkHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import darkknight.jewelrycraft.JewelrycraftMod; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.util.JewelryNBT; - -import net.minecraft.block.Block; -import net.minecraft.block.BlockSkull; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.client.resources.ResourceManager; -import net.minecraft.enchantment.*; -import net.minecraft.entity.*; -import net.minecraft.entity.monster.EntityIronGolem; -import net.minecraft.entity.monster.EntitySnowman; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.InventoryEnderChest; -import net.minecraft.item.*; -import net.minecraft.potion.*; -import net.minecraft.tileentity.*; -import net.minecraft.util.*; -import net.minecraft.world.World; - -public class ItemRing extends Item -{ - public Icon jewel; - private int amplifier, cooldown = 0; - int index = 0; - - public ItemRing(int par1) - { - super(par1); - this.setMaxStackSize(1); - } - - public void registerIcons(IconRegister iconRegister) - { - itemIcon = iconRegister.registerIcon("jewelrycraft:ring"); - jewel = iconRegister.registerIcon("jewelrycraft:jewelRing"); - } - - @Override - 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; - } - - public Icon getIcon(ItemStack stack, int pass) - { - if(pass == 0) return itemIcon; - if(pass == 1 && JewelryNBT.jewel(stack) != null) return jewel; - return itemIcon; - } - - public static int color(ItemStack stack, int pass) throws IOException - { - String domain = "", texture; - ResourceManager rm = Minecraft.getMinecraft().getResourceManager(); - BufferedImage icon; - int x=0, y=0, ok = 0, red, green, blue; - if (pass == 0 && JewelryNBT.ingot(stack) != null && JewelryNBT.ingot(stack).getIconIndex() != null && JewelryNBT.ingotColor(stack) == 16777215) - { - String ingotIconName = JewelryNBT.ingot(stack).getIconIndex().getIconName(); - - if (ingotIconName.substring(0, ingotIconName.indexOf(":") + 1) != "") domain = ingotIconName.substring(0, ingotIconName.indexOf(":") + 1).replace(":", " ").trim(); - else domain = "minecraft"; - - texture = ingotIconName.substring(ingotIconName.lastIndexOf(":") + 1) + ".png"; - ResourceLocation ingot = null; - - if (JewelryNBT.ingot(stack).getUnlocalizedName().contains("item")) ingot = new ResourceLocation(domain, "textures/items/" + texture); - else ingot = new ResourceLocation(domain, "textures/blocks/" + texture); - - icon = ImageIO.read(rm.getResource(ingot).getInputStream()); - while(ok == 0) - { - red = (icon.getRGB(x, y) >> 16) & 0xFF; - green = (icon.getRGB(x, y) >> 8) & 0xFF; - blue = icon.getRGB(x, y) & 0xFF; - if((red <= 80 && green <= 80 && blue <= 80) || (red >= 180 && green >= 180 && blue >= 180)) - { - if(x<icon.getTileWidth()-1) x++; - if(x>=icon.getTileWidth()-1 && y<icon.getTileWidth()-1) - { - x=0; - y++; - } - if(x == icon.getTileWidth()-1 && y==icon.getTileWidth()-1) ok=1; - } - else ok=1; - } - JewelryNBT.addIngotColor(stack, icon.getRGB(x, y)); - } - else if (pass == 1 && JewelryNBT.jewel(stack) != null && JewelryNBT.jewel(stack).getIconIndex() != null && JewelryNBT.jewelColor(stack) == 16777215) - { - x = 0; y = 0; ok=0; - String jewelIconName = JewelryNBT.jewel(stack).getIconIndex().getIconName(); - - if (jewelIconName.substring(0, jewelIconName.indexOf(":") + 1) != "") domain = jewelIconName.substring(0, jewelIconName.indexOf(":") + 1).replace(":", " ").trim(); - else domain = "minecraft"; - - texture = jewelIconName.substring(jewelIconName.lastIndexOf(":") + 1) + ".png"; - ResourceLocation jewelLoc = null; - - if (JewelryNBT.jewel(stack).getUnlocalizedName().contains("item")) jewelLoc = new ResourceLocation(domain, "textures/items/" + texture); - else jewelLoc = new ResourceLocation(domain, "textures/blocks/" + texture); - - icon = ImageIO.read(rm.getResource(jewelLoc).getInputStream()); - while(ok == 0) - { - red = (icon.getRGB(x, y) >> 16) & 0xFF; - green = (icon.getRGB(x, y) >> 8) & 0xFF; - blue = icon.getRGB(x, y) & 0xFF; - if((red <= 95 && green <= 95 && blue <= 95) || (red >= 180 && green >= 180 && blue >= 180)) - { - if(x<icon.getTileWidth()-1) x++; - if(x>=icon.getTileWidth()-1 && y<icon.getTileWidth()-1) - { - x=0; - y++; - } - if(x == icon.getTileWidth()-1 && y==icon.getTileWidth()-1) ok=1; - } - else ok=1; - } - if(JewelryNBT.jewel(stack).getItem().getColorFromItemStack(JewelryNBT.jewel(stack), 1) == 16777215) JewelryNBT.addJewelColor(stack, icon.getRGB(x, y)); - else JewelryNBT.addJewelColor(stack, JewelryNBT.jewel(stack).getItem().getColorFromItemStack(JewelryNBT.jewel(stack), 1)); - } - if(pass == 0 && JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack); - if(pass == 1 && JewelryNBT.jewel(stack) != null) return JewelryNBT.jewelColor(stack); - else if(JewelryNBT.ingot(stack) != null) return JewelryNBT.ingotColor(stack); - return 16777215; - } - - public String getItemDisplayName(ItemStack stack) - { - if (JewelryNBT.ingot(stack) != null && JewelryNBT.jewel(stack) != null && JewelryNBT.modifier(stack) == null && JewelryNBT.isJewelX(stack, new ItemStack(Item.diamond)) && JewelryNBT.isIngotX(stack, new ItemStack(Item.ingotGold))) return "Wedding Ring"; - else if(JewelryNBT.ingot(stack) != null) return JewelryNBT.ingot(stack).getDisplayName().replace("Ingot", " ").trim() + " " + ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); - return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim(); - } - - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) - { - if (!world.isRemote){ - if (JewelryNBT.playerPosX(stack) != -1 && JewelryNBT.playerPosY(stack) != -1 && JewelryNBT.playerPosZ(stack) != -1) - { - double posX = JewelryNBT.playerPosX(stack), posY = JewelryNBT.playerPosY(stack), posZ = JewelryNBT.playerPosZ(stack); - if (JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl)) && JewelryNBT.isModifierX(stack, new ItemStack(Item.bed)) && JewelryNBT.dimension(stack) != -2 && JewelryNBT.dimName(stack) != null) - { - int dimension = JewelryNBT.dimension(stack); - for (int i = 1; i <= 20; i++) world.spawnParticle("largesmoke", player.posX - 0.5D + Math.random(), player.posY - 1.5D + Math.random(), player.posZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); - if (!JewelryNBT.isDimensionX(stack, player.dimension)) player.travelToDimension(dimension); - player.setPositionAndUpdate(posX, posY, posZ); - for (int i = 1; i <= 300; i++) world.spawnParticle("portal", posX - 0.5D + Math.random(), posY + Math.random(), posZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); - } - else if(JewelryNBT.isDimensionX(stack, player.dimension)) - { - for (int i = 1; i <= 20; i++) world.spawnParticle("largesmoke", player.posX - 0.5D + Math.random(), player.posY - 1.5D + Math.random(), player.posZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); - player.setPositionAndUpdate(posX, posY, posZ); - for (int i = 1; i <= 300; i++) world.spawnParticle("portal", posX - 0.5D + Math.random(), posY + Math.random(), posZ - 0.5D + Math.random(), 0.0D, 0.0D, 0.0D); - } - else player.addChatMessage("You can't teleport to these coordonates! You need to be in the same dimension they were set!"); - } - else if(JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl)) && JewelryNBT.isModifierX(stack, new ItemStack(Item.bed)) && JewelryNBT.dimension(stack) == -2 && JewelryNBT.playerPosX(stack) == -1 && JewelryNBT.playerPosY(stack) == -1 && JewelryNBT.playerPosZ(stack) == -1){ - JewelryNBT.addCoordonatesAndDimension(stack, player.posX, player.posY, player.posZ, world.provider.dimensionId, world.provider.getDimensionName()); - JewelryNBT.addFakeEnchantment(stack); - } - else if (JewelryNBT.isJewelX(stack, new ItemStack(Block.obsidian)) && JewelryNBT.isModifierX(stack, new ItemStack(Item.eyeOfEnder))) - { - InventoryEnderChest inventoryenderchest = player.getInventoryEnderChest(); - player.displayGUIChest(inventoryenderchest); - } - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl)) && JewelryNBT.isModifierX(stack, new ItemStack(Block.chest))){ - int i = JewelryNBT.blockCoordX(stack), j = JewelryNBT.blockCoordY(stack), k = JewelryNBT.blockCoordZ(stack); - if (player.getDistance(i + 0.5F, j + 0.5F, k + 0.5F) <= 128 && i != -1 && j != -1 && k != -1){ - int id = world.getBlockId(i, j, k); - if (id != 0 && Block.blocksList[id] != null && Block.blocksList[id].blockID == Block.chest.blockID){ - TileEntity tile = world.getBlockTileEntity(i, j, k); - if (tile != null && tile instanceof TileEntityChest) FMLNetworkHandler.openGui(player, JewelrycraftMod.instance, 0, world, i, j, k); - } - } - else if(i != -1 && j != -1 && k != -1) player.addChatMessage("Chest out of range! You need to be " + ((int)player.getDistance(i + 0.5F, j + 0.5F, k + 0.5F) - 127) + " blocks closer."); - else player.addChatMessage("You need to link the ring with a chest first, before using it!"); - } - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl)) && !JewelryNBT.hasTag(stack, "modifier") && JewelryNBT.playerPosX(stack) == -1 && JewelryNBT.playerPosY(stack) == -1 && JewelryNBT.playerPosZ(stack) == -1){ - JewelryNBT.addCoordonatesAndDimension(stack, player.posX, player.posY, player.posZ, world.provider.dimensionId, world.provider.getDimensionName()); - JewelryNBT.addFakeEnchantment(stack); - } - - if(JewelryNBT.hasTag(stack, "mode")) - { - String mode = ""; - if(JewelryNBT.isModeX(stack, "Disenchant")) mode = "Transfer"; - else if(JewelryNBT.isModeX(stack, "Transfer")) mode = "Enchant"; - else if(JewelryNBT.isModeX(stack, "Enchant")) mode = "Disenchant"; - if(mode != "") - { - player.addChatMessage("Switched to " + mode + " mode"); - JewelryNBT.addMode(stack, mode); - } - if(JewelryNBT.isModeX(stack, "Activated")) mode = "Deactivated"; - else if(JewelryNBT.isModeX(stack, "Deactivated")) mode = "Activated"; - if(mode != "") - { - player.addChatMessage("The Ring has been " + mode); - JewelryNBT.addMode(stack, mode); - } - } - } - return stack; - } - - @Override - public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) - { - if (!player.worldObj.isRemote && entity instanceof EntityLivingBase && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(stack, new ItemStack(Block.chest)) && JewelryNBT.entity(stack, player) == null){ - JewelryNBT.addEntity(stack, entity); - JewelryNBT.addEntityID(stack, entity); - entity.setDead(); - JewelryNBT.addFakeEnchantment(stack); - } - return true; - } - - /** - * allows items to add custom lines of information to the mouseover - * description - */ - @Override - @SuppressWarnings( - { "rawtypes", "unchecked" }) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) - { - if (stack.hasTagCompound() && stack.getDisplayName() != "Wedding Ring" && Minecraft.getMinecraft().gameSettings.advancedItemTooltips) - { - ItemStack ingot = JewelryNBT.ingot(stack); - if (ingot != null) list.add("Ingot: " + EnumChatFormatting.YELLOW + ingot.getDisplayName()); - - ItemStack jewel = JewelryNBT.jewel(stack); - if (jewel != null) list.add("Jewel: " + EnumChatFormatting.BLUE + jewel.getDisplayName()); - - ItemStack modifier = JewelryNBT.modifier(stack); - if(modifier != null) list.add("Modifier: " + EnumChatFormatting.DARK_PURPLE + modifier.getDisplayName()); - - double playerPosX = JewelryNBT.playerPosX(stack), playerPosY = JewelryNBT.playerPosY(stack), playerPosZ = JewelryNBT.playerPosZ(stack); - if(playerPosX != -1 && playerPosY != -1 && playerPosZ != -1) list.add(EnumChatFormatting.YELLOW + "X: " + EnumChatFormatting.GRAY + (int) playerPosX + EnumChatFormatting.YELLOW + " Y: " + EnumChatFormatting.GRAY + (int) playerPosY + EnumChatFormatting.YELLOW + " Z: " + EnumChatFormatting.GRAY + (int) playerPosZ); - - int posX = JewelryNBT.blockCoordX(stack), posY = JewelryNBT.blockCoordY(stack), posZ = JewelryNBT.blockCoordZ(stack); - if(posX != -1 && posY != -1 && posZ != -1) list.add(EnumChatFormatting.YELLOW + "X: " + EnumChatFormatting.GRAY + (int) posX + EnumChatFormatting.YELLOW + " Y: " + EnumChatFormatting.GRAY + (int) posY + EnumChatFormatting.YELLOW + " Z: " + EnumChatFormatting.GRAY + (int) posZ); - - String name = JewelryNBT.dimName(stack); - if(name != null) list.add("Dimension: " + EnumChatFormatting.DARK_GREEN + name); - - EntityLivingBase entity = JewelryNBT.entity(stack, player); - if (entity != null) list.add("Entity: " + EnumChatFormatting.GOLD + entity.getEntityName()); - - String modeN = JewelryNBT.modeName(stack); - if(modeN != null) list.add("Mode: " + modeN); - - int block = JewelryNBT.blockID(stack); - if(block != -1) list.add("Block: " + StatCollector.translateToLocalFormatted(Block.blocksList[block].getUnlocalizedName())); - - int blockmeta = JewelryNBT.blockMetadata(stack); - if(blockmeta != -1) list.add("Block Metadata: " + blockmeta); - - TileEntity tile = JewelryNBT.tileEntity(stack); - if(tile != null) list.add(EnumChatFormatting.RED + "Contains a tile entity"); - - int blockX = JewelryNBT.blockCoordX(stack); - if(blockX != -1) list.add("Block Coords X: " + blockX); - - int blockY = JewelryNBT.blockCoordY(stack); - if(blockY != -1) list.add("Block Coords Y: " + blockY); - - int blockZ = JewelryNBT.blockCoordZ(stack); - if(blockZ != -1) list.add("Block Coords Z: " + blockZ); - - // int colorI = JewelryNBT.ingotColor(stack); - // if(colorI != -1) list.add("Ingot Color: " + colorI); - // - // int colorJ = JewelryNBT.jewelColor(stack); - // if(colorJ != -1) list.add("Jewel Color: " + colorJ); - } - } - - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int i, int j, int k, int side, float par8, float par9, float par10) - { - amplifier = 0; - if (JewelryNBT.isJewelX(stack, new ItemStack(Item.diamond))) amplifier = 1; - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.emerald))) amplifier = 2; - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar))) amplifier = 7; - - if (!world.isRemote) - { - EntityLivingBase entity = JewelryNBT.entity(stack, player); - boolean used = false; - if(entity != null && entity instanceof EntityLivingBase){ - entity.setLocationAndAngles(i + 0.5D, j + 1D, k + 0.5D, MathHelper.wrapAngleTo180_float(world.rand.nextFloat() * 360.0F), 0.0F); - world.spawnEntityInWorld(entity); - JewelryNBT.removeEntity(stack); - } - if (JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl)) && JewelryNBT.isModifierX(stack, new ItemStack(Block.chest)) && world.getBlockId(i, j, k) == Block.chest.blockID) JewelryNBT.addBlockCoordonates(stack, i, j, k); - onItemRightClick(stack, world, player); - if(JewelryNBT.isModifierX(stack, new ItemStack(Item.dyePowder, 1, 15))) world.scheduleBlockUpdate(i, j, k, world.getBlockId(i, j, k), 7 - amplifier); - if(JewelryNBT.isModifierX(stack, new ItemStack(Item.pickaxeDiamond)) && JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl))) - { - if(JewelryNBT.hasTag(stack, "blockID") && !used) - { - int shiftX = 0, shiftY = 0, shiftZ = 0; - if(side == 0) shiftY = -1; - else if(side == 1) shiftY = 1; - else if(side == 2) shiftZ = -1; - else if(side == 3) shiftZ = 1; - else if(side == 4) shiftX = -1; - else if(side == 5) shiftX = 1; - world.setBlock(i + shiftX, j + shiftY, k + shiftZ, JewelryNBT.blockID(stack)); - world.setBlockMetadataWithNotify(i + shiftX, j + shiftY, k + shiftZ, JewelryNBT.blockMetadata(stack), 2); - if(JewelryNBT.hasTag(stack, "tile")) world.setBlockTileEntity(i + shiftX, j + shiftY, k + shiftZ, JewelryNBT.tileEntity(stack)); - if(JewelryNBT.tileEntity(stack) instanceof TileEntitySkull) ((BlockSkull)Block.skull).makeWither(world, i + shiftX, j + shiftY, k + shiftZ, (TileEntitySkull)JewelryNBT.tileEntity(stack)); - if(JewelryNBT.blockID(stack) == Block.pumpkin.blockID || JewelryNBT.blockID(stack) == Block.pumpkinLantern.blockID) createGolems(world, i + shiftX, j + shiftY, k + shiftZ); - JewelryNBT.removeBlock(stack); - used = true; - } - - if(!JewelryNBT.hasTag(stack, "tile") && world.getBlockTileEntity(i, j, k) != null && !used){ - JewelryNBT.addTileEntityBlock(stack, world, i, j, k); - world.removeBlockTileEntity(i, j, k); - world.setBlock(i, j, k, 0); - } - else if(!JewelryNBT.hasTag(stack, "blockID") && !used){ - JewelryNBT.addBlock(stack, world.getBlockId(i, j, k), world.getBlockMetadata(i, j, k)); - JewelryNBT.addBlockCoordonates(stack, i, j, k); - world.setBlock(i, j, k, 0); - } - } - if(JewelryNBT.isModifierX(stack, new ItemStack(Item.pickaxeDiamond)) && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isIngotX(stack, new ItemStack(ItemList.shadowIngot)) && j > 0 && world.getBlockId(i, j, k) != Block.bedrock.blockID) - world.destroyBlock(i, j, k, true); - } - return true; - } - - public boolean canDisenchant(EntityPlayer player) - { - if(player.capabilities.isCreativeMode) return true; - else if(player.experienceLevel >= 2) return true; - return false; - } - - public void dynamicLight(World world, EntityPlayer player) - { - world.setBlock((int)player.prevPosX, (int)player.prevPosY, (int)player.prevPosZ, 0); - world.setBlock((int)player.posX, (int)player.posY, (int)player.posZ, BlockList.glow.blockID); - } - - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) - { - amplifier = 0; - if(cooldown > 0) cooldown--; - if (!world.isRemote){ - EntityPlayer entityplayer = (EntityPlayer) entity; - int posX = (int)Math.floor(entityplayer.posX), posY = (int)Math.floor(entityplayer.posY), posZ = (int)Math.floor(entityplayer.posZ); - - if (JewelryNBT.isJewelX(stack, new ItemStack(Item.diamond))) amplifier = 1; - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.emerald))) amplifier = 2; - else if (JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar))) amplifier = 7; - - if(JewelryNBT.isModifierX(stack, new ItemStack(Item.dyePowder, 1, 15)) && world.getBlockId(posX, posY - 1, posZ) == Block.tilledField.blockID) - world.setBlockMetadataWithNotify(posX, posY - 1, posZ, 1, 7); - - if(JewelryNBT.isModeX(stack, "Activated")) - { - if (JewelryNBT.isModifierX(stack, new ItemStack(Item.blazePowder)) && entityplayer != null) - entityplayer.addPotionEffect(new PotionEffect(Potion.fireResistance.id, 4, amplifier, true)); - else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.sugar)) && entityplayer != null) - { - entityplayer.addPotionEffect(new PotionEffect(Potion.moveSpeed.id, 4, amplifier, true)); - entityplayer.addExhaustion(0.05f*amplifier); - } - else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.pickaxeIron)) && entityplayer != null && !JewelryNBT.isJewelX(stack, new ItemStack(Item.enderPearl))) - entityplayer.addPotionEffect(new PotionEffect(Potion.digSpeed.id, 4, amplifier, true)); - else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.feather)) && entityplayer != null) - { - entityplayer.addPotionEffect(new PotionEffect(Potion.jump.id, 4, amplifier, true)); - if(entityplayer.inventory.armorInventory[0] != null) - { - int damage = entityplayer.inventory.armorInventory[0].getMaxDamage() - entityplayer.inventory.armorInventory[0].getItemDamage(); - if(damage - entityplayer.fallDistance > 0){ - entityplayer.inventory.armorInventory[0].damageItem((int)entityplayer.fallDistance, entityplayer); - entityplayer.fallDistance = 0; - } - else - { - --entityplayer.inventory.armorInventory[0].stackSize; - entityplayer.fallDistance -= damage; - } - } - } - else if (JewelryNBT.isModifierX(stack, new ItemStack(Item.potion, 1, 8270)) && entityplayer != null) entityplayer.addPotionEffect(new PotionEffect(Potion.invisibility.id, 4, amplifier, true)); - } - if(entityplayer.inventory.getCurrentItem() != null && JewelryNBT.isJewelX(stack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(stack, new ItemStack(Item.book)) && entityplayer.inventory.getCurrentItem().equals(stack)) - { - ItemStack item = null; - if(entityplayer.inventory.currentItem + 1 <= 8 && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem + 1) != null && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem + 1).isItemEnchanted()) item = entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem + 1); - if(entityplayer.inventory.currentItem - 1 >= 0 && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem - 1) != null && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem - 1).isItemEnchanted()) item = entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem - 1); - if(item != null && JewelryNBT.isModeX(stack, "Disenchant")) - { - ItemStack enchBook = new ItemStack(Item.enchantedBook); - Map enchItem = EnchantmentHelper.getEnchantments(item); - Map book = EnchantmentHelper.getEnchantments(enchBook); - Iterator iterator = enchItem.keySet().iterator(); - int e; - - if (iterator.hasNext() && canDisenchant(entityplayer)) - { - e = ((Integer)iterator.next()).intValue(); - book.put(Integer.valueOf(e), Integer.valueOf(((Integer)enchItem.get(Integer.valueOf(e))).intValue())); - EnchantmentHelper.setEnchantments(book, enchBook); - if(entityplayer.inventory.addItemStackToInventory(enchBook)) - { - if(!entityplayer.capabilities.isCreativeMode) - { - entityplayer.addExperienceLevel(-2); - entityplayer.heal(-1f); - } - enchItem.remove(Integer.valueOf(e)); - if(item.isItemStackDamageable() && (item.getMaxDamage() - item.getItemDamage())/3 > 0) item.damageItem((item.getMaxDamage() - item.getItemDamage())/3, entityplayer); - EnchantmentHelper.setEnchantments(enchItem, item); - } - } - } - if(entityplayer.inventory.currentItem + 1 <= 8 && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem + 1) != null && entityplayer.inventory.currentItem - 1 >= 0 && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem - 1) != null && JewelryNBT.isModeX(stack, "Transfer")) - { - if(cooldown > 0) entityplayer.addChatMessage("Ring is currently cooling down!"); - ItemStack enchantedItem = null, enchantableItem = null; - if(entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem - 1).isItemEnchanted() && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem + 1) != null) - { - enchantedItem = entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem - 1); - enchantableItem = entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem + 1); - - } - if(enchantedItem != null && enchantableItem != null) - { - Map enchItem = EnchantmentHelper.getEnchantments(enchantedItem); - Map resultItem = EnchantmentHelper.getEnchantments(enchantableItem); - Iterator iterator = enchItem.keySet().iterator(); - int e; - - if (iterator.hasNext() && cooldown == 0) - { - e = ((Integer)iterator.next()).intValue(); - if(!EnchantmentHelper.getEnchantments(enchantableItem).containsKey(Integer.valueOf(e))) - { - resultItem.put(Integer.valueOf(e), Integer.valueOf(((Integer)enchItem.get(Integer.valueOf(e))).intValue())); - EnchantmentHelper.setEnchantments(resultItem, enchantableItem); - enchItem.remove(Integer.valueOf(e)); - EnchantmentHelper.setEnchantments(enchItem, enchantedItem); - cooldown = 50000; - } - } - } - } - if(entityplayer.inventory.currentItem + 1 <= 8 && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem + 1) != null) item = entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem + 1); - else if(entityplayer.inventory.currentItem - 1 >= 0 && entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem - 1) != null) item = entityplayer.inventory.getStackInSlot(entityplayer.inventory.currentItem - 1); - if(item != null && !item.isItemEnchanted() && item.isItemEnchantable() && entityplayer.experienceLevel > 0 && JewelryNBT.isModeX(stack, "Enchant")) - { - Map enchItem = EnchantmentHelper.getEnchantments(item); - int level = entityplayer.experienceLevel; - if(entityplayer.experienceLevel > 6) level = 6; - if(!entityplayer.capabilities.isCreativeMode) entityplayer.addExperienceLevel(-level); - enchItem.put(Enchantment.enchantmentsBookList[new Random().nextInt(Enchantment.enchantmentsBookList.length)].effectId, level); - EnchantmentHelper.setEnchantments(enchItem, item); - } - } - } - } - - public ItemStack getModifiedItemStack(ItemStack ingot, ItemStack modifier, ItemStack jewel) - { - ItemStack itemstack = new ItemStack(this); - JewelryNBT.addMetal(itemstack, ingot); - JewelryNBT.addModifier(itemstack, modifier); - JewelryNBT.addJewel(itemstack, jewel); - if(JewelryNBT.isModifierEffectType(itemstack) && !(JewelryNBT.isJewelX(itemstack, new ItemStack(Item.enderPearl)) && JewelryNBT.isModifierX(itemstack, new ItemStack(Item.pickaxeIron)))) JewelryNBT.addMode(itemstack, "Activated"); - if(JewelryNBT.isJewelX(itemstack, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(itemstack, new ItemStack(Item.book))) - JewelryNBT.addMode(itemstack, "Disenchant"); - return itemstack; - } - - public void createGolems(World world, int i, int j, int k) - { - if (world.getBlockId(i, j - 1, k) == Block.blockSnow.blockID && world.getBlockId(i, j - 2, k) == Block.blockSnow.blockID) - { - if (!world.isRemote) - { - world.setBlock(i, j, k, 0, 0, 2); - world.setBlock(i, j - 1, k, 0, 0, 2); - world.setBlock(i, j - 2, k, 0, 0, 2); - EntitySnowman entitysnowman = new EntitySnowman(world); - entitysnowman.setLocationAndAngles((double)i + 0.5D, (double)j - 1.95D, (double)k + 0.5D, 0.0F, 0.0F); - world.spawnEntityInWorld(entitysnowman); - world.notifyBlockChange(i, j, k, 0); - world.notifyBlockChange(i, j - 1, k, 0); - world.notifyBlockChange(i, j - 2, k, 0); - } - - for (int l = 0; l < 120; ++l) - { - world.spawnParticle("snowshovel", (double)i + world.rand.nextDouble(), (double)(j - 2) + world.rand.nextDouble() * 2.5D, (double)k + world.rand.nextDouble(), 0.0D, 0.0D, 0.0D); - } - } - else if (world.getBlockId(i, j - 1, k) == Block.blockIron.blockID && world.getBlockId(i, j - 2, k) == Block.blockIron.blockID) - { - boolean flag = world.getBlockId(i - 1, j - 1, k) == Block.blockIron.blockID && world.getBlockId(i + 1, j - 1, k) == Block.blockIron.blockID; - boolean flag1 = world.getBlockId(i, j - 1, k - 1) == Block.blockIron.blockID && world.getBlockId(i, j - 1, k + 1) == Block.blockIron.blockID; - - if (flag || flag1) - { - world.setBlock(i, j, k, 0, 0, 2); - world.setBlock(i, j - 1, k, 0, 0, 2); - world.setBlock(i, j - 2, k, 0, 0, 2); - - if (flag) - { - world.setBlock(i - 1, j - 1, k, 0, 0, 2); - world.setBlock(i + 1, j - 1, k, 0, 0, 2); - } - else - { - world.setBlock(i, j - 1, k - 1, 0, 0, 2); - world.setBlock(i, j - 1, k + 1, 0, 0, 2); - } - - EntityIronGolem entityirongolem = new EntityIronGolem(world); - entityirongolem.setPlayerCreated(true); - entityirongolem.setLocationAndAngles((double)i + 0.5D, (double)j - 1.95D, (double)k + 0.5D, 0.0F, 0.0F); - world.spawnEntityInWorld(entityirongolem); - - for (int i1 = 0; i1 < 120; ++i1) - { - world.spawnParticle("snowballpoof", (double)i + world.rand.nextDouble(), (double)(j - 2) + world.rand.nextDouble() * 3.9D, (double)k + world.rand.nextDouble(), 0.0D, 0.0D, 0.0D); - } - - world.notifyBlockChange(i, j, k, 0); - world.notifyBlockChange(i, j - 1, k, 0); - world.notifyBlockChange(i, j - 2, k, 0); - - if (flag) - { - world.notifyBlockChange(i - 1, j - 1, k, 0); - world.notifyBlockChange(i + 1, j - 1, k, 0); - } - else - { - world.notifyBlockChange(i, j - 1, k - 1, 0); - world.notifyBlockChange(i, j - 1, k + 1, 0); - } - } - } - } -} diff --git a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java b/common/darkknight/jewelrycraft/item/ItemThiefGloves.java deleted file mode 100644 index 4535235..0000000 --- a/common/darkknight/jewelrycraft/item/ItemThiefGloves.java +++ /dev/null @@ -1,111 +0,0 @@ -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.item.Item; -import net.minecraft.item.ItemStack; -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; - -public class ItemThiefGloves extends Item -{ - public Random rand; - - public ItemThiefGloves(int par1) - { - super(par1); - this.setCreativeTab(CreativeTabs.tabTools); - this.setMaxStackSize(1); - this.setMaxDamage(10); - } - - @Override - public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) - { - if (par3EntityLivingBase instanceof EntityVillager) - { - EntityVillager villager = (EntityVillager) par3EntityLivingBase; - int wealth = (Integer) ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "wealth", "field_70956_bz"); - MerchantRecipeList buyingList = (MerchantRecipeList) ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "buyingList", "field_70963_i"); - if (buyingList != null) - { - Iterator<?> iterator = buyingList.iterator(); - 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 = 1; - ItemStack s = new ItemStack(recipe.getItemToSell().itemID, quantity, recipe.getItemToSell().getItemDamage()); - s.setTagCompound(recipe.getItemToSell().getTagCompound()); - if (par2EntityPlayer.inventory.addItemStackToInventory(s)) - ; - else - villager.entityDropItem(s, 0); - par2EntityPlayer.addChatMessage("Villager #" + villager.getProfession() + ": Hmmm... I seem to have lost my " + s.getDisplayName() + "!"); - stack.damageItem(1, par2EntityPlayer); - } - buyingList.clear(); - ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 300, "timeUntilReset", "field_70961_j"); - ReflectionHelper.setPrivateValue(EntityVillager.class, villager, true, "needsInitilization", "field_70959_by"); - } - - villager.dropItem(Item.emerald.itemID, wealth); - ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 0, "wealth", "field_70956_bz"); - return true; - } - else - { - return super.itemInteractionForEntity(stack, par2EntityPlayer, par3EntityLivingBase); - } - } - - @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."); - } - } - - public static boolean shouldAddAdditionalInfo() - { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) - { - if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) - { - return true; - } - } - return false; - } - - public static String additionalInfoInstructions() - { - String message = "\247oPress \247b<SHIFT>\2477\247o for more information."; - return message; - } - -} diff --git a/common/darkknight/jewelrycraft/lib/Reference.java b/common/darkknight/jewelrycraft/lib/Reference.java deleted file mode 100644 index a01a77a..0000000 --- a/common/darkknight/jewelrycraft/lib/Reference.java +++ /dev/null @@ -1,9 +0,0 @@ -package darkknight.jewelrycraft.lib; - -public class Reference -{ - public static final String MODID = "Jewelrycraft"; - public static final String MODNAME = "Jewelrycraft"; - public static final String VERSION = "1.3.2"; - public static final String PACKET_CHANNEL = "Jewelrycraft"; -} diff --git a/common/darkknight/jewelrycraft/model/ModelDisplayer.java b/common/darkknight/jewelrycraft/model/ModelDisplayer.java deleted file mode 100644 index 9764ca0..0000000 --- a/common/darkknight/jewelrycraft/model/ModelDisplayer.java +++ /dev/null @@ -1,241 +0,0 @@ -package darkknight.jewelrycraft.model; - -import org.lwjgl.opengl.GL11; - -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.entity.Entity; - -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); - } - - 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(); - } - - 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/common/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java b/common/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java deleted file mode 100644 index 1cc3f72..0000000 --- a/common/darkknight/jewelrycraft/model/ModelJewlersCraftingBench.java +++ /dev/null @@ -1,140 +0,0 @@ -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); - } - - 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); - } - - 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/common/darkknight/jewelrycraft/model/ModelMolder.java b/common/darkknight/jewelrycraft/model/ModelMolder.java deleted file mode 100644 index 374b218..0000000 --- a/common/darkknight/jewelrycraft/model/ModelMolder.java +++ /dev/null @@ -1,76 +0,0 @@ -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); - } - - 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); - } - - 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/common/darkknight/jewelrycraft/model/ModelSmelter.java b/common/darkknight/jewelrycraft/model/ModelSmelter.java deleted file mode 100644 index afb3b09..0000000 --- a/common/darkknight/jewelrycraft/model/ModelSmelter.java +++ /dev/null @@ -1,276 +0,0 @@ -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); - } - - 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); - } - - 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/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java b/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java deleted file mode 100644 index 50eb325..0000000 --- a/common/darkknight/jewelrycraft/recipes/CraftingRecipes.java +++ /dev/null @@ -1,53 +0,0 @@ -package darkknight.jewelrycraft.recipes; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.FurnaceRecipes; -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; - - 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(Block.cloth, 1, 15)); - GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 0), "xx", 'x', Item.clay); - GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 1), " x ", "x x", " x ", 'x', Item.clay); - GameRegistry.addRecipe(new ItemStack(ItemList.clayMolds, 1, 2), "x x", "x x", " x ", 'x', Item.clay); - GameRegistry.addRecipe(new ItemStack(ItemList.crystal, 1, 15), " x ", "x x", " x ", 'x', Block.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(Item.dyePowder, 1, i)}); - GameRegistry.addShapelessRecipe(new ItemStack(ItemList.crystal, 1, 15), new Object[]{new ItemStack(ItemList.crystal, 1, i), new ItemStack(Item.dyePowder, 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(Item.book), new ItemStack(ItemList.molds, 1, 0)}); - GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide), new Object[]{new ItemStack(Item.book), new ItemStack(ItemList.molds, 1, 1)}); - GameRegistry.addShapelessRecipe(new ItemStack(ItemList.guide), new Object[]{new ItemStack(Item.book), new ItemStack(ItemList.molds, 1, 2)}); - - //Blocks - GameRegistry.addRecipe(new ItemStack(BlockList.molder), "x x", "xxx", 'x', Block.cobblestone); - GameRegistry.addRecipe(new ItemStack(BlockList.smelter), "xyx", "x x", "xzx", 'x', Block.cobblestone, 'y', Item.bucketEmpty, 'z', Item.bucketLava); - GameRegistry.addRecipe(new ItemStack(BlockList.jewelCraftingTable), "xxx", "y y", "y y", 'x', Block.planks, 'y', Block.cobblestone); - GameRegistry.addRecipe(new ItemStack(BlockList.displayer, 2), " x ", "xxx", "yyy", 'x', Item.ingotIron, 'y', Block.blockEmerald); - GameRegistry.addRecipe(new ItemStack(BlockList.shadowBlock, 1), "xxx", "xxx", "xxx", 'x', ItemList.shadowIngot); - GameRegistry.addRecipe(new ItemStack(BlockList.jewelAltar, 1), "sws", "bwb", "bbb", 's', Block.whiteStone, 'w', new ItemStack(Block.cloth, 1, 5), 'b', Block.netherBrick); - - //Smelting - GameRegistry.addSmelting(BlockList.shadowOre.blockID, new ItemStack(ItemList.shadowIngot), 1.5f); - FurnaceRecipes.smelting().addSmelting(ItemList.clayMolds.itemID, 0, new ItemStack(ItemList.molds, 1, 0), 0.2F); - FurnaceRecipes.smelting().addSmelting(ItemList.clayMolds.itemID, 1, new ItemStack(ItemList.molds, 1, 1), 0.2F); - FurnaceRecipes.smelting().addSmelting(ItemList.clayMolds.itemID, 2, new ItemStack(ItemList.molds, 1, 2), 0.2F); - - isInitialized = true; - } - } -} diff --git a/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java b/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java deleted file mode 100644 index 075b978..0000000 --- a/common/darkknight/jewelrycraft/renders/TileEntityDisplayerRender.java +++ /dev/null @@ -1,230 +0,0 @@ -package darkknight.jewelrycraft.renders; - -import java.awt.Color; - -import org.lwjgl.opengl.GL11; -import net.minecraft.block.Block; -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.item.Item; -import net.minecraft.item.ItemStack; -import darkknight.jewelrycraft.model.ModelDisplayer; -import darkknight.jewelrycraft.tileentity.TileEntityDisplayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; -import net.minecraftforge.common.FakePlayer; - -public class TileEntityDisplayerRender extends TileEntitySpecialRenderer -{ - ModelDisplayer displayer = new ModelDisplayer(); - String texture = "textures/tileentities/Displayer.png"; - - @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; - int block = disp.getBlockMetadata(); - - 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); - if(disp != null && disp.hasObject && disp.object != null && disp.object != new ItemStack(0, 0, 0)) - { - int ind = -3; - GL11.glPushMatrix(); - renderLabel(disp.object.getDisplayName(), 0F, (-0.171F)*ind, 0F, block, disp, Color.YELLOW.getRGB()); - GL11.glPopMatrix(); - ind++; - GL11.glPushMatrix(); - renderLabel(Integer.toString(disp.quantity), 0F, (-0.171F)*ind, 0F, block, disp, Color.GRAY.getRGB()); - GL11.glPopMatrix(); - ind++; - if(disp.object.itemID != Item.map.itemID && disp.object != null && disp.object != new ItemStack(0, 0, 0) && disp.object.getTooltip(null, true) != null) - { - for(int i = 1; i < disp.object.getTooltip(new FakePlayer(te.worldObj, "Player"), true).size(); i++) - { - if(disp.object.getTooltip(new FakePlayer(te.worldObj, "Player"), true).get(i).toString() != "") - { - GL11.glPushMatrix(); - renderLabel(disp.object.getTooltip(new FakePlayer(te.worldObj, "Player"), true).get(i).toString(), 0F, (-0.171F)*ind, 0F, block, disp, Color.GRAY.getRGB()); - GL11.glPopMatrix(); - ind++; - } - } - } - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.worldObj, 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; - 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(); - } - - public void adjustLightFixture(World world, int i, int j, int k, Block block) - { - Tessellator tess = Tessellator.instance; - float brightness = block.getBlockBrightness(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, (float) modulousModifier, divModifier); - } - - 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((double)(-33.333 - 0), -1D, 0.1D); - tessellator.addVertex((double)(-33.333 - 0), 8D, 0.1D); - tessellator.addVertex((double)(33.333 + 0), 8D, 0.1D); - tessellator.addVertex((double)(33.333 + 0), -1D, 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); - 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/2) + 256 * (green/2) + blue/2); - 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.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_BLEND); - GL11.glPopMatrix(); - } - - 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/common/darkknight/jewelrycraft/renders/TileEntityJewelrsCraftingTableRender.java b/common/darkknight/jewelrycraft/renders/TileEntityJewelrsCraftingTableRender.java deleted file mode 100644 index 2a130ac..0000000 --- a/common/darkknight/jewelrycraft/renders/TileEntityJewelrsCraftingTableRender.java +++ /dev/null @@ -1,165 +0,0 @@ -package darkknight.jewelrycraft.renders; - -import org.lwjgl.opengl.GL11; - -import darkknight.jewelrycraft.model.ModelJewlersCraftingBench; -import darkknight.jewelrycraft.tileentity.TileEntityJewelrsCraftingTable; -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; - -public class TileEntityJewelrsCraftingTableRender extends TileEntitySpecialRenderer -{ - ModelJewlersCraftingBench modelTable = new ModelJewlersCraftingBench(); - String texture = "textures/tileentities/JewelrsCraftingBench.png"; - - @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); - int block = te.getBlockMetadata(); - TileEntityJewelrsCraftingTable jt = (TileEntityJewelrsCraftingTable)te; - - GL11.glPushMatrix(); - if (block == 0) - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - else if (block == 1){ - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); - } - else if (block == 2) - GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); - else if (block == 3) - GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F); - - 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.worldObj, 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.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.hasEndItem && jt.endItem.getIconIndex().getIconName() != "") - { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.worldObj, 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.hasModifier && jt.modifier.getIconIndex().getIconName() != "") - { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.worldObj, 0.0D, 0.0D, 0.0D, jt.modifier); - 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.hasJewel && jt.jewel.getIconIndex().getIconName() != "") - { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.worldObj, 0.0D, 0.0D, 0.0D, jt.jewel); - 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(); - } - - public void adjustLightFixture(World world, int i, int j, int k, Block block) - { - Tessellator tess = Tessellator.instance; - float brightness = block.getBlockBrightness(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, (float) modulousModifier, divModifier); - } - -} diff --git a/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java b/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java deleted file mode 100644 index 74044fb..0000000 --- a/common/darkknight/jewelrycraft/renders/TileEntityMolderRender.java +++ /dev/null @@ -1,100 +0,0 @@ -package darkknight.jewelrycraft.renders; - -import org.lwjgl.opengl.GL11; - -import darkknight.jewelrycraft.model.ModelMolder; -import darkknight.jewelrycraft.tileentity.TileEntityMolder; - -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.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -public class TileEntityMolderRender extends TileEntitySpecialRenderer -{ - ModelMolder modelMolder = new ModelMolder(); - String texture = "textures/tileentities/Molder.png"; - - @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; - - ResourceLocation blockTexture = new ResourceLocation("jewelrycraft", texture); - Minecraft.getMinecraft().renderEngine.bindTexture(blockTexture); - int block = me.getBlockMetadata(); - - GL11.glPushMatrix(); - if (block == 0) - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - else if (block == 1){ - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); - } - else if (block == 2) - GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); - else if (block == 3) - GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F); - modelMolder.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - if (me != null) - { - if (me.hasMold) - { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.worldObj, 0.0D, 0.0D, 0.0D, me.mold); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - GL11.glTranslatef(0F, 1.312F, -0.25F); - GL11.glScalef(1.25F, 1.0F, 1.25F); - GL11.glRotatef(90F, 1F, 0F, 0f); - RenderItem.renderInFrame = true; - if(entityitem != null) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } - if (me.hasJewelBase && me.jewelBase.getIconIndex() != null && me.jewelBase.getIconIndex().getIconName() != "") - { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.worldObj, 0.0D, 0.0D, 0.0D, me.jewelBase); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - GL11.glTranslatef(0F, 1.312F, -0.25F); - GL11.glScalef(1.25F, 1.0F, 1.25F); - GL11.glRotatef(90F, 1F, 0F, 0f); - RenderItem.renderInFrame = true; - if(entityitem != null) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; - GL11.glColor4f(1, 1F, 1F, 1.0F); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - } - } - GL11.glPopMatrix(); - GL11.glPopMatrix(); - } - - public void adjustLightFixture(World world, int i, int j, int k, Block block) - { - Tessellator tess = Tessellator.instance; - float brightness = block.getBlockBrightness(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, (float) modulousModifier, divModifier); - } - -} diff --git a/common/darkknight/jewelrycraft/renders/TileEntitySmelterRender.java b/common/darkknight/jewelrycraft/renders/TileEntitySmelterRender.java deleted file mode 100644 index 128a254..0000000 --- a/common/darkknight/jewelrycraft/renders/TileEntitySmelterRender.java +++ /dev/null @@ -1,119 +0,0 @@ -package darkknight.jewelrycraft.renders; - -import org.lwjgl.opengl.GL11; - -import darkknight.jewelrycraft.model.ModelSmelter; -import darkknight.jewelrycraft.tileentity.TileEntitySmelter; - -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.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; - -public class TileEntitySmelterRender extends TileEntitySpecialRenderer -{ - ModelSmelter modelSmelter = new ModelSmelter(); - String texture = "textures/tileentities/Smelter.png"; - - @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); - TileEntitySmelter st = (TileEntitySmelter)te; - int block = te.getBlockMetadata(); - - GL11.glPushMatrix(); - if (block == 0) - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - else if (block == 1){ - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F); - } - else if (block == 2) - GL11.glRotatef(180F, 1.0F, 0.0F, 0.0F); - else if (block == 3) - GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F); - - modelSmelter.render((Entity) null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F); - - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem entityitem = new EntityItem(te.worldObj, 0.0D, 0.0D, 0.0D, new ItemStack(Block.lavaStill)); - entityitem.getEntityItem().stackSize = 1; - entityitem.hoverStart = 0.0F; - - GL11.glTranslatef(-0F, 1.25F, -0.3F); - GL11.glScalef(1.25F, 1.0F, 1.47F); - GL11.glRotatef(90F, 1F, 0F, 0f); - RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; - - GL11.glTranslatef(0F, 0.46F, 0.0F); - GL11.glScalef(0.8F, 0.1F, 0F); - RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; - - GL11.glTranslatef(0F, -5.6F, 0.0F); - RenderItem.renderInFrame = true; - RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.renderInFrame = false; - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glPopMatrix(); - if (st != null) - { - if (st.hasMetal && st.metal != null && st.metal.getIconIndex() != null && st.metal.getIconIndex().getIconName() != "") - { - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - EntityItem metal = new EntityItem(te.worldObj, 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); - if(RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(metal, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - else - { - RenderManager.instance.options.fancyGraphics = true; - RenderManager.instance.renderEntityWithPosYaw(metal, 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(); - } - - public void adjustLightFixture(World world, int i, int j, int k, Block block) - { - Tessellator tess = Tessellator.instance; - float brightness = block.getBlockBrightness(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, (float) modulousModifier, divModifier); - } - -} diff --git a/common/darkknight/jewelrycraft/server/JewelryCraftServer.java b/common/darkknight/jewelrycraft/server/JewelryCraftServer.java deleted file mode 100644 index 061175c..0000000 --- a/common/darkknight/jewelrycraft/server/JewelryCraftServer.java +++ /dev/null @@ -1,16 +0,0 @@ -package darkknight.jewelrycraft.server; - -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet250CustomPayload; -import cpw.mods.fml.common.network.IPacketHandler; -import cpw.mods.fml.common.network.Player; - -public class JewelryCraftServer implements IPacketHandler -{ - @Override - public void onPacketData(INetworkManager manager, Packet250CustomPayload packet, Player player) - { - // TODO Auto-generated method stub - - } -} diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityAltar.java b/common/darkknight/jewelrycraft/tileentity/TileEntityAltar.java deleted file mode 100644 index a0c0a3e..0000000 --- a/common/darkknight/jewelrycraft/tileentity/TileEntityAltar.java +++ /dev/null @@ -1,145 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.List; - -import darkknight.jewelrycraft.util.JewelryNBT; -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.Packet132TileEntityData; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; - -public class TileEntityAltar extends TileEntity -{ - public ItemStack object; - public boolean isDirty, hasObject; - public String playerName; - - public TileEntityAltar() - { - this.hasObject = false; - this.object = new ItemStack(0, 0, 0); - this.isDirty = false; - this.playerName = ""; - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - NBTTagCompound tag = new NBTTagCompound(); - this.object.writeToNBT(tag); - nbt.setCompoundTag("object", tag); - nbt.setBoolean("hasObject", hasObject); - nbt.setString("playerName", playerName); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.object = new ItemStack(0, 0, 0); - this.object.readFromNBT(nbt.getCompoundTag("object")); - this.hasObject = nbt.getBoolean("hasObject"); - this.playerName = nbt.getString("playerName"); - } - - @SuppressWarnings("rawtypes") - @Override - public void updateEntity() - { - super.updateEntity(); - - if(isDirty) - { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - isDirty = true; - } - if(hasObject && playerName != "") - { - //int playerPosX = (int)player.posX, playerPosY = (int)player.posY, playerPosZ = (int)player.posZ; - List entitiesR = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord, yCoord + 1D, zCoord, xCoord + 0.5D, yCoord + 2D, zCoord + 0.5D)); - List entitiesN = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(xCoord - 0.5D, yCoord + 1D, zCoord - 0.5D, xCoord + 1.5D, yCoord + 2D, zCoord + 1.5D)); - if(object.getUnlocalizedName().contains("ring")) - { - if (JewelryNBT.isJewelX(object, new ItemStack(Item.enderPearl)) && JewelryNBT.dimension(object) != -2 && JewelryNBT.playerPosX(object) != -1 && JewelryNBT.playerPosY(object) != -1 && JewelryNBT.playerPosZ(object) != -1) - { - double posX = JewelryNBT.playerPosX(object), posY = JewelryNBT.playerPosY(object), posZ = JewelryNBT.playerPosZ(object); - int dimension = JewelryNBT.dimension(object); - for(int i = 0; i < entitiesR.size(); i++) - { - EntityLivingBase entity = (EntityLivingBase) entitiesR.get(i); - if (!JewelryNBT.isDimensionX(object, entity.dimension) && JewelryNBT.isModifierX(object, new ItemStack(Item.bed))){ - entity.travelToDimension(dimension); - entity.setPositionAndUpdate(posX, posY, posZ); - } - else if(JewelryNBT.isDimensionX(object, entity.dimension)) entity.setPositionAndUpdate(posX, posY, posZ); - } - } - if (JewelryNBT.isModifierX(object, new ItemStack(Item.dyePowder, 1, 15))) - { - for(int i=-1; i<=1; i++) - for(int j=-1; j<=1; j++) - for(int k=-1; k<=1; k++) - { - //if(worldObj.getBlockId(xCoord + i, yCoord + j, zCoord + k) == Block.dirt.blockID && (worldObj.getBlockId(xCoord + i, yCoord + j + 1, zCoord + k) == 0 || worldObj.getBlockId(xCoord + i, yCoord + j + 1, zCoord + k) == Block.crops.blockID) || worldObj.getBlockId(xCoord + i, yCoord + j + 1, zCoord + k) == Block.potato.blockID) worldObj.setBlock(xCoord + i, yCoord + j, zCoord + k, Block.tilledField.blockID); - if(worldObj.getBlockId(xCoord + i, yCoord + j, zCoord + k) == Block.tilledField.blockID) worldObj.setBlockMetadataWithNotify(xCoord + i, yCoord + j, zCoord + k, 1, 7); - if(worldObj.getBlockId(xCoord + i, yCoord + j, zCoord + k) != Block.tilledField.blockID) worldObj.scheduleBlockUpdate(xCoord + i, yCoord + j, zCoord + k, worldObj.getBlockId(xCoord + i, yCoord + j, zCoord + k), 5); - //JewelrycraftUtil.applyBonemeal(object, worldObj, xCoord + i, yCoord + j, zCoord + k, player); - } - } - } - else if(object.getUnlocalizedName().contains("necklace")) - { - if (JewelryNBT.isJewelX(object, new ItemStack(Item.enderPearl)) && JewelryNBT.dimension(object) != -2 && JewelryNBT.playerPosX(object) != -1 && JewelryNBT.playerPosY(object) != -1 && JewelryNBT.playerPosZ(object) != -1) - { - double posX = JewelryNBT.playerPosX(object), posY = JewelryNBT.playerPosY(object), posZ = JewelryNBT.playerPosZ(object); - int dimension = JewelryNBT.dimension(object); - for(int i = 0; i < entitiesN.size(); i++) - { - EntityLivingBase entity = (EntityLivingBase) entitiesN.get(i); - if (!JewelryNBT.isDimensionX(object, entity.dimension) && JewelryNBT.isModifierX(object, new ItemStack(Item.bed))){ - entity.travelToDimension(dimension); - entity.setPositionAndUpdate(posX, posY, posZ); - } - else if(JewelryNBT.isDimensionX(object, entity.dimension)) entity.setPositionAndUpdate(posX, posY, posZ); - } - } - if (JewelryNBT.isModifierX(object, new ItemStack(Item.dyePowder, 1, 15))) - { - for(int i=-3; i<=3; i++) - for(int j=-1; j<=1; j++) - for(int k=-3; k<=3; k++) - { - //if(worldObj.getBlockId(xCoord + i, yCoord + j, zCoord + k) == Block.dirt.blockID && (worldObj.getBlockId(xCoord + i, yCoord + j + 1, zCoord + k) == 0 || worldObj.getBlockId(xCoord + i, yCoord + j + 1, zCoord + k) == Block.crops.blockID) || worldObj.getBlockId(xCoord + i, yCoord + j + 1, zCoord + k) == Block.potato.blockID) worldObj.setBlock(xCoord + i, yCoord + j, zCoord + k, Block.tilledField.blockID); - if(worldObj.getBlockId(xCoord + i, yCoord + j, zCoord + k) == Block.tilledField.blockID) worldObj.setBlockMetadataWithNotify(xCoord + i, yCoord + j, zCoord + k, 1, 7); - if(worldObj.getBlockId(xCoord + i, yCoord + j, zCoord + k) != Block.tilledField.blockID) worldObj.scheduleBlockUpdate(xCoord + i, yCoord + j, zCoord + k, worldObj.getBlockId(xCoord + i, yCoord + j, zCoord + k), 5); - //JewelrycraftUtil.applyBonemeal(object, worldObj, xCoord + i, yCoord + j, zCoord + k, player); - } - } - } - } - } - - @Override - public Packet getDescriptionPacket() - { - Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket(); - NBTTagCompound dataTag = packet != null ? packet.data : new NBTTagCompound(); - writeToNBT(dataTag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, dataTag); - } - - @Override - public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) - { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt != null ? pkt.data : new NBTTagCompound(); - readFromNBT(tag); - } -} diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java b/common/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java deleted file mode 100644 index 138d0ab..0000000 --- a/common/darkknight/jewelrycraft/tileentity/TileEntityBlockShadow.java +++ /dev/null @@ -1,77 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.Packet132TileEntityData; -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() - { - this.metadata = -1; - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("metadata", metadata); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.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((float)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.getBlockId(xCoord, yCoord, zCoord)); - } - - @Override - public Packet getDescriptionPacket() - { - Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket(); - NBTTagCompound dataTag = packet != null ? packet.data : new NBTTagCompound(); - writeToNBT(dataTag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, dataTag); - } - - @Override - public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) - { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt != null ? pkt.data : new NBTTagCompound(); - readFromNBT(tag); - } -} diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java b/common/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java deleted file mode 100644 index c3eba49..0000000 --- a/common/darkknight/jewelrycraft/tileentity/TileEntityDisplayer.java +++ /dev/null @@ -1,110 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.Packet132TileEntityData; -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; - - public TileEntityDisplayer() - { - this.ringTranslation1 = 0; - this.ringTranslation2 = 0; - this.ringTranslation3 = 0; - this.rotAngle = 0; - this.quantity = 0; - this.isDescending1 = false; - this.isDescending2 = false; - this.isDescending3 = false; - this.isDirty = false; - this.hasObject = false; - this.object = new ItemStack(0, 0, 0); - } - - @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.setBoolean("descending1", isDescending1); - nbt.setBoolean("descending2", isDescending2); - nbt.setBoolean("descending3", isDescending3); - nbt.setBoolean("hasObject", hasObject); - NBTTagCompound tag = new NBTTagCompound(); - this.object.writeToNBT(tag); - nbt.setCompoundTag("object", tag); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.ringTranslation1 = nbt.getFloat("translation1"); - this.ringTranslation2 = nbt.getFloat("translation2"); - this.ringTranslation3 = nbt.getFloat("translation3"); - this.rotAngle = nbt.getFloat("angle"); - this.quantity = nbt.getInteger("quantity"); - this.isDescending1 = nbt.getBoolean("descending1"); - this.isDescending2 = nbt.getBoolean("descending2"); - this.isDescending3 = nbt.getBoolean("descending3"); - this.hasObject = nbt.getBoolean("hasObject"); - this.object = new ItemStack(0, 0, 0); - this.object.readFromNBT(nbt.getCompoundTag("object")); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(isDirty) - { - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - isDirty = true; - } - 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; - } - - @Override - public Packet getDescriptionPacket() - { - Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket(); - NBTTagCompound dataTag = packet != null ? packet.data : new NBTTagCompound(); - writeToNBT(dataTag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, dataTag); - } - - @Override - public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) - { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt != null ? pkt.data : new NBTTagCompound(); - readFromNBT(tag); - } -} diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java b/common/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java deleted file mode 100644 index 69fd69a..0000000 --- a/common/darkknight/jewelrycraft/tileentity/TileEntityJewelrsCraftingTable.java +++ /dev/null @@ -1,143 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import darkknight.jewelrycraft.config.ConfigHandler; -import darkknight.jewelrycraft.util.JewelryNBT; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.Packet132TileEntityData; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityJewelrsCraftingTable extends TileEntity -{ - public boolean hasJewelry, hasModifier, hasEndItem, isDirty, hasJewel; - public ItemStack jewelry, modifier, endItem, jewel; - public int timer, effect; - public float angle; - - public TileEntityJewelrsCraftingTable() - { - this.jewelry = new ItemStack(0, 0, 0); - this.modifier = new ItemStack(0, 0, 0); - this.endItem = new ItemStack(0, 0, 0); - this.jewel = new ItemStack(0, 0, 0); - this.hasJewelry = false; - this.hasModifier = false; - this.hasEndItem = false; - this.hasJewel = false; - this.timer = 0; - this.effect = 0; - this.angle = 0; - this.isDirty = false; - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setBoolean("hasJewelry", hasJewelry); - nbt.setBoolean("hasModifier", hasModifier); - nbt.setBoolean("hasEndItem", hasEndItem); - nbt.setBoolean("hasJewel", hasJewel); - nbt.setInteger("timer", timer); - nbt.setInteger("effect", effect); - nbt.setFloat("angle", angle); - - NBTTagCompound tag = new NBTTagCompound(); - NBTTagCompound tag1 = new NBTTagCompound(); - NBTTagCompound tag2 = new NBTTagCompound(); - NBTTagCompound tag3 = new NBTTagCompound(); - - this.jewelry.writeToNBT(tag); - nbt.setCompoundTag("jewelry", tag); - this.modifier.writeToNBT(tag1); - nbt.setCompoundTag("modifier", tag1); - this.endItem.writeToNBT(tag2); - nbt.setCompoundTag("endItem", tag2); - this.jewel.writeToNBT(tag3); - nbt.setCompoundTag("jewel", tag3); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.hasJewelry = nbt.getBoolean("hasJewelry"); - this.hasModifier = nbt.getBoolean("hasModifier"); - this.hasEndItem = nbt.getBoolean("hasEndItem"); - this.hasJewel = nbt.getBoolean("hasJewel"); - - this.timer = nbt.getInteger("timer"); - this.effect = nbt.getInteger("effect"); - this.angle = nbt.getFloat("angle"); - this.jewelry = new ItemStack(0, 0, 0); - this.jewelry.readFromNBT(nbt.getCompoundTag("jewelry")); - this.modifier = new ItemStack(0, 0, 0); - this.modifier.readFromNBT(nbt.getCompoundTag("modifier")); - this.endItem = new ItemStack(0, 0, 0); - this.endItem.readFromNBT(nbt.getCompoundTag("endItem")); - this.jewel = new ItemStack(0, 0, 0); - this.jewel.readFromNBT(nbt.getCompoundTag("jewel")); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(isDirty){ - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - isDirty = true; - } - if(angle<360F)angle+=3F; - else angle=0F; - if (this.hasJewelry && (this.hasModifier || this.hasJewel) && !this.hasEndItem) - { - if (timer > 0) - { - timer--; - for (int l = 0; l < ConfigHandler.jewelryCraftingTime/(timer + 2); ++l) - { - if(this.getBlockMetadata() == 0) this.worldObj.spawnParticle("witchMagic", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.2F, 0.0D, 0.0D, 0.0D); - if(this.getBlockMetadata() == 1) this.worldObj.spawnParticle("witchMagic", xCoord + 0.8F, (double) yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D); - if(this.getBlockMetadata() == 2) this.worldObj.spawnParticle("witchMagic", xCoord + 0.5F, (double) yCoord + 0.8F, zCoord + 0.8F, 0.0D, 0.0D, 0.0D); - if(this.getBlockMetadata() == 3) this.worldObj.spawnParticle("witchMagic", xCoord + 0.2F, (double) yCoord + 0.8F, zCoord + 0.5F, 0.0D, 0.0D, 0.0D); - } - } - if (timer == 0) - { - this.hasEndItem = true; - this.endItem = jewelry.copy(); - if (hasModifier && modifier != new ItemStack(0, 0, 0)) JewelryNBT.addModifier(endItem, modifier); - if (hasJewel && jewel != new ItemStack(0, 0, 0)) JewelryNBT.addJewel(endItem, jewel); - if (hasJewel && hasModifier && JewelryNBT.isJewelX(endItem, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(endItem, new ItemStack(Item.book))) JewelryNBT.addMode(endItem, "Disenchant"); - if (hasModifier && JewelryNBT.isModifierEffectType(endItem)) JewelryNBT.addMode(endItem, "Activated"); - this.hasJewelry = false; - this.jewelry = new ItemStack(0, 0, 0); - this.hasModifier = false; - this.modifier = new ItemStack(0, 0, 0); - this.hasJewel = false; - this.jewel = new ItemStack(0, 0, 0); - timer = -1; - } - } - } - - @Override - public Packet getDescriptionPacket() - { - Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket(); - NBTTagCompound dataTag = packet != null ? packet.data : new NBTTagCompound(); - writeToNBT(dataTag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, dataTag); - } - - @Override - public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) - { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt != null ? pkt.data : new NBTTagCompound(); - readFromNBT(tag); - } -} diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java b/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java deleted file mode 100644 index 05e6e34..0000000 --- a/common/darkknight/jewelrycraft/tileentity/TileEntityMolder.java +++ /dev/null @@ -1,124 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.Packet132TileEntityData; -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 TileEntityMolder() - { - this.moltenMetal = new ItemStack(0, 0, 0); - this.jewelBase = new ItemStack(0, 0, 0); - this.mold = new ItemStack(0, 0, 0); - this.ringMetal = new ItemStack(0, 0, 0); - this.cooling = 0; - this.hasJewelBase = false; - this.hasMoltenMetal = false; - this.hasMold = false; - this.isDirty = false; - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("cooling", cooling); - 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(); - this.mold.writeToNBT(tag); - nbt.setCompoundTag("mold", tag); - this.jewelBase.writeToNBT(tag1); - nbt.setCompoundTag("jewelBase", tag1); - this.moltenMetal.writeToNBT(tag2); - nbt.setCompoundTag("moltenMetal", tag2); - this.ringMetal.writeToNBT(tag3); - nbt.setCompoundTag("ringMetal", tag3); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.cooling = nbt.getInteger("cooling"); - this.hasJewelBase = nbt.getBoolean("hasJewelBase"); - this.hasMoltenMetal = nbt.getBoolean("hasMoltenMetal"); - this.hasMold = nbt.getBoolean("hasMold"); - this.mold = new ItemStack(0, 0, 0); - this.mold.readFromNBT(nbt.getCompoundTag("mold")); - this.jewelBase = new ItemStack(0, 0, 0); - this.jewelBase.readFromNBT(nbt.getCompoundTag("jewelBase")); - this.moltenMetal = new ItemStack(0, 0, 0); - this.moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal")); - this.ringMetal = new ItemStack(0, 0, 0); - this.ringMetal.readFromNBT(nbt.getCompoundTag("ringMetal")); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - if(isDirty){ - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - isDirty = true; - } - if (moltenMetal.itemID != 0) - { - if(worldObj.rand.nextInt(20) == 0) this.worldObj.playSoundEffect(xCoord, yCoord + 0.5F, zCoord, "random.fizz", 0.5F, 1F); - for (int l = 0; l < 2; ++l) - this.worldObj.spawnParticle("reddust", xCoord + Math.random(), (double) yCoord + 0.2F, zCoord + Math.random(), 0.0D, 1.0D, 1.0D); - } - if (this.hasMoltenMetal && !this.hasJewelBase) - { - ringMetal = moltenMetal; - if (cooling > 0) - this.cooling--; - if (cooling == 0) - { - this.hasMoltenMetal = false; - if (mold.getItemDamage() == 0) - this.jewelBase = moltenMetal; - else if (mold.getItemDamage() == 1) - this.jewelBase = new ItemStack(ItemList.ring); - else - this.jewelBase = new ItemStack(ItemList.necklace); - if(mold.getItemDamage() != 0 && jewelBase != new ItemStack(0, 0, 0)) - JewelryNBT.addMetal(jewelBase, ringMetal); - this.moltenMetal = new ItemStack(0, 0, 0); - this.hasJewelBase = true; - cooling = -1; - } - } - } - - @Override - public Packet getDescriptionPacket() - { - Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket(); - NBTTagCompound dataTag = packet != null ? packet.data : new NBTTagCompound(); - writeToNBT(dataTag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, dataTag); - } - - @Override - public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) - { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt != null ? pkt.data : new NBTTagCompound(); - readFromNBT(tag); - } -} diff --git a/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java b/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java deleted file mode 100644 index 1012741..0000000 --- a/common/darkknight/jewelrycraft/tileentity/TileEntitySmelter.java +++ /dev/null @@ -1,125 +0,0 @@ -package darkknight.jewelrycraft.tileentity; - -import java.util.Random; - -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.INetworkManager; -import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.Packet132TileEntityData; -import net.minecraft.tileentity.TileEntity; - -public class TileEntitySmelter extends TileEntity -{ - public int melting, flow, n = 0, p = 0; - public boolean hasMetal, hasMoltenMetal, isDirty; - public ItemStack metal, moltenMetal; - - public TileEntitySmelter() - { - this.melting = 0; - this.flow = 0; - this.hasMetal = false; - this.hasMoltenMetal = false; - this.metal = new ItemStack(0, 0, 0); - this.moltenMetal = new ItemStack(0, 0, 0); - this.isDirty = false; - } - - @Override - public void writeToNBT(NBTTagCompound nbt) - { - super.writeToNBT(nbt); - nbt.setInteger("melting", melting); - nbt.setBoolean("hasMetal", hasMetal); - nbt.setBoolean("hasMoltenMetal", hasMoltenMetal); - NBTTagCompound tag = new NBTTagCompound(); - NBTTagCompound tag1 = new NBTTagCompound(); - this.metal.writeToNBT(tag); - nbt.setCompoundTag("metal", tag); - this.moltenMetal.writeToNBT(tag1); - nbt.setCompoundTag("moltenMetal", tag1); - } - - @Override - public void readFromNBT(NBTTagCompound nbt) - { - super.readFromNBT(nbt); - this.melting = nbt.getInteger("melting"); - this.hasMetal = nbt.getBoolean("hasMetal"); - this.hasMoltenMetal = nbt.getBoolean("hasMoltenMetal"); - this.metal = new ItemStack(0, 0, 0); - this.metal.readFromNBT(nbt.getCompoundTag("metal")); - this.moltenMetal = new ItemStack(0, 0, 0); - this.moltenMetal.readFromNBT(nbt.getCompoundTag("moltenMetal")); - } - - @Override - public void updateEntity() - { - super.updateEntity(); - Random rand = new Random(); - if(isDirty){ - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - isDirty = true; - } - 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 (this.hasMetal) - { - for (int l = 0; l < 2; ++l) - this.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 = this.xCoord + rand.nextFloat(); - double d7 = this.yCoord; - double d6 = this.zCoord + rand.nextFloat(); - this.worldObj.playSound(d5, d7, d6, "liquid.lavapop", 0.2F + rand.nextFloat() * 0.2F, 0.9F + rand.nextFloat() * 0.15F, false); - } - if (this.hasMetal) - { - if (melting > 0) - this.melting--; - if (melting == 0) - { - this.hasMetal = false; - this.moltenMetal = metal; - this.metal = new ItemStack(0, 0, 0); - this.hasMoltenMetal = true; - melting = -1; - } - } - } - - @Override - public Packet getDescriptionPacket() - { - Packet132TileEntityData packet = (Packet132TileEntityData) super.getDescriptionPacket(); - NBTTagCompound dataTag = packet != null ? packet.data : new NBTTagCompound(); - writeToNBT(dataTag); - return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, dataTag); - } - - @Override - public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) - { - super.onDataPacket(net, pkt); - NBTTagCompound tag = pkt != null ? pkt.data : new NBTTagCompound(); - readFromNBT(tag); - } -} diff --git a/common/darkknight/jewelrycraft/util/BlockUtils.java b/common/darkknight/jewelrycraft/util/BlockUtils.java deleted file mode 100644 index 78ee46c..0000000 --- a/common/darkknight/jewelrycraft/util/BlockUtils.java +++ /dev/null @@ -1,121 +0,0 @@ -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.ForgeDirection; - -public class BlockUtils -{ - - public static final ForgeDirection DEFAULT_BLOCK_DIRECTION = ForgeDirection.WEST; - - 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; - - } - - 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; - } - } - - 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); - } - - 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; - } - - 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; - } - - 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); - } - } - } - - 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); - } - - public static TileEntity getTileInDirection(TileEntity tile, ForgeDirection direction) { - int targetX = tile.xCoord + direction.offsetX; - int targetY = tile.yCoord + direction.offsetY; - int targetZ = tile.zCoord + direction.offsetZ; - return tile.worldObj.getBlockTileEntity(targetX, targetY, targetZ); - } - - public static int getFirstNonAirBlockFromTop(World world, int x, int z) { - int y; - for (y = world.getActualHeight(); world.isAirBlock(x, y - 1, z) && y > 0; y--) {} - return y; - } - - public static boolean isBlockHit(MovingObjectPosition mop, TileEntity tile) { - if (tile == null) return false; - return isBlockHit(mop, tile.xCoord, tile.yCoord, tile.zCoord); - } - - public static boolean isBlockHit(MovingObjectPosition mop, int x, int y, int z) { - if (mop == null) return false; - return mop.blockX == x && mop.blockY == y && mop.blockZ == z; - } - -}
\ No newline at end of file diff --git a/common/darkknight/jewelrycraft/util/JewelryNBT.java b/common/darkknight/jewelrycraft/util/JewelryNBT.java deleted file mode 100644 index d7d396d..0000000 --- a/common/darkknight/jewelrycraft/util/JewelryNBT.java +++ /dev/null @@ -1,623 +0,0 @@ -package darkknight.jewelrycraft.util; - -import java.util.List; - -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 jewel The jewel you want to add on the item - */ - public static void addJewel(ItemStack item, ItemStack jewel) - { - if(jewel != null) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) - itemStackData = item.getTagCompound(); - else - { - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound jewelNBT = new NBTTagCompound(); - jewel.writeToNBT(jewelNBT); - itemStackData.setTag("jewel", jewelNBT); - } - } - - /** - * - * @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 addModifier(ItemStack item, ItemStack modifier) - { - if(modifier != null) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) - itemStackData = item.getTagCompound(); - else - { - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound modifierNBT = new NBTTagCompound(); - modifier.writeToNBT(modifierNBT); - itemStackData.setTag("modifier", modifierNBT); - } - } - - 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); - } - - 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); - } - - 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); - } - - 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.getBlockTileEntity(x, y, z).writeToNBT(tileNBT); - itemStackData.setTag("tile", tileNBT); - block.setInteger("blockID", world.getBlockId(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); - } - - 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); - } - - 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); - } - - 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); - } - - public static void addMode(ItemStack item, String modeN) - { - NBTTagCompound itemStackData; - if (item.hasTagCompound()) - itemStackData = item.getTagCompound(); - else - { - itemStackData = new NBTTagCompound(); - item.setTagCompound(itemStackData); - } - NBTTagCompound mode = new NBTTagCompound(); - mode.setString("mode", modeN); - itemStackData.setTag("mode", mode); - } - - 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("ench")); - } - - 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); - } - - public static void addJewelColor(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("jewelColor", color); - itemStackData.setTag("jewelColor", colors); - } - - @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 - 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); - } - - public static void removeEntity(ItemStack item) - { - JewelryNBT.removeNBT(item, "entityID"); - JewelryNBT.removeNBT(item, "entity"); - JewelryNBT.removeNBT(item, "ench"); - } - - 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 - 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; - } - - public static boolean isJewelX(ItemStack stack, ItemStack jewel) - { - if(jewel(stack) != null && jewel(stack).itemID == jewel.itemID && jewel(stack).getItemDamage() == jewel.getItemDamage()) return true; - return false; - } - - public static boolean isModifierX(ItemStack stack, ItemStack modifier) - { - if(modifier(stack) != null && modifier(stack).itemID == modifier.itemID && modifier(stack).getItemDamage() == modifier.getItemDamage()) return true; - return false; - } - - public static boolean isModifierEffectType(ItemStack stack) - { - if(modifier(stack) != null && (isModifierX(stack, new ItemStack(Item.blazePowder)) || isModifierX(stack, new ItemStack(Item.sugar)) - || isModifierX(stack, new ItemStack(Item.pickaxeIron)) || isModifierX(stack, new ItemStack(Item.feather)) - || isModifierX(stack, new ItemStack(Item.potion, 1, 8270)))) return true; - return false; - } - - public static boolean isIngotX(ItemStack stack, ItemStack ingot) - { - if(ingot(stack) != null && ingot(stack).itemID == ingot.itemID && ingot(stack).getItemDamage() == ingot.getItemDamage()) return true; - return false; - } - - public static boolean isModeX(ItemStack stack, String modeN) - { - if(modeName(stack) != null && modeName(stack).equals(modeN)) return true; - return false; - } - - 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; - } - - public static boolean isDimNameX(ItemStack stack, String dimName) - { - if(ingot(stack) != null && dimName(stack).equals(dimName)) return true; - return false; - } - - 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 - - public static ItemStack jewel(ItemStack stack) - { - if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewel")) - { - NBTTagCompound jewelNBT = (NBTTagCompound) stack.getTagCompound().getTag("jewel"); - ItemStack jewel = new ItemStack(0, 0, 0); - jewel.readFromNBT(jewelNBT); - return jewel; - } - return null; - } - - public static ItemStack modifier(ItemStack stack) - { - if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("modifier")) - { - NBTTagCompound modifierNBT = (NBTTagCompound) stack.getTagCompound().getTag("modifier"); - ItemStack modifier = new ItemStack(0, 0, 0); - modifier.readFromNBT(modifierNBT); - return modifier; - } - return null; - } - - public static ItemStack ingot(ItemStack stack) - { - if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("ingot")) - { - NBTTagCompound ingotNBT = (NBTTagCompound) stack.getTagCompound().getTag("ingot"); - ItemStack ingot = new ItemStack(0, 0, 0); - ingot.readFromNBT(ingotNBT); - return ingot; - } - return null; - } - - public static EntityLivingBase entity(ItemStack stack, EntityPlayer player) - { - if (stack != null && stack != new ItemStack(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; - } - - public static TileEntity tileEntity(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("tile")) - { - NBTTagCompound tileNBT = (NBTTagCompound) stack.getTagCompound().getTag("tile"); - TileEntity tile = (TileEntity) TileEntity.createAndLoadEntity(tileNBT); - if(tile != null && tile instanceof TileEntity) - { - tile.readFromNBT(tileNBT); - return tile; - } - else return null; - } - return null; - } - - public static String dimName(ItemStack stack) - { - if(stack != null && stack != new ItemStack(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; - } - - public static String modeName(ItemStack stack) - { - if(stack != null && stack != new ItemStack(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; - } - - public static int dimension(ItemStack stack) - { - if(stack != null && stack != new ItemStack(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; - } - - public static int blockCoordX(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("blockX")) - { - NBTTagCompound x = (NBTTagCompound) stack.getTagCompound().getTag("blockX"); - int posX = x.getInteger("blockX"); - return posX; - } - return -1; - } - - public static int blockCoordY(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("blockY")) - { - NBTTagCompound y = (NBTTagCompound) stack.getTagCompound().getTag("blockY"); - int posY = y.getInteger("blockY"); - return posY; - } - return -1; - } - - public static int blockCoordZ(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("blockZ")) - { - NBTTagCompound z = (NBTTagCompound) stack.getTagCompound().getTag("blockZ"); - int posZ = z.getInteger("blockZ"); - return posZ; - } - return -1; - } - - public static int blockID(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("blockID")) - { - NBTTagCompound blockID = (NBTTagCompound) stack.getTagCompound().getTag("blockID"); - int blockId = blockID.getInteger("blockID"); - return blockId; - } - return -1; - } - - public static int blockMetadata(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("metadata")) - { - NBTTagCompound metadataNBT = (NBTTagCompound) stack.getTagCompound().getTag("metadata"); - int metadata = metadataNBT.getInteger("metadata"); - return metadata; - } - return -1; - } - - public static double playerPosX(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("x")) - { - NBTTagCompound x = (NBTTagCompound) stack.getTagCompound().getTag("x"); - double posX = x.getDouble("x"); - return posX; - } - return -1; - } - - public static double playerPosY(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("y")) - { - NBTTagCompound y = (NBTTagCompound) stack.getTagCompound().getTag("y"); - double posY = y.getDouble("y"); - return posY; - } - return -1; - } - - public static double playerPosZ(ItemStack stack) - { - if (stack != null && stack != new ItemStack(0, 0, 0) && stack.getTagCompound().hasKey("z")) - { - NBTTagCompound z = (NBTTagCompound) stack.getTagCompound().getTag("z"); - double posZ = z.getDouble("z"); - return posZ; - } - return -1; - } - - public static int ingotColor(ItemStack stack) - { - if(stack != null && stack != new ItemStack(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; - } - - public static int jewelColor(ItemStack stack) - { - if(stack != null && stack != new ItemStack(0, 0, 0) && stack.hasTagCompound() && stack.getTagCompound().hasKey("jewelColor")) - { - NBTTagCompound colors = (NBTTagCompound) stack.getTagCompound().getTag("jewelColor"); - int color = colors.getInteger("jewelColor"); - return color; - } - return 16777215; - } - - @SuppressWarnings({ "rawtypes", "unchecked", "null" }) - public static List entities(ItemStack stack, EntityPlayer player) - { - if (stack != null && stack != new ItemStack(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 i = 0; i < entityID.length; i++){ - entity = (EntityLivingBase) EntityList.createEntityByID(entityID[i], player.worldObj); - list.add(entity); - } - return list; - } - return null; - } -} diff --git a/common/darkknight/jewelrycraft/util/JewelrycraftUtil.java b/common/darkknight/jewelrycraft/util/JewelrycraftUtil.java deleted file mode 100644 index 6e7d734..0000000 --- a/common/darkknight/jewelrycraft/util/JewelrycraftUtil.java +++ /dev/null @@ -1,136 +0,0 @@ -package darkknight.jewelrycraft.util; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; -import darkknight.jewelrycraft.item.ItemList; - -public class JewelrycraftUtil -{ - public static ArrayList<ItemStack> modifiers = new ArrayList<ItemStack>(); - public static ArrayList<ItemStack> jewel = new ArrayList<ItemStack>(); - public static ArrayList<ItemStack> jewelry = new ArrayList<ItemStack>(); - public static ArrayList<ItemStack> metal = new ArrayList<ItemStack>(); - public static ArrayList<String> jamcraftPlayers = new ArrayList<String>(); - public static Random rand = new Random(); - - public static void addStuff() - { - //Modifiers - modifiers.add(new ItemStack(Block.chest)); - modifiers.add(new ItemStack(Block.torchWood)); - modifiers.add(new ItemStack(Item.book)); - modifiers.add(new ItemStack(Item.dyePowder, 1, 15)); - modifiers.add(new ItemStack(Item.bone)); - modifiers.add(new ItemStack(Item.sugar)); - modifiers.add(new ItemStack(Item.feather)); - modifiers.add(new ItemStack(Item.bed)); - modifiers.add(new ItemStack(Item.pickaxeIron)); - modifiers.add(new ItemStack(Item.redstone)); - modifiers.add(new ItemStack(Item.pickaxeDiamond)); - modifiers.add(new ItemStack(Item.blazePowder)); - modifiers.add(new ItemStack(Item.eyeOfEnder)); - modifiers.add(new ItemStack(Item.potion, 1, 8270)); - - //Jewels - for(int i=0; i < 16; i++) - jewel.add(new ItemStack(ItemList.crystal, 1, i)); - jewel.add(new ItemStack(Block.blockRedstone)); - jewel.add(new ItemStack(Block.blockLapis)); - jewel.add(new ItemStack(Block.obsidian)); - jewel.add(new ItemStack(Item.diamond)); - jewel.add(new ItemStack(Item.emerald)); - jewel.add(new ItemStack(Item.enderPearl)); - jewel.add(new ItemStack(Item.netherStar)); - - //Jewelry - jewelry.add(new ItemStack(ItemList.ring)); - jewelry.add(new ItemStack(ItemList.necklace)); - } - - public static void jamcrafters() - { - jamcraftPlayers.add("allout58"); - jamcraftPlayers.add("ChewBaker"); - jamcraftPlayers.add("domi1819"); - jamcraftPlayers.add("founderio"); - jamcraftPlayers.add("Ironhammer354"); - jamcraftPlayers.add("isomgirls6"); - jamcraftPlayers.add("jmjmjm439"); - jamcraftPlayers.add("Joban"); - jamcraftPlayers.add("KJ4IPS"); - jamcraftPlayers.add("Mitchellbrine"); - jamcraftPlayers.add("MrComputerGhost"); - jamcraftPlayers.add("MrKol999"); - jamcraftPlayers.add("Resinresin"); - jamcraftPlayers.add("sci4me"); - jamcraftPlayers.add("sor1n"); - jamcraftPlayers.add("theminecoder"); - jamcraftPlayers.add("YSPilot"); - jamcraftPlayers.add("direwolf20"); - } - - public static void addMetals() - { - int index = 0, index2 = 0; - while(index < OreDictionary.getOreNames().length) - { - while(index2 < OreDictionary.getOres(OreDictionary.getOreNames()[index]).size()) - { - ItemStack stack = OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2).copy(); - if(stack.getItemDamage() == Short.MAX_VALUE) stack.setItemDamage(0); - if(stack.getUnlocalizedName().toLowerCase().contains("ingot") && !JewelrycraftUtil.metal.contains(stack)) - metal.add(OreDictionary.getOres(OreDictionary.getOreNames()[index]).get(index2)); - index2++; - } - index2 = 0; - index++; - } - if(!metal.contains(new ItemStack(Item.ingotGold)))metal.add(new ItemStack(Item.ingotGold)); - if(!metal.contains(new ItemStack(Item.ingotIron)))metal.add(new ItemStack(Item.ingotIron)); - } - - public static boolean isModifier(ItemStack item) - { - Iterator<ItemStack> i = modifiers.iterator(); - - while (i.hasNext()) - { - ItemStack temp = i.next(); - if (temp.itemID == item.itemID && temp.getItemDamage() == item.getItemDamage()) - return true; - } - return false; - } - - public static boolean isJewel(ItemStack item) - { - Iterator<ItemStack> i = jewel.iterator(); - - while (i.hasNext()) - { - ItemStack temp = i.next(); - if (temp.itemID == item.itemID && temp.getItemDamage() == item.getItemDamage()) - return true; - } - return false; - } - - public static boolean isJewelry(ItemStack item) - { - Iterator<ItemStack> i = jewelry.iterator(); - - while (i.hasNext()) - { - ItemStack temp = i.next(); - if (temp.itemID == item.itemID && temp.getItemDamage() == item.getItemDamage()) - return true; - } - return false; - } -} diff --git a/common/darkknight/jewelrycraft/util/PlayerUtils.java b/common/darkknight/jewelrycraft/util/PlayerUtils.java deleted file mode 100644 index 65b8a17..0000000 --- a/common/darkknight/jewelrycraft/util/PlayerUtils.java +++ /dev/null @@ -1,57 +0,0 @@ -package darkknight.jewelrycraft.util; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.integrated.IntegratedServer; -import cpw.mods.fml.common.FMLCommonHandler; - -/** - * Code taken from OpenBlocks - */ -public class PlayerUtils -{ - public static boolean isPlayerOp(String username) - { - username = username.toLowerCase(); - - MinecraftServer server = FMLCommonHandler.instance().getSidedDelegate().getServer(); - - // SP and LAN - if (server.isSinglePlayer()) { - if (server instanceof IntegratedServer) return server.getServerOwner().equals(username); - return server.getConfigurationManager().getOps().contains(username); - } - - // SMP - return server.getConfigurationManager().getOps().contains(username); - } - - public static NBTTagCompound getModPlayerPersistTag(EntityPlayer player, String modName) - { - - 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.setCompoundTag(EntityPlayer.PERSISTED_NBT_TAG, persistTag); - } - - NBTTagCompound modTag = null; - if (persistTag.hasKey(modName)) - { - modTag = persistTag.getCompoundTag(modName); - } else - { - modTag = new NBTTagCompound(); - persistTag.setCompoundTag(modName, modTag); - } - - return modTag; - } -}
\ No newline at end of file diff --git a/common/darkknight/jewelrycraft/worldGen/Generation.java b/common/darkknight/jewelrycraft/worldGen/Generation.java deleted file mode 100644 index 32da73d..0000000 --- a/common/darkknight/jewelrycraft/worldGen/Generation.java +++ /dev/null @@ -1,46 +0,0 @@ -package darkknight.jewelrycraft.worldGen; - -import java.util.Random; - -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 -{ - @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; - } - } - - private void generateEnd(World world, Random random, int i, int 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); - world.setBlock(x, y, z, BlockList.shadowOre.blockID); - if(random.nextInt(3) == 0) world.setBlock(x + random.nextInt(2), y + random.nextInt(1), z + random.nextInt(2), BlockList.shadowOre.blockID); - } - } - - private void generateNether(World world, Random random, int i, int j) - {} -} diff --git a/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java b/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java deleted file mode 100644 index 2c740f5..0000000 --- a/common/darkknight/jewelrycraft/worldGen/village/ComponentJewelry.java +++ /dev/null @@ -1,354 +0,0 @@ -package darkknight.jewelrycraft.worldGen.village; - -import java.util.List; -import java.util.Random; - -import darkknight.jewelrycraft.block.BlockList; -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; - -import net.minecraft.block.Block; -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.ComponentVillage; -import net.minecraft.world.gen.structure.ComponentVillageStartPiece; -import net.minecraft.world.gen.structure.StructureBoundingBox; -import net.minecraft.world.gen.structure.StructureComponent; - -public class ComponentJewelry extends ComponentVillage -{ - private int averageGroundLevel = -1; - - public ComponentJewelry() - { - } - - public ComponentJewelry(ComponentVillageStartPiece par1ComponentVillageStartPiece, int par2, Random par3Random, StructureBoundingBox par4StructureBoundingBox, int par5) - { - super(par1ComponentVillageStartPiece, par2); - this.coordBaseMode = par5; - this.boundingBox = par4StructureBoundingBox; - } - - @SuppressWarnings("rawtypes") - public static ComponentJewelry buildComponent (ComponentVillageStartPiece 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... - */ - public boolean addComponentParts (World world, Random random, StructureBoundingBox sbb) - { - if (this.averageGroundLevel < 0) - { - this.averageGroundLevel = this.getAverageGroundLevel(world, sbb); - - if (this.averageGroundLevel < 0) - { - return true; - } - - this.boundingBox.offset(0, this.averageGroundLevel - this.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) - */ - this.fillWithBlocks(world, sbb, 0, 0, 6, 10, 5, 11, 0, 0, false); - this.fillWithBlocks(world, sbb, 2, 0, 0, 8, 5, 5, 0, 0, false); - //Pillars - this.fillWithBlocks(world, sbb, 2, 0, 0, 2, 3, 0, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 2, 0, 3, 2, 3, 3, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 8, 0, 0, 8, 3, 0, Block.wood.blockID, Block.wood.blockID, false); - this.fillWithBlocks(world, sbb, 8, 0, 3, 8, 3, 3, Block.wood.blockID, Block.wood.blockID, false); - - //Walls - this.fillWithBlocks(world, sbb, 2, 0, 1, 2, 3, 2, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 2, 0, 4, 2, 3, 5, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 8, 0, 1, 8, 3, 2, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 8, 0, 4, 8, 3, 5, Block.planks.blockID, Block.planks.blockID, false); - this.fillWithBlocks(world, sbb, 3, 0, 0, 7, 3, 0, Block.planks.blockID, Block.planks.blockID, false); - - this.fillWithBlocks(world, sbb, 0, 0, 6, 10, 3, 6, Block.cobblestone.blockID, Block.cobblestone.blockID, false); - this.fillWithBlocks(world, sbb, 0, 0, 11, 10, 3, 11, Block.cobblestone.blockID, Block.cobblestone.blockID, false); - this.fillWithBlocks(world, sbb, 0, 0, 6, 0, 3, 11, Block.cobblestone.blockID, Block.cobblestone.blockID, false); - this.fillWithBlocks(world, sbb, 10, 0, 6, 10, 3, 11, Block.cobblestone.blockID, Block.cobblestone.blockID, false); - - //Roof - for(int i = 3; i <= 7; i++) - for(int j = 1; j <= 5; j++) - this.placeBlockAtCurrentPosition(world, Block.woodSingleSlab.blockID, 2, i, 4, j, sbb); - - for(int i = 3; i <= 7; i++) - for(int j = 6; j <= 6; j++) - this.placeBlockAtCurrentPosition(world, Block.stoneSingleSlab.blockID, 0, i, 4, j, sbb); - - for(int i = 1; i <= 9; i++) - for(int j = 7; j <= 10; j++) - this.placeBlockAtCurrentPosition(world, Block.stoneSingleSlab.blockID, 3, i, 4, j, sbb); - - for(int i = 2; i <= 8; i++) - this.placeBlockAtCurrentPosition(world, Block.woodDoubleSlab.blockID, 2, i, 4, 0, sbb); - - for(int i = 1; i <= 5; i++){ - this.placeBlockAtCurrentPosition(world, Block.woodDoubleSlab.blockID, 2, 2, 4, i, sbb); - this.placeBlockAtCurrentPosition(world, Block.woodDoubleSlab.blockID, 2, 8, 4, i, sbb); - } - - for(int i = 0; i <= 2; i++){ - this.placeBlockAtCurrentPosition(world, Block.stoneDoubleSlab.blockID, 0, i, 4, 6, sbb); - this.placeBlockAtCurrentPosition(world, Block.stoneDoubleSlab.blockID, 0, i + 8, 4, 6, sbb); - } - - for(int i = 7; i <= 11; i++){ - this.placeBlockAtCurrentPosition(world, Block.stoneDoubleSlab.blockID, 0, 0, 4, i, sbb); - this.placeBlockAtCurrentPosition(world, Block.stoneDoubleSlab.blockID, 0, 10, 4, i, sbb); - } - - for(int i = 0; i <= 10; i++) - this.placeBlockAtCurrentPosition(world, Block.stoneDoubleSlab.blockID, 0, i, 4, 11, sbb); - - //Base - for(int i = 2; i <= 8; i++) - for(int j = 0; j <= 5; j++) - this.placeBlockAtCurrentPosition(world, Block.planks.blockID, 1, i, 0, j, sbb); - this.fillWithBlocks(world, sbb, 0, 0, 6, 10, 0, 11, Block.stoneBrick.blockID, Block.stoneBrick.blockID, false); - - for(int i = 6; i <= 10; i++) - this.placeBlockAtCurrentPosition(world, Block.stoneDoubleSlab.blockID, 0, 5, 0, i, sbb); - - for(int i = 7; i <= 10; i++){ - this.placeBlockAtCurrentPosition(world, Block.stoneBrick.blockID, 3, 1, 0, i, sbb); - this.placeBlockAtCurrentPosition(world, Block.stoneBrick.blockID, 3, 9, 0, i, sbb); - } - - //Decorations - this.placeDoorAtCurrentPosition(world, sbb, random, 6, 1, 0, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); - this.placeDoorAtCurrentPosition(world, sbb, random, 5, 1, 6, this.getMetadataWithOffset(Block.doorWood.blockID, 1)); - - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 3, 2, 0, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 4, 2, 0, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 2, 1, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 2, 2, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 2, 4, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 2, 2, 5, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 8, 2, 1, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 8, 2, 2, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 8, 2, 4, sbb); - this.placeBlockAtCurrentPosition(world, Block.thinGlass.blockID, 0, 8, 2, 5, sbb); - - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 6, 3, 1, sbb); - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 3, 3, 3, sbb); - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 7, 3, 3, sbb); - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 5, 3, 5, sbb); - - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 5, 3, 7, sbb); - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 5, 3, 10, sbb); - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 1, 3, 8, sbb); - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 1, 3, 9, sbb); - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 9, 3, 8, sbb); - this.placeBlockAtCurrentPosition(world, Block.torchWood.blockID, 0, 9, 3, 9, sbb); - - int bgCarpetColor = random.nextInt(16); - - for(int i = 4; i <= 7; i++) - for(int j = 1; j <= 5; j++) - this.placeBlockAtCurrentPosition(world, Block.carpet.blockID, bgCarpetColor, i, 1, j, sbb); - - generateChest(world, 3, 1, 1, 0, random, sbb, 2, 6); - generateDisplayer(world, 3, 1, 2, (coordBaseMode == 0 || coordBaseMode == 2)?1:2, random, sbb); - placeBlockAtCurrentPosition(world, BlockList.jewelCraftingTable.blockID, (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, 2, 6); - - generateFurnace(world, 1, 1, 7, 0, random, sbb, 1, 2, true); - generateFurnace(world, 1, 2, 7, 0, random, sbb, 2, 3, true); - generateFurnace(world, 1, 3, 7, 0, random, sbb, 1, 3, true); - generateFurnace(world, 1, 1, 10, 0, random, sbb, 1, 2, true); - generateFurnace(world, 1, 2, 10, 0, random, sbb, 2, 3, true); - generateFurnace(world, 1, 3, 10, 0, random, sbb, 1, 3, true); - - 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()); - - generateIngotChest(world, 9, 1, 7, 0, random, sbb, 3, 12, Block.chest, 5); - generateIngotChest(world, 9, 1, 8, 0, random, sbb, 5, 16, Block.chest, 3); - generateIngotChest(world, 9, 1, 9, 0, random, sbb, 3, 10, Block.chestTrapped, 2); - generateIngotChest(world, 9, 1, 10, 0, random, sbb, 3, 9, Block.chestTrapped, 6); - - - for (int l = 0; l < 6; ++l) - { - for (int i1 = 2; i1 < 9; ++i1) - { - this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); - this.fillCurrentPositionBlocksDownwards(world, Block.cobblestone.blockID, 0, i1, -1, l, sbb); - } - } - - for (int l = 6; l < 12; ++l) - { - for (int i1 = 0; i1 < 11; ++i1) - { - this.clearCurrentPositionBlocksUpwards(world, i1, 9, l, sbb); - this.fillCurrentPositionBlocksDownwards(world, Block.cobblestone.blockID, 0, i1, -1, l, sbb); - } - } - - this.spawnVillagers(world, sbb, 3, 1, 3, 1); - - return true; - } - - public void generateChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) - { - int i1 = this.getXWithOffset(i, k); - int j1 = this.getYWithOffset(j); - int k1 = this.getZWithOffset(i, k); - int t = random.nextInt(max - min + 1) + min; - this.placeBlockAtCurrentPosition(world, Block.chest.blockID, metadata, i, j, k, sbb); - TileEntityChest chest = (TileEntityChest)world.getBlockTileEntity(i1, j1, k1); - while(chest != null && t > 0) - { - chest.setChestGuiName("Jeweler's Chest"); - if(random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), JewelrycraftUtil.modifiers.get(random.nextInt(JewelrycraftUtil.modifiers.size()))); - else chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), JewelrycraftUtil.jewel.get(random.nextInt(JewelrycraftUtil.jewel.size()))); - t--; - } - } - - 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 = this.getXWithOffset(i, k); - int j1 = this.getYWithOffset(j); - int k1 = this.getZWithOffset(i, k); - int t = random.nextInt(max - min + 1) + min; - this.placeBlockAtCurrentPosition(world, chestB.blockID, metadata, i, j, k, sbb); - TileEntityChest chest = (TileEntityChest)world.getBlockTileEntity(i1, j1, k1); - while(chest != null && t > 0) - { - chest.setChestGuiName("Ingot Chest"); - if(random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), new ItemStack(JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())).getItem(), 2 + random.nextInt(randomAmount))); - t--; - } - } - - public void generateTrappedChest(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, int min, int max) - { - int i1 = this.getXWithOffset(i, k); - int j1 = this.getYWithOffset(j); - int k1 = this.getZWithOffset(i, k); - int t = random.nextInt(max - min + 1) + min; - this.placeBlockAtCurrentPosition(world, Block.chestTrapped.blockID, metadata, i, j, k, sbb); - TileEntityChest chest = (TileEntityChest)world.getBlockTileEntity(i1, j1, k1); - while(chest != null && t > 0) - { - chest.setChestGuiName("Jeweler's Chest"); - if(random.nextBoolean()) chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), JewelrycraftUtil.modifiers.get(random.nextInt(JewelrycraftUtil.modifiers.size()))); - else chest.setInventorySlotContents(random.nextInt(chest.getSizeInventory()), JewelrycraftUtil.jewel.get(random.nextInt(JewelrycraftUtil.jewel.size()))); - t--; - } - } - - public void generateDisplayer(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb) - { - int i1 = this.getXWithOffset(i, k); - int j1 = this.getYWithOffset(j); - int k1 = this.getZWithOffset(i, k); - placeBlockAtCurrentPosition(world, BlockList.displayer.blockID, metadata, i, j, k, sbb); - TileEntityDisplayer displayer = (TileEntityDisplayer)world.getBlockTileEntity(i1, j1, k1); - if(displayer != null) - { - ItemStack ring = new ItemStack(ItemList.ring); - JewelryNBT.addMetal(ring, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); - JewelryNBT.addModifier(ring, JewelrycraftUtil.modifiers.get(random.nextInt(JewelrycraftUtil.modifiers.size()))); - JewelryNBT.addJewel(ring, JewelrycraftUtil.jewel.get(random.nextInt(JewelrycraftUtil.jewel.size()))); - if(JewelryNBT.isModifierEffectType(ring)) JewelryNBT.addMode(ring, "Activated"); - if(JewelryNBT.isJewelX(ring, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(ring, new ItemStack(Item.book))) - JewelryNBT.addMode(ring, "Disenchant"); - displayer.object = ring; - displayer.quantity = 1; - displayer.hasObject = true; - } - } - - public void generateSmelter(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean isEmpty) - { - int i1 = this.getXWithOffset(i, k); - int j1 = this.getYWithOffset(j); - int k1 = this.getZWithOffset(i, k); - placeBlockAtCurrentPosition(world, BlockList.smelter.blockID, metadata, i, j, k, sbb); - TileEntitySmelter smelter = (TileEntitySmelter)world.getBlockTileEntity(i1, j1, k1); - if(smelter != null && !isEmpty) - { - smelter.moltenMetal = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); - smelter.hasMoltenMetal = true; - } - } - - public void generateMolder(World world, int i, int j, int k, int metadata, Random random, StructureBoundingBox sbb, boolean hasMold, boolean hasStuff) - { - int i1 = this.getXWithOffset(i, k); - int j1 = this.getYWithOffset(j); - int k1 = this.getZWithOffset(i, k); - placeBlockAtCurrentPosition(world, BlockList.molder.blockID, metadata, i, j, k, sbb); - TileEntityMolder molder = (TileEntityMolder)world.getBlockTileEntity(i1, j1, k1); - if(molder != null) - { - if(hasMold){ - int meta = random.nextInt(ItemMolds.moldsItemNames.length + 1); - 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()))); - if(meta == 0) molder.jewelBase = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); - else molder.jewelBase = ring; - molder.hasJewelBase = true; - } - } - } - } - - 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 = this.getXWithOffset(i, k); - int j1 = this.getYWithOffset(j); - int k1 = this.getZWithOffset(i, k); - placeBlockAtCurrentPosition(world, Block.furnaceIdle.blockID, metadata, i, j, k, sbb); - TileEntityFurnace furnace = (TileEntityFurnace)world.getBlockTileEntity(i1, j1, k1); - if(furnace != null) - { - if(random.nextBoolean()) furnace.setInventorySlotContents(1, new ItemStack(Item.coal, 1 + random.nextInt(16))); - if(hasMetal){ - ItemStack metal = JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size())); - furnace.setInventorySlotContents(2, new ItemStack(metal.getItem(), random.nextInt(max - min + 1) + min)); - } - } - } - - /** - * Returns the villager type to spawn in this component, based on the number of villagers already spawned. - */ - protected int getVillagerType (int par1) - { - return 3000; - } -}
\ No newline at end of file diff --git a/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java b/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java deleted file mode 100644 index 2a5ba6f..0000000 --- a/common/darkknight/jewelrycraft/worldGen/village/JCTrades.java +++ /dev/null @@ -1,151 +0,0 @@ -package darkknight.jewelrycraft.worldGen.village; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.item.Item; -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.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -public class JCTrades implements IVillageTradeHandler -{ - - public JCTrades() - { - super(); - } - - @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(8); - ingredient = new ItemStack(Item.emerald, 2 + random.nextInt(2)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 2 + random.nextInt(2)); - break; - } - case 1: - { - result = new ItemStack(ItemList.molds, 5 + random.nextInt(7), random.nextInt(2)); - ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(1)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(2)); - break; - } - case 2: - { - result = new ItemStack(ItemList.thiefGloves); - ingredient = new ItemStack(Item.emerald, 16 + random.nextInt(8)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 8 + random.nextInt(4)); - break; - } - case 3: - { - result = new ItemStack(BlockList.displayer, 1 + random.nextInt(6)); - ingredient = new ItemStack(Item.emerald, 3 + random.nextInt(8)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 3 + random.nextInt(8)); - break; - } - case 4: - { - result = new ItemStack(BlockList.jewelCraftingTable); - ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(2)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(2)); - break; - } - case 5: - { - result = new ItemStack(BlockList.shadowOre, 1 + random.nextInt(16)); - ingredient = new ItemStack(Item.emerald, 3 + random.nextInt(4)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 3 + random.nextInt(4)); - break; - } - case 6: - { - result = new ItemStack(BlockList.molder, 5 + random.nextInt(5)); - ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(1)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(1)); - break; - } - case 7: - { - result = new ItemStack(BlockList.smelter); - ingredient = new ItemStack(Item.emerald, 1 + random.nextInt(2)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 1 + random.nextInt(2)); - break; - } - case 8: - { - int end = random.nextInt(JewelrycraftUtil.modifiers.size()); - result = JewelrycraftUtil.modifiers.get(end); - if(JewelrycraftUtil.modifiers.size() - 1 - end >= 3) - { - result.stackSize = 1 + random.nextInt(JewelrycraftUtil.modifiers.size() - end); - int value = end; - if(value > 64) value = 64; - ingredient = new ItemStack(Item.emerald, 3 + random.nextInt(value)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 4 + random.nextInt(value)); - } - else - { - result.stackSize = 1 + random.nextInt(7); - ingredient = new ItemStack(Item.emerald, result.stackSize/2 + 1 + random.nextInt(7)); - ingredient2 = new ItemStack(Item.emerald, result.stackSize/2 + 1 + random.nextInt(4)); - } - if(result.getMaxStackSize()<=1) result.stackSize = 1; - break; - } - case 9: - { - int end = random.nextInt(JewelrycraftUtil.jewel.size()); - result = JewelrycraftUtil.jewel.get(end); - result.stackSize = 1 + random.nextInt(JewelrycraftUtil.jewel.size() - end); - if(JewelrycraftUtil.jewel.size() - 1 - end >= 1) - { - int value = end; - if(value > 64) value = 64; - ingredient = new ItemStack(Item.emerald, 2 + random.nextInt(value)); - if(random.nextBoolean()) ingredient2 = new ItemStack(Item.emerald, 2 + random.nextInt(value)); - } - else - { - ingredient = new ItemStack(Block.blockEmerald, 16 + random.nextInt(32)); - ingredient2 = new ItemStack(Block.blockEmerald, 8 + random.nextInt(48)); - } - break; - } - default: - { - result = new ItemStack(ItemList.ring, 1, 0); - JewelryNBT.addMetal(result, JewelrycraftUtil.metal.get(random.nextInt(JewelrycraftUtil.metal.size()))); - JewelryNBT.addModifier(result, JewelrycraftUtil.modifiers.get(random.nextInt(JewelrycraftUtil.modifiers.size()))); - JewelryNBT.addJewel(result, JewelrycraftUtil.jewel.get(random.nextInt(JewelrycraftUtil.jewel.size()))); - if(JewelryNBT.isModifierEffectType(result)) JewelryNBT.addMode(result, "Activated"); - if(JewelryNBT.isJewelX(result, new ItemStack(Item.netherStar)) && JewelryNBT.isModifierX(result, new ItemStack(Item.book))) - JewelryNBT.addMode(result, "Disenchant"); - ingredient = new ItemStack(Item.emerald, 16 + random.nextInt(20)); - ingredient2 = new ItemStack(Block.blockEmerald, 5 + random.nextInt(5)); - } - } - - recipeList.addToListWithCheck(new MerchantRecipe(ingredient, ingredient2, result)); - } - } -}
\ No newline at end of file diff --git a/common/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java b/common/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java deleted file mode 100644 index e53b4d7..0000000 --- a/common/darkknight/jewelrycraft/worldGen/village/VillageJewelryHandler.java +++ /dev/null @@ -1,29 +0,0 @@ -package darkknight.jewelrycraft.worldGen.village; - -import java.util.List; -import java.util.Random; - -import net.minecraft.world.gen.structure.ComponentVillageStartPiece; -import net.minecraft.world.gen.structure.StructureVillagePieceWeight; -import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler; - -public class VillageJewelryHandler implements IVillageCreationHandler -{ - @Override - public StructureVillagePieceWeight getVillagePieceWeight (Random random, int i) - { - return new StructureVillagePieceWeight(ComponentJewelry.class, 30, i + random.nextInt(4)); - } - - @Override - public Class<?> getComponentClass () - { - return ComponentJewelry.class; - } - - @Override - public Object buildComponent (StructureVillagePieceWeight villagePiece, ComponentVillageStartPiece 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 @@ -0,0 +1,164 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# For Cygwin, ensure paths are in UNIX format before anything is touched. +if $cygwin ; then + [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` +fi + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >&- +APP_HOME="`pwd -P`" +cd "$SAVED" >&- + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/resources/assets/jewelrycraft/Changelog.txt b/resources/assets/jewelrycraft/Changelog.txt deleted file mode 100644 index b1af1e8..0000000 --- a/resources/assets/jewelrycraft/Changelog.txt +++ /dev/null @@ -1,83 +0,0 @@ -- Added the Shadow Block -- Added a enchanting/disenchanting/enchantments transfering ring made out of a Netherstar as jewel and book as modifier -- Added a creative tab that generates all the possible ingot+jewel+modifier combinations -- Fixed(?) bug with knightmetal ingots from Twilight Forest not being detected as ingots -- Fixed weird empty spaces generated by Jewelries in villages -- Added crystals -- Reworked the coloring system, thus fixed some rings not having proper colors -- Fixed(?) the entity holding ring storing entities that don't extend EntityLivingBase -- Added generation of ingots in the Jewelry village house -- Added 4 new possible jewels: Redstone, Redstone Block, Lapis and Lapis Block -- Removed animation from the Shadow Ore -- Made Shadow Ore more common -- Balanced Villager trades -- Fixed Displayer text rendering in front of everything -- Added the Jewel Altar -- Added a guide - -TODO -- Make it so you can smelt ores in the smelter -- Make a way so that the ingot affects the jewels somehow -- Add a ring of Resistance -- Think of a way to balance the rings -- (MAYBE) Shadow Ring -> Shadow ingot ring, nether star, obsidian - makes you appear as hostile so mobs actually leave you alone -- Elemental jewellery -> punch a creature with it in your hand to do different things, lightning, fling into the air, set on fire, - encase in ice/fences/iron bars, turn into a sheep (like that spell from Warcraft 2, if anyone remembers that), blindness, extreme - knockback, charm (turns on your enemies), tame - tames any tamable mob -- Add Necklaces, bracelets and earrings; Necklaces could have an AOE effect; -- Shadow armor and tools -- Add an item that can store rings (maybe a keychain?) -- Monks Ring -> ups your unarmed damage / block breaking speed / ability to break harder blocks with bare hands, made with a block of iron and a jewel. -- Ring of Strength -> self explanatory -- (MAYBE) Add a Shadow Merchant (a villager that trades only shadow related stuff and appears randomly at night) -- Add a blast protection jewelry -- Add a jewelery of the Arrow Catcher - each tier of protection gives you a certain % chance of catching arrows instead of being hit by them. -- (MAYBE) Render the rings on the character -- In the case of passive benefits, might it be possible to make it so, with fire resistance for example, it refreshes the buff as long as you're not in fire, - but as soon as you are it gains a limited duration (better jewels for longer durations) that, when it expires there goes the buff and you can burn to death. - Then you'd need to avoid being on fire for a cooldown period of a few seconds before it could refresh back to the passive state (this part reduced by better jewels)? - Invisibility could turn off for a period when you punch a mob, that kind of thing. -- Glowstone Block (Modifier): Places a torch-like blob of light in exchange for 1/2 a heart, higher-tier jewels increase the light emitted. -- Ghast Tear (Modifier): Allows for a limited-duration flight buff, say starting at 3 seconds all the way to 60 when combined with a nether star. When the timer expires - you have to land again to reset the usage. -- Any Color Dye (Modifier): Right-click a sheep to dye it the chosen color. Posted Image -- Beacon (Modifier): Portable beacon, with the tier based on the jewel added. Shift + Right-click to open the beacon GUI, which would work just like the vanilla one. -- Water Bucket (Modifier): Right-click the air to start a storm. -- Lava Bucket (Modifier): Passively adds fire aspect to your weapons and tools. -- Sand (Modifier): Shift + right-click to advance the day 1 hour. Only usable once per day by default, better jewels increase this. -- Glass (Jewel): Right-click while holding the ring to zoom in! -- Lapis Piece (Modifier): Passively adds a slowing effect to your weapons. Better jewels improve this. -- Lapis Block (Jewel): A jewel that looks pretty but doesn't do much else. -- Bone (Jewel): Right-click to trade 1/2 a hunger for a bonemeal effect. Otherwise a white jewel with no benefit. -- Carrot (Modifier): Right-click to trade 1/2 a heart for 1/2 a hunger. Better jewels increase these values. 4 hearts for a steaks-worth of food? XD -- Diamond Block (Jewel): When on a gold ring it turns it into "Ostentatious Wedding Ring". Otherwise the same (or a little better than) diamond. -- Golden Apple (Jewel): Ring becomes named "Discord". Right-clicking gives an entirely random buff, a debuff, launches you high into the air, teleports you to a - random location, sets you on fire, spawns a pig or makes lightning strike. Pretty much anything can happen, and the more biased to negative results the better. :P -- Enchanted Golden Apple (Jewel): As above, but more biased towards positive effects. Hail Discordia! -- Name Tag (Jewel): Right-clicking a mob gives it a random name (bonus points if it's from a user-editable list!) -- Add randomly generated "named" loot to dungeon chests! Ring of Displacement (lets you tele randomly like an enderman), Necklace of Second Chances - (heals you for 50 when you drop to 3 or fewer hearts with a cooldown of ~1 minute), Trinket of the Gale (arrow/fireball immunity!), Goggles of the Merfolk - (water breathing!). Endless possibilities! :D -- Also! Trinkets and Belts! - -Trinkets would probably require a new mold, and should bring out the more passive side of items (like, say, instead of opening an enderchest, it automatically -sucks items into your ender chest, or instead of teleporting you it prevents endermen from teleporting away from you [which could be done pretty easily with a -fake screen overlay that's treated like the pumpkin one]). - -Belts... I'd personally see belts as a ring crafted with a piece of Leather as the "jewel" and could provide conditional buffs proportionate to some factor, like -say increasing strength buff the lower your HP is. The idea being that the belt should assist you in a useful way, but only when its needed. I'd probably limit it -to HP and Hunger as determining factors. Things like resistance, regeneration and strength could be applied at low HP, while things like jump boost, haste and speed -could be applied at high hunger meter values. I wouldn't tie anything to having high/max HP or no hunger since those would be things that players normally try to -avoid or always have. - -And as for goggles... A new mold for the base goggle template, and have it only accept "jewel"-typed items (as "lenses"). If you can't think of where to put a neat -effect it should probably end up on goggles. Off the top of my head I can think of a few neat uses: Ore Radar (2x diamonds), Clear Vision (2x glass), Mob Spawnable -Area Highlighting (2x ender pearl), Compass and Clock overlays (doy), Coordinate HUD (map and glass), Speedometer (glass and enderpearl), Altimiter (glass and emerald), -Thermometer (diamond and glass)... Required Pickaxe Level HUD (no idea). XD - -Oooh! And last but not least: Cursed items! I'd probably start with an upgraded jewelry table requiring a regular one, a brewing stand, a piece of glass and a stick. -You could initially use this upgraded stand to add additional effects, or merge two items into one. Should operate kind of like a furnace, but only accepts blaze powder -and rods as fuel (about 1 rod or 2 powder = 1 process, the idea being using the blaze stuff like welding materials). But the other use would be cursing jewelry! Why? -Because nothing says "I hate you so much." like a non-dequipable piece of jewelry that gives you blindness and slowness! Slimeballs could add a cursed sticky effect -that prevents you dropping it without dying. Fermented spider eye, like with brewing potions, could corrupt the effects on the item. Flint and steel could randomly set -you on fire. Eye of Ender could randomly tell the world your coordinates.
\ No newline at end of file diff --git a/resources/assets/jewelrycraft/Displayer.tcn b/resources/assets/jewelrycraft/Displayer.tcn Binary files differdeleted file mode 100644 index 06113a0..0000000 --- a/resources/assets/jewelrycraft/Displayer.tcn +++ /dev/null diff --git a/resources/assets/jewelrycraft/Smelter.tcn b/resources/assets/jewelrycraft/Smelter.tcn Binary files differdeleted file mode 100644 index 2f6597f..0000000 --- a/resources/assets/jewelrycraft/Smelter.tcn +++ /dev/null diff --git a/resources/assets/jewelrycraft/lang/en_US.lang b/resources/assets/jewelrycraft/lang/en_US.lang deleted file mode 100644 index 528ba74..0000000 --- a/resources/assets/jewelrycraft/lang/en_US.lang +++ /dev/null @@ -1,47 +0,0 @@ -item.Jewelrycraft.thiefGloves.name=Thiefing Gloves -item.Jewelrycraft.ingotShadow.name=Shadow Ingot -item.Jewelrycraft.mold.ingot.name=Ingot Mold -item.Jewelrycraft.mold.ring.name=Ring Mold -item.Jewelrycraft.mold.necklace.name=Necklace Mold -item.Jewelrycraft.mold.clayIngot.name=Clay Ingot Mold -item.Jewelrycraft.mold.clayRing.name=Clay Ring Mold -item.Jewelrycraft.mold.clayNecklace.name=Clay Necklace Mold -item.Jewelrycraft.ring.name=Ring -item.Jewelrycraft.necklace.name=Necklace -item.Jewelrycraft.crystal.name=Crystal -item.Jewelrycraft.guide.name=Jewelrycraft Guide -tile.Jewelrycraft.oreShadow.name=Shadow Ore -tile.Jewelrycraft.blockShadow.name=Shadow Block -tile.Jewelrycraft.glow.name=Glow -tile.Jewelrycraft.smelter.name=Smelter -tile.Jewelrycraft.molder.name=Molder -tile.Jewelrycraft.displayer.name=Storage Displayer -tile.Jewelrycraft.jewelCraftingTable.name=Jeweler's Crafting Table -tile.Jewelrycraft.altar.name=Jewel Altar -itemGroup.JewelryCraft=Jewelrycraft -itemGroup.Rings=Jewelrycraft Rings -itemGroup.Necklaces=Jewelrycraft Necklaces -chatmessage.Jewelrycraft.molder.addedmold=Added %s to molder. -chatmessage.Jewelrycraft.molder.metaliscooling=Molten metal is cooling... -chatmessage.Jewelrycraft.molder.moldisempty=Mold is currently empty. -chatmessage.Jewelrycraft.molder.moldismissing=Molder does not contain a mold. -chatmessage.Jewelrycraft.molder.hasmoltenmetal=You can't remove the mold. It contains molten metal! -chatmessage.Jewelrycraft.smelter.alreadyhasingot=The Smelter already contains a %s -chatmessage.Jewelrycraft.smelter.hasmolteningot=The Smelter contains a molten %s -chatmessage.Jewelrycraft.smelter.itemneedstobeingot=The item needs to be an ingot! -chatmessage.Jewelrycraft.smelter.itemrenamedtoingot=Nice try, but renaming it to an ingot doesn't make it an ingot :p You can't fool me player! -chatmessage.Jewelrycraft.smelter.molderhasmoltenmetal=The Molder already has molten metal in it! -chatmessage.Jewelrycraft.smelter.molderhasnomold=The Molder doesn't have a mold in it! You might as well pour this stuff on the ground, eh? -chatmessage.Jewelrycraft.smelter.modlerhasitem=The Molder contains an item in it. Now you wouldn't want it to be destroyed, would you? -chatmessage.Jewelrycraft.smelter.molderismissing=You need a Molder in front of this block in order to pour the molten metal! -chatmessage.Jewelrycraft.smelter.nowsmeltingingot=Smelter is now smelting a %s. -chatmessage.Jewelrycraft.smelter.metalismelting=%s is being melted. -chatmessage.Jewelrycraft.smelter.empty=The Smelter is empty. -chatmessage.Jewelrycraft.table.hasenditem=First take out the crafted jewel before inserting new stuff. -chatmessage.Jewelrycraft.table.missingjewelryandmodifierorjewel=You need a jewelry piece and a modifier or a jewel. -chatmessage.Jewelrycraft.table.missingjewelry=You're missing a piece of jewelry. -chatmessage.Jewelrycraft.table.missingmodifierorjewel=You need a modifier or a jewel. -chatmessage.Jewelrycraft.table.iscrafting=The %s is being modified. -chatmessage.Jewelrycraft.table.jewelrymodifiedfull=This piece of jewelry is already modified at maxium. You can't modify it anymore! -chatmessage.Jewelrycraft.table.jewelrycontainsmodifier=The piece of jewelry already contains a modifier. -chatmessage.Jewelrycraft.table.jewelrycontainsjewel=The piece of jewelry already contains a jewel.
\ No newline at end of file diff --git a/resources/assets/jewelrycraft/pack.mcmeta b/resources/assets/jewelrycraft/pack.mcmeta deleted file mode 100644 index 0b04ef8..0000000 --- a/resources/assets/jewelrycraft/pack.mcmeta +++ /dev/null @@ -1,6 +0,0 @@ -{ - "pack": { - "pack_format": 1, - "description": "Jewelrycraft" - } -}
\ No newline at end of file diff --git a/resources/assets/jewelrycraft/textures/blocks/altar_bottom.png b/resources/assets/jewelrycraft/textures/blocks/altar_bottom.png Binary files differdeleted file mode 100644 index 7ca4c6a..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/altar_bottom.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/altar_side.png b/resources/assets/jewelrycraft/textures/blocks/altar_side.png Binary files differdeleted file mode 100644 index 3a69977..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/altar_side.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/altar_top.png b/resources/assets/jewelrycraft/textures/blocks/altar_top.png Binary files differdeleted file mode 100644 index 39210c3..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/altar_top.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow0.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow0.png Binary files differdeleted file mode 100644 index 0b5323d..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow0.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow1.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow1.png Binary files differdeleted file mode 100644 index 16f9908..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow1.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow10.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow10.png Binary files differdeleted file mode 100644 index be70eb5..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow10.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow11.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow11.png Binary files differdeleted file mode 100644 index 1684d9a..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow11.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow12.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow12.png Binary files differdeleted file mode 100644 index ed4ea49..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow12.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow13.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow13.png Binary files differdeleted file mode 100644 index 9b2100a..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow13.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow14.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow14.png Binary files differdeleted file mode 100644 index ea00725..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow14.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow15.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow15.png Binary files differdeleted file mode 100644 index 2140624..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow15.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow2.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow2.png Binary files differdeleted file mode 100644 index f95b111..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow2.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow3.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow3.png Binary files differdeleted file mode 100644 index 0dd5633..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow3.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow4.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow4.png Binary files differdeleted file mode 100644 index a4e926c..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow4.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow5.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow5.png Binary files differdeleted file mode 100644 index 8461ac4..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow5.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow6.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow6.png Binary files differdeleted file mode 100644 index 352d3e4..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow6.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow7.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow7.png Binary files differdeleted file mode 100644 index 9aa0e03..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow7.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow8.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow8.png Binary files differdeleted file mode 100644 index ad21447..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow8.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/blockShadow9.png b/resources/assets/jewelrycraft/textures/blocks/blockShadow9.png Binary files differdeleted file mode 100644 index 01c0fa4..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/blockShadow9.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/displayer.png b/resources/assets/jewelrycraft/textures/blocks/displayer.png Binary files differdeleted file mode 100644 index 155fa53..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/displayer.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/jewelrsCraftingTable.png b/resources/assets/jewelrycraft/textures/blocks/jewelrsCraftingTable.png Binary files differdeleted file mode 100644 index e826bbe..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/jewelrsCraftingTable.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/molder.png b/resources/assets/jewelrycraft/textures/blocks/molder.png Binary files differdeleted file mode 100644 index 5a08164..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/molder.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/oreShadow.png b/resources/assets/jewelrycraft/textures/blocks/oreShadow.png Binary files differdeleted file mode 100644 index ffc48dc..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/oreShadow.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/blocks/smelter.png b/resources/assets/jewelrycraft/textures/blocks/smelter.png Binary files differdeleted file mode 100644 index 4da0c0a..0000000 --- a/resources/assets/jewelrycraft/textures/blocks/smelter.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/entities/jeweler.png b/resources/assets/jewelrycraft/textures/entities/jeweler.png Binary files differdeleted file mode 100644 index fbd01cb..0000000 --- a/resources/assets/jewelrycraft/textures/entities/jeweler.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/gui/chest_ring.png b/resources/assets/jewelrycraft/textures/gui/chest_ring.png Binary files differdeleted file mode 100644 index 66f00cc..0000000 --- a/resources/assets/jewelrycraft/textures/gui/chest_ring.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/gui/guidePage.png b/resources/assets/jewelrycraft/textures/gui/guidePage.png Binary files differdeleted file mode 100644 index c74dab2..0000000 --- a/resources/assets/jewelrycraft/textures/gui/guidePage.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/gui/guidePageFlip.png b/resources/assets/jewelrycraft/textures/gui/guidePageFlip.png Binary files differdeleted file mode 100644 index 0746861..0000000 --- a/resources/assets/jewelrycraft/textures/gui/guidePageFlip.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/clayIngotMold.png b/resources/assets/jewelrycraft/textures/items/clayIngotMold.png Binary files differdeleted file mode 100644 index 0fecb22..0000000 --- a/resources/assets/jewelrycraft/textures/items/clayIngotMold.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/clayNecklaceMold.png b/resources/assets/jewelrycraft/textures/items/clayNecklaceMold.png Binary files differdeleted file mode 100644 index 455f094..0000000 --- a/resources/assets/jewelrycraft/textures/items/clayNecklaceMold.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/clayRingMold.png b/resources/assets/jewelrycraft/textures/items/clayRingMold.png Binary files differdeleted file mode 100644 index 49d2ab1..0000000 --- a/resources/assets/jewelrycraft/textures/items/clayRingMold.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/crystal.png b/resources/assets/jewelrycraft/textures/items/crystal.png Binary files differdeleted file mode 100644 index 563a41f..0000000 --- a/resources/assets/jewelrycraft/textures/items/crystal.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/crystalOverlay.png b/resources/assets/jewelrycraft/textures/items/crystalOverlay.png Binary files differdeleted file mode 100644 index d17e909..0000000 --- a/resources/assets/jewelrycraft/textures/items/crystalOverlay.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/guide.png b/resources/assets/jewelrycraft/textures/items/guide.png Binary files differdeleted file mode 100644 index 39c7f2c..0000000 --- a/resources/assets/jewelrycraft/textures/items/guide.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/ingotMold.png b/resources/assets/jewelrycraft/textures/items/ingotMold.png Binary files differdeleted file mode 100644 index 0575de5..0000000 --- a/resources/assets/jewelrycraft/textures/items/ingotMold.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/ingotShadow.png b/resources/assets/jewelrycraft/textures/items/ingotShadow.png Binary files differdeleted file mode 100644 index e3b3aed..0000000 --- a/resources/assets/jewelrycraft/textures/items/ingotShadow.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/jewelNecklace.png b/resources/assets/jewelrycraft/textures/items/jewelNecklace.png Binary files differdeleted file mode 100644 index 41244d4..0000000 --- a/resources/assets/jewelrycraft/textures/items/jewelNecklace.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/jewelRing.png b/resources/assets/jewelrycraft/textures/items/jewelRing.png Binary files differdeleted file mode 100644 index 4875772..0000000 --- a/resources/assets/jewelrycraft/textures/items/jewelRing.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/necklace.png b/resources/assets/jewelrycraft/textures/items/necklace.png Binary files differdeleted file mode 100644 index 054744d..0000000 --- a/resources/assets/jewelrycraft/textures/items/necklace.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/necklaceMold.png b/resources/assets/jewelrycraft/textures/items/necklaceMold.png Binary files differdeleted file mode 100644 index 0df4b65..0000000 --- a/resources/assets/jewelrycraft/textures/items/necklaceMold.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/ring.png b/resources/assets/jewelrycraft/textures/items/ring.png Binary files differdeleted file mode 100644 index ae59f5a..0000000 --- a/resources/assets/jewelrycraft/textures/items/ring.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/ringMold.png b/resources/assets/jewelrycraft/textures/items/ringMold.png Binary files differdeleted file mode 100644 index 7bab639..0000000 --- a/resources/assets/jewelrycraft/textures/items/ringMold.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/items/thiefGloves.png b/resources/assets/jewelrycraft/textures/items/thiefGloves.png Binary files differdeleted file mode 100644 index b56e925..0000000 --- a/resources/assets/jewelrycraft/textures/items/thiefGloves.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/tileentities/Displayer.png b/resources/assets/jewelrycraft/textures/tileentities/Displayer.png Binary files differdeleted file mode 100644 index 200637b..0000000 --- a/resources/assets/jewelrycraft/textures/tileentities/Displayer.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/tileentities/JewelrsCraftingBench.png b/resources/assets/jewelrycraft/textures/tileentities/JewelrsCraftingBench.png Binary files differdeleted file mode 100644 index 1ee75d0..0000000 --- a/resources/assets/jewelrycraft/textures/tileentities/JewelrsCraftingBench.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/tileentities/Molder.png b/resources/assets/jewelrycraft/textures/tileentities/Molder.png Binary files differdeleted file mode 100644 index c5acc88..0000000 --- a/resources/assets/jewelrycraft/textures/tileentities/Molder.png +++ /dev/null diff --git a/resources/assets/jewelrycraft/textures/tileentities/Smelter.png b/resources/assets/jewelrycraft/textures/tileentities/Smelter.png Binary files differdeleted file mode 100644 index 6ec3595..0000000 --- a/resources/assets/jewelrycraft/textures/tileentities/Smelter.png +++ /dev/null diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info new file mode 100644 index 0000000..e7148b2 --- /dev/null +++ b/src/main/resources/mcmod.info @@ -0,0 +1,16 @@ +[ +{ + "modid": "examplemod", + "name": "Example Mod", + "description": "Example placeholder mod.", + "version": "${version}", + "mcversion": "${mcversion}", + "url": "", + "updateUrl": "", + "authors": ["ExampleDude"], + "credits": "The Forge and FML guys, for making this example", + "logoFile": "", + "screenshots": [], + "dependencies": [] +} +] |
