From 4f7ad220df0438b6f3382110577b53f29da46453 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Thu, 24 May 2018 15:50:07 -0400 Subject: Update of all changes --- .../jewelrycraft/item/ItemStructureGen.java | 82 ++++++++++++---------- 1 file changed, 45 insertions(+), 37 deletions(-) mode change 100644 => 100755 src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java (limited to 'src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java') diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java b/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java old mode 100644 new mode 100755 index 9c0b03f..4ff91df --- a/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java @@ -1,6 +1,7 @@ package darkknight.jewelrycraft.item; import java.util.List; + import darkknight.jewelrycraft.util.JewelrycraftUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -9,41 +10,48 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -public class ItemStructureGen extends Item -{ - int no = 0; - - public ItemStructureGen() - { - super(); - } - - @Override - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) - { - if (!world.isRemote && player.capabilities.isCreativeMode){ - if (!player.isSneaking()){ - if (no < JewelrycraftUtil.structures.size() - 1) no++; - else no = 0; - }else - { - if (no > 0) no--; - else no = JewelrycraftUtil.structures.size() - 1; - } - player.addChatMessage(new ChatComponentText("Structure no. " + (no + 1))); - } - return stack; - } - - @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int par1, float par2, float par3, float par4) - { - if(player.capabilities.isCreativeMode) JewelrycraftUtil.structures.get(no).generate(world, world.getBiomeGenForCoords(x, z), itemRand, x, y + 1, z); - return true; - } - - public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) - { - list.add(EnumChatFormatting.GRAY + "Creative Only"); - } +public class ItemStructureGen extends Item { + int no = 0; + + public ItemStructureGen() { + super(); + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, + EntityPlayer player) { + if (!world.isRemote && player.capabilities.isCreativeMode) { + if (!player.isSneaking()) { + if (no < JewelrycraftUtil.structures.size() - 1) + no++; + else + no = 0; + } else { + if (no > 0) + no--; + else + no = JewelrycraftUtil.structures.size() - 1; + } + player.addChatMessage( + new ChatComponentText("Structure no. " + (no + 1))); + } + return stack; + } + + @Override + public boolean onItemUse(ItemStack stack, EntityPlayer player, + World world, int x, int y, int z, int par1, float par2, + float par3, float par4) { + if (player.capabilities.isCreativeMode) + JewelrycraftUtil.structures.get(no).generate(world, + world.getBiomeGenForCoords(x, z), itemRand, x, y + 1, + z); + return true; + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, + List list, boolean par4) { + list.add(EnumChatFormatting.GRAY + "Creative Only"); + } } \ No newline at end of file -- cgit v1.2.3