本文整理汇总了Java中net.minecraft.network.packet.Packet8UpdateHealth类的典型用法代码示例。如果您正苦于以下问题:Java Packet8UpdateHealth类的具体用法?Java Packet8UpdateHealth怎么用?Java Packet8UpdateHealth使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Packet8UpdateHealth类属于net.minecraft.network.packet包,在下文中一共展示了Packet8UpdateHealth类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleUpdateHealth
import net.minecraft.network.packet.Packet8UpdateHealth; //导入依赖的package包/类
/**
* Recieves player health from the server and then proceeds to set it locally on the client.
*/
public void handleUpdateHealth(Packet8UpdateHealth par1Packet8UpdateHealth)
{
this.mc.thePlayer.setPlayerSPHealth(par1Packet8UpdateHealth.healthMP);
this.mc.thePlayer.getFoodStats().setFoodLevel(par1Packet8UpdateHealth.food);
this.mc.thePlayer.getFoodStats().setFoodSaturationLevel(par1Packet8UpdateHealth.foodSaturation);
}
示例2: handleUpdateHealth
import net.minecraft.network.packet.Packet8UpdateHealth; //导入依赖的package包/类
@Override
public void handleUpdateHealth(Packet8UpdateHealth par1Packet8UpdateHealth)
{
nch.handleUpdateHealth(par1Packet8UpdateHealth);
}
示例3: func_71127_g
import net.minecraft.network.packet.Packet8UpdateHealth; //导入依赖的package包/类
public void func_71127_g() {
try {
super.func_70071_h_();
for(int var1 = 0; var1 < this.field_71071_by.func_70302_i_(); ++var1) {
ItemStack var6 = this.field_71071_by.func_70301_a(var1);
if(var6 != null && Item.field_77698_e[var6.field_77993_c].func_77643_m_() && this.field_71135_a.func_72568_e() <= 5) {
Packet var8 = ((ItemMapBase)Item.field_77698_e[var6.field_77993_c]).func_77871_c(var6, this.field_70170_p, this);
if(var8 != null) {
this.field_71135_a.func_72567_b(var8);
}
}
}
if(this.func_110143_aJ() != this.field_71149_ch || this.field_71146_ci != this.field_71100_bB.func_75116_a() || this.field_71100_bB.func_75115_e() == 0.0F != this.field_71147_cj) {
this.field_71135_a.func_72567_b(new Packet8UpdateHealth(this.func_110143_aJ(), this.field_71100_bB.func_75116_a(), this.field_71100_bB.func_75115_e()));
this.field_71149_ch = this.func_110143_aJ();
this.field_71146_ci = this.field_71100_bB.func_75116_a();
this.field_71147_cj = this.field_71100_bB.func_75115_e() == 0.0F;
}
if(this.func_110143_aJ() + this.func_110139_bj() != this.field_130068_bO) {
this.field_130068_bO = this.func_110143_aJ() + this.func_110139_bj();
Collection var5 = this.func_96123_co().func_96520_a(ScoreObjectiveCriteria.field_96638_f);
Iterator var7 = var5.iterator();
while(var7.hasNext()) {
ScoreObjective var9 = (ScoreObjective)var7.next();
this.func_96123_co().func_96529_a(this.func_70023_ak(), var9).func_96651_a(Arrays.asList(new EntityPlayer[]{this}));
}
}
if(this.field_71067_cb != this.field_71144_ck) {
this.field_71144_ck = this.field_71067_cb;
this.field_71135_a.func_72567_b(new Packet43Experience(this.field_71106_cc, this.field_71067_cb, this.field_71068_ca));
}
} catch (Throwable var4) {
CrashReport var2 = CrashReport.func_85055_a(var4, "Ticking player");
CrashReportCategory var3 = var2.func_85058_a("Player being ticked");
this.func_85029_a(var3);
throw new ReportedException(var2);
}
}
示例4: func_72521_a
import net.minecraft.network.packet.Packet8UpdateHealth; //导入依赖的package包/类
public void func_72521_a(Packet8UpdateHealth p_72521_1_) {
this.func_72509_a(p_72521_1_);
}
示例5: func_72521_a
import net.minecraft.network.packet.Packet8UpdateHealth; //导入依赖的package包/类
public void func_72521_a(Packet8UpdateHealth p_72521_1_) {
this.field_72563_h.field_71439_g.func_71150_b(p_72521_1_.field_73640_a);
this.field_72563_h.field_71439_g.func_71024_bL().func_75114_a(p_72521_1_.field_73638_b);
this.field_72563_h.field_71439_g.func_71024_bL().func_75119_b(p_72521_1_.field_73639_c);
}
示例6: onUpdateEntity
import net.minecraft.network.packet.Packet8UpdateHealth; //导入依赖的package包/类
public void onUpdateEntity()
{
try
{
super.onUpdate();
for (int i = 0; i < this.inventory.getSizeInventory(); ++i)
{
ItemStack itemstack = this.inventory.getStackInSlot(i);
if (itemstack != null && Item.itemsList[itemstack.itemID].isMap() && this.playerNetServerHandler.packetSize() <= 5)
{
Packet packet = ((ItemMapBase)Item.itemsList[itemstack.itemID]).createMapDataPacket(itemstack, this.worldObj, this);
if (packet != null)
{
this.playerNetServerHandler.sendPacketToPlayer(packet);
}
}
}
if (this.getHealth() != this.lastHealth || this.lastFoodLevel != this.foodStats.getFoodLevel() || this.foodStats.getSaturationLevel() == 0.0F != this.wasHungry)
{
this.playerNetServerHandler.sendPacketToPlayer(new Packet8UpdateHealth(this.getHealth(), this.foodStats.getFoodLevel(), this.foodStats.getSaturationLevel()));
this.lastHealth = this.getHealth();
this.lastFoodLevel = this.foodStats.getFoodLevel();
this.wasHungry = this.foodStats.getSaturationLevel() == 0.0F;
}
if (this.getHealth() + this.getAbsorptionAmount() != this.field_130068_bO)
{
this.field_130068_bO = this.getHealth() + this.getAbsorptionAmount();
Collection collection = this.getWorldScoreboard().func_96520_a(ScoreObjectiveCriteria.health);
Iterator iterator = collection.iterator();
while (iterator.hasNext())
{
ScoreObjective scoreobjective = (ScoreObjective)iterator.next();
this.getWorldScoreboard().func_96529_a(this.getEntityName(), scoreobjective).func_96651_a(Arrays.asList(new EntityPlayer[] {this}));
}
}
if (this.experienceTotal != this.lastExperience)
{
this.lastExperience = this.experienceTotal;
this.playerNetServerHandler.sendPacketToPlayer(new Packet43Experience(this.experience, this.experienceTotal, this.experienceLevel));
}
}
catch (Throwable throwable)
{
CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking player");
CrashReportCategory crashreportcategory = crashreport.makeCategory("Player being ticked");
this.addEntityCrashInfo(crashreportcategory);
throw new ReportedException(crashreport);
}
}