From 6de100d3856c4a31b5b2dc78fbf1cff924cf1f17 Mon Sep 17 00:00:00 2001 From: Calclavia Date: Sat, 13 Sep 2014 21:45:44 +0800 Subject: [PATCH] Temporarily removed PartFlatSwitchWire --- .../wire/flat/PartFlatSwitchWire.java | 95 ------------------- .../electrical/wire/flat/PartFlatWire.java | 34 ------- 2 files changed, 129 deletions(-) delete mode 100644 src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java diff --git a/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java b/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java deleted file mode 100644 index f9ab5a37d..000000000 --- a/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatSwitchWire.java +++ /dev/null @@ -1,95 +0,0 @@ -package resonantinduction.electrical.wire.flat; - -import java.util.Collections; -import java.util.List; - -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; -import codechicken.lib.vec.BlockCoord; -import codechicken.multipart.MultiPartRegistry; -import codechicken.multipart.TileMultipart; - -public class PartFlatSwitchWire extends PartFlatWire -{ - @Override - public boolean canConnectTo(Object obj) - { - if (this.checkRedstone(this.side ^ 0x1)) - { - return super.canConnectTo(obj); - } - - return false; - } - - @Override - public boolean canConnectTo(Object obj, ForgeDirection dir) - { - if (this.checkRedstone(this.side ^ 0x1)) - { - return super.canConnectTo(obj, dir); - } - - return false; - } - - @Override - public String getType() - { - return "resonant_induction_flat_switch_wire"; - } - - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item) - { - TileMultipart tile = tile(); - World w = world(); - - if (item.getItem() == Item.getItemFromBlock(Blocks.lever)) - { - if (!w.isRemote) - { - PartFlatWire wire = (PartFlatWire) MultiPartRegistry.createPart("resonant_induction_flat_wire", false); - wire.copyFrom(this); - - if (tile.canReplacePart(this, wire)) - { - tile.remPart(this); - TileMultipart.addPart(w, new BlockCoord(tile), wire); - - if (!player.capabilities.isCreativeMode) - { - tile.dropItems(Collections.singletonList(new ItemStack(Blocks.lever, 1))); - } - } - } - return true; - } - else - { - return super.activate(player, part, item); - } - } - - @Override - public void drop() - { - tile().dropItems(Collections.singletonList(new ItemStack(Blocks.lever, 1))); - super.drop(); - } - - @Override - public Iterable getDrops() - { - List drops = (List) super.getDrops(); - drops.add(new ItemStack(Blocks.lever, 1)); - - return drops; - } -} diff --git a/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java b/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java index 8c40ba2bc..4188eb4d2 100644 --- a/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java +++ b/src/main/scala/resonantinduction/electrical/wire/flat/PartFlatWire.java @@ -28,7 +28,6 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import org.lwjgl.opengl.GL11; -import resonantinduction.core.prefab.part.MultipartUtil; import resonantinduction.electrical.wire.base.TWire; import resonantinduction.electrical.wire.base.WireMaterial; @@ -274,39 +273,6 @@ public class PartFlatWire extends TWire implements TFacePart, TNormalOcclusion super.onNeighborChanged(); } - @Override - public boolean activate(EntityPlayer player, MovingObjectPosition part, ItemStack item) - { - if (item != null) - { - if (Item.getIdFromItem(item.getItem()) == Block.getIdFromBlock(Blocks.lever)) - { - TileMultipart tile = tile(); - World w = world(); - - if (!w.isRemote) - { - PartFlatSwitchWire wire = (PartFlatSwitchWire) MultiPartRegistry.createPart("resonant_induction_flat_switch_wire", false); - wire.copyFrom(this); - - if (tile.canReplacePart(this, wire)) - { - tile.remPart(this); - TileMultipart.addPart(w, new BlockCoord(tile), wire); - - if (!player.capabilities.isCreativeMode) - { - player.inventory.decrStackSize(player.inventory.currentItem, 1); - } - } - } - return true; - } - } - - return super.activate(player, part, item); - } - @Override public void recalculateConnections() {