Search in sources :

Example 1 with PacketBackpackHasItems

use of net.mcft.copy.betterstorage.network.packet.PacketBackpackHasItems in project BetterStorage by copygirl.

the class ItemBackpack method updateHasItems.

public static void updateHasItems(EntityLivingBase entity, PropertiesBackpack backpackData) {
    if (entity.worldObj.isRemote || !(entity instanceof EntityPlayer))
        return;
    EntityPlayer player = (EntityPlayer) entity;
    boolean hasItems = ((backpackData.contents != null) && !StackUtils.isEmpty(backpackData.contents));
    if (backpackData.hasItems == hasItems)
        return;
    BetterStorage.networkChannel.sendTo(new PacketBackpackHasItems(hasItems), player);
    backpackData.hasItems = hasItems;
}
Also used : EntityPlayer(net.minecraft.entity.player.EntityPlayer) PacketBackpackHasItems(net.mcft.copy.betterstorage.network.packet.PacketBackpackHasItems)

Aggregations

PacketBackpackHasItems (net.mcft.copy.betterstorage.network.packet.PacketBackpackHasItems)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1