Ejemplo n.º 1
0
 @Override
 public boolean onBlockActivated(
     World world,
     int x,
     int y,
     int z,
     EntityPlayer player,
     int side,
     float preciseX,
     float preciseY,
     float preciseZ) {
   TileEntity tile = world.getTileEntity(x, y, z);
   if (tile instanceof TileEntityZeldaSuperChest) {
     TileEntityZeldaSuperChest tileChest = (TileEntityZeldaSuperChest) tile;
     tileChest.inverse();
     return true;
   }
   return false;
 }
Ejemplo n.º 2
0
 @Override
 public void onBlockPlacedBy(
     World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
   TileEntity tile = world.getTileEntity(x, y, z);
   if (tile instanceof TileEntityZeldaSuperChest) {
     int direction =
         MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 2.5D) & 3;
     ((TileEntityZeldaSuperChest) tile).setDirection((byte) direction);
   }
 }