Example #1
0
 // Spigot start
 // Helper method for scheduleTicks. If the hopper at x0, y0, z0 is pointed
 // at this tile entity, then make it active.
 private void scheduleTick(int x0, int y0, int z0) {
   TileEntity tileEntity = world.getTileEntity(x0, y0, z0);
   if (tileEntity instanceof TileEntityHopper && tileEntity.world != null) {
     // i is the metadeta assoiated with the direction the hopper faces.
     int i = BlockHopper.b(tileEntity.p());
     // Facing class provides arrays for direction offset.
     if (tileEntity.x + Facing.b[i] == x
         && tileEntity.y + Facing.c[i] == y
         && tileEntity.z + Facing.d[i] == z) {
       ((TileEntityHopper) tileEntity).makeTick();
     }
   }
 }