From 0bdc4f00978cbf6023e33497c5394bfcea75a409 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 4 Apr 2015 05:20:19 +0200 Subject: [PATCH] ESD Updates, Item Description Sorting, OreDictionary Crafting! --- .../actuallyadditions/ActuallyAdditions.java | 2 - .../ellpeck/actuallyadditions/PLANNED.txt | 9 -- .../blocks/BlockCompost.java | 17 +-- .../actuallyadditions/blocks/BlockFeeder.java | 16 +-- .../blocks/BlockFishingNet.java | 17 +-- .../blocks/BlockFurnaceDouble.java | 16 +-- .../blocks/BlockFurnaceSolar.java | 17 +-- .../blocks/BlockGiantChest.java | 20 ++-- .../blocks/BlockGrinder.java | 15 ++- .../blocks/BlockHeatCollector.java | 15 ++- .../blocks/BlockInputter.java | 32 +++-- .../blocks/BlockItemRepairer.java | 18 +-- .../actuallyadditions/blocks/BlockMisc.java | 17 ++- .../actuallyadditions/blocks/InitBlocks.java | 8 +- .../blocks/metalists/TheMiscBlocks.java | 23 ++-- .../crafting/BlockCrafting.java | 110 +++++++++++------- .../crafting/FoodCrafting.java | 71 +++++------ .../crafting/GrinderCrafting.java | 4 +- .../crafting/ItemCrafting.java | 42 ++++--- .../crafting/MiscCrafting.java | 18 +-- .../crafting/ToolCrafting.java | 31 ++--- .../creative/CreativeTab.java | 1 + .../gadget/RenderSpecial.java | 8 +- .../inventory/ContainerInputter.java | 31 +++-- .../inventory/GuiHandler.java | 11 +- .../inventory/GuiInputter.java | 45 +++---- .../inventory/slot/SlotFilter.java | 16 +++ .../actuallyadditions/items/InitItems.java | 8 +- .../items/ItemCrafterOnAStick.java | 11 +- .../actuallyadditions/items/ItemDust.java | 17 ++- .../items/ItemFertilizer.java | 11 +- .../actuallyadditions/items/ItemFoods.java | 13 ++- .../actuallyadditions/items/ItemKnife.java | 10 +- .../items/ItemLeafBlower.java | 17 ++- .../actuallyadditions/items/ItemMisc.java | 17 ++- .../items/ItemPotionRing.java | 8 +- .../items/ItemSpecialDrop.java | 17 ++- .../items/metalists/TheDusts.java | 29 +++-- .../items/metalists/TheFoods.java | 45 ++++--- .../items/metalists/TheMiscItems.java | 29 +++-- .../items/metalists/ThePotionRings.java | 9 +- .../items/metalists/TheSpecialDrops.java | 25 ++-- .../items/tools/ItemAxeAA.java | 15 ++- .../items/tools/ItemHoeAA.java | 17 ++- .../items/tools/ItemPickaxeAA.java | 15 ++- .../items/tools/ItemShovelAA.java | 15 ++- .../items/tools/ItemSwordAA.java | 17 ++- .../oredict/OreDictRegistry.java | 25 ---- .../tile/TileEntityInputter.java | 50 ++++++-- .../actuallyadditions/util/BlockUtil.java | 33 +++++- .../util/{IName.java => INameableItem.java} | 4 +- .../actuallyadditions/util/ItemUtil.java | 33 +++++- .../assets/actuallyadditions/lang/en_US.lang | 17 ++- .../textures/blocks/blockFeeder.png | Bin 622 -> 603 bytes .../textures/blocks/blockFeederTop.png | Bin 352 -> 657 bytes .../textures/blocks/blockGiantChest.png | Bin 353 -> 622 bytes .../textures/blocks/blockGiantChestTop.png | Bin 374 -> 752 bytes .../textures/items/itemLeafBlower.png | Bin 422 -> 421 bytes .../textures/items/itemLeafBlowerAdvanced.png | Bin 348 -> 412 bytes 59 files changed, 729 insertions(+), 408 deletions(-) create mode 100644 src/main/java/ellpeck/actuallyadditions/inventory/slot/SlotFilter.java delete mode 100644 src/main/java/ellpeck/actuallyadditions/oredict/OreDictRegistry.java rename src/main/java/ellpeck/actuallyadditions/util/{IName.java => INameableItem.java} (51%) diff --git a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java index 90c9dddc2..85f298dd2 100644 --- a/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java +++ b/src/main/java/ellpeck/actuallyadditions/ActuallyAdditions.java @@ -18,7 +18,6 @@ import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.material.InitItemMaterials; import ellpeck.actuallyadditions.network.PacketHandler; -import ellpeck.actuallyadditions.oredict.OreDictRegistry; import ellpeck.actuallyadditions.proxy.IProxy; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.util.ModUtil; @@ -42,7 +41,6 @@ public class ActuallyAdditions{ InitItemMaterials.init(); InitBlocks.init(); InitItems.init(); - OreDictRegistry.init(); proxy.preInit(); Util.logInfo("PreInitialization Finished."); diff --git a/src/main/java/ellpeck/actuallyadditions/PLANNED.txt b/src/main/java/ellpeck/actuallyadditions/PLANNED.txt index fbd8f76fd..e9bba6d6c 100644 --- a/src/main/java/ellpeck/actuallyadditions/PLANNED.txt +++ b/src/main/java/ellpeck/actuallyadditions/PLANNED.txt @@ -1,13 +1,8 @@ --Redstone Control for the ESD - -Quartz Enchanter -Lets you enchant Tools with Black Quartz -Doesn't use Levels -Needs Quartz and Diamond Blocks instead of Bookcases around --Advanced ESD - -Has a Filter - -Instant Teleport Device -Teleports Players to where they look (Much like the Bukkit Compass) @@ -30,10 +25,6 @@ -Has a Recipe saved -Crafts Recipe on Shift-Right-Click if all Items are in Inventory --Repair Station - -Powered by Coal - -Repairs Items slowly - -TNT Arrows -Teleport Arrows diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java index a146016b4..946a0854e 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockCompost.java @@ -8,10 +8,7 @@ import ellpeck.actuallyadditions.items.ItemFertilizer; import ellpeck.actuallyadditions.items.ItemMisc; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import ellpeck.actuallyadditions.tile.TileEntityCompost; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -29,7 +26,7 @@ import net.minecraft.world.World; import java.util.List; -public class BlockCompost extends BlockContainerBase implements IName{ +public class BlockCompost extends BlockContainerBase implements INameableItem{ public BlockCompost(){ super(Material.wood); @@ -125,6 +122,11 @@ public class BlockCompost extends BlockContainerBase implements IName{ return "blockCompost"; } + @Override + public String getOredictName(){ + return this.getName(); + } + public static class TheItemBlock extends ItemBlock{ private Block theBlock; @@ -151,9 +153,10 @@ public class BlockCompost extends BlockContainerBase implements IName{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc.1")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc.1")); //TODO Remove second info - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc.2")); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc.2")); + BlockUtil.addOredictName(theBlock, list); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java index 7ea42f5f3..4d02d5de8 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFeeder.java @@ -5,9 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityFeeder; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -18,12 +17,11 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class BlockFeeder extends BlockContainerBase implements IName{ +public class BlockFeeder extends BlockContainerBase implements INameableItem{ private IIcon topIcon; @@ -34,6 +32,11 @@ public class BlockFeeder extends BlockContainerBase implements IName{ this.setStepSound(soundTypeWood); } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFeeder(); @@ -97,8 +100,7 @@ public class BlockFeeder extends BlockContainerBase implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addStandardInformation(theBlock, list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java index 3431050ca..bde59564c 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFishingNet.java @@ -4,10 +4,8 @@ import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityFishingNet; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -18,12 +16,11 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class BlockFishingNet extends BlockContainerBase implements IName{ +public class BlockFishingNet extends BlockContainerBase implements INameableItem{ public BlockFishingNet(){ super(Material.wood); @@ -33,6 +30,11 @@ public class BlockFishingNet extends BlockContainerBase implements IName{ this.setBlockBounds(0F, 0F, 0F, 1F, 1F/16F, 1F); } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFishingNet(); @@ -94,8 +96,7 @@ public class BlockFishingNet extends BlockContainerBase implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addStandardInformation(theBlock, list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java index 1cf568b08..5467c2895 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceDouble.java @@ -5,9 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityFurnaceDouble; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -20,14 +19,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import java.util.List; import java.util.Random; -public class BlockFurnaceDouble extends BlockContainerBase implements IName{ +public class BlockFurnaceDouble extends BlockContainerBase implements INameableItem{ private IIcon topIcon; private IIcon onIcon; @@ -41,6 +39,11 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IName{ this.setTickRandomly(true); } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public void onBlockAdded(World world, int x, int y, int z){ super.onBlockAdded(world, x, y, z); @@ -179,8 +182,7 @@ public class BlockFurnaceDouble extends BlockContainerBase implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addStandardInformation(theBlock, list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java index f38b339db..9c5aaee2f 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockFurnaceSolar.java @@ -4,10 +4,8 @@ import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityFurnaceSolar; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -18,12 +16,11 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class BlockFurnaceSolar extends BlockContainerBase implements IName{ +public class BlockFurnaceSolar extends BlockContainerBase implements INameableItem{ public BlockFurnaceSolar(){ super(Material.wood); @@ -33,6 +30,11 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IName{ this.setBlockBounds(0F, 0F, 0F, 1F, 3F/16F, 1F); } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityFurnaceSolar(); @@ -94,8 +96,7 @@ public class BlockFurnaceSolar extends BlockContainerBase implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addStandardInformation(theBlock, list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java index 6d3a0a7c9..9883331f7 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGiantChest.java @@ -5,9 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityGiantChest; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -18,14 +17,14 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.World; import java.util.List; -public class BlockGiantChest extends BlockContainerBase implements IName{ +public class BlockGiantChest extends BlockContainerBase implements INameableItem{ private IIcon topIcon; + private IIcon bottomIcon; public BlockGiantChest(){ super(Material.wood); @@ -34,6 +33,11 @@ public class BlockGiantChest extends BlockContainerBase implements IName{ this.setStepSound(soundTypeWood); } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityGiantChest(); @@ -41,7 +45,7 @@ public class BlockGiantChest extends BlockContainerBase implements IName{ @Override public IIcon getIcon(int side, int metadata){ - return side == 1 ? this.topIcon : this.blockIcon; + return side == 1 ? this.topIcon : (side == 0 ? this.bottomIcon : this.blockIcon); } @Override @@ -49,6 +53,7 @@ public class BlockGiantChest extends BlockContainerBase implements IName{ public void registerBlockIcons(IIconRegister iconReg){ this.blockIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName()); this.topIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Top"); + this.bottomIcon = iconReg.registerIcon(ModUtil.MOD_ID_LOWER + ":" + this.getName() + "Bottom"); } @Override @@ -97,8 +102,7 @@ public class BlockGiantChest extends BlockContainerBase implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addStandardInformation(theBlock, list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java index c7dc6c77e..11e4cee57 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockGrinder.java @@ -5,10 +5,7 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityGrinder; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -25,7 +22,7 @@ import net.minecraft.world.World; import java.util.List; import java.util.Random; -public class BlockGrinder extends BlockContainerBase implements IName{ +public class BlockGrinder extends BlockContainerBase implements INameableItem{ private IIcon topIcon; private IIcon onIcon; @@ -94,6 +91,11 @@ public class BlockGrinder extends BlockContainerBase implements IName{ return true; } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public void breakBlock(World world, int x, int y, int z, Block block, int par6){ this.dropInventory(world, x, y, z); @@ -132,8 +134,9 @@ public class BlockGrinder extends BlockContainerBase implements IName{ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ for(int i = 0; i < (((BlockGrinder)theBlock).isDouble ? 3 : 4); i++){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + (i+1))); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc." + (i+1))); } + BlockUtil.addOredictName(theBlock, list); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java index d36d826c0..9bb0fd9c7 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockHeatCollector.java @@ -3,10 +3,7 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.tile.TileEntityHeatCollector; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -21,7 +18,7 @@ import net.minecraft.world.World; import java.util.List; -public class BlockHeatCollector extends BlockContainerBase implements IName{ +public class BlockHeatCollector extends BlockContainerBase implements INameableItem{ private IIcon topIcon; private IIcon bottomIcon; @@ -33,6 +30,11 @@ public class BlockHeatCollector extends BlockContainerBase implements IName{ this.setStepSound(soundTypeStone); } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityHeatCollector(); @@ -83,8 +85,9 @@ public class BlockHeatCollector extends BlockContainerBase implements IName{ public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ for(int i = 0; i < 3; i++){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + (i + 1))); + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc." + (i + 1))); } + BlockUtil.addOredictName(theBlock, list); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java index 7bfe8a6d9..0dc8ed38a 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockInputter.java @@ -21,21 +21,29 @@ import net.minecraft.world.World; import java.util.List; import java.util.Random; -public class BlockInputter extends BlockContainerBase implements IName{ +public class BlockInputter extends BlockContainerBase implements INameableItem{ - public static final int NAME_FLAVOUR_AMOUNTS = 12; + public static final int NAME_FLAVOUR_AMOUNTS = 15; - public BlockInputter(){ + public boolean isAdvanced; + + public BlockInputter(boolean isAdvanced){ super(Material.rock); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.0F); this.setStepSound(soundTypeStone); this.setTickRandomly(true); + this.isAdvanced = isAdvanced; + } + + @Override + public String getOredictName(){ + return this.getName(); } @Override public TileEntity createNewTileEntity(World world, int par2){ - return new TileEntityInputter(); + return new TileEntityInputter(this.isAdvanced); } @Override @@ -53,7 +61,7 @@ public class BlockInputter extends BlockContainerBase implements IName{ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ TileEntityInputter inputter = (TileEntityInputter)world.getTileEntity(x, y, z); - if (inputter != null) player.openGui(ActuallyAdditions.instance, GuiHandler.INPUTTER_ID, world, x, y, z); + if (inputter != null) player.openGui(ActuallyAdditions.instance, this.isAdvanced ? GuiHandler.INPUTTER_ADVANCED_ID : GuiHandler.INPUTTER_ID, world, x, y, z); return true; } return true; @@ -67,7 +75,7 @@ public class BlockInputter extends BlockContainerBase implements IName{ @Override public String getName(){ - return "blockInputter"; + return this.isAdvanced ? "blockInputterAdvanced" : "blockInputter"; } public static class TheItemBlock extends ItemBlock{ @@ -86,7 +94,7 @@ public class BlockInputter extends BlockContainerBase implements IName{ @Override public EnumRarity getRarity(ItemStack stack){ - return EnumRarity.rare; + return ((BlockInputter)theBlock).isAdvanced ? EnumRarity.epic : EnumRarity.rare; } @Override @@ -99,7 +107,7 @@ public class BlockInputter extends BlockContainerBase implements IName{ this.toPick = rand.nextInt(NAME_FLAVOUR_AMOUNTS+1); } - return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name") + " (" + StatCollector.translateToLocal(this.getUnlocalizedName() + ".add." + this.toPick + ".name") + ")"; + return StatCollector.translateToLocal(this.getUnlocalizedName() + ".name") + " (" + StatCollector.translateToLocal("tile." + ModUtil.MOD_ID_LOWER + ".blockInputter.add." + this.toPick + ".name") + ")"; } @Override @@ -112,10 +120,12 @@ public class BlockInputter extends BlockContainerBase implements IName{ @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocalFormatted("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + 1, StringUtil.OBFUSCATED, StringUtil.LIGHT_GRAY)); - for(int i = 1; i < 5; i++){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc." + (i + 1))); + list.add(StatCollector.translateToLocalFormatted("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + 1, StringUtil.OBFUSCATED, StringUtil.LIGHT_GRAY)); + for(int i = 1; i < 6; i++){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".blockInputter.desc." + (i + 1))); } + if((((BlockInputter)theBlock).isAdvanced)) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + ".desc")); + BlockUtil.addOredictName(theBlock, list); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java index 23a1a4b5e..3dbd210fa 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockItemRepairer.java @@ -5,9 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; import ellpeck.actuallyadditions.tile.TileEntityItemRepairer; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; +import ellpeck.actuallyadditions.util.BlockUtil; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; @@ -18,14 +17,13 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; -import net.minecraft.util.StatCollector; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import java.util.List; import java.util.Random; -public class BlockItemRepairer extends BlockContainerBase implements IName{ +public class BlockItemRepairer extends BlockContainerBase implements INameableItem{ private IIcon topIcon; private IIcon onIcon; @@ -39,6 +37,11 @@ public class BlockItemRepairer extends BlockContainerBase implements IName{ this.setTickRandomly(true); } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public TileEntity createNewTileEntity(World world, int par2){ return new TileEntityItemRepairer(); @@ -118,10 +121,7 @@ public class BlockItemRepairer extends BlockContainerBase implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()){ - list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + ".desc")); - } - else list.add(ItemUtil.shiftForInfo()); + BlockUtil.addStandardInformation(theBlock, list); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java index d04ae3cc7..99a163c09 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockMisc.java @@ -3,10 +3,7 @@ package ellpeck.actuallyadditions.blocks; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -21,7 +18,7 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class BlockMisc extends Block implements IName{ +public class BlockMisc extends Block implements INameableItem{ public static final TheMiscBlocks[] allMiscBlocks = TheMiscBlocks.values(); public IIcon[] textures = new IIcon[allMiscBlocks.length]; @@ -63,6 +60,11 @@ public class BlockMisc extends Block implements IName{ return "blockMisc"; } + @Override + public String getOredictName(){ + return ""; + } + public static class TheItemBlock extends ItemBlock{ private Block theBlock; @@ -88,7 +90,10 @@ public class BlockMisc extends Block implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)theBlock).getName() + allMiscBlocks[stack.getItemDamage()].getName() + ".desc")); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)theBlock).getName() + allMiscBlocks[stack.getItemDamage()].getName() + ".desc")); + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allMiscBlocks[stack.getItemDamage()].getOredictName()); + } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java index 45e4b03ef..cca5866f2 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/InitBlocks.java @@ -15,6 +15,7 @@ public class InitBlocks{ public static Block blockGrinderDouble; public static Block blockFurnaceDouble; public static Block blockInputter; + public static Block blockInputterAdvanced; public static Block blockFishingNet; public static Block blockFurnaceSolar; public static Block blockHeatCollector; @@ -27,7 +28,7 @@ public class InitBlocks{ BlockUtil.register(blockCompost, BlockCompost.TheItemBlock.class); blockMisc = new BlockMisc(); - BlockUtil.register(blockMisc, BlockMisc.TheItemBlock.class); + BlockUtil.register(blockMisc, BlockMisc.TheItemBlock.class, BlockMisc.allMiscBlocks); blockFeeder = new BlockFeeder(); BlockUtil.register(blockFeeder, BlockFeeder.TheItemBlock.class); @@ -44,9 +45,12 @@ public class InitBlocks{ blockFurnaceDouble = new BlockFurnaceDouble(); BlockUtil.register(blockFurnaceDouble, BlockFurnaceDouble.TheItemBlock.class); - blockInputter = new BlockInputter(); + blockInputter = new BlockInputter(false); BlockUtil.register(blockInputter, BlockInputter.TheItemBlock.class); + blockInputterAdvanced = new BlockInputter(true); + BlockUtil.register(blockInputterAdvanced, BlockInputter.TheItemBlock.class); + blockFishingNet = new BlockFishingNet(); BlockUtil.register(blockFishingNet, BlockFishingNet.TheItemBlock.class); diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java b/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java index 43e4e64a7..d2c2dcdb3 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/metalists/TheMiscBlocks.java @@ -1,25 +1,34 @@ package ellpeck.actuallyadditions.blocks.metalists; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.item.EnumRarity; -public enum TheMiscBlocks implements IName{ +public enum TheMiscBlocks implements INameableItem{ - QUARTZ_PILLAR("BlackQuartzPillar", EnumRarity.rare), - QUARTZ_CHISELED("BlackQuartzChiseled", EnumRarity.rare), - QUARTZ("BlackQuartz", EnumRarity.rare), - ORE_QUARTZ("OreBlackQuartz", EnumRarity.epic); + QUARTZ_PILLAR("BlackQuartzPillar", EnumRarity.rare, "blockQuartzBlack"), + QUARTZ_CHISELED("BlackQuartzChiseled", EnumRarity.rare, "blockQuartzBlack"), + QUARTZ("BlackQuartz", EnumRarity.rare, "blockQuartzBlack"), + ORE_QUARTZ("OreBlackQuartz", EnumRarity.epic, "oreQuartzBlack"), + WOOD_CASING("WoodCasing", EnumRarity.common, "blockCasingWood"), + STONE_CASING("StoneCasing", EnumRarity.uncommon, "blockCasingStone"); public final String name; + public final String oredictName; public final EnumRarity rarity; - TheMiscBlocks(String name, EnumRarity rarity){ + TheMiscBlocks(String name, EnumRarity rarity, String oredictName){ this.name = name; this.rarity = rarity; + this.oredictName = oredictName; } @Override public String getName(){ return this.name; } + + @Override + public String getOredictName(){ + return this.oredictName; + } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java index bdc1bde90..7d805dfe3 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -4,12 +4,13 @@ import cpw.mods.fml.common.registry.GameRegistry; import ellpeck.actuallyadditions.blocks.InitBlocks; import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; import ellpeck.actuallyadditions.config.ConfigValues; -import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import ellpeck.actuallyadditions.util.Util; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; public class BlockCrafting{ @@ -17,103 +18,124 @@ public class BlockCrafting{ //Compost if(ConfigValues.enableCompostRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockCompost), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockCompost), "W W", "WFW", "WWW", - 'W', new ItemStack(Blocks.planks, 1, Util.WILDCARD), - 'F', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.MASHED_FOOD.ordinal())); + 'W', "plankWood", + 'F', TheMiscItems.MASHED_FOOD.getOredictName())); + + //Wood Casing + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.WOOD_CASING.ordinal()), + "WSW", "SRS", "WSW", + 'W', "plankWood", + 'R', "dustRedstone", + 'S', "stickWood")); + + //Stone Casing + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()), + "WSW", "SRS", "WSW", + 'W', "cobblestone", + 'R', "dustRedstone", + 'S', "stickWood")); //Quartz Block - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal()), "QQ", "QQ", - 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); + 'Q', TheMiscItems.QUARTZ.getOredictName())); //Fishing Net if(ConfigValues.enableFishingNetRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockFishingNet), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFishingNet), "SSS", "SDS", "SSS", - 'D', new ItemStack(Items.diamond), - 'S', new ItemStack(Items.string)); + 'D', "gemDiamond", + 'S', Items.string)); //Repairer if(ConfigValues.enableRepairerRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockItemRepairer), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockItemRepairer), "DID", "DCD", "DID", - 'D', new ItemStack(Items.diamond), - 'I', new ItemStack(Items.iron_ingot), - 'C', new ItemStack(Blocks.crafting_table)); + 'D', "gemDiamond", + 'I', "ingotIron", + 'C', Blocks.crafting_table)); //Solar Panel if(ConfigValues.enableSolarRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockFurnaceSolar), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFurnaceSolar), "IBI", "BDB", "IBI", - 'D', new ItemStack(Blocks.diamond_block), - 'I', new ItemStack(Items.iron_ingot), - 'B', new ItemStack(Blocks.iron_bars)); + 'D', "blockDiamond", + 'I', "ingotIron", + 'B', new ItemStack(Blocks.iron_bars))); //Heat Collector if(ConfigValues.enableHeatCollectorRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockHeatCollector), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockHeatCollector), "BRB", "LDL", "BRB", - 'D', new ItemStack(Blocks.diamond_block), + 'D', "blockDiamond", 'R', new ItemStack(Items.repeater), 'L', new ItemStack(Items.lava_bucket), - 'B', new ItemStack(Blocks.iron_bars)); + 'B', new ItemStack(Blocks.iron_bars))); //Quartz Pillar - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ_PILLAR.ordinal()), "Q", "Q", - 'Q', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); + 'Q', TheMiscItems.QUARTZ.getOredictName())); //Chiseled Quartz - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockMisc, 2, TheMiscBlocks.QUARTZ_CHISELED.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockMisc, 2, TheMiscBlocks.QUARTZ_CHISELED.ordinal()), "Q", "Q", - 'Q', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.QUARTZ.ordinal())); + 'Q', TheMiscBlocks.QUARTZ.getOredictName())); //Inputter - if(ConfigValues.enableInputterRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockInputter), + if(ConfigValues.enableInputterRecipe){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockInputter), "WWW", "WHW", "WWW", - 'W', new ItemStack(Blocks.planks, 1, Util.WILDCARD), - 'H', new ItemStack(Blocks.hopper)); + 'W', "plankWood", + 'H', new ItemStack(Blocks.hopper))); + + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitBlocks.blockInputterAdvanced), + ((INameableItem)InitBlocks.blockInputter).getOredictName(), + "gemQuartz", + TheMiscItems.QUARTZ.getOredictName(), + "dustRedstone")); + } //Crusher if(ConfigValues.enableCrusherRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockGrinder), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGrinder), "CFC", "CPC", "CFC", - 'C', new ItemStack(Blocks.cobblestone), + 'C', "cobblestone", 'P', new ItemStack(Blocks.piston), - 'F', new ItemStack(Items.flint)); + 'F', new ItemStack(Items.flint))); //Double Crusher if(ConfigValues.enableCrusherDoubleRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockGrinderDouble), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGrinderDouble), "CCC", "RPR", "CCC", - 'C', new ItemStack(Blocks.cobblestone), - 'R', new ItemStack(InitBlocks.blockGrinder), - 'P', new ItemStack(Blocks.piston)); + 'C', "cobblestone", + 'R', ((INameableItem)InitBlocks.blockGrinder).getOredictName(), + 'P', new ItemStack(Blocks.piston))); //Double Furnace if(ConfigValues.enableFurnaceDoubleRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockFurnaceDouble), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFurnaceDouble), "CCC", "RPR", "CCC", - 'C', new ItemStack(Blocks.cobblestone), + 'C', "cobblestone", 'R', new ItemStack(Blocks.furnace), - 'P', new ItemStack(Items.brick)); + 'P', "ingotBrick")); //Feeder if(ConfigValues.enableFeederRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockFeeder), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockFeeder), "WCW", "WHW", "WCW", - 'W', new ItemStack(Blocks.planks, 1, Util.WILDCARD), + 'W', "plankWood", 'C', new ItemStack(Items.golden_carrot), - 'H', new ItemStack(Items.wheat)); + 'H', "cropWheat")); //Giant Chest if(ConfigValues.enableGiantChestRecipe) - GameRegistry.addRecipe(new ItemStack(InitBlocks.blockGiantChest), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockGiantChest), "CWC", "W W", "CWC", 'C', new ItemStack(Blocks.chest), - 'W', new ItemStack(Blocks.planks, 1, Util.WILDCARD)); + 'W', "plankWood")); } diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/FoodCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/FoodCrafting.java index fc81c1203..d10ce842f 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/FoodCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/FoodCrafting.java @@ -5,16 +5,19 @@ import ellpeck.actuallyadditions.config.ConfigValues; import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.metalists.TheFoods; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.Util; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; public class FoodCrafting{ public static void init(){ - ItemStack knifeStack = new ItemStack(InitItems.itemKnife, 1, Util.WILDCARD); + String knifeStack = ((INameableItem)InitItems.itemKnife).getOredictName(); //Baguette if(ConfigValues.enabledFoodRecipes[TheFoods.BAGUETTE.ordinal()]) @@ -23,61 +26,61 @@ public class FoodCrafting{ //Pizza if(ConfigValues.enabledFoodRecipes[TheFoods.PIZZA.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.PIZZA.ordinal()), "HKH", "MCF", " D ", - 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), + 'D', TheMiscItems.DOUGH.getOredictName(), 'M', new ItemStack(Blocks.brown_mushroom), - 'C', new ItemStack(Items.carrot), + 'C', "cropCarrot", 'F', new ItemStack(Items.cooked_fished, 1, Util.WILDCARD), 'K', knifeStack, - 'H', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal())); + 'H', TheFoods.CHEESE.getOredictName())); //Hamburger if(ConfigValues.enabledFoodRecipes[TheFoods.HAMBURGER.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.HAMBURGER.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.HAMBURGER.ordinal()), "KT ", "CB ", " T ", - 'T', new ItemStack(InitItems.itemFoods, 1, TheFoods.TOAST.ordinal()), - 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), + 'T', TheFoods.TOAST.getOredictName(), + 'C', TheFoods.CHEESE.getOredictName(), 'K', knifeStack, - 'B', new ItemStack(Items.cooked_beef)); + 'B', new ItemStack(Items.cooked_beef))); //Big Cookie if(ConfigValues.enabledFoodRecipes[TheFoods.BIG_COOKIE.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.BIG_COOKIE.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.BIG_COOKIE.ordinal()), "DCD", "CDC", "DCD", - 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), - 'C', new ItemStack(Items.dye, 1, 3)); + 'D', TheMiscItems.DOUGH.getOredictName(), + 'C', new ItemStack(Items.dye, 1, 3))); //Sub Sandwich if(ConfigValues.enabledFoodRecipes[TheFoods.SUBMARINE_SANDWICH.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SUBMARINE_SANDWICH.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SUBMARINE_SANDWICH.ordinal()), "KCP", "FB ", "PCP", 'P', new ItemStack(Items.paper), - 'C', new ItemStack(InitItems.itemFoods, 1, TheFoods.CHEESE.ordinal()), + 'C', TheFoods.CHEESE.getOredictName(), 'F', new ItemStack(Items.cooked_fished, 1, Util.WILDCARD), - 'B', new ItemStack(InitItems.itemFoods, 1, TheFoods.BAGUETTE.ordinal()), - 'K', knifeStack); + 'B', TheFoods.BAGUETTE.getOredictName(), + 'K', knifeStack)); //French Fry if(ConfigValues.enabledFoodRecipes[TheFoods.FRENCH_FRY.ordinal()]) - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.FRENCH_FRY.ordinal()), + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemFoods, 2, TheFoods.FRENCH_FRY.ordinal()), new ItemStack(Items.baked_potato), - knifeStack); + knifeStack)); //French Fries if(ConfigValues.enabledFoodRecipes[TheFoods.FRENCH_FRIES.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRIES.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRIES.ordinal()), "FFF", " P ", - 'P', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), - 'F', new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal())); + 'P', TheMiscItems.PAPER_CONE.getOredictName(), + 'F', TheFoods.FRENCH_FRY.getOredictName())); //Fish N Chips if(ConfigValues.enabledFoodRecipes[TheFoods.FISH_N_CHIPS.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FISH_N_CHIPS.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.FISH_N_CHIPS.ordinal()), "FIF", " P ", 'I', new ItemStack(Items.cooked_fished, 1, Util.WILDCARD), - 'P', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.PAPER_CONE.ordinal()), - 'F', new ItemStack(InitItems.itemFoods, 1, TheFoods.FRENCH_FRY.ordinal())); + 'P', TheMiscItems.PAPER_CONE.getOredictName(), + 'F', TheFoods.FRENCH_FRY.getOredictName())); //Cheese if(ConfigValues.enabledFoodRecipes[TheFoods.CHEESE.ordinal()]) @@ -93,20 +96,20 @@ public class FoodCrafting{ //Carrot Juice if(ConfigValues.enabledFoodRecipes[TheFoods.CARROT_JUICE.ordinal()]) - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()), - new ItemStack(Items.glass_bottle), new ItemStack(Items.carrot), knifeStack); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CARROT_JUICE.ordinal()), + new ItemStack(Items.glass_bottle), "cropCarrot", knifeStack)); //Spaghetti if(ConfigValues.enabledFoodRecipes[TheFoods.SPAGHETTI.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SPAGHETTI.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.SPAGHETTI.ordinal()), "NNN", " B ", - 'N', new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), - 'B', new ItemStack(Items.bowl)); + 'N', TheFoods.NOODLE.getOredictName(), + 'B', new ItemStack(Items.bowl))); //Noodle if(ConfigValues.enabledFoodRecipes[TheFoods.NOODLE.ordinal()]) - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), - new ItemStack(Items.wheat), knifeStack); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.NOODLE.ordinal()), + "cropWheat", knifeStack)); //Chocolate if(ConfigValues.enabledFoodRecipes[TheFoods.CHOCOLATE.ordinal()]) @@ -117,13 +120,13 @@ public class FoodCrafting{ //Chocolate Cake if(ConfigValues.enabledFoodRecipes[TheFoods.CHOCOLATE_CAKE.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE_CAKE.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemFoods, 1, TheFoods.CHOCOLATE_CAKE.ordinal()), "MMM", "CCC", "EDS", 'M', new ItemStack(Items.milk_bucket), 'E', new ItemStack(Items.egg), - 'D', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.DOUGH.ordinal()), + 'D', TheMiscItems.DOUGH.getOredictName(), 'S', new ItemStack(Items.sugar), - 'C', new ItemStack(Items.dye, 1, 3)); + 'C', new ItemStack(Items.dye, 1, 3))); //Toast if(ConfigValues.enabledFoodRecipes[TheFoods.TOAST.ordinal()]) diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/GrinderCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/GrinderCrafting.java index ddba1280a..0958fdaa3 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/GrinderCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/GrinderCrafting.java @@ -16,7 +16,7 @@ import java.util.ArrayList; public class GrinderCrafting{ public static void init(){ - Util.logInfo("Initializing Grinder Recipes..."); + Util.logInfo("Initializing Crusher Recipes..."); GrinderRecipes.instance().registerRecipe(new ItemStack(Blocks.iron_ore), new ItemStack(InitItems.itemDust, 2, TheDusts.IRON.ordinal()), new ItemStack(InitItems.itemDust, 1, TheDusts.GOLD.ordinal()), 10); GrinderRecipes.instance().registerRecipe(new ItemStack(Blocks.redstone_ore), new ItemStack(Items.redstone, 10), null, 0); @@ -66,7 +66,7 @@ public class GrinderCrafting{ if(name.equals("oreNickel")) specialStacks = OreDictionary.getOres("dustPlatinum"); - if(specialStacks != null){ + if(specialStacks != null && specialStacks.size() > 0){ for(ItemStack theSpecial : specialStacks){ ItemStack special = theSpecial.copy(); GrinderRecipes.instance().registerRecipe(input, output, special, 10); diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java index 20f7ce775..c590a74ce 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/ItemCrafting.java @@ -15,6 +15,8 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; public class ItemCrafting{ @@ -22,12 +24,26 @@ public class ItemCrafting{ //Leaf Blower if(ConfigValues.enableLeafBlowerRecipe) - GameRegistry.addRecipe(new ItemStack(InitItems.itemLeafBlower), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlower), " F", "IP", "IR", 'F', new ItemStack(Items.flint), - 'I', new ItemStack(Items.iron_ingot), + 'I', "ingotIron", 'P', new ItemStack(Blocks.piston), - 'R', new ItemStack(Items.redstone)); + 'R', "dustRedstone")); + + //Coil + if(ConfigValues.enabledMiscRecipes[TheMiscItems.COIL.ordinal()]) + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), + " R ", "RIR", " R ", + 'I', "ingotIron", + 'R', "dustRedstone")); + + //Advanced Coil + if(ConfigValues.enabledMiscRecipes[TheMiscItems.COIL_ADVANCED.ordinal()]) + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), + " G ", "GCG", " G ", + 'C', TheMiscItems.COIL.getOredictName(), + 'G', "ingotGold")); //Ender Pearl GameRegistry.addRecipe(new ItemStack(Items.ender_pearl), @@ -41,12 +57,12 @@ public class ItemCrafting{ //Advanced Leaf Blower if(ConfigValues.enableLeafBlowerAdvancedRecipe) - GameRegistry.addRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemLeafBlowerAdvanced), " F", "DP", "DR", 'F', new ItemStack(Items.flint), - 'D', new ItemStack(Items.diamond), + 'D', "gemDiamond", 'P', new ItemStack(Blocks.piston), - 'R', new ItemStack(Items.redstone)); + 'R', "dustRedstone")); //Quartz if(ConfigValues.enabledMiscRecipes[TheMiscItems.QUARTZ.ordinal()]) @@ -55,9 +71,9 @@ public class ItemCrafting{ //Knife if(ConfigValues.enableKnifeRecipe) - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemKnife), - new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), - new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal())); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemKnife), + TheMiscItems.KNIFE_BLADE.getOredictName(), + TheMiscItems.KNIFE_HANDLE.getOredictName())); //Crafter on a Stick if(ConfigValues.enableCrafterRecipe) @@ -94,11 +110,11 @@ public class ItemCrafting{ } public static void initPotionRingRecipes(){ - GameRegistry.addRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.RING.ordinal()), "IGI", "GDG", "IGI", - 'G', new ItemStack(Items.gold_ingot), - 'I', new ItemStack(Items.iron_ingot), - 'D', new ItemStack(Items.glowstone_dust)); + 'G', "ingotGold", + 'I', "ingotIron", + 'D', "dustGlowstone")); for(int i = 0; i < ThePotionRings.values().length; i++){ if(ConfigValues.enablePotionRingRecipes[i]){ diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/MiscCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/MiscCrafting.java index e044852d8..990d694fa 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/MiscCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/MiscCrafting.java @@ -6,6 +6,8 @@ import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; +import net.minecraftforge.oredict.ShapelessOreRecipe; public class MiscCrafting{ @@ -13,8 +15,8 @@ public class MiscCrafting{ //Dough if(ConfigValues.enabledMiscRecipes[TheMiscItems.DOUGH.ordinal()]) - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.DOUGH.ordinal()), - new ItemStack(Items.wheat), new ItemStack(Items.wheat)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 2, TheMiscItems.DOUGH.ordinal()), + "cropWheat", "cropWheat")); //Paper Cone if(ConfigValues.enabledMiscRecipes[TheMiscItems.PAPER_CONE.ordinal()]) @@ -24,16 +26,16 @@ public class MiscCrafting{ //Knife Handle if(ConfigValues.enabledMiscRecipes[TheMiscItems.KNIFE_HANDLE.ordinal()]) - GameRegistry.addShapelessRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal()), - new ItemStack(Items.stick), - new ItemStack(Items.leather)); + GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_HANDLE.ordinal()), + "stickWood", + new ItemStack(Items.leather))); //Knife Blade if(ConfigValues.enabledMiscRecipes[TheMiscItems.KNIFE_BLADE.ordinal()]) - GameRegistry.addRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.KNIFE_BLADE.ordinal()), "KF", - 'K', new ItemStack(Items.iron_ingot), - 'F', new ItemStack(Items.flint)); + 'K', "ingotIron", + 'F', new ItemStack(Items.flint))); } diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/ToolCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/ToolCrafting.java index 51470baee..a7efe83a1 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/ToolCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/ToolCrafting.java @@ -6,6 +6,7 @@ import ellpeck.actuallyadditions.items.InitItems; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.ShapedOreRecipe; public class ToolCrafting{ @@ -13,34 +14,34 @@ public class ToolCrafting{ if(ConfigValues.enableToolEmeraldRecipe){ //Pickaxe - GameRegistry.addRecipe(new ItemStack(InitItems.itemPickaxeEmerald), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemPickaxeEmerald), "EEE", " S ", " S ", - 'E', new ItemStack(Items.emerald), - 'S', new ItemStack(Items.stick)); + 'E', "gemEmerald", + 'S', new ItemStack(Items.stick))); //Sword - GameRegistry.addRecipe(new ItemStack(InitItems.itemSwordEmerald), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemSwordEmerald), "E", "E", "S", - 'E', new ItemStack(Items.emerald), - 'S', new ItemStack(Items.stick)); + 'E', "gemEmerald", + 'S', new ItemStack(Items.stick))); //Axe - GameRegistry.addRecipe(new ItemStack(InitItems.itemAxeEmerald), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemAxeEmerald), "EE", "ES", " S", - 'E', new ItemStack(Items.emerald), - 'S', new ItemStack(Items.stick)); + 'E', "gemEmerald", + 'S', new ItemStack(Items.stick))); //Shovel - GameRegistry.addRecipe(new ItemStack(InitItems.itemShovelEmerald), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemShovelEmerald), "E", "S", "S", - 'E', new ItemStack(Items.emerald), - 'S', new ItemStack(Items.stick)); + 'E', "gemEmerald", + 'S', new ItemStack(Items.stick))); //Hoe - GameRegistry.addRecipe(new ItemStack(InitItems.itemHoeEmerald), + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemHoeEmerald), "EE", " S", " S", - 'E', new ItemStack(Items.emerald), - 'S', new ItemStack(Items.stick)); + 'E', "gemEmerald", + 'S', new ItemStack(Items.stick))); } if(ConfigValues.enableToolObsidianRecipe){ diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index 0a03afdb3..b2ecbf1b7 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -27,6 +27,7 @@ public class CreativeTab extends CreativeTabs{ this.list = list; this.addBlock(InitBlocks.blockInputter); + this.addBlock(InitBlocks.blockInputterAdvanced); this.addBlock(InitBlocks.blockGrinder); this.addBlock(InitBlocks.blockGrinderDouble); this.addBlock(InitBlocks.blockFurnaceDouble); diff --git a/src/main/java/ellpeck/actuallyadditions/gadget/RenderSpecial.java b/src/main/java/ellpeck/actuallyadditions/gadget/RenderSpecial.java index bd81aa449..d2ca7e8ec 100644 --- a/src/main/java/ellpeck/actuallyadditions/gadget/RenderSpecial.java +++ b/src/main/java/ellpeck/actuallyadditions/gadget/RenderSpecial.java @@ -22,9 +22,9 @@ public class RenderSpecial{ public void render(EntityPlayer player, float renderTick, float size, float offsetUp){ int bobHeight = 70; - double rotationModifier = 2; + long theTime = Minecraft.getSystemTime(); + long time = theTime/50; - long time = player.worldObj.getTotalWorldTime(); if(time-bobHeight >= lastTimeForBobbing){ this.lastTimeForBobbing = time; } @@ -37,7 +37,7 @@ public class RenderSpecial{ GL11.glTranslated(playerPos.xCoord-clientPos.xCoord, playerPos.yCoord-clientPos.yCoord+1.6225, playerPos.zCoord-clientPos.zCoord); } - GL11.glTranslated(0F, offsetUp+0.15D, 0F); + GL11.glTranslated(0F, offsetUp + 0.15D, 0F); GL11.glRotatef(180F, 1.0F, 0.0F, 1.0F); GL11.glScalef(size, size, size); @@ -49,7 +49,7 @@ public class RenderSpecial{ GL11.glTranslated(0, -((double)time-lastTimeForBobbing)/100+(double)bobHeight/100, 0); } - GL11.glRotated((double)time*rotationModifier, 0, 1, 0); + GL11.glRotated((double)theTime/20, 0, 1, 0); Minecraft.getMinecraft().renderEngine.bindTexture(theTexture); theModel.render(0.0625F); diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java index f71db1cc6..4529ab5ff 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/ContainerInputter.java @@ -2,6 +2,7 @@ package ellpeck.actuallyadditions.inventory; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +import ellpeck.actuallyadditions.inventory.slot.SlotFilter; import ellpeck.actuallyadditions.tile.TileEntityBase; import ellpeck.actuallyadditions.tile.TileEntityInputter; import net.minecraft.entity.player.EntityPlayer; @@ -22,18 +23,32 @@ public class ContainerInputter extends Container{ private int lastPlaceToPutSlotAmount; private int lastPlaceToPullSlotAmount; - public ContainerInputter(InventoryPlayer inventory, TileEntityBase tile){ + private boolean isAdvanced; + + public ContainerInputter(InventoryPlayer inventory, TileEntityBase tile, boolean isAdvanced){ this.tileInputter = (TileEntityInputter)tile; + this.isAdvanced = isAdvanced; - this.addSlotToContainer(new Slot(this.tileInputter, 0, 80, 21)); + this.addSlotToContainer(new Slot(this.tileInputter, 0, 80, 21 + (isAdvanced ? 12 : 0))); - for (int i = 0; i < 3; i++){ - for (int j = 0; j < 9; j++){ - this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18)); + if(isAdvanced){ + for(int i = 0; i < 2; i++){ + this.addSlotToContainer(new SlotFilter(this.tileInputter, 1+i*6, 20+i*84, 6)); + this.addSlotToContainer(new SlotFilter(this.tileInputter, 2+i*6, 38+i*84, 6)); + this.addSlotToContainer(new SlotFilter(this.tileInputter, 3+i*6, 56+i*85, 6)); + this.addSlotToContainer(new SlotFilter(this.tileInputter, 4+i*6, 20+i*84, 24)); + this.addSlotToContainer(new SlotFilter(this.tileInputter, 5+i*6, 38+i*84, 24)); + this.addSlotToContainer(new SlotFilter(this.tileInputter, 6+i*6, 56+i*84, 24)); } } - for (int i = 0; i < 9; i++){ - this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155)); + + for(int i = 0; i < 3; i++){ + for (int j = 0; j < 9; j++){ + this.addSlotToContainer(new Slot(inventory, j + i * 9 + 9, 8 + j * 18, 97 + i * 18 + (isAdvanced ? 12 : 0))); + } + } + for(int i = 0; i < 9; i++){ + this.addSlotToContainer(new Slot(inventory, i, 8 + i * 18, 155 + (isAdvanced ? 12 : 0))); } } @@ -87,7 +102,7 @@ public class ContainerInputter extends Container{ @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot){ - final int inventoryStart = 1; + final int inventoryStart = this.isAdvanced ? 13 : 1; final int inventoryEnd = inventoryStart+26; final int hotbarStart = inventoryEnd+1; final int hotbarEnd = hotbarStart+8; diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java b/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java index ae06c7865..a4ef75c5c 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/GuiHandler.java @@ -33,7 +33,10 @@ public class GuiHandler implements IGuiHandler{ return new ContainerFurnaceDouble(entityPlayer.inventory, tileFurnace); case INPUTTER_ID: TileEntityBase tileInputter = (TileEntityBase)world.getTileEntity(x, y, z); - return new ContainerInputter(entityPlayer.inventory, tileInputter); + return new ContainerInputter(entityPlayer.inventory, tileInputter, false); + case INPUTTER_ADVANCED_ID: + TileEntityBase tileInputterAdvanced = (TileEntityBase)world.getTileEntity(x, y, z); + return new ContainerInputter(entityPlayer.inventory, tileInputterAdvanced, true); case REPAIRER_ID: TileEntityBase tileRepairer = (TileEntityBase)world.getTileEntity(x, y, z); return new ContainerRepairer(entityPlayer.inventory, tileRepairer); @@ -64,7 +67,10 @@ public class GuiHandler implements IGuiHandler{ return new GuiFurnaceDouble(entityPlayer.inventory, tileFurnace); case INPUTTER_ID: TileEntityBase tileInputter = (TileEntityBase)world.getTileEntity(x, y, z); - return new GuiInputter(entityPlayer.inventory, tileInputter, x, y, z, world); + return new GuiInputter(entityPlayer.inventory, tileInputter, x, y, z, world, false); + case INPUTTER_ADVANCED_ID: + TileEntityBase tileInputterAdvanced = (TileEntityBase)world.getTileEntity(x, y, z); + return new GuiInputter(entityPlayer.inventory, tileInputterAdvanced, x, y, z, world, true); case REPAIRER_ID: TileEntityBase tileRepairer = (TileEntityBase)world.getTileEntity(x, y, z); return new GuiRepairer(entityPlayer.inventory, tileRepairer); @@ -81,6 +87,7 @@ public class GuiHandler implements IGuiHandler{ public static final int FURNACE_DOUBLE_ID = 5; public static final int INPUTTER_ID = 6; public static final int REPAIRER_ID = 7; + public static final int INPUTTER_ADVANCED_ID = 8; public static void init(){ Util.logInfo("Initializing GuiHandler..."); diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/GuiInputter.java b/src/main/java/ellpeck/actuallyadditions/inventory/GuiInputter.java index fba4f7905..10e1cd684 100644 --- a/src/main/java/ellpeck/actuallyadditions/inventory/GuiInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/inventory/GuiInputter.java @@ -23,6 +23,8 @@ import org.lwjgl.opengl.GL11; public class GuiInputter extends GuiContainer{ private static final ResourceLocation resLoc = AssetUtil.getGuiLocation("guiInputter"); + private static final ResourceLocation resLocAdvanced = AssetUtil.getGuiLocation("guiInputterAdvanced"); + private TileEntityInputter tileInputter; private int x; @@ -35,6 +37,8 @@ public class GuiInputter extends GuiContainer{ private SmallerButton buttonSlotPutM; private SmallerButton buttonSlotPullM; + private boolean isAdvanced; + public static final String[] sideString = new String[]{ StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.disabled"), StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.up"), @@ -44,15 +48,16 @@ public class GuiInputter extends GuiContainer{ StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.south"), StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.west")}; - public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world){ - super(new ContainerInputter(inventory, tile)); + public GuiInputter(InventoryPlayer inventory, TileEntityBase tile, int x, int y, int z, World world, boolean isAdvanced){ + super(new ContainerInputter(inventory, tile, isAdvanced)); this.tileInputter = (TileEntityInputter)tile; this.x = x; this.y = y; this.z = z; this.world = world; this.xSize = 176; - this.ySize = 93+86; + this.ySize = 93+86 + (isAdvanced ? 12 : 0); + this.isAdvanced = isAdvanced; } @SuppressWarnings("unchecked") @@ -60,15 +65,15 @@ public class GuiInputter extends GuiContainer{ public void initGui(){ super.initGui(); - SmallerButton buttonSidePutP = new SmallerButton(0, guiLeft + 70, guiTop + 43, ">"); - SmallerButton buttonSidePutM = new SmallerButton(1, guiLeft + 5, guiTop + 43, "<"); - buttonSlotPutP = new SmallerButton(2, guiLeft + 70, guiTop + 64, "+"); - buttonSlotPutM = new SmallerButton(3, guiLeft + 5, guiTop + 64, "-"); + SmallerButton buttonSidePutP = new SmallerButton(0, guiLeft + 70, guiTop + 43 + (isAdvanced ? 12 : 0), ">"); + SmallerButton buttonSidePutM = new SmallerButton(1, guiLeft + 5, guiTop + 43 + (isAdvanced ? 12 : 0), "<"); + buttonSlotPutP = new SmallerButton(2, guiLeft + 70, guiTop + 64 + (isAdvanced ? 12 : 0), "+"); + buttonSlotPutM = new SmallerButton(3, guiLeft + 5, guiTop + 64 + (isAdvanced ? 12 : 0), "-"); - SmallerButton buttonSidePullP = new SmallerButton(4, guiLeft + 155, guiTop + 43, ">"); - SmallerButton buttonSidePullM = new SmallerButton(5, guiLeft + 90, guiTop + 43, "<"); - buttonSlotPullP = new SmallerButton(6, guiLeft+ 155, guiTop + 64, "+"); - buttonSlotPullM = new SmallerButton(7, guiLeft + 90, guiTop + 64, "-"); + SmallerButton buttonSidePullP = new SmallerButton(4, guiLeft + 155, guiTop + 43 + (isAdvanced ? 12 : 0), ">"); + SmallerButton buttonSidePullM = new SmallerButton(5, guiLeft + 90, guiTop + 43 + (isAdvanced ? 12 : 0), "<"); + buttonSlotPullP = new SmallerButton(6, guiLeft+ 155, guiTop + 64 + (isAdvanced ? 12 : 0), "+"); + buttonSlotPullM = new SmallerButton(7, guiLeft + 90, guiTop + 64 + (isAdvanced ? 12 : 0), "-"); this.buttonList.add(buttonSidePutP); this.buttonList.add(buttonSlotPutP); @@ -85,19 +90,19 @@ public class GuiInputter extends GuiContainer{ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.getTextureManager().bindTexture(AssetUtil.GUI_INVENTORY_LOCATION); - this.drawTexturedModalRect(this.guiLeft, this.guiTop+93, 0, 0, 176, 86); + this.drawTexturedModalRect(this.guiLeft, this.guiTop+93 + (isAdvanced ? 12 : 0), 0, 0, 176, 86); - this.mc.getTextureManager().bindTexture(resLoc); - this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93); + this.mc.getTextureManager().bindTexture(this.isAdvanced ? resLocAdvanced : resLoc); + this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, 176, 93 + (isAdvanced ? 12 : 0)); - this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.put"), guiLeft + 22 + 3, guiTop + 32, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.pull"), guiLeft + 107 + 3, guiTop + 32, 4210752); + this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.put"), guiLeft + 22 + 3, guiTop + 32 + (isAdvanced ? 12 : 0), 4210752); + this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.pull"), guiLeft + 107 + 3, guiTop + 32 + (isAdvanced ? 12 : 0), 4210752); - this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft + 24 + 1, guiTop + 45 + 3, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPut == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPut).toString(), guiLeft + 24 + 3, guiTop + 66 + 3, 4210752); + this.fontRendererObj.drawString(sideString[tileInputter.sideToPut+1], guiLeft + 24 + 1, guiTop + 45 + 3 + (isAdvanced ? 12 : 0), 4210752); + this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPut == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPut).toString(), guiLeft + 24 + 3, guiTop + 66 + 3 + (isAdvanced ? 12 : 0), 4210752); - this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft + 109 + 1, guiTop + 45 + 3, 4210752); - this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPull == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPull).toString(), guiLeft + 109 + 3, guiTop + 66 + 3, 4210752); + this.fontRendererObj.drawString(sideString[tileInputter.sideToPull+1], guiLeft + 109 + 1, guiTop + 45 + 3 + (isAdvanced ? 12 : 0), 4210752); + this.fontRendererObj.drawString(StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.slot") + " " + (tileInputter.slotToPull == -1 ? StatCollector.translateToLocal("info." + ModUtil.MOD_ID_LOWER + ".gui.all") : tileInputter.slotToPull).toString(), guiLeft + 109 + 3, guiTop + 66 + 3 + (isAdvanced ? 12 : 0), 4210752); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/inventory/slot/SlotFilter.java b/src/main/java/ellpeck/actuallyadditions/inventory/slot/SlotFilter.java new file mode 100644 index 000000000..ab1be1320 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/inventory/slot/SlotFilter.java @@ -0,0 +1,16 @@ +package ellpeck.actuallyadditions.inventory.slot; + +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; + +public class SlotFilter extends Slot{ + + public SlotFilter(IInventory inventory, int id, int x, int y){ + super(inventory, id, x, y); + } + + @Override + public int getSlotStackLimit(){ + return 1; + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java index 4b6d7a67b..2f96afa88 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/InitItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/InitItems.java @@ -44,10 +44,10 @@ public class InitItems{ ItemUtil.register(itemFertilizer); itemMisc = new ItemMisc(); - ItemUtil.register(itemMisc); + ItemUtil.register(itemMisc, ItemMisc.allMiscItems); itemFoods = new ItemFoods(); - ItemUtil.register(itemFoods); + ItemUtil.register(itemFoods, ItemFoods.allFoods); itemKnife = new ItemKnife(); ItemUtil.register(itemKnife); @@ -56,10 +56,10 @@ public class InitItems{ ItemUtil.register(itemCrafterOnAStick); itemDust = new ItemDust(); - ItemUtil.register(itemDust); + ItemUtil.register(itemDust, ItemDust.allDusts); itemSpecialDrop = new ItemSpecialDrop(); - ItemUtil.register(itemSpecialDrop); + ItemUtil.register(itemSpecialDrop, ItemSpecialDrop.allDrops); itemLeafBlower = new ItemLeafBlower(false); ItemUtil.register(itemLeafBlower); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java b/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java index cb7f05fe9..1f5bf9f56 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemCrafterOnAStick.java @@ -4,7 +4,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.ActuallyAdditions; import ellpeck.actuallyadditions.inventory.GuiHandler; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; @@ -17,7 +17,7 @@ import net.minecraft.world.World; import java.util.List; -public class ItemCrafterOnAStick extends Item implements IName{ +public class ItemCrafterOnAStick extends Item implements INameableItem{ public ItemCrafterOnAStick(){ this.setMaxStackSize(1); @@ -27,7 +27,7 @@ public class ItemCrafterOnAStick extends Item implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(ItemUtil.addStandardInformation(this)); + ItemUtil.addStandardInformation(this, list); } @Override @@ -56,4 +56,9 @@ public class ItemCrafterOnAStick extends Item implements IName{ public String getName(){ return "itemCrafterOnAStick"; } + + @Override + public String getOredictName(){ + return this.getName(); + } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java b/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java index 35fcc18df..f8920add6 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemDust.java @@ -3,10 +3,7 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheDusts; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -18,7 +15,7 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class ItemDust extends Item implements IName{ +public class ItemDust extends Item implements INameableItem{ public static final TheDusts[] allDusts = TheDusts.values(); @@ -31,6 +28,11 @@ public class ItemDust extends Item implements IName{ return "itemDust"; } + @Override + public String getOredictName(){ + return ""; + } + @Override public int getMetadata(int damage){ return damage; @@ -58,7 +60,10 @@ public class ItemDust extends Item implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDusts[stack.getItemDamage()].getName() + ".desc")); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDusts[stack.getItemDamage()].getName() + ".desc")); + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allDusts[stack.getItemDamage()].getOredictName()); + } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java index 72b8391cb..f7e3e2208 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFertilizer.java @@ -2,7 +2,7 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import net.minecraft.client.renderer.texture.IIconRegister; @@ -16,7 +16,7 @@ import net.minecraft.world.World; import java.util.List; -public class ItemFertilizer extends Item implements IName{ +public class ItemFertilizer extends Item implements INameableItem{ @Override public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10){ @@ -36,7 +36,7 @@ public class ItemFertilizer extends Item implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(ItemUtil.addStandardInformation(this)); + ItemUtil.addStandardInformation(this, list); } @Override @@ -54,4 +54,9 @@ public class ItemFertilizer extends Item implements IName{ public String getName(){ return "itemFertilizer"; } + + @Override + public String getOredictName(){ + return this.getName(); + } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java index 86d4f73e2..c8a3483c7 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemFoods.java @@ -3,10 +3,7 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheFoods; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityItem; @@ -18,7 +15,7 @@ import net.minecraft.world.World; import java.util.List; -public class ItemFoods extends ItemFood implements IName{ +public class ItemFoods extends ItemFood implements INameableItem{ public static final TheFoods[] allFoods = TheFoods.values(); public IIcon[] textures = new IIcon[allFoods.length]; @@ -30,6 +27,11 @@ public class ItemFoods extends ItemFood implements IName{ TheFoods.setReturnItems(); } + @Override + public String getOredictName(){ + return ""; + } + @Override public EnumRarity getRarity(ItemStack stack){ return allFoods[stack.getItemDamage()].rarity; @@ -97,6 +99,7 @@ public class ItemFoods extends ItemFood implements IName{ list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allFoods[stack.getItemDamage()].getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".hunger.desc") + ": " + allFoods[stack.getItemDamage()].healAmount); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".saturation.desc") + ": " + allFoods[stack.getItemDamage()].saturation); + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allFoods[stack.getItemDamage()].getOredictName()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java index dc95fe564..1fbe9f335 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemKnife.java @@ -3,7 +3,7 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.config.ConfigValues; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; @@ -17,7 +17,7 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class ItemKnife extends Item implements IName{ +public class ItemKnife extends Item implements INameableItem{ public ItemKnife(){ this.setMaxDamage(ConfigValues.knifeMaxDamage); @@ -38,6 +38,11 @@ public class ItemKnife extends Item implements IName{ return false; } + @Override + public String getOredictName(){ + return this.getName(); + } + @Override public EnumRarity getRarity(ItemStack stack){ return EnumRarity.epic; @@ -50,6 +55,7 @@ public class ItemKnife extends Item implements IName{ if(KeyUtil.isShiftPressed()){ list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + ItemUtil.addOredictName(this, list); } else list.add(ItemUtil.shiftForInfo()); diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java index ca9fe635b..083930f83 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemLeafBlower.java @@ -23,7 +23,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -public class ItemLeafBlower extends Item implements IName{ +public class ItemLeafBlower extends Item implements INameableItem{ public final int range = ConfigValues.leafBlowerRangeSides; public final int rangeUp = ConfigValues.leafBlowerRangeUp; @@ -48,6 +48,16 @@ public class ItemLeafBlower extends Item implements IName{ } } + @Override + public String getOredictName(){ + return this.getName(); + } + + @Override + public boolean shouldRotateAroundWhenRendering(){ + return false; + } + public void breakStuff(World world, int x, int y, int z){ ArrayList theCoords = new ArrayList(); @@ -82,12 +92,12 @@ public class ItemLeafBlower extends Item implements IName{ @Override public int getMaxItemUseDuration(ItemStack stack){ - return 100000; + return 1000000; } @Override public EnumAction getItemUseAction(ItemStack stack){ - return EnumAction.none; + return EnumAction.bow; } @Override @@ -109,6 +119,7 @@ public class ItemLeafBlower extends Item implements IName{ list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + ".desc." + 1)); list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.2")); list.add(StringUtil.ITALIC + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemLeafBlower.desc.3")); + ItemUtil.addOredictName(this, list); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java b/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java index 733f77a18..56789f767 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemMisc.java @@ -3,10 +3,7 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -18,7 +15,7 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class ItemMisc extends Item implements IName{ +public class ItemMisc extends Item implements INameableItem{ public static final TheMiscItems[] allMiscItems = TheMiscItems.values(); public IIcon[] textures = new IIcon[allMiscItems.length]; @@ -32,6 +29,11 @@ public class ItemMisc extends Item implements IName{ return "itemMisc"; } + @Override + public String getOredictName(){ + return ""; + } + @Override public EnumRarity getRarity(ItemStack stack){ return allMiscItems[stack.getItemDamage()].rarity; @@ -59,7 +61,10 @@ public class ItemMisc extends Item implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allMiscItems[stack.getItemDamage()].getName() + ".desc")); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allMiscItems[stack.getItemDamage()].getName() + ".desc")); + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allMiscItems[stack.getItemDamage()].getOredictName()); + } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java index 1b217d314..436e14957 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemPotionRing.java @@ -18,7 +18,7 @@ import net.minecraft.world.World; import java.util.List; -public class ItemPotionRing extends Item implements IName{ +public class ItemPotionRing extends Item implements INameableItem{ public static final ThePotionRings[] allRings = ThePotionRings.values(); @@ -30,6 +30,11 @@ public class ItemPotionRing extends Item implements IName{ this.isAdvanced = isAdvanced; } + @Override + public String getOredictName(){ + return ""; + } + @Override @SuppressWarnings("unchecked") public void onUpdate(ItemStack stack, World world, Entity player, int par4, boolean par5){ @@ -90,6 +95,7 @@ public class ItemPotionRing extends Item implements IName{ list.add(StringUtil.RED + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemPotionRing.desc.off.1")); list.add(StringUtil.RED + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".itemPotionRing.desc.off.2")); } + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allRings[stack.getItemDamage()].getOredictName()); } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java index 3ee14cbe1..69d9ca8e5 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java +++ b/src/main/java/ellpeck/actuallyadditions/items/ItemSpecialDrop.java @@ -3,10 +3,7 @@ package ellpeck.actuallyadditions.items; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; -import ellpeck.actuallyadditions.util.IName; -import ellpeck.actuallyadditions.util.ItemUtil; -import ellpeck.actuallyadditions.util.KeyUtil; -import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.*; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.item.EntityXPOrb; @@ -21,7 +18,7 @@ import net.minecraft.world.World; import java.util.List; import java.util.Random; -public class ItemSpecialDrop extends Item implements IName{ +public class ItemSpecialDrop extends Item implements INameableItem{ public static final TheSpecialDrops[] allDrops = TheSpecialDrops.values(); public IIcon[] textures = new IIcon[allDrops.length]; @@ -51,6 +48,11 @@ public class ItemSpecialDrop extends Item implements IName{ return allDrops[stack.getItemDamage()].rarity; } + @Override + public String getOredictName(){ + return ""; + } + @Override public int getMetadata(int damage){ return damage; @@ -73,7 +75,10 @@ public class ItemSpecialDrop extends Item implements IName{ @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - if(KeyUtil.isShiftPressed()) list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDrops[stack.getItemDamage()].getName() + ".desc")); + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + this.getName() + allDrops[stack.getItemDamage()].getName() + ".desc")); + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + allDrops[stack.getItemDamage()].getOredictName()); + } else list.add(ItemUtil.shiftForInfo()); } diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheDusts.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheDusts.java index 140981ac1..c20b577a5 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheDusts.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheDusts.java @@ -1,32 +1,39 @@ package ellpeck.actuallyadditions.items.metalists; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.StringUtil; import net.minecraft.item.EnumRarity; -public enum TheDusts implements IName{ +public enum TheDusts implements INameableItem{ - IRON("Iron", 7826534, EnumRarity.common), - GOLD("Gold", 14335744, EnumRarity.uncommon), - DIAMOND("Diamond", 292003, EnumRarity.rare), - EMERALD("Emerald", 4319527, EnumRarity.epic), - LAPIS("Lapis", 1849791, EnumRarity.uncommon), - QUARTZ("Quartz", StringUtil.DECIMAL_COLOR_WHITE, EnumRarity.uncommon), - COAL("Coal", 0, EnumRarity.uncommon), - QUARTZ_BLACK("QuartzBlack", 18, EnumRarity.rare); + IRON("Iron", 7826534, EnumRarity.common, "dustIron"), + GOLD("Gold", 14335744, EnumRarity.uncommon, "dustGold"), + DIAMOND("Diamond", 292003, EnumRarity.rare, "dustDiamond"), + EMERALD("Emerald", 4319527, EnumRarity.epic, "dustEmerald"), + LAPIS("Lapis", 1849791, EnumRarity.uncommon, "dustLapis"), + QUARTZ("Quartz", StringUtil.DECIMAL_COLOR_WHITE, EnumRarity.uncommon, "dustQuartz"), + COAL("Coal", 0, EnumRarity.uncommon, "dustCoal"), + QUARTZ_BLACK("QuartzBlack", 18, EnumRarity.rare, "dustQuartzBlack"); public final String name; + public final String oredictName; public final int color; public final EnumRarity rarity; - TheDusts(String name, int color, EnumRarity rarity){ + TheDusts(String name, int color, EnumRarity rarity, String oredictName){ this.name = name; this.color = color; this.rarity = rarity; + this.oredictName = oredictName; } @Override public String getName(){ return this.name; } + + @Override + public String getOredictName(){ + return this.oredictName; + } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java index 39f175b28..b9df1658a 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheFoods.java @@ -1,29 +1,29 @@ package ellpeck.actuallyadditions.items.metalists; import ellpeck.actuallyadditions.items.InitItems; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -public enum TheFoods implements IName{ +public enum TheFoods implements INameableItem{ - CHEESE("Cheese", 1, 0.5F, false, 3, EnumRarity.common), - PUMPKIN_STEW("PumpkinStew", 10, 1F, true, 30, EnumRarity.common), - CARROT_JUICE("CarrotJuice", 6, 0.6F, true, 20, EnumRarity.common), - FISH_N_CHIPS("FishNChips", 20, 5F, false, 40, EnumRarity.uncommon), - FRENCH_FRIES("FrenchFries", 16, 4F, false, 32, EnumRarity.common), - FRENCH_FRY("FrenchFry", 3, 0.5F, false, 3, EnumRarity.common), - SPAGHETTI("Spaghetti", 18, 3F, false, 38, EnumRarity.common), - NOODLE("Noodle", 1, 0.5F, false, 3, EnumRarity.common), - CHOCOLATE_CAKE("ChocolateCake", 16, 2F, false, 45, EnumRarity.uncommon), - CHOCOLATE("Chocolate", 5, 1F, false, 15, EnumRarity.common), - TOAST("Toast", 3, 0.4F, false, 25, EnumRarity.common), - SUBMARINE_SANDWICH("SubmarineSandwich", 10, 8F, false, 40, EnumRarity.uncommon), - BIG_COOKIE("BigCookie", 6, 1F, false, 20, EnumRarity.uncommon), - HAMBURGER("Hamburger", 14, 6F, false, 40, EnumRarity.common), - PIZZA("Pizza", 20, 10F, false, 45, EnumRarity.uncommon), - BAGUETTE("Baguette", 7, 2F, false, 25, EnumRarity.common); + CHEESE("Cheese", 1, 0.5F, false, 3, EnumRarity.common, "foodCheese"), + PUMPKIN_STEW("PumpkinStew", 10, 1F, true, 30, EnumRarity.common, "foodPumpkinStew"), + CARROT_JUICE("CarrotJuice", 6, 0.6F, true, 20, EnumRarity.common, "foodCarrotJuice"), + FISH_N_CHIPS("FishNChips", 20, 5F, false, 40, EnumRarity.uncommon, "foodFishNChips"), + FRENCH_FRIES("FrenchFries", 16, 4F, false, 32, EnumRarity.common, "foodFrenchFries"), + FRENCH_FRY("FrenchFry", 3, 0.5F, false, 3, EnumRarity.common, "foodFrenchFry"), + SPAGHETTI("Spaghetti", 18, 3F, false, 38, EnumRarity.common, "foodSpaghetti"), + NOODLE("Noodle", 1, 0.5F, false, 3, EnumRarity.common, "foodNoodle"), + CHOCOLATE_CAKE("ChocolateCake", 16, 2F, false, 45, EnumRarity.uncommon, "foodChocolateCake"), + CHOCOLATE("Chocolate", 5, 1F, false, 15, EnumRarity.common, "foodChocolate"), + TOAST("Toast", 3, 0.4F, false, 25, EnumRarity.common, "foodToast"), + SUBMARINE_SANDWICH("SubmarineSandwich", 10, 8F, false, 40, EnumRarity.uncommon, "foodSubmarineSandwich"), + BIG_COOKIE("BigCookie", 6, 1F, false, 20, EnumRarity.uncommon, "foodBigCookie"), + HAMBURGER("Hamburger", 14, 6F, false, 40, EnumRarity.common, "foodHamburger"), + PIZZA("Pizza", 20, 10F, false, 45, EnumRarity.uncommon, "foodPizza"), + BAGUETTE("Baguette", 7, 2F, false, 25, EnumRarity.common, "foodBaguette"); public static void setReturnItems(){ SPAGHETTI.returnItem = new ItemStack(Items.bowl); @@ -34,6 +34,7 @@ public enum TheFoods implements IName{ } public final String name; + public final String oredictName; public final int healAmount; public final float saturation; public final boolean getsDrunken; @@ -41,17 +42,23 @@ public enum TheFoods implements IName{ public ItemStack returnItem; public final EnumRarity rarity; - TheFoods(String name, int healAmount, float saturation, boolean getsDrunken, int useDuration, EnumRarity rarity){ + TheFoods(String name, int healAmount, float saturation, boolean getsDrunken, int useDuration, EnumRarity rarity, String oredictName){ this.name = name; this.getsDrunken = getsDrunken; this.healAmount = healAmount; this.saturation = saturation; this.useDuration = useDuration; this.rarity = rarity; + this.oredictName = oredictName; } @Override public String getName(){ return this.name; } + + @Override + public String getOredictName(){ + return this.oredictName; + } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheMiscItems.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheMiscItems.java index 7e7c84d91..c8e5fcfd1 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheMiscItems.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheMiscItems.java @@ -1,28 +1,37 @@ package ellpeck.actuallyadditions.items.metalists; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.item.EnumRarity; -public enum TheMiscItems implements IName{ +public enum TheMiscItems implements INameableItem{ - PAPER_CONE("PaperCone", EnumRarity.common), - MASHED_FOOD("MashedFood", EnumRarity.uncommon), - KNIFE_BLADE("KnifeBlade", EnumRarity.common), - KNIFE_HANDLE("KnifeHandle", EnumRarity.common), - DOUGH("Dough", EnumRarity.common), - QUARTZ("BlackQuartz", EnumRarity.epic), - RING("Ring", EnumRarity.uncommon); + PAPER_CONE("PaperCone", EnumRarity.common, "itemPaperCone"), + MASHED_FOOD("MashedFood", EnumRarity.uncommon, "itemMashedFood"), + KNIFE_BLADE("KnifeBlade", EnumRarity.common, "itemKnifeBlade"), + KNIFE_HANDLE("KnifeHandle", EnumRarity.common, "itemKnifeHandle"), + DOUGH("Dough", EnumRarity.common, "itemDough"), + QUARTZ("BlackQuartz", EnumRarity.epic, "gemQuartzBlack"), + RING("Ring", EnumRarity.uncommon, "itemRing"), + COIL("Coil", EnumRarity.common, "itemCoilBasic"), + COIL_ADVANCED("CoilAdvanced", EnumRarity.uncommon, "itemCoilAdvanced"); public final String name; + public final String oredictName; public final EnumRarity rarity; - TheMiscItems(String name, EnumRarity rarity){ + TheMiscItems(String name, EnumRarity rarity, String oredictName){ this.name = name; this.rarity = rarity; + this.oredictName = oredictName; } @Override public String getName(){ return this.name; } + + @Override + public String getOredictName(){ + return this.oredictName; + } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/ThePotionRings.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/ThePotionRings.java index 26cd4c2b6..a5141ad75 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/ThePotionRings.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/ThePotionRings.java @@ -1,12 +1,12 @@ package ellpeck.actuallyadditions.items.metalists; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemStack; -public enum ThePotionRings implements IName{ +public enum ThePotionRings implements INameableItem{ SPEED("Speed", 8171462, 1, 0, 3, 10, false, EnumRarity.uncommon, new ItemStack(Items.sugar)), //TODO Slowness @@ -58,4 +58,9 @@ public enum ThePotionRings implements IName{ public String getName(){ return this.name; } + + @Override + public String getOredictName(){ + return "itemPotionRing"; + } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheSpecialDrops.java b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheSpecialDrops.java index 9ac0b6268..4e40b2dd4 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/metalists/TheSpecialDrops.java +++ b/src/main/java/ellpeck/actuallyadditions/items/metalists/TheSpecialDrops.java @@ -1,40 +1,47 @@ package ellpeck.actuallyadditions.items.metalists; import ellpeck.actuallyadditions.config.ConfigValues; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import net.minecraft.entity.EntityCreature; import net.minecraft.entity.monster.EntityCreeper; import net.minecraft.entity.monster.EntityEnderman; import net.minecraft.entity.monster.EntitySkeleton; import net.minecraft.item.EnumRarity; -public enum TheSpecialDrops implements IName{ +public enum TheSpecialDrops implements INameableItem{ - SOLIDIFIED_EXPERIENCE("SolidifiedExperience", 40, 3, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableExperienceDrop), - BLOOD_FRAGMENT("BloodFragment", 15, 1, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableBloodDrop), - HEART_PART("HeartPart", 5, 1, EntityCreature.class, EnumRarity.rare, ConfigValues.enableHeartDrop), - UNKNOWN_SUBSTANCE("UnknownSubstance", 3, 1, EntitySkeleton.class, EnumRarity.epic, ConfigValues.enableSubstanceDrop), - PEARL_SHARD("PearlShard", 30, 3, EntityEnderman.class, EnumRarity.epic, ConfigValues.enablePearlShardDrop), - EMERALD_SHARD("EmeraldShard", 30, 3, EntityCreeper.class, EnumRarity.rare, ConfigValues.enableEmeraldShardDrop); + SOLIDIFIED_EXPERIENCE("SolidifiedExperience", 40, 3, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableExperienceDrop, "itemSolidifiedExperience"), + BLOOD_FRAGMENT("BloodFragment", 15, 1, EntityCreature.class, EnumRarity.uncommon, ConfigValues.enableBloodDrop, "itemBloodFragment"), + HEART_PART("HeartPart", 5, 1, EntityCreature.class, EnumRarity.rare, ConfigValues.enableHeartDrop, "itemHeartPart"), + UNKNOWN_SUBSTANCE("UnknownSubstance", 3, 1, EntitySkeleton.class, EnumRarity.epic, ConfigValues.enableSubstanceDrop, "itemUnknownSubstance"), + PEARL_SHARD("PearlShard", 30, 3, EntityEnderman.class, EnumRarity.epic, ConfigValues.enablePearlShardDrop, "nuggetEnderpearl"), + EMERALD_SHARD("EmeraldShard", 30, 3, EntityCreeper.class, EnumRarity.rare, ConfigValues.enableEmeraldShardDrop, "nuggetEmerald"); public final String name; + public final String oredictName; public final int chance; public final int maxAmount; public final Class dropFrom; public final boolean canDrop; public final EnumRarity rarity; - TheSpecialDrops(String name, int chance, int maxAmount, Class dropFrom, EnumRarity rarity, boolean canDrop){ + TheSpecialDrops(String name, int chance, int maxAmount, Class dropFrom, EnumRarity rarity, boolean canDrop, String oredictName){ this.name = name; this.chance = chance; this.rarity = rarity; this.maxAmount = maxAmount; this.dropFrom = dropFrom; this.canDrop = canDrop; + this.oredictName = oredictName; } @Override public String getName(){ return this.name; } + + @Override + public String getOredictName(){ + return this.oredictName; + } } \ No newline at end of file diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java index 9c503b8e4..26babfc5d 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemAxeAA.java @@ -2,7 +2,7 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; @@ -16,27 +16,31 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class ItemAxeAA extends ItemAxe implements IName{ +public class ItemAxeAA extends ItemAxe implements INameableItem{ private String name; private EnumRarity rarity; private ItemStack repairItem; + private String oredictName; public ItemAxeAA(ToolMaterial toolMat, ItemStack repairItem, String unlocalizedName, EnumRarity rarity){ super(toolMat); this.name = unlocalizedName; this.rarity = rarity; this.repairItem = repairItem; + this.oredictName = name; } @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(ItemUtil.addStandardInformation(this)); if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + ItemUtil.addOredictName(this, list); } + else ItemUtil.addStandardInformation(this, list); } @Override @@ -64,4 +68,9 @@ public class ItemAxeAA extends ItemAxe implements IName{ public String getName(){ return name; } + + @Override + public String getOredictName(){ + return oredictName; + } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java index 64c6c2698..28d85967a 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemHoeAA.java @@ -2,7 +2,7 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; @@ -16,9 +16,10 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class ItemHoeAA extends ItemHoe implements IName{ +public class ItemHoeAA extends ItemHoe implements INameableItem{ private String name; + private String oredictName; private EnumRarity rarity; private ItemStack repairItem; @@ -27,16 +28,19 @@ public class ItemHoeAA extends ItemHoe implements IName{ this.name = unlocalizedName; this.rarity = rarity; this.repairItem = repairItem; + this.oredictName = name; } @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - list.add(ItemUtil.addStandardInformation(this)); + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + ItemUtil.addOredictName(this, list); } + else ItemUtil.addStandardInformation(this, list); } @Override @@ -64,4 +68,9 @@ public class ItemHoeAA extends ItemHoe implements IName{ public String getName(){ return name; } + + @Override + public String getOredictName(){ + return this.oredictName; + } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java index 127c5bd59..a6846a2b5 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemPickaxeAA.java @@ -2,7 +2,7 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; @@ -16,9 +16,10 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class ItemPickaxeAA extends ItemPickaxe implements IName{ +public class ItemPickaxeAA extends ItemPickaxe implements INameableItem{ private String name; + private String oredictName; private EnumRarity rarity; private ItemStack repairItem; @@ -27,16 +28,19 @@ public class ItemPickaxeAA extends ItemPickaxe implements IName{ this.name = unlocalizedName; this.rarity = rarity; this.repairItem = repairItem; + this.oredictName = name; } @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(ItemUtil.addStandardInformation(this)); if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + ItemUtil.addOredictName(this, list); } + else ItemUtil.addStandardInformation(this, list); } @Override @@ -64,4 +68,9 @@ public class ItemPickaxeAA extends ItemPickaxe implements IName{ public String getName(){ return name; } + + @Override + public String getOredictName(){ + return oredictName; + } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java index 76695c63c..b4dd21f8e 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemShovelAA.java @@ -2,7 +2,7 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; @@ -16,9 +16,10 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class ItemShovelAA extends ItemSpade implements IName{ +public class ItemShovelAA extends ItemSpade implements INameableItem{ private String name; + private String oredictName; private EnumRarity rarity; private ItemStack repairItem; @@ -27,16 +28,19 @@ public class ItemShovelAA extends ItemSpade implements IName{ this.name = unlocalizedName; this.rarity = rarity; this.repairItem = repairItem; + this.oredictName = name; } @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { - list.add(ItemUtil.addStandardInformation(this)); if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + ItemUtil.addOredictName(this, list); } + else ItemUtil.addStandardInformation(this, list); } @Override @@ -64,4 +68,9 @@ public class ItemShovelAA extends ItemSpade implements IName{ public String getName(){ return name; } + + @Override + public String getOredictName(){ + return oredictName; + } } diff --git a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java index aa791ae42..c2373a4b2 100644 --- a/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java +++ b/src/main/java/ellpeck/actuallyadditions/items/tools/ItemSwordAA.java @@ -2,7 +2,7 @@ package ellpeck.actuallyadditions.items.tools; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import ellpeck.actuallyadditions.util.IName; +import ellpeck.actuallyadditions.util.INameableItem; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.KeyUtil; import ellpeck.actuallyadditions.util.ModUtil; @@ -16,9 +16,10 @@ import net.minecraft.util.StatCollector; import java.util.List; -public class ItemSwordAA extends ItemSword implements IName{ +public class ItemSwordAA extends ItemSword implements INameableItem{ private String name; + private String oredictName; private EnumRarity rarity; private ItemStack repairItem; @@ -27,16 +28,19 @@ public class ItemSwordAA extends ItemSword implements IName{ this.name = unlocalizedName; this.rarity = rarity; this.repairItem = repairItem; + this.oredictName = name; } @Override @SuppressWarnings("unchecked") @SideOnly(Side.CLIENT) - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld){ - list.add(ItemUtil.addStandardInformation(this)); + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean isHeld) { if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)this).getName() + ".desc")); list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".durability.desc") + ": " + (this.getMaxDamage()-this.getDamage(stack)) + "/" + this.getMaxDamage()); + ItemUtil.addOredictName(this, list); } + else ItemUtil.addStandardInformation(this, list); } @Override @@ -64,4 +68,9 @@ public class ItemSwordAA extends ItemSword implements IName{ public String getName(){ return name; } + + @Override + public String getOredictName(){ + return oredictName; + } } diff --git a/src/main/java/ellpeck/actuallyadditions/oredict/OreDictRegistry.java b/src/main/java/ellpeck/actuallyadditions/oredict/OreDictRegistry.java deleted file mode 100644 index f67eb5415..000000000 --- a/src/main/java/ellpeck/actuallyadditions/oredict/OreDictRegistry.java +++ /dev/null @@ -1,25 +0,0 @@ -package ellpeck.actuallyadditions.oredict; - -import ellpeck.actuallyadditions.blocks.InitBlocks; -import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; -import ellpeck.actuallyadditions.items.InitItems; -import ellpeck.actuallyadditions.items.metalists.TheDusts; -import ellpeck.actuallyadditions.items.metalists.TheMiscItems; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class OreDictRegistry{ - - public static void init(){ - OreDictionary.registerOre("dustDiamond", new ItemStack(InitItems.itemDust, 1, TheDusts.DIAMOND.ordinal())); - OreDictionary.registerOre("dustIron", new ItemStack(InitItems.itemDust, 1, TheDusts.IRON.ordinal())); - OreDictionary.registerOre("dustGold", new ItemStack(InitItems.itemDust, 1, TheDusts.GOLD.ordinal())); - OreDictionary.registerOre("dustEmerald", new ItemStack(InitItems.itemDust, 1, TheDusts.EMERALD.ordinal())); - OreDictionary.registerOre("dustLapis", new ItemStack(InitItems.itemDust, 1, TheDusts.LAPIS.ordinal())); - OreDictionary.registerOre("dustCoal", new ItemStack(InitItems.itemDust, 1, TheDusts.COAL.ordinal())); - OreDictionary.registerOre("dustQuartz", new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ.ordinal())); - OreDictionary.registerOre("dustQuartzBlack", new ItemStack(InitItems.itemDust, 1, TheDusts.QUARTZ_BLACK.ordinal())); - OreDictionary.registerOre("oreQuartzBlack", new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())); - OreDictionary.registerOre("itemQuartzBlack", new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())); - } -} diff --git a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java index ac7e8c798..5e1103743 100644 --- a/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java +++ b/src/main/java/ellpeck/actuallyadditions/tile/TileEntityInputter.java @@ -9,6 +9,9 @@ import net.minecraft.world.World; public class TileEntityInputter extends TileEntityInventoryBase{ + public static final int PUT_FILTER_START = 1; + public static final int PULL_FILTER_START = 7; + public int sideToPut = -1; public int slotToPut = -1; public int placeToPutSlotAmount; @@ -19,8 +22,15 @@ public class TileEntityInputter extends TileEntityInventoryBase{ public int placeToPullSlotAmount; public TileEntity placeToPull; + public boolean isAdvanced; + public TileEntityInputter(){ - super(1, "tileEntityInputter"); + super(0, ""); + } + + public TileEntityInputter(boolean isAdvanced){ + super(isAdvanced ? 13 : 1, isAdvanced ? "tilEntityInputterAdvanced" : "tileEntityInputter"); + this.isAdvanced = isAdvanced; } @Override @@ -28,9 +38,11 @@ public class TileEntityInputter extends TileEntityInventoryBase{ if(!worldObj.isRemote){ this.initVars(); - if(!(this.sideToPull == this.sideToPut && this.slotToPull == this.slotToPut)){ - if(sideToPull != -1) this.pull(); - if(sideToPut != -1) this.put(); + if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ + if(!(this.sideToPull == this.sideToPut && this.slotToPull == this.slotToPut)){ + if(sideToPull != -1) this.pull(); + if(sideToPut != -1) this.put(); + } } } } @@ -50,7 +62,7 @@ public class TileEntityInputter extends TileEntityInventoryBase{ if(tempStack.getMaxStackSize() < this.getInventoryStackLimit()) maxSize = tempStack.getMaxStackSize(); else maxSize = this.getInventoryStackLimit(); } - if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < maxSize))){ + if(tempStack != null && (this.slots[0] == null || (tempStack.isItemEqual(this.slots[0]) && this.slots[0].stackSize < maxSize)) && this.checkFilters(tempStack, true)){ if(theSided != null){ for(int j = 0; j < 5; j++){ if(theSided.canExtractItem(i, tempStack, j)){ @@ -108,7 +120,7 @@ public class TileEntityInputter extends TileEntityInventoryBase{ if(tempStack.getMaxStackSize() < theInventory.getInventoryStackLimit()) maxSize = tempStack.getMaxStackSize(); else maxSize = theInventory.getInventoryStackLimit(); } - if(tempStack == null || (theInventory.isItemValidForSlot(i, this.slots[0]) && tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)){ + if((tempStack == null || (theInventory.isItemValidForSlot(i, this.slots[0]) && tempStack.isItemEqual(this.slots[0]) && tempStack.stackSize < maxSize)) && this.checkFilters(this.slots[0], false)){ if(theSided != null){ for(int j = 0; j < 5; j++){ if(theSided.canInsertItem(i, this.slots[0], j)){ @@ -152,6 +164,18 @@ public class TileEntityInputter extends TileEntityInventoryBase{ } } + public boolean checkFilters(ItemStack stack, boolean isPull){ + if(!this.isAdvanced) return true; + + int slotStart = isPull ? PULL_FILTER_START : PUT_FILTER_START; + int slotStop = slotStart+6; + + for(int i = slotStart; i < slotStop; i++){ + if(this.slots[i] != null && this.slots[i].isItemEqual(stack)) return true; + } + return false; + } + public void initVars(){ this.placeToPull = getTileEntityFromSide(this.sideToPull, this.worldObj, this.xCoord, this.yCoord, this.zCoord); this.placeToPut = getTileEntityFromSide(this.sideToPut, this.worldObj, this.xCoord, this.yCoord, this.zCoord); @@ -211,20 +235,26 @@ public class TileEntityInputter extends TileEntityInventoryBase{ compound.setInteger("SlotToPut", this.slotToPut); compound.setInteger("SideToPull", this.sideToPull); compound.setInteger("SlotToPull", this.slotToPull); + compound.setBoolean("IsAdvanced", this.isAdvanced); + compound.setString("Name", this.name); + compound.setInteger("Slots", this.slots.length); } @Override public void readFromNBT(NBTTagCompound compound){ - super.readFromNBT(compound); + this.initializeSlots(compound.getInteger("Slots")); this.sideToPut = compound.getInteger("SideToPut"); this.slotToPut = compound.getInteger("SlotToPut"); this.sideToPull = compound.getInteger("SideToPull"); this.slotToPull = compound.getInteger("SlotToPull"); + this.isAdvanced = compound.getBoolean("IsAdvanced"); + this.name = compound.getString("Name"); + super.readFromNBT(compound); } - + @Override public boolean isItemValidForSlot(int i, ItemStack stack){ - return true; + return i == 0; } @Override @@ -234,6 +264,6 @@ public class TileEntityInputter extends TileEntityInventoryBase{ @Override public boolean canExtractItem(int slot, ItemStack stack, int side){ - return true; + return slot == 0; } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java b/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java index cc4d59a5c..cca4cedad 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/BlockUtil.java @@ -4,17 +4,46 @@ import cpw.mods.fml.common.registry.GameRegistry; import ellpeck.actuallyadditions.creative.CreativeTab; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.List; public class BlockUtil{ public static String createUnlocalizedName(Block block){ - return ModUtil.MOD_ID_LOWER + "." + ((IName)block).getName(); + return ModUtil.MOD_ID_LOWER + "." + ((INameableItem)block).getName(); + } + + @SuppressWarnings("unchecked") + public static void addStandardInformation(Block block, List list){ + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)block).getName() + ".desc")); + addOredictName(block, list); + } + else list.add(ItemUtil.shiftForInfo()); + } + + @SuppressWarnings("unchecked") + public static void addOredictName(Block block, List list){ + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + ((INameableItem)block).getOredictName()); + } + + public static void register(Block block, Class itemBlock, Enum[] list){ + block.setCreativeTab(CreativeTab.instance); + block.setBlockName(createUnlocalizedName(block)); + GameRegistry.registerBlock(block, itemBlock, ((INameableItem)block).getName()); + for(Enum current : list){ + OreDictionary.registerOre(((INameableItem)current).getOredictName(), new ItemStack(block, 1, current.ordinal())); + } } public static void register(Block block, Class itemBlock){ block.setCreativeTab(CreativeTab.instance); block.setBlockName(createUnlocalizedName(block)); - GameRegistry.registerBlock(block, itemBlock, ((IName)block).getName()); + GameRegistry.registerBlock(block, itemBlock, ((INameableItem)block).getName()); + OreDictionary.registerOre(((INameableItem)block).getOredictName(), block); } } diff --git a/src/main/java/ellpeck/actuallyadditions/util/IName.java b/src/main/java/ellpeck/actuallyadditions/util/INameableItem.java similarity index 51% rename from src/main/java/ellpeck/actuallyadditions/util/IName.java rename to src/main/java/ellpeck/actuallyadditions/util/INameableItem.java index 51a235199..7ae6d959f 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/IName.java +++ b/src/main/java/ellpeck/actuallyadditions/util/INameableItem.java @@ -1,7 +1,9 @@ package ellpeck.actuallyadditions.util; -public interface IName{ +public interface INameableItem{ String getName(); + String getOredictName(); + } diff --git a/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java b/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java index ea10fd3aa..e40efb4c0 100644 --- a/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java +++ b/src/main/java/ellpeck/actuallyadditions/util/ItemUtil.java @@ -3,13 +3,21 @@ package ellpeck.actuallyadditions.util; import cpw.mods.fml.common.registry.GameRegistry; import ellpeck.actuallyadditions.creative.CreativeTab; import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.List; public class ItemUtil{ - public static String addStandardInformation(Item item){ - if(KeyUtil.isShiftPressed()) return StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((IName)item).getName() + ".desc"); - else return shiftForInfo(); + @SuppressWarnings("unchecked") + public static void addStandardInformation(Item item, List list){ + if(KeyUtil.isShiftPressed()){ + list.add(StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + "." + ((INameableItem)item).getName() + ".desc")); + addOredictName(item, list); + } + else list.add(shiftForInfo()); } public static void registerItems(Item[] items){ @@ -18,14 +26,29 @@ public class ItemUtil{ } } + @SuppressWarnings("unchecked") + public static void addOredictName(Item item, List list){ + list.add(StringUtil.GRAY + StatCollector.translateToLocal("tooltip." + ModUtil.MOD_ID_LOWER + ".oredictName.desc") + ": " + ((INameableItem)item).getOredictName()); + } + public static void register(Item item){ item.setCreativeTab(CreativeTab.instance); item.setUnlocalizedName(createUnlocalizedName(item)); - GameRegistry.registerItem(item, ((IName)item).getName()); + GameRegistry.registerItem(item, ((INameableItem)item).getName()); + OreDictionary.registerOre(((INameableItem)item).getOredictName(), item); + } + + public static void register(Item item, Enum[] list){ + item.setCreativeTab(CreativeTab.instance); + item.setUnlocalizedName(createUnlocalizedName(item)); + GameRegistry.registerItem(item, ((INameableItem)item).getName()); + for(Enum current : list){ + OreDictionary.registerOre(((INameableItem)current).getOredictName(), new ItemStack(item, 1, current.ordinal())); + } } public static String createUnlocalizedName(Item item){ - return ModUtil.MOD_ID_LOWER + "." + ((IName)item).getName(); + return ModUtil.MOD_ID_LOWER + "." + ((INameableItem)item).getName(); } public static String shiftForInfo(){ diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index ba9638d5b..8c2fa533a 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -7,7 +7,7 @@ tile.actuallyadditions.blockMiscBlackQuartz.name=Block of Black Quartz tile.actuallyadditions.blockMiscBlackQuartzChiseled.name=Chiseled Block of Black Quartz tile.actuallyadditions.blockMiscBlackQuartzPillar.name=Pillar of Black Quartz tile.actuallyadditions.blockFeeder.name=Automatic Feeder -tile.actuallyadditions.blockGiantChest.name=Giant Chest +tile.actuallyadditions.blockGiantChest.name=Storage Crate tile.actuallyadditions.blockGrinder.name=Crusher tile.actuallyadditions.blockGrinderDouble.name=Double Crusher tile.actuallyadditions.blockFurnaceDouble.name=Double Furnace @@ -17,6 +17,7 @@ tile.actuallyadditions.blockHeatCollector.name=Heat Collector tile.actuallyadditions.blockItemRepairer.name=Item Repairer tile.actuallyadditions.blockInputter.name=ESD +tile.actuallyadditions.blockInputterAdvanced.name=Advanced ESD tile.actuallyadditions.blockInputter.add.0.name=Ellpeck's Slot Device tile.actuallyadditions.blockInputter.add.1.name=Energetic Solo Dancer tile.actuallyadditions.blockInputter.add.2.name=Ethereal System Dude @@ -30,6 +31,9 @@ tile.actuallyadditions.blockInputter.add.9.name=Express Sending Doughnut tile.actuallyadditions.blockInputter.add.10.name=Expelling Sugar Dagger tile.actuallyadditions.blockInputter.add.11.name=Extra-Long Solidifying Dissociation tile.actuallyadditions.blockInputter.add.12.name=Extravagant Supreme Dirt +tile.actuallyadditions.blockInputter.add.13.name=Efficient Sucking Dilettant +tile.actuallyadditions.blockInputter.add.14.name=Extreme Sand Digger +tile.actuallyadditions.blockInputter.add.15.name=MISSINGNO item.actuallyadditions.itemMiscMashedFood.name=Mashed Food item.actuallyadditions.itemFertilizer.name=Fertilizer @@ -95,6 +99,7 @@ tooltip.actuallyadditions.shiftForInfo.desc=Press Shift for Info tooltip.actuallyadditions.hunger.desc=Fills tooltip.actuallyadditions.saturation.desc=Saturation tooltip.actuallyadditions.durability.desc=Durability +tooltip.actuallyadditions.oredictName.desc=OreDictionary Name tooltip.actuallyadditions.blockCompost.desc.1=Used to make Fertilizer with Mashed Food tooltip.actuallyadditions.blockCompost.desc.2=BETA INFO: Will visually contain Compost in the Future! @@ -103,7 +108,7 @@ tooltip.actuallyadditions.blockMiscBlackQuartz.desc=Black, eerie Quartz! Nice fo tooltip.actuallyadditions.blockMiscBlackQuartzChiseled.desc=Black, eerie chiseled Quartz! Nice for decorating. tooltip.actuallyadditions.blockMiscBlackQuartzPillar.desc=Kind of a pillar. Not really, though. It's fake! Fake I say! tooltip.actuallyadditions.blockFeeder.desc=Feeds Animals on its own! -tooltip.actuallyadditions.blockGiantChest.desc=GUI Scale on 'Auto'? That's a problem! +tooltip.actuallyadditions.blockGiantChest.desc=Stores a whole lot of stuff. Bigger than a Double Chest! tooltip.actuallyadditions.blockGrinder.desc.1=Crushes Ores into Dusts! tooltip.actuallyadditions.blockGrinder.desc.2=You get two Dusts per Ore and Extras! tooltip.actuallyadditions.blockGrinder.desc.3=To crush two ores simultaneously, @@ -114,9 +119,11 @@ tooltip.actuallyadditions.blockGrinderDouble.desc.3=Can crush two Ores simultane tooltip.actuallyadditions.blockFurnaceDouble.desc=Smelts two things simultaneously! tooltip.actuallyadditions.blockInputter.desc.1=Its real name is %sObfuscated%s! tooltip.actuallyadditions.blockInputter.desc.2=Acts like a more advanced Hopper -tooltip.actuallyadditions.blockInputter.desc.3=Configurable: -tooltip.actuallyadditions.blockInputter.desc.4=-Side to Output to and Input from -tooltip.actuallyadditions.blockInputter.desc.5=-Slot in the other Inventory to Output to and Input from +tooltip.actuallyadditions.blockInputter.desc.3=Turn me off with Redstone! +tooltip.actuallyadditions.blockInputter.desc.4=Configurable: +tooltip.actuallyadditions.blockInputter.desc.5=-Side to Output to and Input from +tooltip.actuallyadditions.blockInputter.desc.6=-Slot in the other Inventory to Output to and Input from +tooltip.actuallyadditions.blockInputterAdvanced.desc=Has an Input and Output Filter! tooltip.actuallyadditions.blockFishingNet.desc=Catches Fish automatically when placed above Water tooltip.actuallyadditions.blockFurnaceSolar.desc=Powers Furnaces and Crushers below it in Daylight tooltip.actuallyadditions.blockHeatCollector.desc.1=Powers Furnaces and Crushers above it diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockFeeder.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockFeeder.png index fe16b7fa5e113e2db1452a85972d6b6824b5767b..44ef1d1787591873cda3a8d23c1df57afcfe3077 100644 GIT binary patch delta 569 zcmV-90>=IB1lt6V85#xv001BJ|6u?C00v@9M??Vs0RI60puMM)kuey52XskIMF-yl z6B0ELij*Ta0005#Nkla1V^%*ep>4zKw|7}t?W1Z~S?lxu z!vjRn&9{;yA(ueWJ4+;y7Ys_#OEp#BoF@kfu3t9I?57m9n#!5yug#Ej|tI z6Zd+AMim;1AYfX`*WnLjx`0uoA%abFj4GSkmgYhOql)RAWRx6Wj1sCY^6`rW;Kns5 zihzU3bT*D=>jVJ3Gfe{VgWB570ch)K!ogt3%Qw3KT)t=-Pn!Jvm6BQuIJ#XWwU+Bw zyV$HCwU&3QdmylXzP>?_k27xFd`6xXB*_SXAP7j35k&zuo023WY*sLyc-%hK;K`#` zWcw-d{KZp8d8W?Io&J%~9>+oWZF>iqi>{BV)U+jC3y~`$4PjCI<}irP`FQ%JmvIE+ zDl-R!ll_Tbl%bpJR+zhJPzJG<+;H|=t|oO=?{dr}>YBe4Z`jQ^=c`;P00000NkvXX Hu0mjf79<1& delta 608 zcmV-m0-ycc1nvZo8Gix*005AYXf^-<00d`2O+f$vv5yP5RJDxmJ5JKVDLV_}S;IDbfEv`Cs_ij>ZjVuiM8 zNvbXFv{IT-pbo(}KmlW5_cN1s?hwnezFz>QM;(}^iTYQ!P$&?r z8is+9gIq3$>BS1dsUTEUC76dhc=HdieI9k-jFHxWVvPvof#24Bzi17L-3Ow1`@CXv zSTXO3<{i65o`3k<$kBe+!+sa)(_8M5YcBtFS68v}*ynZ>CrNxlj;k;?4pkju6M*sT zbGkeY9|EAglouvxdWI%~teIx9fIUfe5?8~E^3RO zw!w! zGo0+^y{C1__$c;Dv=jrY!g1kegRkkm$Hl(Y2()YV7Y@o$*1U%mPK+h*S%YgqzE`Ac z8a=Eq?Um<7Qg0#p0$&fLHKd^5+XG^!L%hR}VO!CDY@zYyeT)^<=3Vh^NRY0_XgPB1 uX3yA-9_Iq+Iv%IXM?N>!|GS?r9R35(pKnJJ$G?yO0000h+DscpTJde&70=NYjpqfa$3xF(ufYsV&I(Ty#0KA8XU?qFeV2n z@ao-10G>X$PY3~kH!mOY{=+8#+J|2;#^9X8IhVIkIfsZrfQ5wxRF&YB)6-Md*H!_T zpPxrW`1~b<=qEJJImDRK)8b5%rP*nK5)803JI&%u6A(}(x8B35YF{*-qzQnZwP$mC z_sS;j-oDAmK!x;wvx^8RDYn<^5o16^G9B35-lf@W(rUE;*x1-$e}A8QcW#xH3SdOA z#u%J+7}F>kIyyR{)oRh{bN~uyxN@Wv@!nH=j}IPs_Iz2djg2!rJjB%0jl2!bf)Npn zm`j4ny|>#3oSmKZrHmBEljHA%7>O}(QQ1XVnyDaQE)CsECQYD9_xzj`BR+Uk73Un4 zt58)`wLc@uffYcn_ls|x!~W5va&g9FC0-m)mahgdZ8Gix*005AYXf^-<00d`2O+f$vv5yPMht^zR(M7a|choGbS1qB^7&6X5jN{guIxCAAK<7J;UihlypDDsZSV|$fNYwbE5 zKJV*UmWBH}+Y8>0)9dzkIqtZ@^M5}=h8r0*RWK<4_3(Nbfa-8QYypaIn2MkZMthwM zWYF0Yu-JyNCRS-aft8?l;8*CXR78PMNYFb_G|lR`Vj^pY(E}D^8p)iLfZ=uwYeX%rLW~6lu?M}w`fTg? iq&XyVD!0Dv*4hW_>~;U0+8IeUToh(;h6~q(|A1Nd+t3y*45ROTWge3kVHy})*8Kc z03rfOgMrx~V<( ziSm|%d7gRtuxUU^Oml(>fUi= z#kfoiCMx#>%P}>Y@Z1)K$3j1a8prpgE#P{cyV;CJJ0L@lJTYhi;CI9HPX%}qXFxHM z3iuOqo;p;3rAoQSZDt5;qCjHr|I*SvHiW?hEKUCs3h+1q7DNNQ1Ry?)Ju1KyP@pr( jd}8u%NZJOSDNTI=fo1{=TVi~C00000NkvXXu0mjfj#Y>@ diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/blockGiantChestTop.png b/src/main/resources/assets/actuallyadditions/textures/blocks/blockGiantChestTop.png index 485f8a4f0aa6187ad2073c3307c5ad3eeb04e6e6..52880a6e963182802ee462991d7397592c0e6ce8 100644 GIT binary patch delta 739 zcmV<90v!GJ0`LWp8Gi-<001BJ|6u?C00v@9M??U(0FVG!!v_vc00009a7bBm000XU z000XU0RWnu7ytkO2XskIMF-ym1OO)i_?)*s0000OX;fHrLvL+uWo~o;00000Oks9o zH8w6VE-^4M-^x3#00076Nklhc zLXm=(K@>=oNc$itNa@nhgFq38j_mHe=Z-yNin9rptkI0d{`t=**Voq>5tLF85mc3k zp!W{I7y}W(%--DrYOO5GLUDIgl|O&}4uEAhF;A5-l0F8<^+fZan6d08YAqa(Cmw(G zEfIm58UMWefq#dWd)~X+vzsc-gXYe9YD~58@M6!!gEIi$+#K-eyngXL?oKf?9_-I( z?)>uVcSa_eY?gpPCaB(@B7FViBisXkQcB_G_P{(>c2ni)=O2>@s=^q9(FY)?3B{Bb zuYTijTv1Wxd8PnNwa}U)0wcjAHaXc81!z9#ee<*3%zw>c-CA&WqIWzxBNO+ak3nXV znT(N)gknk-BNJ{9D`rY&ZWZ(~-VJFzH9&|STz&eCh~W6^Pc#oaI+@8d6;u=vp@<0Q z%WezIr1@5j2(;FiritUJZJ+N|Ybo?THV&3$;q`H)_ko(QHb+J2WAOLOA2CzpeiNq_ z^pSW3)qe^RL0Q+8>9)3yZ>%(gd=yr*+Rx@0E*-W~vmKKSFWH`JoMwamnOGI}BcwJ605?@8~SGEEax zEdYG>$zw8eQ&gpS5WO=-GS$LV3(-4f%A?CYs$7beQh5K1=d|bu|Mz`!Sn=L5GtQSC zyLn=&m5cK;65;B}HycQIcXt4M_~mm{6*HsOikac=tn2!gdFFY>-D$1ST4Pxj{sU~C Vbn)A-7|#Fz002ovPDHLkV1ig{Qe^-D delta 358 zcmV-s0h#{r1@;1v8Gix*005AYXf^-<00d`2O+f$vv5yP>%W)AKQ^KT7mu*@$!*|jPhEB_9C(yk}L9Ba* z3MuMbwFBp1{=b2>XyDnAHCF%yn`NNsek_nQTWGe%yNJzBAO~skaK`V@wE7rK3|5`5 z#3MFaNf~?x_g}f9qtIU&h_4yKt)OOs%^Fzi`Nw7JYU&#)V6zN=H++O{f>+H08R>&DuhE$U;qFB07*qoM6N<$ Ef_XHPg8%>k diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemLeafBlower.png b/src/main/resources/assets/actuallyadditions/textures/items/itemLeafBlower.png index 65503eabd2a70e4e8874cb9a1f42ea543e1c2ce2..ad59792f75a2c2cb36712689df60f2d59654de78 100644 GIT binary patch delta 348 zcmV-i0i*t=1Em9yDlu9BS^!#Mb$^)v000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2j2r96)h5}7;}G-TP%MGNklk*mSu|} zHpXbWuH!e5JkRxT#>{18Sw`1&09?h$!`KfYsP~?_uFV7z5n_Lg#vFPvL1K*G%g<}r zO5!6a=PS#0T`>#;ZQEk!fMasJ_w<7zgW{~gS?K$oloBGc4>$&Syxg(t6K2$V_jZAE z4(HsLiO0;EL%cKNWrH0Br<7=#hN38p{mJnOa{GElQdl{V>nF;xL{$-y{S;2cCn8i; ug{rdIY$%GtoCF{oe%#HAPg8t<_6DC9R*)uDeK8*Z0000y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G` z2j2r66%G}fU_MikTP%MHNklinO;#fuf1LOA&&SNLYYG$1i8*X-0oO0Izq2@UI`MD2fCizlHNW zXSG`4jvG}~rSHNa1d(0Qdr#MO0#H>|GBZL50&olIsVD&0hXH@2ZQE3qC92AJ(eSp3 zjGQp`j>`p~gU6e97mdt}7$Y%8)PXv|`ou|}@IGS*2DTokDyquO%PI2V?0OSIe-`O?crAnV+rN;B00000NkvXXu0mjf9q*T2 diff --git a/src/main/resources/assets/actuallyadditions/textures/items/itemLeafBlowerAdvanced.png b/src/main/resources/assets/actuallyadditions/textures/items/itemLeafBlowerAdvanced.png index 0f64f1940c07f9703163fadb30a0bc1f26bcba23..5b9b6eb7d52cc0fef982cdc11549a695f55c437c 100644 GIT binary patch delta 385 zcmV-{0e=460-OVoB!32COGiWiw*Zg;Si=VnO#lD@32;bRa{vGf6951U69E94oEQKA z00(qQO+^Ra1OxyoC2=t=q5uE@9cffpbVF}#ZDnqB0000007G(RVRU6=Aa`kWXdp*P zO;BVmWd{HN0RTxvK~y-)-IK9O13?gm|JfreSgcPm)q#x^&y^CfZ~DdsJ)9iV2BYB z^4_Blq%2F#d#G!}IS21O0N_LfcTJs{)mn?Xt|@^+2oMpX{1yo!BJJ?}6!;7gUs16? zGPu8-0{|A&8G1|?@RJ>DEjC+4*eVJ`C`@*P+-DAXI$mM5iJ->s#rr|q8`kSxKn}45 zHJb^hV|X#0p?a8*`R(Efa{ji5sKBTICRZ;we12@V_g0E;ysUJ*tn}#ST6bdX^Koad fHm3Og>u(I%UAk;s!;hqFm0eH#Htwt zRF?L^4Y*vU^8X}I^N~EI|L1{*!CZw?GYB9X08#|9{V33Y<3N|3DN@GnY;*wg21p@D z(}@CQutAqfRXPZ31_5MOfbiL3h#}~Ki5DOTCP)*Z=)?+O8bP@e8AGLM0T>tnV@#RG TBJ#gG00000NkvXXu0mjfvCMX|