Advertisement
Gamebuster

Untitled

Jul 26th, 2018
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1.     public void update() {
  2.         if(this.world != null && !this.world.isRemote) {
  3.             if (this.ticksSinceLastUpdate > 20) {
  4.                 ticksSinceLastUpdate = 0;
  5.                 int dim= world.provider.getDimension();
  6.                 Main.proxy.NETWORK.sendToAllAround(new PacketDungeonStructureBlockSync(this), new TargetPoint(dim, pos.getX(), pos.getY(), pos.getZ(), 128));
  7.             }
  8.             else {
  9.                 ticksSinceLastUpdate++;
  10.             }
  11.         }
  12.     }
  13.  
  14.     public void updateFromPacket(PacketDungeonStructureBlockSync message) {
  15.         final NonNullList<ItemStack> stacks = message.getStacks();
  16.         //TODO: Change 'i < 1' to 'i < stacks.size()' after publishing this example
  17.         for(int i = 0; i < 1 && i < SIZE; i++) {
  18.             this.setInventorySlotContents(i, stacks.get(i));
  19.             Main.LOGGER.log(Level.INFO, "[" + i + "] " + stacks.get(i).toString()); //the packet's slot 0
  20.             Main.LOGGER.log(Level.ERROR,"[" + i + "] " + itemHandler.getStackInSlot(i).toString()); //the TE's slot 0
  21.         }
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement