use of com.github.technus.tectech.thing.metaTileEntity.IFrontRotation in project TecTech by Technus.
the class FrontRotationTriggerItem method onItemUseFirst.
@Override
public boolean onItemUseFirst(ItemStack aStack, EntityPlayer aPlayer, World aWorld, int aX, int aY, int aZ, int aSide, float hitX, float hitY, float hitZ) {
TileEntity tTileEntity = aWorld.getTileEntity(aX, aY, aZ);
if (tTileEntity == null || aPlayer instanceof FakePlayer) {
return aPlayer instanceof EntityPlayerMP;
}
if (aPlayer instanceof EntityPlayerMP) {
if (tTileEntity instanceof IGregTechTileEntity) {
IMetaTileEntity metaTE = ((IGregTechTileEntity) tTileEntity).getMetaTileEntity();
if (metaTE instanceof IFrontRotation) {
((IFrontRotation) metaTE).rotateAroundFrontPlane(!aPlayer.isSneaking());
System.out.println("DID SHIT");
return true;
}
} else if (tTileEntity instanceof IFrontRotation) {
((IFrontRotation) tTileEntity).rotateAroundFrontPlane(!aPlayer.isSneaking());
return true;
}
}
return false;
}
Aggregations