From 40487f07fa5ef31fde99713c0b842d34a0ba3622 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Sun, 31 May 2015 01:44:17 +0100 Subject: - Fixed an issue with the Liquids tab - Changed Entity registration so it only uses 'registerModEntity' to fix potential issues - Added crystal blocks - Changed Jewelry Tab to not override TiCon tabs (sorry TiCon, your system is good, but not for me) - The player renders in the Jewelry GUI (makes it easier for you to see how the jewelry render) - The Pentagram now has an actual effect - The Pentagram now renders beneath your feet when you look down and no longer does it in your inventory; it is also a lot smaller - Working on Structures - Created my own WeightedRandomItem (why isn't this in vanilla?) - Updated the curse API so now people can specify when a curse can be activated (I believe the world is all you need :p) - Some curses can no longer aquired in hardcore (such as Rotten Heart, Midas Touch etc) which would make it impossible to work with and require a total restart of the game (as the only way to get rid of them is by dying to replace them) Hooraaay for proper changelogs! --- .../jewelrycraft/item/ItemStructureGen.java | 44 ++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 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 new file mode 100644 index 0000000..6b736d2 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/item/ItemStructureGen.java @@ -0,0 +1,44 @@ +package darkknight.jewelrycraft.item; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import darkknight.jewelrycraft.worldGen.WorldGenStructure1; + +public class ItemStructureGen extends Item +{ + int structure = 0; + WorldGenerator[] structures = new WorldGenerator[]{new WorldGenStructure1(), new WorldGenStructure1(), new WorldGenStructure1()}; + + public ItemStructureGen() + { + super(); + } + + @Override + public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) + { + if (!world.isRemote){ + if (!player.isSneaking()){ + if (structure < structures.length - 1) structure++; + else structure = 0; + }else + { + if (structure > 0) structure--; + else structure = structures.length - 1; + } + player.addChatMessage(new ChatComponentText("Structure no. " + structure)); + } + 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) + { + structures[structure].generate(world, itemRand, x, y + 1, z); + return true; + } +} \ No newline at end of file -- cgit v1.2.3