Package nallar.patched.entity

Source Code of nallar.patched.entity.PatchEntityPlayerMP

package nallar.patched.entity;

import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.item.ItemInWorldManager;
import net.minecraft.network.packet.Packet29DestroyEntity;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;

import java.util.*;

public abstract class PatchEntityPlayerMP extends EntityPlayerMP {
  public PatchEntityPlayerMP(MinecraftServer par1MinecraftServer, World par2World, String par3Str, ItemInWorldManager par4ItemInWorldManager) {
    super(par1MinecraftServer, par2World, par3Str, par4ItemInWorldManager);
  }

  @Override
  public void onUpdate() {
    xpCooldown = 0;
    this.theItemInWorldManager.updateBlockRemoving();
    --this.initialInvulnerability;
    this.openContainer.detectAndSendChanges();

    List<Integer> destroyedItemsNetCache = this.destroyedItemsNetCache;
    while (!destroyedItemsNetCache.isEmpty()) {
      int items = Math.min(destroyedItemsNetCache.size(), 127);
      int[] removedItems = new int[items];
      Iterator<Integer> iterator = destroyedItemsNetCache.iterator();

      for (int var4 = 0; iterator.hasNext() && var4 < items; var4++) {
        removedItems[var4] = iterator.next();
        iterator.remove();
      }

      this.playerNetServerHandler.sendPacketToPlayer(new Packet29DestroyEntity(removedItems));
    }

    if (playerNetServerHandler.connectionClosed) {
      worldObj.removePlayerEntityDangerously(this);
    }
  }
}
TOP

Related Classes of nallar.patched.entity.PatchEntityPlayerMP

TOP
Copyright © 2018 www.massapi.com. 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.