From c1e3604e3eda373aa07492b3c0b58fec34ee3238 Mon Sep 17 00:00:00 2001 From: fewizz Date: Wed, 13 May 2015 19:55:47 +0300 Subject: [PATCH] fixes --- .../tombenpotter/emt/common/Registry.java | 2 ++ .../emt/common/items/ItemRegistry.java | 14 ++++++---- .../common/items/foci/ItemShieldFocus.java | 28 ++++++++++++++++--- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/src/main/java/tombenpotter/emt/common/Registry.java b/src/main/java/tombenpotter/emt/common/Registry.java index f741a91..af399e0 100644 --- a/src/main/java/tombenpotter/emt/common/Registry.java +++ b/src/main/java/tombenpotter/emt/common/Registry.java @@ -4,8 +4,10 @@ import tombenpotter.emt.common.blocks.BlockRegistry; import tombenpotter.emt.common.RecipeRegistry; import tombenpotter.emt.common.items.ItemRegistry; import tombenpotter.emt.common.tile.TileRegistry; +import cpw.mods.fml.common.Loader; public class Registry{ + public static void register(){ BlockRegistry.registerBlocks(); ItemRegistry.registerItems(); diff --git a/src/main/java/tombenpotter/emt/common/items/ItemRegistry.java b/src/main/java/tombenpotter/emt/common/items/ItemRegistry.java index 4c1a9f0..5cd08f2 100644 --- a/src/main/java/tombenpotter/emt/common/items/ItemRegistry.java +++ b/src/main/java/tombenpotter/emt/common/items/ItemRegistry.java @@ -89,15 +89,19 @@ public class ItemRegistry { public static void registerItems() { //craftingComponents = new ItemCraftingComponents("components"); //GameRegistry.registerItem(craftingComponents, "craftingComponents"); - baseBaubles = new ItemBaseBaubles(); - GameRegistry.registerItem(baseBaubles, "BaseBaubles"); - focusChristmas = new ItemChristmasFocus(); - GameRegistry.registerItem(focusChristmas, "FocusChristmas"); + //focusChristmas = new ItemChristmasFocus(); + //GameRegistry.registerItem(focusChristmas, "FocusChristmas"); itemEMTItems = new ItemMaterials().setUnlocalizedName(ModInformation.modid + ".emtitems"); GameRegistry.registerItem(itemEMTItems, "EMTItems"); + + emtBauble = new ItemIC2Baubles().setUnlocalizedName(ModInformation.modid + ".emtbauble"); - GameRegistry.registerItem(emtBauble, "EMTBaubles"); + GameRegistry.registerItem(emtBauble, "EMTBaubles"); + + baseBaubles = new ItemBaseBaubles(); + GameRegistry.registerItem(baseBaubles, "BaseBaubles"); + electricGoggles = new ItemElectricGoggles(ItemArmor.ArmorMaterial.IRON, 3, 0).setUnlocalizedName(ModInformation.modid + ".goggles.electric"); GameRegistry.registerItem(electricGoggles, "ElectricGogglesRevealing"); diff --git a/src/main/java/tombenpotter/emt/common/items/foci/ItemShieldFocus.java b/src/main/java/tombenpotter/emt/common/items/foci/ItemShieldFocus.java index 683e00e..b10dd4f 100644 --- a/src/main/java/tombenpotter/emt/common/items/foci/ItemShieldFocus.java +++ b/src/main/java/tombenpotter/emt/common/items/foci/ItemShieldFocus.java @@ -26,7 +26,9 @@ import tombenpotter.emt.ElectroMagicTools; import tombenpotter.emt.common.blocks.BlockRegistry; public class ItemShieldFocus extends ItemBaseFocus { - + int x1 = 0; + int y1 = 0; + int z1 = 0; private static final AspectList visCost = new AspectList().add(Aspect.ORDER, 10).add(Aspect.WATER, 10).add(Aspect.AIR, 10); @@ -56,12 +58,14 @@ public class ItemShieldFocus extends ItemBaseFocus { @Override public void onUsingFocusTick(ItemStack itemstack, EntityPlayer player, int count) { - player.motionX = 0.0D; - player.motionY = 0.0D; - player.motionZ = 0.0D; ItemWandCasting wand = (ItemWandCasting) itemstack.getItem(); if (wand.consumeAllVis(itemstack, player, getVisCost(itemstack), true, true)) { + + player.motionX = 0.0D; + player.motionY = -0.1D; + player.motionZ = 0.0D; + int x = MathHelper.floor_double(player.posX); int y = MathHelper.floor_double(player.posY); int z = MathHelper.floor_double(player.posZ); @@ -84,6 +88,22 @@ public class ItemShieldFocus extends ItemBaseFocus { player.worldObj.setBlock(x, y + 1, z + 1, BlockRegistry.shield); player.worldObj.setBlock(x, y + 1, z - 1, BlockRegistry.shield); } + + if (y > y1 && (player.worldObj.isAirBlock(x + 1, y - 2, z) && player.worldObj.isAirBlock(x - 1, y - 2, z) && player.worldObj.isAirBlock(x, y - 2, z + 1) && player.worldObj.isAirBlock(x, y - 2, z - 1)) || (player.worldObj.getBlock(x + 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y - 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y - 2, z - 1) == BlockRegistry.shield)){ + player.worldObj.setBlockToAir(x + 1, y - 2, z); + player.worldObj.setBlockToAir(x - 1, y - 2, z); + player.worldObj.setBlockToAir(x, y - 2, z + 1); + player.worldObj.setBlockToAir(x, y - 2, z - 1); + } + + if (y < y1 && (player.worldObj.isAirBlock(x + 1, y + 2, z) && player.worldObj.isAirBlock(x - 1, y + 2, z) && player.worldObj.isAirBlock(x, y + 2, z + 1) && player.worldObj.isAirBlock(x, y + 2, z - 1)) || (player.worldObj.getBlock(x + 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x - 1, y + 2, z) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z + 1) == BlockRegistry.shield && player.worldObj.getBlock(x, y + 2, z - 1) == BlockRegistry.shield)){ + player.worldObj.setBlockToAir(x + 1, y + 2, z); + player.worldObj.setBlockToAir(x - 1, y + 2, z); + player.worldObj.setBlockToAir(x, y + 2, z + 1); + player.worldObj.setBlockToAir(x, y + 2, z - 1); + } + + y1 = y; } }