Start of work on Doing It Right™. Appears to work for cofh's API, not yet for IC2 or BC. Not sure why. Might have to ask @cpw.

This commit is contained in:
Ben Spiers committed 2014-06-26 01:10:53 +01:00
1 parent 82a708c7b2
commit 9c58ed549f
81 files changed
+425 -155

No files matched your search

@@ -22,7 +22,10 @@ import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import cpw.mods.fml.common.Optional.Interface;
import cpw.mods.fml.common.Optional.Method;
@Interface(iface = "ic2.api.tile.IWrenchable", modid = "IC2API")
public abstract class TileEntityBasicBlock extends TileEntity implements IWrenchable, ITileNetwork
{
/** The direction this block is facing. */
@@ -158,18 +161,21 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
}
@Override
@Method(modid = "IC2API")
public boolean wrenchCanSetFacing(EntityPlayer entityPlayer, int side)
{
return true;
}
@Override
@Method(modid = "IC2API")
public short getFacing()
{
return (short)facing;
}
@Override
@Method(modid = "IC2API")
public void setFacing(short direction)
{
if(canSetFacing(direction))
@@ -196,18 +202,21 @@ public abstract class TileEntityBasicBlock extends TileEntity implements IWrench
}
@Override
@Method(modid = "IC2API")
public boolean wrenchCanRemove(EntityPlayer entityPlayer)
{
return true;
}
@Override
@Method(modid = "IC2API")
public float getWrenchDropRate()
{
return 1.0F;
}
@Override
@Method(modid = "IC2API")
public ItemStack getWrenchDrop(EntityPlayer entityPlayer)
{
return getBlockType().getPickBlock(null, worldObj, xCoord, yCoord, zCoord);