Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void update() {
- if(this.world != null && !this.world.isRemote) {
- if (this.ticksSinceLastUpdate > 20) {
- ticksSinceLastUpdate = 0;
- int dim= world.provider.getDimension();
- Main.proxy.NETWORK.sendToAllAround(new PacketDungeonStructureBlockSync(this), new TargetPoint(dim, pos.getX(), pos.getY(), pos.getZ(), 128));
- }
- else {
- ticksSinceLastUpdate++;
- }
- }
- }
- public void updateFromPacket(PacketDungeonStructureBlockSync message) {
- final NonNullList<ItemStack> stacks = message.getStacks();
- //TODO: Change 'i < 1' to 'i < stacks.size()' after publishing this example
- for(int i = 0; i < 1 && i < SIZE; i++) {
- this.setInventorySlotContents(i, stacks.get(i));
- Main.LOGGER.log(Level.INFO, "[" + i + "] " + stacks.get(i).toString()); //the packet's slot 0
- Main.LOGGER.log(Level.ERROR,"[" + i + "] " + itemHandler.getStackInSlot(i).toString()); //the TE's slot 0
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement