Fixed bedrock issue, transmitters can now be wrenched by IC2 wrenches

This commit is contained in:
Aidan C. Brady 2014-01-09 14:30:30 -05:00
parent 8886b4caaa
commit ec9a77d31f
3 changed files with 39 additions and 7 deletions

View file

@ -6,6 +6,7 @@ import mekanism.api.Coord4D;
import mekanism.common.IBoundingBlock; import mekanism.common.IBoundingBlock;
import mekanism.common.tile.TileEntityDigitalMiner; import mekanism.common.tile.TileEntityDigitalMiner;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
public class ThreadMinerSearch extends Thread public class ThreadMinerSearch extends Thread
@ -54,7 +55,7 @@ public class ThreadMinerSearch extends Thread
int blockID = tileEntity.worldObj.getBlockId(x, y, z); int blockID = tileEntity.worldObj.getBlockId(x, y, z);
int meta = tileEntity.worldObj.getBlockMetadata(x, y, z); int meta = tileEntity.worldObj.getBlockMetadata(x, y, z);
if(blockID != 0) if(blockID != 0 && blockID != Block.bedrock.blockID)
{ {
ItemStack stack = new ItemStack(blockID, 1, meta); ItemStack stack = new ItemStack(blockID, 1, meta);

View file

@ -31,6 +31,7 @@ public class MultipartMekanism implements IPartFactory
MultipartGenerator.registerPassThroughInterface("cofh.api.energy.IEnergyHandler"); MultipartGenerator.registerPassThroughInterface("cofh.api.energy.IEnergyHandler");
MultipartGenerator.registerPassThroughInterface("mekanism.common.IConfigurable"); MultipartGenerator.registerPassThroughInterface("mekanism.common.IConfigurable");
MultipartGenerator.registerPassThroughInterface("mekanism.common.ITileNetwork"); MultipartGenerator.registerPassThroughInterface("mekanism.common.ITileNetwork");
MultipartGenerator.registerPassThroughInterface("ic2.api.tile.IWrenchable");
MultipartGenerator.registerPassThroughInterface("mekanism.api.transmitters.IBlockableConnection"); MultipartGenerator.registerPassThroughInterface("mekanism.api.transmitters.IBlockableConnection");
} }

View file

@ -1,5 +1,7 @@
package mekanism.common.multipart; package mekanism.common.multipart;
import ic2.api.tile.IWrenchable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.Collections; import java.util.Collections;
@ -10,20 +12,15 @@ import java.util.Set;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.api.EnumColor; import mekanism.api.EnumColor;
import mekanism.api.transmitters.IBlockableConnection; import mekanism.api.transmitters.IBlockableConnection;
import mekanism.api.transmitters.IGridTransmitter;
import mekanism.api.transmitters.ITransmitter; import mekanism.api.transmitters.ITransmitter;
import mekanism.api.transmitters.TransmissionType; import mekanism.api.transmitters.TransmissionType;
import mekanism.client.render.RenderPartTransmitter; import mekanism.client.render.RenderPartTransmitter;
import mekanism.common.IConfigurable; import mekanism.common.IConfigurable;
import mekanism.common.ITileNetwork; import mekanism.common.ITileNetwork;
import mekanism.common.Mekanism; import mekanism.common.Mekanism;
import mekanism.common.PacketHandler;
import mekanism.common.PacketHandler.Transmission;
import mekanism.common.item.ItemConfigurator; import mekanism.common.item.ItemConfigurator;
import mekanism.common.multipart.PartUniversalCable.CableTier; import mekanism.common.multipart.PartUniversalCable.CableTier;
import mekanism.common.multipart.TransmitterType.Size; import mekanism.common.multipart.TransmitterType.Size;
import mekanism.common.network.PacketTransmitterUpdate;
import mekanism.common.network.PacketTransmitterUpdate.PacketType;
import net.minecraft.client.particle.EffectRenderer; import net.minecraft.client.particle.EffectRenderer;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -56,7 +53,7 @@ import com.google.common.io.ByteArrayDataInput;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, JNormalOcclusion, IHollowConnect, JIconHitEffects, ITileNetwork, IBlockableConnection, IConfigurable, ITransmitter public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart, JNormalOcclusion, IHollowConnect, JIconHitEffects, ITileNetwork, IBlockableConnection, IConfigurable, ITransmitter, IWrenchable
{ {
public static IndexedCuboid6[] smallSides = new IndexedCuboid6[7]; public static IndexedCuboid6[] smallSides = new IndexedCuboid6[7];
public static IndexedCuboid6[] largeSides = new IndexedCuboid6[7]; public static IndexedCuboid6[] largeSides = new IndexedCuboid6[7];
@ -614,6 +611,39 @@ public abstract class PartSidedPipe extends TMultiPart implements TSlottedPart,
} }
} }
@Override
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
{
return false;
}
@Override
public short getFacing()
{
return 0;
}
@Override
public void setFacing(short facing) {}
@Override
public boolean wrenchCanRemove(EntityPlayer entityPlayer)
{
return true;
}
@Override
public float getWrenchDropRate()
{
return 1.0F;
}
@Override
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
{
return new ItemStack(Mekanism.PartTransmitter, 1, getTransmitter().ordinal());
}
public static enum ConnectionType public static enum ConnectionType
{ {
NORMAL, NORMAL,