Package net.minecraft.network.play.server

Examples of net.minecraft.network.play.server.S2FPacketSetSlot


      }
    }

    // Make sure the client has the same information as the server. It does not sync when backpackChestplate is disabled because there are no changes to the slot in that case.
    if (!player.worldObj.isRemote && success && player instanceof EntityPlayerMP && BetterStorage.globalConfig.getBoolean(GlobalConfig.backpackChestplate)) { 
      ((EntityPlayerMP)player).playerNetServerHandler.sendPacket(new S2FPacketSetSlot(0, 6, backpack));
    }
   
    if (success) player.swingItem();
    return success;
   
View Full Code Here


  @Override
  public void setEquipment(EntityPlayer player, ItemStack item) {
    player.setCurrentItemOrArmor(region.ordinal() + 1, item);
    // Shouldn't this be done automatically?
    ((EntityPlayerMP)player).playerNetServerHandler.sendPacket(
        new S2FPacketSetSlot(player.openContainer.windowId, 8 - region.ordinal(), item));
  }
View Full Code Here

      boolean success = playerView.canFitSome(slotStack);
      ItemStack overflow = playerView.data.addItems(slotStack);
      slot.putStack(overflow);
      // Send slot contents to player if it doesn't match the calculated overflow.
      ((EntityPlayerMP)player).playerNetServerHandler.sendPacket(
          new S2FPacketSetSlot(player.openContainer.windowId, slotId, overflow));
      if (!success) return null;
    }
    return stackBefore;
  }
View Full Code Here

TOP

Related Classes of net.minecraft.network.play.server.S2FPacketSetSlot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.