Temporarily removed PartFlatSwitchWire

This commit is contained in:
Calclavia 2014-09-13 21:45:44 +08:00
parent 98674d42a9
commit 6de100d385
2 changed files with 0 additions and 129 deletions

View file

@ -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<ItemStack> getDrops()
{
List<ItemStack> drops = (List<ItemStack>) super.getDrops();
drops.add(new ItemStack(Blocks.lever, 1));
return drops;
}
}

View file

@ -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()
{