mirror of
https://github.com/GTNewHorizons/Electro-Magic-Tools.git
synced 2026-11-13 17:04:02 +00:00
fixes
This commit is contained in:
1 parent
0d12f5456b
commit
c1e3604e3e
3 files changed
+35
-9
No files matched your search
@@ -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();
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user