From 4bb53b5510ef45f67ca9b17d14b7a15bbfd32429 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 5 Jan 2015 22:50:20 +0100 Subject: [PATCH] Changing stuff! --- build.gradle | 14 +- .../{Gemification.java => SPTS.java} | 6 +- .../blocks/BlockCrucible.java | 61 ------- .../blocks/BlockCrucibleFire.java | 68 -------- .../blocks/InitBlocks.java | 30 ---- .../someprettytechystuff/blocks/OreGem.java | 95 ---------- .../{ModelBaseG.java => ModelBaseSPTS.java} | 2 +- .../blocks/models/ModelCrucible.java | 67 ------- .../blocks/models/ModelCrucibleFire.java | 76 -------- .../blocks/models/RendererCrucible.java | 28 --- .../blocks/models/RendererCrucibleFire.java | 28 --- .../models/RendererHoldingTileEntity.java | 73 -------- .../someprettytechystuff/booklet/Chapter.java | 23 --- .../booklet/ChapterList.java | 14 -- .../booklet/ContainerInfoBook.java | 16 -- .../booklet/GuiInfoBook.java | 163 ----------------- .../booklet/ItemInfoBook.java | 47 ----- .../crafting/CrucibleCraftingManager.java | 109 ------------ .../crafting/CrucibleRecipe.java | 19 -- .../crafting/InitCrafting.java | 29 --- .../someprettytechystuff/gen/OreGen.java | 7 +- .../inventory/GuiHandler.java | 30 +--- .../container/ContainerCrucible.java | 101 ----------- .../container/ContainerCrucibleFire.java | 71 -------- .../inventory/gui/GuiCrucible.java | 85 --------- .../inventory/gui/GuiCrucibleFire.java | 36 ---- .../someprettytechystuff/items/InitItems.java | 59 ------- .../someprettytechystuff/items/ItemGem.java | 63 ------- .../tools/{ItemAxeG.java => ItemAxeSPTS.java} | 8 +- .../items/tools/ItemHoeSPTS.java | 32 ++++ .../items/tools/ItemPickaxeSPTS.java | 32 ++++ .../{ItemShovelG.java => ItemShovelSPTS.java} | 8 +- .../ItemSwordSPTS.java} | 16 +- .../proxy/ClientProxy.java | 13 +- .../tile/TileEntityBase.java | 5 +- .../tile/TileEntityCrucible.java | 165 ------------------ .../tile/TileEntityCrucibleFire.java | 73 -------- .../someprettytechystuff/util/GemType.java | 13 -- .../someprettytechystuff/util/Util.java | 27 +-- 39 files changed, 98 insertions(+), 1714 deletions(-) rename src/main/java/ellpeck/someprettytechystuff/{Gemification.java => SPTS.java} (91%) delete mode 100644 src/main/java/ellpeck/someprettytechystuff/blocks/BlockCrucible.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/blocks/BlockCrucibleFire.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/blocks/OreGem.java rename src/main/java/ellpeck/someprettytechystuff/blocks/models/{ModelBaseG.java => ModelBaseSPTS.java} (75%) delete mode 100644 src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelCrucible.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelCrucibleFire.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererCrucible.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererCrucibleFire.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererHoldingTileEntity.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/booklet/Chapter.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/booklet/ChapterList.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/booklet/ContainerInfoBook.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/booklet/GuiInfoBook.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/booklet/ItemInfoBook.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/crafting/CrucibleCraftingManager.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/crafting/CrucibleRecipe.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/inventory/container/ContainerCrucible.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/inventory/container/ContainerCrucibleFire.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/inventory/gui/GuiCrucible.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/inventory/gui/GuiCrucibleFire.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/items/ItemGem.java rename src/main/java/ellpeck/someprettytechystuff/items/tools/{ItemAxeG.java => ItemAxeSPTS.java} (73%) create mode 100644 src/main/java/ellpeck/someprettytechystuff/items/tools/ItemHoeSPTS.java create mode 100644 src/main/java/ellpeck/someprettytechystuff/items/tools/ItemPickaxeSPTS.java rename src/main/java/ellpeck/someprettytechystuff/items/tools/{ItemShovelG.java => ItemShovelSPTS.java} (73%) rename src/main/java/ellpeck/someprettytechystuff/items/{ItemInfusedIron.java => tools/ItemSwordSPTS.java} (70%) delete mode 100644 src/main/java/ellpeck/someprettytechystuff/tile/TileEntityCrucible.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/tile/TileEntityCrucibleFire.java delete mode 100644 src/main/java/ellpeck/someprettytechystuff/util/GemType.java diff --git a/build.gradle b/build.gradle index 898879ba0..084947bae 100644 --- a/build.gradle +++ b/build.gradle @@ -17,12 +17,12 @@ buildscript { apply plugin: 'forge' -version = "1.7.10-1.0.1" +version = "1.7.10-0.0.1" group = "ellpeck.someprettytechystuff" archivesBaseName = "SomePrettyTechyStuff" minecraft { - version = "1.7.10-10.13.2.1264" + version = "1.7.10-10.13.2.1277" runDir = "idea" } @@ -30,8 +30,8 @@ dependencies { } -processResources -{ +processResources{ + inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version @@ -45,3 +45,9 @@ processResources exclude 'mcmod.info' } } + +sourceSets { + main { + output.resourcesDir = output.classesDir + } +} diff --git a/src/main/java/ellpeck/someprettytechystuff/Gemification.java b/src/main/java/ellpeck/someprettytechystuff/SPTS.java similarity index 91% rename from src/main/java/ellpeck/someprettytechystuff/Gemification.java rename to src/main/java/ellpeck/someprettytechystuff/SPTS.java index 5ea72f4b8..c0f7f53de 100644 --- a/src/main/java/ellpeck/someprettytechystuff/Gemification.java +++ b/src/main/java/ellpeck/someprettytechystuff/SPTS.java @@ -8,7 +8,6 @@ import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import ellpeck.someprettytechystuff.blocks.InitBlocks; -import ellpeck.someprettytechystuff.booklet.ChapterList; import ellpeck.someprettytechystuff.crafting.InitCrafting; import ellpeck.someprettytechystuff.gen.OreGen; import ellpeck.someprettytechystuff.inventory.GuiHandler; @@ -18,10 +17,10 @@ import ellpeck.someprettytechystuff.tile.TileEntityBase; import ellpeck.someprettytechystuff.util.Util; @Mod(modid = Util.MOD_ID, name = Util.NAME, version = Util.VERSION) -public class Gemification{ +public class SPTS{ @Instance(Util.MOD_ID) - public static Gemification instance; + public static SPTS instance; @SidedProxy(clientSide = "ellpeck.someprettytechystuff.proxy.ClientProxy", serverSide = "ellpeck.someprettytechystuff.proxy.ServerProxy") public static IProxy proxy; @@ -29,7 +28,6 @@ public class Gemification{ @SuppressWarnings("unused") @EventHandler() public void preInit(FMLPreInitializationEvent event){ - ChapterList.init(); InitBlocks.init(); InitItems.init(); proxy.preInit(); diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/BlockCrucible.java b/src/main/java/ellpeck/someprettytechystuff/blocks/BlockCrucible.java deleted file mode 100644 index dd6fa3afe..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/BlockCrucible.java +++ /dev/null @@ -1,61 +0,0 @@ -package ellpeck.someprettytechystuff.blocks; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import ellpeck.someprettytechystuff.Gemification; -import ellpeck.someprettytechystuff.creative.CreativeTab; -import ellpeck.someprettytechystuff.inventory.GuiHandler; -import ellpeck.someprettytechystuff.tile.TileEntityCrucible; -import ellpeck.someprettytechystuff.tile.TileEntityInventoryBase; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockCrucible extends BlockContainerBase{ - - protected BlockCrucible(){ - super(Material.rock); - this.setBlockName("blockCrucible"); - this.setCreativeTab(CreativeTab.instance); - this.setHardness(3.0F); - this.setResistance(5.0F); - this.setHarvestLevel("pickaxe", 2); - } - - public TileEntity createNewTileEntity(World world, int i){ - return new TileEntityCrucible(); - } - - @SuppressWarnings("static-access") - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){ - if (!world.isRemote){ - player.openGui(Gemification.instance, GuiHandler.guiCrucible, world, x, y, z); - } - return true; - } - - public int getRenderType(){ - return RenderingRegistry.getNextAvailableRenderId(); - } - - public boolean isOpaqueCube(){ - return false; - } - - public boolean renderAsNormalBlock(){ - return false; - } - - public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = Blocks.hopper.getIcon(0, 0); - } - - public TileEntityInventoryBase dropInventory(World world, int x, int y, int z){ - TileEntityCrucible tileEntity = (TileEntityCrucible)super.dropInventory(world, x, y, z); - if(tileEntity.currentFluid != Util.fluidNone) world.setBlock(x, y, z, Blocks.flowing_water); - return tileEntity; - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/BlockCrucibleFire.java b/src/main/java/ellpeck/someprettytechystuff/blocks/BlockCrucibleFire.java deleted file mode 100644 index ac86c9df6..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/BlockCrucibleFire.java +++ /dev/null @@ -1,68 +0,0 @@ -package ellpeck.someprettytechystuff.blocks; - -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.Gemification; -import ellpeck.someprettytechystuff.creative.CreativeTab; -import ellpeck.someprettytechystuff.inventory.GuiHandler; -import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -import java.util.Random; - -public class BlockCrucibleFire extends BlockContainerBase{ - - protected BlockCrucibleFire(){ - super(Material.rock); - this.setBlockName("blockCrucibleFire"); - this.setCreativeTab(CreativeTab.instance); - this.setTickRandomly(true); - this.setHardness(3.0F); - this.setResistance(5.0F); - this.setHarvestLevel("pickaxe", 2); - } - - public TileEntity createNewTileEntity(World world, int i){ - return new TileEntityCrucibleFire(); - } - - @SuppressWarnings("static-access") - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ){ - if (!world.isRemote){ - player.openGui(Gemification.instance, GuiHandler.guiCrucibleFire, world, x, y, z); - } - return true; - } - - public int getRenderType(){ - return RenderingRegistry.getNextAvailableRenderId(); - } - - public boolean isOpaqueCube(){ - return false; - } - - public boolean renderAsNormalBlock(){ - return false; - } - - public void registerBlockIcons(IIconRegister iconReg){ - this.blockIcon = Blocks.hopper.getIcon(0, 0); - } - - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, int x, int y, int z, Random rand){ - if(((TileEntityCrucibleFire)world.getTileEntity(x, y, z)).isBurning()){ - for(int i = 0; i < 8; i++){ - world.spawnParticle("flame", (double) x + rand.nextFloat() * 0.5F + 0.25F, (double) y + 0.55F, (double) z + rand.nextFloat() * 0.5F + 0.25F, 0.0D, 0.0D, 0.0D); - world.spawnParticle("smoke", (double) x + rand.nextFloat() * 0.5F + 0.25F, (double) y + 0.55F, (double) z + rand.nextFloat() * 0.5F + 0.25F, 0.0D, 0.0D, 0.0D); - } - } - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/InitBlocks.java b/src/main/java/ellpeck/someprettytechystuff/blocks/InitBlocks.java index 9e5670070..75c3a751a 100644 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/InitBlocks.java +++ b/src/main/java/ellpeck/someprettytechystuff/blocks/InitBlocks.java @@ -1,39 +1,9 @@ package ellpeck.someprettytechystuff.blocks; -import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.block.Block; - public class InitBlocks{ - public static Block oreGem; - public static Block blockCrucible; - public static Block blockCrucibleFire; - - public static Block blockCropIron; - public static Block blockCropGold; - public static Block blockCropRedstone; - public static Block blockCropDiamond; - public static void init(){ - oreGem = new OreGem(); - blockCrucible = new BlockCrucible(); - blockCrucibleFire = new BlockCrucibleFire(); - - blockCropIron = new BlockCrop("blockCropIron", 4); - blockCropGold = new BlockCrop("blockCropGold", 4); - blockCropRedstone = new BlockCrop("blockCropRedstone", 4); - blockCropDiamond = new BlockCrop("blockCropDiamond", 4); - - GameRegistry.registerBlock(oreGem, OreGem.ItemBlockOreGem.class, oreGem.getUnlocalizedName().substring(5)); - GameRegistry.registerBlock(blockCrucible, DefaultItemBlock.class, blockCrucible.getUnlocalizedName().substring(5)); - GameRegistry.registerBlock(blockCrucibleFire, DefaultItemBlock.class, blockCrucibleFire.getUnlocalizedName().substring(5)); - - GameRegistry.registerBlock(blockCropIron, blockCropIron.getUnlocalizedName().substring(5)); - GameRegistry.registerBlock(blockCropGold, blockCropGold.getUnlocalizedName().substring(5)); - GameRegistry.registerBlock(blockCropRedstone, blockCropRedstone.getUnlocalizedName().substring(5)); - GameRegistry.registerBlock(blockCropDiamond, blockCropDiamond.getUnlocalizedName().substring(5)); - } } diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/OreGem.java b/src/main/java/ellpeck/someprettytechystuff/blocks/OreGem.java deleted file mode 100644 index 463b7a600..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/OreGem.java +++ /dev/null @@ -1,95 +0,0 @@ -package ellpeck.someprettytechystuff.blocks; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.creative.CreativeTab; -import ellpeck.someprettytechystuff.items.InitItems; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; - -import java.util.List; -import java.util.Random; - -public class OreGem extends Block{ - - public final IIcon[] textures; - - public OreGem() { - super(Material.rock); - textures = new IIcon[Util.gemList.size()]; - this.setHardness(3.0F); - this.setResistance(5.0F); - this.setStepSound(soundTypeStone); - this.setCreativeTab(CreativeTab.instance); - this.setBlockName("oreGem"); - this.setHarvestLevel("pickaxe", 2); - } - - @SuppressWarnings("unchecked") - public void getSubBlocks(Item stack, CreativeTabs tab, List list) { - for (int i = 0; i < Util.gemList.size(); i++) { - list.add(new ItemStack(stack, 1, i)); - } - } - - public Item getItemDropped(int par1, Random rand, int par3){ - return InitItems.itemGem; - } - - public int damageDropped(int i){ - return i; - } - - public int quantityDropped(Random rand){ - return 1 + rand.nextInt(5); - } - - public IIcon getIcon(int side, int meta) { - return textures[meta]; - } - - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister iconReg) { - for (int i = 0; i < Util.gemList.size(); i++) { - textures[i] = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5) + Util.gemList.get(i).name.substring(5)); - } - } - - public static class ItemBlockOreGem extends ItemBlock { - - public ItemBlockOreGem(Block block){ - super(block); - setHasSubtypes(true); - } - - public String getUnlocalizedName(ItemStack stack) { - return this.getUnlocalizedName() + Util.gemList.get(stack.getItemDamage()).name.substring(5); - } - - public int getMetadata(int i) { - return i; - } - - @SuppressWarnings("unchecked") - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(Util.isShiftPressed()){ - for(int i = 0; i < Util.gemList.size(); i++){ - if(this.getDamage(stack) == i) list.add(StatCollector.translateToLocal("tooltip.gem" + Util.gemList.get(i).name.substring(5) + ".desc")); - } - list.add(EnumChatFormatting.BOLD + StatCollector.translateToLocal("tooltip.gemIsOre.desc")); - } - else list.add(Util.shiftForInfo()); - } - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelBaseG.java b/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelBaseSPTS.java similarity index 75% rename from src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelBaseG.java rename to src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelBaseSPTS.java index 87c279a51..22b58119f 100644 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelBaseG.java +++ b/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelBaseSPTS.java @@ -2,7 +2,7 @@ package ellpeck.someprettytechystuff.blocks.models; import net.minecraft.client.model.ModelBase; -public class ModelBaseG extends ModelBase{ +public class ModelBaseSPTS extends ModelBase{ public void render(float f){ diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelCrucible.java b/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelCrucible.java deleted file mode 100644 index ab908f06d..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelCrucible.java +++ /dev/null @@ -1,67 +0,0 @@ -package ellpeck.someprettytechystuff.blocks.models; - -import net.minecraft.client.model.ModelRenderer; - -public class ModelCrucible extends ModelBaseG{ - public ModelRenderer floor, rimOne, rimTwo, rimThree, rimFour, wallOne, wallTwo, wallThree, wallFour, supportOne, supportTwo, supportThree, supportFour; - - public ModelCrucible() { - this.textureWidth = 64; - this.textureHeight = 64; - this.supportTwo = new ModelRenderer(this, 0, 0); - this.supportTwo.setRotationPoint(-6.5F, 21.0F, 4.5F); - this.supportTwo.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2); - this.wallTwo = new ModelRenderer(this, 0, 0); - this.wallTwo.setRotationPoint(7.0F, 9.5F, -8.0F); - this.wallTwo.addBox(0.0F, 0.0F, 0.0F, 1, 9, 16); - this.floor = new ModelRenderer(this, 0, 0); - this.floor.setRotationPoint(-6.0F, 21.5F, -6.0F); - this.floor.addBox(0.0F, 0.0F, 0.0F, 12, 1, 12); - this.rimThree = new ModelRenderer(this, 0, 0); - this.rimThree.setRotationPoint(6.0F, 18.5F, -6.0F); - this.rimThree.addBox(0.0F, 0.0F, 0.0F, 1, 3, 12); - this.wallThree = new ModelRenderer(this, 0, 0); - this.wallThree.setRotationPoint(-7.0F, 9.5F, 7.0F); - this.wallThree.addBox(0.0F, 0.0F, 0.0F, 14, 9, 1); - this.rimTwo = new ModelRenderer(this, 0, 0); - this.rimTwo.setRotationPoint(-7.0F, 18.5F, 6.0F); - this.rimTwo.addBox(0.0F, 0.0F, 0.0F, 14, 3, 1); - this.rimOne = new ModelRenderer(this, 0, 0); - this.rimOne.setRotationPoint(-7.0F, 18.5F, -7.0F); - this.rimOne.addBox(0.0F, 0.0F, 0.0F, 14, 3, 1); - this.supportOne = new ModelRenderer(this, 0, 0); - this.supportOne.setRotationPoint(4.5F, 21.0F, 4.5F); - this.supportOne.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2); - this.wallOne = new ModelRenderer(this, 0, 0); - this.wallOne.setRotationPoint(-8.0F, 9.5F, -8.0F); - this.wallOne.addBox(0.0F, 0.0F, 0.0F, 1, 9, 16); - this.supportFour = new ModelRenderer(this, 0, 0); - this.supportFour.setRotationPoint(-6.5F, 21.0F, -6.5F); - this.supportFour.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2); - this.wallFour = new ModelRenderer(this, 0, 0); - this.wallFour.setRotationPoint(-7.0F, 9.5F, -8.0F); - this.wallFour.addBox(0.0F, 0.0F, 0.0F, 14, 9, 1); - this.rimFour = new ModelRenderer(this, 0, 0); - this.rimFour.setRotationPoint(-7.0F, 18.5F, -6.0F); - this.rimFour.addBox(0.0F, 0.0F, 0.0F, 1, 3, 12); - this.supportThree = new ModelRenderer(this, 0, 0); - this.supportThree.setRotationPoint(4.5F, 21.0F, -6.5F); - this.supportThree.addBox(0.0F, 0.0F, 0.0F, 2, 3, 2); - } - - public void render(float f){ - this.supportTwo.render(f); - this.wallTwo.render(f); - this.floor.render(f); - this.rimThree.render(f); - this.wallThree.render(f); - this.rimTwo.render(f); - this.rimOne.render(f); - this.supportOne.render(f); - this.wallOne.render(f); - this.supportFour.render(f); - this.wallFour.render(f); - this.rimFour.render(f); - this.supportThree.render(f); - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelCrucibleFire.java b/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelCrucibleFire.java deleted file mode 100644 index 85d8c703d..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/models/ModelCrucibleFire.java +++ /dev/null @@ -1,76 +0,0 @@ -package ellpeck.someprettytechystuff.blocks.models; - -import net.minecraft.client.model.ModelRenderer; - -public class ModelCrucibleFire extends ModelBaseG{ - public ModelRenderer floor, wallOne, wallTwo, wallThree, wallFour, supportOne, supportTwo, supportThree, supportFour, outsideSupOne, outsideSupTwo, outsideSupThree, outsideSupFour, topFloor, floorBlock; - - public ModelCrucibleFire() { - this.textureWidth = 64; - this.textureHeight = 64; - this.wallFour = new ModelRenderer(this, 0, 0); - this.wallFour.setRotationPoint(-4.5F, 15.0F, 4.5F); - this.wallFour.addBox(0.0F, 0.0F, 0.0F, 9, 3, 1); - this.outsideSupFour = new ModelRenderer(this, 0, 30); - this.outsideSupFour.setRotationPoint(-8.0F, 9.0F, 6.0F); - this.outsideSupFour.addBox(0.0F, 0.0F, 0.0F, 2, 15, 2); - this.supportFour = new ModelRenderer(this, 0, 0); - this.supportFour.setRotationPoint(3.5F, 19.0F, -4.5F); - this.supportFour.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1); - this.outsideSupThree = new ModelRenderer(this, 0, 30); - this.outsideSupThree.setRotationPoint(-8.0F, 9.0F, -8.0F); - this.outsideSupThree.addBox(0.0F, 0.0F, 0.0F, 2, 15, 2); - this.outsideSupOne = new ModelRenderer(this, 0, 30); - this.outsideSupOne.setRotationPoint(6.0F, 9.0F, 6.0F); - this.outsideSupOne.addBox(0.0F, 0.0F, 0.0F, 2, 15, 2); - this.floorBlock = new ModelRenderer(this, 0, 17); - this.floorBlock.setRotationPoint(-5.0F, 21.0F, -5.0F); - this.floorBlock.addBox(0.0F, 0.0F, 0.0F, 10, 3, 10); - this.wallOne = new ModelRenderer(this, 0, 0); - this.wallOne.setRotationPoint(4.5F, 15.0F, -5.5F); - this.wallOne.addBox(0.0F, 0.0F, 0.0F, 1, 3, 11); - this.wallTwo = new ModelRenderer(this, 0, 0); - this.wallTwo.setRotationPoint(-5.5F, 15.0F, -5.5F); - this.wallTwo.addBox(0.0F, 0.0F, 0.0F, 1, 3, 11); - this.supportOne = new ModelRenderer(this, 0, 0); - this.supportOne.setRotationPoint(3.5F, 19.0F, 3.5F); - this.supportOne.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1); - this.wallThree = new ModelRenderer(this, 0, 0); - this.wallThree.setRotationPoint(-4.5F, 15.0F, -5.5F); - this.wallThree.addBox(0.0F, 0.0F, 0.0F, 9, 3, 1); - this.outsideSupTwo = new ModelRenderer(this, 0, 30); - this.outsideSupTwo.setRotationPoint(6.0F, 9.0F, -8.0F); - this.outsideSupTwo.addBox(0.0F, 0.0F, 0.0F, 2, 15, 2); - this.floor = new ModelRenderer(this, 0, 0); - this.floor.mirror = true; - this.floor.setRotationPoint(-4.5F, 18.0F, -4.5F); - this.floor.addBox(0.0F, 0.0F, 0.0F, 9, 1, 9); - this.supportThree = new ModelRenderer(this, 0, 0); - this.supportThree.setRotationPoint(-4.5F, 19.0F, -4.5F); - this.supportThree.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1); - this.topFloor = new ModelRenderer(this, 0, 30); - this.topFloor.setRotationPoint(-8.0F, 8.0F, -8.0F); - this.topFloor.addBox(0.0F, 0.0F, 0.0F, 16, 1, 16); - this.supportTwo = new ModelRenderer(this, 0, 0); - this.supportTwo.setRotationPoint(-4.5F, 19.0F, 3.5F); - this.supportTwo.addBox(0.0F, 0.0F, 0.0F, 1, 2, 1); - } - - public void render(float f){ - this.wallFour.render(f); - this.outsideSupFour.render(f); - this.supportFour.render(f); - this.outsideSupThree.render(f); - this.outsideSupOne.render(f); - this.floorBlock.render(f); - this.wallOne.render(f); - this.wallTwo.render(f); - this.supportOne.render(f); - this.wallThree.render(f); - this.outsideSupTwo.render(f); - this.floor.render(f); - this.supportThree.render(f); - this.topFloor.render(f); - this.supportTwo.render(f); - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererCrucible.java b/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererCrucible.java deleted file mode 100644 index 8dcd9920b..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererCrucible.java +++ /dev/null @@ -1,28 +0,0 @@ -package ellpeck.someprettytechystuff.blocks.models; - -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -public class RendererCrucible extends TileEntitySpecialRenderer{ - - public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/blocks/models/modelCrucible.png"); - private ModelCrucible model; - - public RendererCrucible(){ - this.model = new ModelCrucible(); - } - - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); - GL11.glRotatef(180, 0F, 0F, 1F); - this.bindTexture(resLoc); - GL11.glPushMatrix(); - this.model.render(0.0625F); - GL11.glPopMatrix(); - GL11.glPopMatrix(); - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererCrucibleFire.java b/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererCrucibleFire.java deleted file mode 100644 index 04ba9b259..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererCrucibleFire.java +++ /dev/null @@ -1,28 +0,0 @@ -package ellpeck.someprettytechystuff.blocks.models; - -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -public class RendererCrucibleFire extends TileEntitySpecialRenderer{ - - public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/blocks/models/modelCrucibleFire.png"); - private ModelCrucibleFire model; - - public RendererCrucibleFire(){ - this.model = new ModelCrucibleFire(); - } - - public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float par5) { - GL11.glPushMatrix(); - GL11.glTranslatef((float)x + 0.5F, (float)y + 1.5F, (float)z + 0.5F); - GL11.glRotatef(180, 0F, 0F, 1F); - this.bindTexture(resLoc); - GL11.glPushMatrix(); - this.model.render(0.0625F); - GL11.glPopMatrix(); - GL11.glPopMatrix(); - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererHoldingTileEntity.java b/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererHoldingTileEntity.java deleted file mode 100644 index 5173d2c10..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/blocks/models/RendererHoldingTileEntity.java +++ /dev/null @@ -1,73 +0,0 @@ -package ellpeck.someprettytechystuff.blocks.models; - -import net.minecraft.client.Minecraft; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.IItemRenderer; -import org.lwjgl.opengl.GL11; - -public class RendererHoldingTileEntity implements IItemRenderer { - - ModelBaseG model; - ResourceLocation texture; - - public RendererHoldingTileEntity(ModelBaseG model, ResourceLocation res){ - this.model = model; - texture = res; - } - - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return true; - } - - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } - - public void renderItem(ItemRenderType type, ItemStack item, Object... data){ - switch(type){ - case INVENTORY: - GL11.glPushMatrix(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(-0.5F, -1.27F, 0.5F); - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - model.render(0.0625F); - GL11.glPopMatrix(); - break; - - case EQUIPPED: - GL11.glPushMatrix(); - GL11.glTranslatef(0.5F, 0.5F, 0.5F); - GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); - GL11.glTranslatef(0.6F, -1.2F, -0.0F); - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - model.render(0.0625F); - GL11.glPopMatrix(); - break; - - case EQUIPPED_FIRST_PERSON: - GL11.glPushMatrix(); - GL11.glScalef(1.2F, 1.2F, 1.2F); - GL11.glRotatef(180, 2F, -0F, 0.1F); - GL11.glTranslatef(1.5F, -1.2F, -0.3F); - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - model.render(0.0625F); - GL11.glPopMatrix(); - break; - - default: - GL11.glPushMatrix(); - GL11.glScalef(1.2F, 1.2F, 1.2F); - GL11.glRotatef(180, 2F, -0F, 0.1F); - GL11.glTranslatef(0F, -1.2F, 0F); - Minecraft.getMinecraft().renderEngine.bindTexture(texture); - model.render(0.0625F); - GL11.glPopMatrix(); - break; - } - - - } - -} diff --git a/src/main/java/ellpeck/someprettytechystuff/booklet/Chapter.java b/src/main/java/ellpeck/someprettytechystuff/booklet/Chapter.java deleted file mode 100644 index ede030bd3..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/booklet/Chapter.java +++ /dev/null @@ -1,23 +0,0 @@ -package ellpeck.someprettytechystuff.booklet; - -import net.minecraft.util.StatCollector; - -public class Chapter{ - - public final int ID; - public final String name; - public final int pageAmount; - public final boolean hasCraftingRecipe; - public String[] pageTexts; - - public Chapter(int ID, String name, int pageAmount, boolean hasCraftingRecipe){ - this.ID = ID; - this.name = name + "Chapter"; - this.pageAmount = pageAmount; - this.hasCraftingRecipe = hasCraftingRecipe; - this.pageTexts = new String[pageAmount]; - for(int i = 0; i < pageTexts.length; i++){ - this.pageTexts[i] = StatCollector.translateToLocal("infoBook." + this.name + ".page" + i + ".text"); - } - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/booklet/ChapterList.java b/src/main/java/ellpeck/someprettytechystuff/booklet/ChapterList.java deleted file mode 100644 index 29722f009..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/booklet/ChapterList.java +++ /dev/null @@ -1,14 +0,0 @@ -package ellpeck.someprettytechystuff.booklet; - -import java.util.ArrayList; - -public class ChapterList{ - - public static ArrayList chapterList = new ArrayList(); - - public static void init(){ - chapterList.add(new Chapter(0, "crucible", 1, false)); - chapterList.add(new Chapter(1, "crucibleFire", 2, false)); - chapterList.add(new Chapter(2, "gems", 4, false)); - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/booklet/ContainerInfoBook.java b/src/main/java/ellpeck/someprettytechystuff/booklet/ContainerInfoBook.java deleted file mode 100644 index 0ea4e016f..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/booklet/ContainerInfoBook.java +++ /dev/null @@ -1,16 +0,0 @@ -package ellpeck.someprettytechystuff.booklet; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; - -public class ContainerInfoBook extends Container { - - @SuppressWarnings("unused") - public ContainerInfoBook(EntityPlayer player){ - - } - - public boolean canInteractWith(EntityPlayer player){ - return true; - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/booklet/GuiInfoBook.java b/src/main/java/ellpeck/someprettytechystuff/booklet/GuiInfoBook.java deleted file mode 100644 index 1bd10d8b1..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/booklet/GuiInfoBook.java +++ /dev/null @@ -1,163 +0,0 @@ -package ellpeck.someprettytechystuff.booklet; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.gui.GuiScreen; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; - -public class GuiInfoBook extends GuiScreen{ - - public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/gui/guiInfoBook.png"); - public static final ResourceLocation fontLocation = new ResourceLocation("textures/font/ascii.png"); - - public final int xSize = 180; - public final int ySize = 180; - - @SideOnly(Side.CLIENT) - public final FontRenderer thisRenderer = new FontRenderer(Minecraft.getMinecraft().gameSettings, fontLocation, Minecraft.getMinecraft().renderEngine, true); - - public Chapter mainChapter = new Chapter(-1, "main", 1, false); - - public int currentPage = 0; - public Chapter currentChapter = mainChapter; - - public ChangePageButton nextPageButton; - public ChangePageButton prevPageButton; - public ChangePageButton mainPageButton; - - @SuppressWarnings("unused") - public GuiInfoBook(EntityPlayer player){ - - } - - @SuppressWarnings("all") - public void initGui(){ - this.buttonList.clear(); - - int xPos = (this.width-this.xSize)/2; - int yPos = (this.height-this.ySize)/2; - - this.addMainChapterButtons(); - this.nextPageButton = new ChangePageButton(-3, xPos+180, yPos+170); - this.prevPageButton = new ChangePageButton(-2, xPos-18, yPos+170); - this.mainPageButton = new ChangePageButton(-1, xPos, yPos-15); - this.buttonList.add(nextPageButton); - this.buttonList.add(prevPageButton); - this.buttonList.add(mainPageButton); - - this.updateButtons(); - } - - @SuppressWarnings("all") - public void addMainChapterButtons(){ - int xPos = (this.width-this.xSize)/2; - int yPos = (this.height-this.ySize)/2; - - int size = ChapterList.chapterList.size(); - for(int i = 0; i < size; i++) { - this.buttonList.add(new InvisiButton(i, xPos + 20, yPos + 15 + 11 * i, 145, 10, StatCollector.translateToLocal("infoBook." + ChapterList.chapterList.get(i).name + ".title"), this.thisRenderer)); - } - } - - public void updateButtons(){ - this.nextPageButton.visible = this.currentPage < this.currentChapter.pageAmount-1; - this.prevPageButton.visible = this.currentPage > 0; - this.mainPageButton.visible = this.currentChapter != this.mainChapter; - for(int i = 0; i < ChapterList.chapterList.size(); i++){ - ((GuiButton)this.buttonList.get(i)).visible = this.currentChapter == mainChapter; - } - } - - @SuppressWarnings("static-access") - public void actionPerformed(GuiButton button){ - if(button == this.nextPageButton) this.currentPage++; - else if(button == this.prevPageButton) this.currentPage--; - else if(button == this.mainPageButton){ - this.currentPage = 0; - this.currentChapter = this.mainChapter; - } - else this.currentChapter = ChapterList.chapterList.get(button.id); - this.updateButtons(); - } - - public void drawScreen(int x, int y, float f){ - this.drawDefaultBackground(); - GL11.glColor4f(1F, 1F, 1F, 1F); - - int xPos = (this.width-this.xSize)/2; - int yPos = (this.height-this.ySize)/2; - - this.mc.getTextureManager().bindTexture(resLoc); - this.drawTexturedModalRect(xPos, yPos, 0, 0, this.xSize, this.ySize); - - this.drawPageContents(); - - super.drawScreen(x, y, f); - } - - public void drawPageContents(){ - int xPos = (this.width-this.xSize)/2; - int yPos = (this.height-this.ySize)/2; - - if(this.currentChapter != this.mainChapter) this.thisRenderer.drawSplitString(this.currentChapter.pageTexts[this.currentPage], xPos + 15, yPos + 14, 150, 0); - } - - @SideOnly(Side.CLIENT) - static class ChangePageButton extends GuiButton{ - /** - * Type of the button - * -3: Next Page - * -2: Previous Page - * -1: Back to main Page - */ - private final int buttonType; - - public ChangePageButton(int ID, int x, int y){ - super(ID, x, y, 18, ID == -1 ? 14 : 10, ""); - this.buttonType = ID; - } - - public void drawButton(Minecraft mc, int mouseX, int mouseY){ - if (this.visible){ - boolean isHoverOver = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.getTextureManager().bindTexture(GuiInfoBook.resLoc); - - int posX = 0; - int posY = 180; - if(this.buttonType == -2) posY += 10; - else if(this.buttonType == -1) posY += 20; - if(isHoverOver) posX += 18; - this.drawTexturedModalRect(this.xPosition, this.yPosition, posX, posY, 18, this.buttonType == -1 ? 14 : 10); - } - } - } - - @SideOnly(Side.CLIENT) - static class InvisiButton extends GuiButton{ - private FontRenderer renderer; - public InvisiButton(int ID, int x, int y, int width, int height, String text, FontRenderer renderer){ - super(ID, x, y, width, height, text); - this.renderer = renderer; - } - - public void drawButton(Minecraft mc, int mouseX, int mouseY){ - if (this.visible){ - boolean isHoverOver = false; - if(mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height) isHoverOver = true; - this.renderer.drawString((isHoverOver ? ((char) 167 + "2" + (char) 167 + "n") : "") + this.displayString, this.xPosition, this.yPosition + (this.height - 8) / 2, 0); - } - } - } - - public boolean doesGuiPauseGame(){ - return false; - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/booklet/ItemInfoBook.java b/src/main/java/ellpeck/someprettytechystuff/booklet/ItemInfoBook.java deleted file mode 100644 index 7d29590f6..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/booklet/ItemInfoBook.java +++ /dev/null @@ -1,47 +0,0 @@ -package ellpeck.someprettytechystuff.booklet; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.Gemification; -import ellpeck.someprettytechystuff.creative.CreativeTab; -import ellpeck.someprettytechystuff.inventory.GuiHandler; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; - -import java.util.List; - -public class ItemInfoBook extends Item { - - public ItemInfoBook(){ - this.setCreativeTab(CreativeTab.instance); - this.setUnlocalizedName("itemInfoBook"); - } - - @SuppressWarnings("unchecked") - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + this.getUnlocalizedName().substring(5) + ".desc")); - else list.add(Util.shiftForInfo()); - } - - public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName(); - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconReg){ - this.itemIcon = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5)); - } - - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player){ - if (!world.isRemote){ - player.openGui(Gemification.instance, GuiHandler.guiInfoBook, world, (int)player.posX, (int)player.posY, (int)player.posZ); - } - return stack; - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/crafting/CrucibleCraftingManager.java b/src/main/java/ellpeck/someprettytechystuff/crafting/CrucibleCraftingManager.java deleted file mode 100644 index 18bf9e711..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/crafting/CrucibleCraftingManager.java +++ /dev/null @@ -1,109 +0,0 @@ -package ellpeck.someprettytechystuff.crafting; - -import ellpeck.someprettytechystuff.util.GemType; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -import java.util.ArrayList; -import java.util.HashMap; - -public class CrucibleCraftingManager{ - - public static final CrucibleCraftingManager instance = new CrucibleCraftingManager(); - public static ArrayList recipes = new ArrayList(); - - @SuppressWarnings("unchecked, static-access") - public void addRecipe(ItemStack output, GemType fluidNeeded, int processTimeNeeded, Object ... recipe){ - String s = ""; - int i = 0; - int j = 0; - int k = 0; - - if (recipe[i] instanceof String[]){ - String[] strg = ((String[])recipe[i++]); - for(String s1 : strg) { - k++; - j = s1.length(); - s = s + s1; - } - } - else{ - while (recipe[i] instanceof String){ - String s2 = (String)recipe[i++]; - k++; - j = s2.length(); - s = s + s2; - } - } - - HashMap map; - for (map = new HashMap(); i < recipe.length; i += 2){ - Character character = (Character)recipe[i]; - ItemStack stack1 = null; - - if (recipe[i + 1] instanceof Item){ - stack1 = new ItemStack((Item)recipe[i + 1], 1, OreDictionary.WILDCARD_VALUE); - } - else if (recipe[i + 1] instanceof Block){ - stack1 = new ItemStack((Block)recipe[i + 1], 1, OreDictionary.WILDCARD_VALUE); - } - else if (recipe[i + 1] instanceof ItemStack){ - stack1 = (ItemStack)recipe[i + 1]; - } - map.put(character, stack1); - } - - ItemStack[] stack2 = new ItemStack[j * k]; - for (int i1 = 0; i1 < j * k; ++i1){ - char c0 = s.charAt(i1); - if (map.containsKey(Character.valueOf(c0))){ - stack2[i1] = ((ItemStack)map.get(Character.valueOf(c0))).copy(); - } - else{ - stack2[i1] = null; - } - } - this.recipes.add(new CrucibleRecipe(stack2, output, fluidNeeded, processTimeNeeded)); - } - - @SuppressWarnings("static-access") - public ItemStack getCraftingResult(ItemStack[] slots, int minSlot, int maxSlot, GemType currentFluid){ - CrucibleRecipe matchingRecipe = this.matchingRecipe(slots, minSlot, maxSlot); - if(matchingRecipe != null){ - if (currentFluid == matchingRecipe.fluidNeeded){ - return matchingRecipe.recipeOutput; - } - } - return null; - } - - @SuppressWarnings("static-access") - public int getProcessTimeNeeded(ItemStack[] slots, int minSlot, int maxSlot){ - CrucibleRecipe matchingRecipe = this.matchingRecipe(slots, minSlot, maxSlot); - if(matchingRecipe != null){ - return matchingRecipe.processTimeNeeded; - } - return 0; - } - - @SuppressWarnings("static-access") - public CrucibleRecipe matchingRecipe(ItemStack[] slots, int minSlot, int maxSlot){ - for (CrucibleRecipe recipe : this.recipes){ - ItemStack[] inputs = recipe.recipeItems; - int k = 0; - for (int j = 0; j < maxSlot - minSlot + 1; j++){ - if (slots[minSlot + j] != null && inputs[j] != null && slots[minSlot + j].getItem() == inputs[j].getItem()){ - if(inputs[j].getItemDamage() == OreDictionary.WILDCARD_VALUE || inputs[j].getItemDamage() == slots[minSlot + j].getItemDamage()) { - k++; - } - } - } - if (k == maxSlot - minSlot + 1){ - return recipe; - } - } - return null; - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/someprettytechystuff/crafting/CrucibleRecipe.java b/src/main/java/ellpeck/someprettytechystuff/crafting/CrucibleRecipe.java deleted file mode 100644 index 78cd54e00..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/crafting/CrucibleRecipe.java +++ /dev/null @@ -1,19 +0,0 @@ -package ellpeck.someprettytechystuff.crafting; - -import ellpeck.someprettytechystuff.util.GemType; -import net.minecraft.item.ItemStack; - -public class CrucibleRecipe{ - - public final ItemStack[] recipeItems; - public final ItemStack recipeOutput; - public final GemType fluidNeeded; - public final int processTimeNeeded; - - public CrucibleRecipe(ItemStack[] items, ItemStack output, GemType fluid, int processTimeNeeded){ - this.recipeItems = items; - this.recipeOutput = output; - this.fluidNeeded = fluid; - this.processTimeNeeded = processTimeNeeded; - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/crafting/InitCrafting.java b/src/main/java/ellpeck/someprettytechystuff/crafting/InitCrafting.java index 88b4ca369..d700a3326 100644 --- a/src/main/java/ellpeck/someprettytechystuff/crafting/InitCrafting.java +++ b/src/main/java/ellpeck/someprettytechystuff/crafting/InitCrafting.java @@ -1,38 +1,9 @@ package ellpeck.someprettytechystuff.crafting; -import cpw.mods.fml.common.registry.GameRegistry; -import ellpeck.someprettytechystuff.blocks.InitBlocks; -import ellpeck.someprettytechystuff.items.InitItems; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - public class InitCrafting { public static void init(){ - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockCrucible), "i i", "gcg", "iii", 'i', Items.iron_ingot, 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'c', Items.cauldron); - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockCrucibleFire), "ccc", "cac", "csc", 'c', Blocks.cobblestone, 'a', Items.cauldron, 's', Blocks.stone_slab); - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemInfoBook), new ItemStack(Items.book), new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE)); - GameRegistry.addRecipe(new ItemStack(Items.iron_ingot), "xx", "xx", 'x', new ItemStack(InitItems.itemPile, 1, 0)); - GameRegistry.addRecipe(new ItemStack(Items.gold_ingot), "xx", "xx", 'x', new ItemStack(InitItems.itemPile, 1, 1)); - GameRegistry.addRecipe(new ItemStack(Items.redstone), "xx", "xx", 'x', new ItemStack(InitItems.itemPile, 1, 2)); - GameRegistry.addRecipe(new ItemStack(Items.diamond), "xx", "xx", 'x', new ItemStack(InitItems.itemPile, 1, 3)); - GameRegistry.addRecipe(new ItemStack(InitItems.itemPile, 8, 0), "x", "x", 'x', new ItemStack(Items.iron_ingot)); - GameRegistry.addRecipe(new ItemStack(InitItems.itemPile, 8, 1), "x", "x", 'x', new ItemStack(Items.gold_ingot)); - GameRegistry.addRecipe(new ItemStack(InitItems.itemPile, 8, 2), "x", "x", 'x', new ItemStack(Items.redstone)); - GameRegistry.addRecipe(new ItemStack(InitItems.itemPile, 8, 3), "x", "x", 'x', new ItemStack(Items.diamond)); - - CrucibleCraftingManager.instance.addRecipe(new ItemStack(Blocks.acacia_stairs), Util.chromeDiopside, 200, "ccc", "cgc", "ccc", 'c', Blocks.cobblestone, 'g', Items.stick); - - CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronIngot), Util.goshenite, 500, "gig", "idi", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', Items.iron_ingot, 'd', Items.diamond); - CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronAxe), Util.chromeDiopside, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_axe); - CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronHoe), Util.jasper, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_hoe); - CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronPickaxe), Util.hematite, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_pickaxe); - CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronShovel), Util.tourmaline, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_shovel); - CrucibleCraftingManager.instance.addRecipe(new ItemStack(InitItems.itemInfusedIronSword), Util.almandineGarnet, 1000, "gig", "iai", "gig", 'g', new ItemStack(InitItems.itemGem, 1, OreDictionary.WILDCARD_VALUE), 'i', InitItems.itemInfusedIronIngot, 'a', Items.iron_sword); } } diff --git a/src/main/java/ellpeck/someprettytechystuff/gen/OreGen.java b/src/main/java/ellpeck/someprettytechystuff/gen/OreGen.java index 27089ad36..a00289201 100644 --- a/src/main/java/ellpeck/someprettytechystuff/gen/OreGen.java +++ b/src/main/java/ellpeck/someprettytechystuff/gen/OreGen.java @@ -2,10 +2,7 @@ package ellpeck.someprettytechystuff.gen; import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.registry.GameRegistry; -import ellpeck.someprettytechystuff.blocks.InitBlocks; -import ellpeck.someprettytechystuff.util.Util; import net.minecraft.block.Block; -import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraft.world.gen.feature.WorldGenMinable; @@ -31,9 +28,7 @@ public class OreGen implements IWorldGenerator { } private void generateSurface(World world, Random random, int x, int z){ - for(int i = 0; i < Util.gemList.size(); i++) { - this.addOreSpawn(InitBlocks.oreGem, i, Blocks.stone, world, random, x, z, 4 + random.nextInt(3), 6, 1, 70); - } + } @SuppressWarnings("unused") diff --git a/src/main/java/ellpeck/someprettytechystuff/inventory/GuiHandler.java b/src/main/java/ellpeck/someprettytechystuff/inventory/GuiHandler.java index 2ef57fcef..b7f56d486 100644 --- a/src/main/java/ellpeck/someprettytechystuff/inventory/GuiHandler.java +++ b/src/main/java/ellpeck/someprettytechystuff/inventory/GuiHandler.java @@ -2,35 +2,16 @@ package ellpeck.someprettytechystuff.inventory; import cpw.mods.fml.common.network.IGuiHandler; import cpw.mods.fml.common.network.NetworkRegistry; -import ellpeck.someprettytechystuff.Gemification; -import ellpeck.someprettytechystuff.booklet.ContainerInfoBook; -import ellpeck.someprettytechystuff.booklet.GuiInfoBook; -import ellpeck.someprettytechystuff.inventory.container.ContainerCrucible; -import ellpeck.someprettytechystuff.inventory.container.ContainerCrucibleFire; -import ellpeck.someprettytechystuff.inventory.gui.GuiCrucible; -import ellpeck.someprettytechystuff.inventory.gui.GuiCrucibleFire; +import ellpeck.someprettytechystuff.SPTS; import ellpeck.someprettytechystuff.tile.TileEntityBase; -import ellpeck.someprettytechystuff.tile.TileEntityCrucible; -import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public class GuiHandler implements IGuiHandler { - public static final int guiCrucible = 0; - public static final int guiCrucibleFire = 1; - public static final int guiInfoBook = 2; - public Object getServerGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z) { TileEntityBase tile = (TileEntityBase)world.getTileEntity(x, y, z); switch (id) { - case guiCrucible: - return new ContainerCrucible(entityPlayer.inventory, (TileEntityCrucible)tile); - case guiCrucibleFire: - return new ContainerCrucibleFire(entityPlayer.inventory, (TileEntityCrucibleFire)tile); - case guiInfoBook: - return new ContainerInfoBook(entityPlayer); - default: return null; } @@ -39,19 +20,12 @@ public class GuiHandler implements IGuiHandler { public Object getClientGuiElement(int id, EntityPlayer entityPlayer, World world, int x, int y, int z) { TileEntityBase tile = (TileEntityBase)world.getTileEntity(x, y, z); switch (id) { - case guiCrucible: - return new GuiCrucible(entityPlayer.inventory, (TileEntityCrucible)tile); - case guiCrucibleFire: - return new GuiCrucibleFire(entityPlayer.inventory, (TileEntityCrucibleFire)tile); - case guiInfoBook: - return new GuiInfoBook(entityPlayer); - default: return null; } } public static void init(){ - NetworkRegistry.INSTANCE.registerGuiHandler(Gemification.instance, new GuiHandler()); + NetworkRegistry.INSTANCE.registerGuiHandler(SPTS.instance, new GuiHandler()); } } diff --git a/src/main/java/ellpeck/someprettytechystuff/inventory/container/ContainerCrucible.java b/src/main/java/ellpeck/someprettytechystuff/inventory/container/ContainerCrucible.java deleted file mode 100644 index 6c168a5dd..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/inventory/container/ContainerCrucible.java +++ /dev/null @@ -1,101 +0,0 @@ -package ellpeck.someprettytechystuff.inventory.container; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.tile.TileEntityCrucible; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.inventory.SlotFurnace; -import net.minecraft.item.ItemStack; - -public class ContainerCrucible extends Container { - - private TileEntityCrucible tileCrucible; - - private int lastCurrentFluidID; - private int lastProcessTime; - private int lastProcessTimeNeeded; - private int lastBurnTime; - private int lastBurnTimeOfItem; - - public ContainerCrucible(InventoryPlayer inventoryPlayer, TileEntityCrucible tileCrucible) { - this.tileCrucible = tileCrucible; - - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput-4, 32, 23)); - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput-3, 57, 18)); - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput-2, 82, 23)); - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput-1, 27, 48)); - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput, 57, 48)); - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput+1, 87, 48)); - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput+2, 32, 73)); - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput+3, 57, 78)); - this.addSlotToContainer(new Slot(this.tileCrucible, tileCrucible.slotMainInput+4, 82, 73)); - - this.addSlotToContainer(new Slot(tileCrucible, tileCrucible.slotSmeltGem, 129, 37)); - this.addSlotToContainer(new Slot(tileCrucible, tileCrucible.slotWater, 149, 37)); - - this.addSlotToContainer(new SlotFurnace(inventoryPlayer.player, this.tileCrucible, tileCrucible.slotOutput, 146, 85)); - - for (int i = 0; i < 3; ++i){ - for (int j = 0; j < 9; ++j){ - this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 113 + i * 18)); - } - } - - for (int i = 0; i < 9; ++i){ - this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 171)); - } - } - - public boolean canInteractWith(EntityPlayer player) { - return tileCrucible.isUseableByPlayer(player); - } - - public void addCraftingToCrafters(ICrafting iCraft){ - super.addCraftingToCrafters(iCraft); - - iCraft.sendProgressBarUpdate(this, 0, this.tileCrucible.currentFluidID); - iCraft.sendProgressBarUpdate(this, 1, this.tileCrucible.currentProcessTime); - iCraft.sendProgressBarUpdate(this, 2, this.tileCrucible.processTimeNeeded); - iCraft.sendProgressBarUpdate(this, 3, this.tileCrucible.burnTime); - iCraft.sendProgressBarUpdate(this, 4, this.tileCrucible.burnTimeOfItem); - } - - public void detectAndSendChanges(){ - super.detectAndSendChanges(); - for (Object crafter : this.crafters) { - ICrafting iCraft = (ICrafting) crafter; - - if (this.lastCurrentFluidID != this.tileCrucible.currentFluidID) iCraft.sendProgressBarUpdate(this, 0, this.tileCrucible.currentFluidID); - if (this.lastProcessTime != this.tileCrucible.currentProcessTime) iCraft.sendProgressBarUpdate(this, 1, this.tileCrucible.currentProcessTime); - if (this.lastProcessTimeNeeded != this.tileCrucible.processTimeNeeded) iCraft.sendProgressBarUpdate(this, 2, this.tileCrucible.processTimeNeeded); - if (this.lastBurnTime != this.tileCrucible.burnTime) iCraft.sendProgressBarUpdate(this, 3, this.tileCrucible.burnTime); - if (this.lastBurnTimeOfItem != this.tileCrucible.burnTimeOfItem) iCraft.sendProgressBarUpdate(this, 4, this.tileCrucible.burnTimeOfItem); - } - - this.lastCurrentFluidID = this.tileCrucible.currentFluidID; - this.lastProcessTime = this.tileCrucible.currentProcessTime; - this.lastProcessTimeNeeded = this.tileCrucible.processTimeNeeded; - this.lastBurnTime = this.tileCrucible.burnTime; - this.lastBurnTimeOfItem = this.tileCrucible.burnTimeOfItem; - } - - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2){ - if (par1 == 0) this.tileCrucible.currentFluidID = par2; - if (par1 == 1) this.tileCrucible.currentProcessTime = par2; - if (par1 == 2) this.tileCrucible.processTimeNeeded = par2; - if (par1 == 3) this.tileCrucible.burnTime = par2; - if (par1 == 4) this.tileCrucible.burnTimeOfItem = par2; - } - - //TODO Add transferStackInSlot() - public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) { - Slot slot = (Slot)this.inventorySlots.get(slotNumber); - return null; - } - -} diff --git a/src/main/java/ellpeck/someprettytechystuff/inventory/container/ContainerCrucibleFire.java b/src/main/java/ellpeck/someprettytechystuff/inventory/container/ContainerCrucibleFire.java deleted file mode 100644 index 27bf75908..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/inventory/container/ContainerCrucibleFire.java +++ /dev/null @@ -1,71 +0,0 @@ -package ellpeck.someprettytechystuff.inventory.container; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class ContainerCrucibleFire extends Container { - - private TileEntityCrucibleFire tileCrucibleFire; - - private int lastBurnTime; - private int lastBurnTimeOfItem; - - public ContainerCrucibleFire(InventoryPlayer inventoryPlayer, TileEntityCrucibleFire tileCrucibleFire) { - this.tileCrucibleFire = tileCrucibleFire; - - this.addSlotToContainer(new Slot(this.tileCrucibleFire, 0, 70, 9)); - - for (int i = 0; i < 3; ++i){ - for (int j = 0; j < 9; ++j){ - this.addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 34 + i * 18)); - } - } - - for (int i = 0; i < 9; ++i){ - this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 92)); - } - } - - public boolean canInteractWith(EntityPlayer player) { - return tileCrucibleFire.isUseableByPlayer(player); - } - - public void addCraftingToCrafters(ICrafting iCraft){ - super.addCraftingToCrafters(iCraft); - - iCraft.sendProgressBarUpdate(this, 0, this.tileCrucibleFire.burnTime); - iCraft.sendProgressBarUpdate(this, 1, this.tileCrucibleFire.burnTimeOfItem); - } - - public void detectAndSendChanges(){ - super.detectAndSendChanges(); - for (Object crafter : this.crafters) { - ICrafting iCraft = (ICrafting) crafter; - - if (this.lastBurnTime != this.tileCrucibleFire.burnTime) iCraft.sendProgressBarUpdate(this, 0, this.tileCrucibleFire.burnTime); - if (this.lastBurnTimeOfItem != this.tileCrucibleFire.burnTimeOfItem) iCraft.sendProgressBarUpdate(this, 1, this.tileCrucibleFire.burnTimeOfItem); - } - - this.lastBurnTime = tileCrucibleFire.burnTime; - this.lastBurnTimeOfItem = tileCrucibleFire.burnTimeOfItem; - } - - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2){ - if (par1 == 0) this.tileCrucibleFire.burnTime = par2; - if (par1 == 1) this.tileCrucibleFire.burnTimeOfItem = par2; - } - - //TODO Add transferStackInSlot() - public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) { - Slot slot = (Slot)this.inventorySlots.get(slotNumber); - return null; - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/inventory/gui/GuiCrucible.java b/src/main/java/ellpeck/someprettytechystuff/inventory/gui/GuiCrucible.java deleted file mode 100644 index 6fb9db03e..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/inventory/gui/GuiCrucible.java +++ /dev/null @@ -1,85 +0,0 @@ -package ellpeck.someprettytechystuff.inventory.gui; - -import ellpeck.someprettytechystuff.inventory.container.ContainerCrucible; -import ellpeck.someprettytechystuff.tile.TileEntityCrucible; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; - -import java.util.Arrays; - -public class GuiCrucible extends GuiContainer{ - - private TileEntityCrucible tileCrucible; - - public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/gui/guiCrucible.png"); - - public GuiCrucible(InventoryPlayer inventoryPlayer, TileEntityCrucible tileCrucible){ - super(new ContainerCrucible(inventoryPlayer, tileCrucible)); - this.tileCrucible = tileCrucible; - - this.xSize = 176; - this.ySize = 195; - } - - public void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); - this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - - if(this.tileCrucible.currentProcessTime > 0){ - int i = this.tileCrucible.getCraftProcessScaled(32); - this.drawTexturedModalRect(guiLeft + 107, guiTop + 55, 176, 0, i, 45); - } - - if(this.tileCrucible.burnTime > 0 && this.tileCrucible.burnTimeOfItem > 0) { - int i = this.tileCrucible.getBurnTimeRemainingScaled(13); - this.drawTexturedModalRect(guiLeft + 141, guiTop + 21 + 12 - i, 188, 45 + 12 - i, 14, i + 1); - } - - if(this.tileCrucible.currentFluidID == Util.fluidWater.ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 47, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(0).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(1).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(2).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(3).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+12, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(4).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59+12, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(5).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59+12, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(6).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+24, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(7).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59+24, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(8).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59+24, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(9).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+36, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(10).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59+36, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(11).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59+36, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(12).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+48, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(13).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 188, 59+48, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(14).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 200, 59+48, 12, 12); - else if(this.tileCrucible.currentFluidID == Util.gemList.get(15).ID) this.drawTexturedModalRect(guiLeft + 141, guiTop + 7, 176, 59+60, 12, 12); - } - - @SuppressWarnings("static-access, unchecked") - public void drawScreen(int par1, int par2, float par3){ - super.drawScreen(par1, par2, par3); - - if(tileCrucible.output != null){ - RenderHelper.enableGUIStandardItemLighting(); - GL11.glEnable(GL11.GL_LIGHTING); - itemRender.renderItemAndEffectIntoGUI(fontRendererObj, mc.getTextureManager(), tileCrucible.output.copy(), guiLeft + 112, guiTop + 65); - GL11.glDisable(GL11.GL_LIGHTING); - RenderHelper.disableStandardItemLighting(); - if(par1 >= 112 + guiLeft && par2 >= 65 + guiTop && par1 <= 112 + 16 + guiLeft && par2 <= 65 + 16 + guiTop){ - this.drawHoveringText(tileCrucible.output.copy().getTooltip(mc.thePlayer, true), par1, par2, mc.fontRenderer); - } - } - if(par1 >= 141 + guiLeft && par2 >= 7 + guiTop && par1 <= 141+12 + guiLeft && par2 <= 7+12 + guiTop){ - String fluidType; - if(tileCrucible.currentFluidID == Util.fluidWater.ID) fluidType = Util.fluidWater.name.substring(5); - else if(tileCrucible.currentFluidID == Util.fluidNone.ID) fluidType = Util.fluidNone.name.substring(5); - else fluidType = Util.gemList.get(tileCrucible.currentFluidID).name.substring(5); - this.drawHoveringText(Arrays.asList(StatCollector.translateToLocal("tooltip.fluid" + fluidType + ".name")), par1, par2, mc.fontRenderer); - } - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/inventory/gui/GuiCrucibleFire.java b/src/main/java/ellpeck/someprettytechystuff/inventory/gui/GuiCrucibleFire.java deleted file mode 100644 index caa1babd0..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/inventory/gui/GuiCrucibleFire.java +++ /dev/null @@ -1,36 +0,0 @@ -package ellpeck.someprettytechystuff.inventory.gui; - -import ellpeck.someprettytechystuff.inventory.container.ContainerCrucibleFire; -import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; - -public class GuiCrucibleFire extends GuiContainer{ - - @SuppressWarnings("all") - private TileEntityCrucibleFire tileCrucibleFire; - - public static final ResourceLocation resLoc = new ResourceLocation(Util.MOD_ID, "textures/gui/guiCrucibleFire.png"); - - public GuiCrucibleFire(InventoryPlayer inventoryPlayer, TileEntityCrucibleFire tileCrucibleFire){ - super(new ContainerCrucibleFire(inventoryPlayer, tileCrucibleFire)); - this.tileCrucibleFire = tileCrucibleFire; - - this.xSize = 176; - this.ySize = 116; - } - - public void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.getTextureManager().bindTexture(resLoc); - this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - - if(this.tileCrucibleFire.burnTime > 0 && this.tileCrucibleFire.burnTimeOfItem > 0) { - int i = this.tileCrucibleFire.getBurnTimeRemainingScaled(13); - this.drawTexturedModalRect(guiLeft + 96, guiTop + 10 + 12 - i, 176, 12 - i, 14, i + 1); - } - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/items/InitItems.java b/src/main/java/ellpeck/someprettytechystuff/items/InitItems.java index b88dfac90..128adbe4a 100644 --- a/src/main/java/ellpeck/someprettytechystuff/items/InitItems.java +++ b/src/main/java/ellpeck/someprettytechystuff/items/InitItems.java @@ -1,67 +1,8 @@ package ellpeck.someprettytechystuff.items; -import cpw.mods.fml.common.registry.GameRegistry; -import ellpeck.someprettytechystuff.blocks.InitBlocks; -import ellpeck.someprettytechystuff.booklet.ItemInfoBook; -import ellpeck.someprettytechystuff.items.tools.*; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.item.Item.ToolMaterial; -import net.minecraftforge.common.util.EnumHelper; - public class InitItems { - public static Item itemInfoBook; - public static Item itemGem; - public static Item itemPile; - - public static Item itemSeedIron; - public static Item itemSeedGold; - public static Item itemSeedRedstone; - public static Item itemSeedDiamond; - - public static Item itemInfusedIronIngot; - public static Item itemInfusedIronAxe; - public static Item itemInfusedIronHoe; - public static Item itemInfusedIronPickaxe; - public static Item itemInfusedIronShovel; - public static Item itemInfusedIronSword; - - public static ToolMaterial infusedIronMaterial = EnumHelper.addToolMaterial("INFUSED_IRON", 3, 2000, 20.0F, 6.0F, 10); - public static void init(){ - itemInfoBook = new ItemInfoBook(); - itemGem = new ItemGem(); - itemPile = new ItemPile(); - - itemInfusedIronIngot = new ItemInfusedIron(); - itemSeedIron = new ItemSeed(InitBlocks.blockCropIron, new ItemStack(itemPile, 1, 0), "itemSeedIron"); - itemSeedGold = new ItemSeed(InitBlocks.blockCropGold, new ItemStack(itemPile, 1, 1), "itemSeedGold"); - itemSeedRedstone = new ItemSeed(InitBlocks.blockCropRedstone, new ItemStack(itemPile, 1, 2), "itemSeedRedstone"); - itemSeedDiamond = new ItemSeed(InitBlocks.blockCropDiamond, new ItemStack(itemPile, 1, 3), "itemSeedDiamond"); - - itemInfusedIronAxe = new ItemAxeG(infusedIronMaterial, "itemInfusedIronAxe"); - itemInfusedIronHoe = new ItemHoeG(infusedIronMaterial, "itemInfusedIronHoe"); - itemInfusedIronPickaxe = new ItemPickaxeG(infusedIronMaterial, "itemInfusedIronPickaxe"); - itemInfusedIronShovel = new ItemShovelG(infusedIronMaterial, "itemInfusedIronShovel"); - itemInfusedIronSword = new ItemSwordG(infusedIronMaterial, "itemInfusedIronSword"); - - GameRegistry.registerItem(itemInfoBook, itemInfoBook.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemGem, itemGem.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemPile, itemPile.getUnlocalizedName().substring(5)); - - GameRegistry.registerItem(itemSeedIron, itemSeedIron.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemSeedGold, itemSeedGold.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemSeedRedstone, itemSeedRedstone.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemSeedDiamond, itemSeedDiamond.getUnlocalizedName().substring(5)); - - GameRegistry.registerItem(itemInfusedIronIngot, itemInfusedIronIngot.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemInfusedIronAxe, itemInfusedIronAxe.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemInfusedIronHoe, itemInfusedIronHoe.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemInfusedIronPickaxe, itemInfusedIronPickaxe.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemInfusedIronShovel, itemInfusedIronShovel.getUnlocalizedName().substring(5)); - GameRegistry.registerItem(itemInfusedIronSword, itemInfusedIronSword.getUnlocalizedName().substring(5)); - } } diff --git a/src/main/java/ellpeck/someprettytechystuff/items/ItemGem.java b/src/main/java/ellpeck/someprettytechystuff/items/ItemGem.java deleted file mode 100644 index 157991813..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/items/ItemGem.java +++ /dev/null @@ -1,63 +0,0 @@ -package ellpeck.someprettytechystuff.items; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.creative.CreativeTab; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; - -import java.util.List; - -public class ItemGem extends Item { - - public final IIcon[] textures; - - public ItemGem(){ - textures = new IIcon[Util.gemList.size()]; - this.setHasSubtypes(true); - this.setCreativeTab(CreativeTab.instance); - this.setUnlocalizedName("itemGem"); - } - - @SuppressWarnings("unchecked") - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(Util.isShiftPressed()){ - for(int i = 0; i < Util.gemList.size(); i++){ - if(this.getDamage(stack) == i) list.add(StatCollector.translateToLocal("tooltip.gem" + Util.gemList.get(i).name.substring(5) + ".desc")); - } - } - else list.add(Util.shiftForInfo()); - } - - public String getUnlocalizedName(ItemStack stack){ - return this.getUnlocalizedName() + Util.gemList.get(stack.getItemDamage()).name.substring(5); - } - - @SuppressWarnings("unchecked") - @SideOnly(Side.CLIENT) - public void getSubItems(Item item, CreativeTabs tabs, List list){ - for (int i = 0; i < Util.gemList.size(); i++) { - list.add(new ItemStack(item, 1, i)); - } - } - - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1){ - return textures[par1]; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister iconReg){ - for (int i = 0; i < Util.gemList.size(); i++) { - textures[i] = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5) + Util.gemList.get(i).name.substring(5)); - } - } - -} \ No newline at end of file diff --git a/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemAxeG.java b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemAxeSPTS.java similarity index 73% rename from src/main/java/ellpeck/someprettytechystuff/items/tools/ItemAxeG.java rename to src/main/java/ellpeck/someprettytechystuff/items/tools/ItemAxeSPTS.java index b4d772301..6349b7048 100644 --- a/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemAxeG.java +++ b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemAxeSPTS.java @@ -8,13 +8,12 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemAxe; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import java.util.List; -public class ItemAxeG extends ItemAxe{ +public class ItemAxeSPTS extends ItemAxe{ - public ItemAxeG(ToolMaterial toolMat, String unlocalizedName){ + public ItemAxeSPTS(ToolMaterial toolMat, String unlocalizedName){ super(toolMat); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(CreativeTab.instance); @@ -23,8 +22,7 @@ public class ItemAxeG extends ItemAxe{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + this.getUnlocalizedName().substring(5) + ".desc")); - else list.add(Util.shiftForInfo()); + Util.addStandardInformation(this); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemHoeSPTS.java b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemHoeSPTS.java new file mode 100644 index 000000000..38b4c1aba --- /dev/null +++ b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemHoeSPTS.java @@ -0,0 +1,32 @@ +package ellpeck.someprettytechystuff.items.tools; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.someprettytechystuff.creative.CreativeTab; +import ellpeck.someprettytechystuff.util.Util; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemHoe; +import net.minecraft.item.ItemStack; + +import java.util.List; + +public class ItemHoeSPTS extends ItemHoe{ + + public ItemHoeSPTS(ToolMaterial toolMat, String unlocalizedName){ + super(toolMat); + this.setUnlocalizedName(unlocalizedName); + this.setCreativeTab(CreativeTab.instance); + } + + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ + Util.addStandardInformation(this); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconReg){ + this.itemIcon = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5)); + } +} diff --git a/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemPickaxeSPTS.java b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemPickaxeSPTS.java new file mode 100644 index 000000000..7867758a8 --- /dev/null +++ b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemPickaxeSPTS.java @@ -0,0 +1,32 @@ +package ellpeck.someprettytechystuff.items.tools; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.someprettytechystuff.creative.CreativeTab; +import ellpeck.someprettytechystuff.util.Util; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemPickaxe; +import net.minecraft.item.ItemStack; + +import java.util.List; + +public class ItemPickaxeSPTS extends ItemPickaxe{ + + public ItemPickaxeSPTS(ToolMaterial toolMat, String unlocalizedName){ + super(toolMat); + this.setUnlocalizedName(unlocalizedName); + this.setCreativeTab(CreativeTab.instance); + } + + @SuppressWarnings("unchecked") + @SideOnly(Side.CLIENT) + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { + Util.addStandardInformation(this); + } + + @SideOnly(Side.CLIENT) + public void registerIcons(IIconRegister iconReg){ + this.itemIcon = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5)); + } +} diff --git a/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemShovelG.java b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemShovelSPTS.java similarity index 73% rename from src/main/java/ellpeck/someprettytechystuff/items/tools/ItemShovelG.java rename to src/main/java/ellpeck/someprettytechystuff/items/tools/ItemShovelSPTS.java index 537995b27..b20362164 100644 --- a/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemShovelG.java +++ b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemShovelSPTS.java @@ -8,13 +8,12 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemSpade; import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; import java.util.List; -public class ItemShovelG extends ItemSpade{ +public class ItemShovelSPTS extends ItemSpade{ - public ItemShovelG(ToolMaterial toolMat, String unlocalizedName){ + public ItemShovelSPTS(ToolMaterial toolMat, String unlocalizedName){ super(toolMat); this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(CreativeTab.instance); @@ -23,8 +22,7 @@ public class ItemShovelG extends ItemSpade{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(Util.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + this.getUnlocalizedName().substring(5) + ".desc")); - else list.add(Util.shiftForInfo()); + Util.addStandardInformation(this); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/ellpeck/someprettytechystuff/items/ItemInfusedIron.java b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemSwordSPTS.java similarity index 70% rename from src/main/java/ellpeck/someprettytechystuff/items/ItemInfusedIron.java rename to src/main/java/ellpeck/someprettytechystuff/items/tools/ItemSwordSPTS.java index 3866b010d..1f2e8dcab 100644 --- a/src/main/java/ellpeck/someprettytechystuff/items/ItemInfusedIron.java +++ b/src/main/java/ellpeck/someprettytechystuff/items/tools/ItemSwordSPTS.java @@ -1,4 +1,4 @@ -package ellpeck.someprettytechystuff.items; +package ellpeck.someprettytechystuff.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -6,27 +6,27 @@ import ellpeck.someprettytechystuff.creative.CreativeTab; import ellpeck.someprettytechystuff.util.Util; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.ItemSword; import java.util.List; -public class ItemInfusedIron extends Item{ +public class ItemSwordSPTS extends ItemSword{ - public ItemInfusedIron(){ + public ItemSwordSPTS(ToolMaterial toolMat, String unlocalizedName){ + super(toolMat); + this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(CreativeTab.instance); - this.setUnlocalizedName("itemInfusedIronIngot"); } @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(Util.addStandardInformation(this)); + Util.addStandardInformation(this); } @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister iconReg){ this.itemIcon = iconReg.registerIcon(Util.MOD_ID + ":" + this.getUnlocalizedName().substring(5)); } - -} \ No newline at end of file +} diff --git a/src/main/java/ellpeck/someprettytechystuff/proxy/ClientProxy.java b/src/main/java/ellpeck/someprettytechystuff/proxy/ClientProxy.java index 3c5694239..27c2fc901 100644 --- a/src/main/java/ellpeck/someprettytechystuff/proxy/ClientProxy.java +++ b/src/main/java/ellpeck/someprettytechystuff/proxy/ClientProxy.java @@ -1,13 +1,5 @@ package ellpeck.someprettytechystuff.proxy; -import cpw.mods.fml.client.registry.ClientRegistry; -import ellpeck.someprettytechystuff.blocks.InitBlocks; -import ellpeck.someprettytechystuff.blocks.models.*; -import ellpeck.someprettytechystuff.tile.TileEntityCrucible; -import ellpeck.someprettytechystuff.tile.TileEntityCrucibleFire; -import net.minecraft.item.Item; -import net.minecraftforge.client.MinecraftForgeClient; - @SuppressWarnings("unused") public class ClientProxy implements IProxy{ @@ -16,10 +8,7 @@ public class ClientProxy implements IProxy{ } public void init() { - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrucible.class, new RendererCrucible()); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockCrucible), new RendererHoldingTileEntity(new ModelCrucible(), RendererCrucible.resLoc)); - ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCrucibleFire.class, new RendererCrucibleFire()); - MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(InitBlocks.blockCrucibleFire), new RendererHoldingTileEntity(new ModelCrucibleFire(), RendererCrucibleFire.resLoc)); + } public void postInit() { diff --git a/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityBase.java b/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityBase.java index b709ef0bb..92125418e 100644 --- a/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityBase.java +++ b/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityBase.java @@ -1,7 +1,5 @@ package ellpeck.someprettytechystuff.tile; -import cpw.mods.fml.common.registry.GameRegistry; -import ellpeck.someprettytechystuff.util.Util; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.NetworkManager; import net.minecraft.network.Packet; @@ -22,7 +20,6 @@ public class TileEntityBase extends TileEntity{ } public static void init(){ - GameRegistry.registerTileEntity(TileEntityCrucible.class, Util.MOD_ID + "tileEntityCrucible"); - GameRegistry.registerTileEntity(TileEntityCrucibleFire.class, Util.MOD_ID + "tileEntityCrucibleFire"); + } } diff --git a/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityCrucible.java b/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityCrucible.java deleted file mode 100644 index d97a44b17..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityCrucible.java +++ /dev/null @@ -1,165 +0,0 @@ -package ellpeck.someprettytechystuff.tile; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.blocks.InitBlocks; -import ellpeck.someprettytechystuff.crafting.CrucibleCraftingManager; -import ellpeck.someprettytechystuff.items.ItemGem; -import ellpeck.someprettytechystuff.util.GemType; -import ellpeck.someprettytechystuff.util.Util; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class TileEntityCrucible extends TileEntityInventoryBase{ - - public final int slotOutput = 11; - public final int slotMainInput = 4; - public final int slotWater = 9; - public final int slotSmeltGem = 10; - - /* - Variables that need to be saved to and loaded from NBT - */ - public GemType currentFluid = Util.fluidNone; - public int currentFluidID; - public int currentProcessTime; - public int processTimeNeeded; - public int burnTime; - public int burnTimeOfItem; - - public ItemStack output; - - public TileEntityCrucible(){ - /** - * 0-3: Inputs - * 4: Main Input - * 5-8: Inputs - * 9: Water - * 10: Gem - * 11: Output - */ - this.slots = new ItemStack[12]; - } - - @SuppressWarnings("static-access") - public void updateEntity(){ - boolean isCraftingFlag = this.isCrafting(); - if(!worldObj.isRemote){ - if(!this.isCrafting()) this.output = CrucibleCraftingManager.instance.getCraftingResult(slots, 0, 8, currentFluid); - this.getBurnFromBelow(); - this.addWaterByWaterSlot(); - this.colorGemWater(); - this.craft(); - this.currentFluidID = this.currentFluid.ID; - } - if(isCraftingFlag != this.isCrafting()){ - this.markDirty(); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - } - - public boolean isCrafting(){ - return this.currentProcessTime > 0; - } - - public void craft(){ - if(this.burnTime > 0){ - if (!this.isCrafting()){ - if (output != null && (this.slots[slotOutput] == null || this.slots[slotOutput].isItemEqual(output))) { - this.processTimeNeeded = this.currentProcessTime = CrucibleCraftingManager.instance.getProcessTimeNeeded(slots, 0, 8); - for (int i = 0; i <= 8; i++){ - this.slots[i].stackSize--; - if (this.slots[i].stackSize == 0) { - this.slots[i] = slots[i].getItem().getContainerItem(slots[i]); - } - } - this.currentFluid = Util.fluidNone; - } - } - if(this.isCrafting()){ - this.currentProcessTime--; - if (this.currentProcessTime <= 0){ - if (this.slots[slotOutput] == null) this.slots[slotOutput] = output.copy(); - else if(this.slots[slotOutput].isItemEqual(output)) this.slots[slotOutput].stackSize += output.stackSize; - this.currentProcessTime = 0; - this.processTimeNeeded = 0; - this.output = null; - } - } - } - } - - public void getBurnFromBelow(){ - TileEntity tileDown = worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord); - if(tileDown instanceof TileEntityCrucibleFire){ - this.burnTime = ((TileEntityCrucibleFire)tileDown).burnTime; - this.burnTimeOfItem = ((TileEntityCrucibleFire)tileDown).burnTimeOfItem; - } - else{ - this.burnTime = 0; - this.burnTimeOfItem = 0; - } - } - - public void colorGemWater(){ - ItemStack stack = this.slots[slotSmeltGem]; - if(stack != null && stack.getItem() instanceof ItemGem){ - if(this.currentFluid == Util.fluidWater) { - this.currentFluid = Util.gemList.get(stack.getItemDamage()); - stack.stackSize--; - if(stack.stackSize == 0) this.slots[slotSmeltGem] = stack.getItem().getContainerItem(stack); - } - } - } - - public void addWaterByWaterSlot(){ - if(this.slots[this.slotWater] != null && this.slots[this.slotWater].getItem() == Items.water_bucket && this.currentFluid == Util.fluidNone){ - this.currentFluid = Util.fluidWater; - this.slots[this.slotWater] = new ItemStack(Items.bucket); - } - } - - public String getInventoryName() { - return InitBlocks.blockCrucible.getUnlocalizedName().substring(5); - } - - public void writeToNBT(NBTTagCompound compound){ - super.writeToNBT(compound); - - compound.setInteger("CurrentFluidID", this.currentFluidID); - compound.setInteger("ProcessTime", this.currentProcessTime); - compound.setInteger("ProcessTimeNeeded", this.processTimeNeeded); - - if(output != null) { - NBTTagCompound compoundOutput = new NBTTagCompound(); - compoundOutput = output.writeToNBT(compoundOutput); - compound.setTag("Output", compoundOutput); - } - } - - @SuppressWarnings("static-access") - public void readFromNBT(NBTTagCompound compound){ - super.readFromNBT(compound); - - this.currentFluidID = compound.getInteger("CurrentFluidID"); - this.currentProcessTime = compound.getInteger("ProcessTime"); - this.processTimeNeeded = compound.getInteger("ProcessTimeNeeded"); - this.output = ItemStack.loadItemStackFromNBT(compound.getCompoundTag("Output")); - - if(this.currentFluidID == Util.fluidWater.ID) this.currentFluid = Util.fluidWater; - else if(this.currentFluidID == Util.fluidNone.ID) this.currentFluid = Util.fluidNone; - else this.currentFluid = Util.gemList.get(this.currentFluidID); - } - - @SideOnly(Side.CLIENT) - public int getCraftProcessScaled(int par1){ - return (this.processTimeNeeded-this.currentProcessTime) * par1 / this.processTimeNeeded; - } - - @SideOnly(Side.CLIENT) - public int getBurnTimeRemainingScaled(int i){ - return this.burnTime * i / this.burnTimeOfItem; - } -} \ No newline at end of file diff --git a/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityCrucibleFire.java b/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityCrucibleFire.java deleted file mode 100644 index 97c6d5243..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/tile/TileEntityCrucibleFire.java +++ /dev/null @@ -1,73 +0,0 @@ -package ellpeck.someprettytechystuff.tile; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.someprettytechystuff.blocks.InitBlocks; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntityFurnace; - -public class TileEntityCrucibleFire extends TileEntityInventoryBase{ - - public int burnTime; - public int burnTimeOfItem; - - public TileEntityCrucibleFire(){ - this.slots = new ItemStack[1]; - } - - public void updateEntity(){ - boolean isBurningFlag = this.isBurning(); - if(!worldObj.isRemote){ - this.burnFuel(); - } - if(isBurningFlag != this.isBurning()){ - this.markDirty(); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); - } - } - - public void burnFuel(){ - if(this.burnTime <= 0){ - if (this.slots[0] != null) { - this.burnTimeOfItem = this.burnTime = TileEntityFurnace.getItemBurnTime(this.slots[0]); - this.slots[0].stackSize--; - if (this.slots[0].stackSize == 0){ - this.slots[0] = slots[0].getItem().getContainerItem(slots[0]); - } - } - } - if(this.burnTime > 0){ - this.burnTime--; - if(this.burnTime <= 0){ - this.burnTimeOfItem = 0; - this.burnTime = 0; - } - } - } - - public String getInventoryName() { - return InitBlocks.blockCrucibleFire.getUnlocalizedName().substring(5); - } - - public void writeToNBT(NBTTagCompound compound){ - super.writeToNBT(compound); - compound.setInteger("BurnTime", this.burnTime); - compound.setInteger("BurnTimeOfItem", this.burnTimeOfItem); - } - - public void readFromNBT(NBTTagCompound compound){ - super.readFromNBT(compound); - this.burnTime = compound.getInteger("BurnTime"); - this.burnTimeOfItem = compound.getInteger("BurnTimeOfItem"); - } - - @SideOnly(Side.CLIENT) - public int getBurnTimeRemainingScaled(int i){ - return this.burnTime * i / this.burnTimeOfItem; - } - - public boolean isBurning(){ - return this.burnTime > 0; - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/util/GemType.java b/src/main/java/ellpeck/someprettytechystuff/util/GemType.java deleted file mode 100644 index db378b5b5..000000000 --- a/src/main/java/ellpeck/someprettytechystuff/util/GemType.java +++ /dev/null @@ -1,13 +0,0 @@ -package ellpeck.someprettytechystuff.util; - -public class GemType{ - - public final int ID; - public final String name; - - public GemType(int ID, String name, boolean shouldAddToList){ - this.ID = ID; - this.name = "fluid" + name; - if(shouldAddToList) Util.gemList.add(ID, this); - } -} diff --git a/src/main/java/ellpeck/someprettytechystuff/util/Util.java b/src/main/java/ellpeck/someprettytechystuff/util/Util.java index a9b8633bf..082786c87 100644 --- a/src/main/java/ellpeck/someprettytechystuff/util/Util.java +++ b/src/main/java/ellpeck/someprettytechystuff/util/Util.java @@ -4,35 +4,12 @@ import net.minecraft.item.Item; import net.minecraft.util.StatCollector; import org.lwjgl.input.Keyboard; -import java.util.ArrayList; - @SuppressWarnings("unused") public class Util{ public static final String MOD_ID = "someprettytechystuff"; - public static final String NAME = "Gemification"; - public static final String VERSION = "1.7.10-1.0.1"; - - public static ArrayList gemList = new ArrayList(); - - public static final GemType onyx = new GemType(0, "Onyx", true); - public static final GemType almandineGarnet = new GemType(1, "AlmandineGarnet", true); - public static final GemType chromeDiopside = new GemType(2, "ChromeDiopside", true); - public static final GemType jasper = new GemType(3, "Jasper", true); - public static final GemType sodalite = new GemType(4, "Sodalite", true); - public static final GemType iolite = new GemType(5, "Iolite", true); - public static final GemType smithsonite = new GemType(6, "Smithsonite", true); - public static final GemType danburite = new GemType(7, "Danburite", true); - public static final GemType hematite = new GemType(8, "Hematite", true); - public static final GemType lepidolite = new GemType(9, "Lepidolite", true); - public static final GemType tourmaline = new GemType(10, "Tourmaline", true); - public static final GemType sphene = new GemType(11, "Sphene", true); - public static final GemType paraibaTourlamine = new GemType(12, "ParaibaTourlamine", true); - public static final GemType rhodochrosite = new GemType(13, "Rhodochrosite", true); - public static final GemType clinohumite = new GemType(14, "Clinohumite", true); - public static final GemType goshenite = new GemType(15, "Goshenite", true); - public static final GemType fluidWater = new GemType(16, "Water", false); - public static final GemType fluidNone = new GemType(17, "None", false); + public static final String NAME = "SomePrettyTechyStuff"; + public static final String VERSION = "1.7.10-0.0.1"; public static boolean isShiftPressed(){ return Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT);