本文整理汇总了Java中net.minecraft.network.play.server.S1DPacketEntityEffect.getEffectId方法的典型用法代码示例。如果您正苦于以下问题:Java S1DPacketEntityEffect.getEffectId方法的具体用法?Java S1DPacketEntityEffect.getEffectId怎么用?Java S1DPacketEntityEffect.getEffectId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.network.play.server.S1DPacketEntityEffect
的用法示例。
在下文中一共展示了S1DPacketEntityEffect.getEffectId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleEntityEffect
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入方法依赖的package包/类
public void handleEntityEffect(S1DPacketEntityEffect packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
if (entity instanceof EntityLivingBase)
{
PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(), packetIn.getAmplifier(), false, packetIn.func_179707_f());
potioneffect.setPotionDurationMax(packetIn.func_149429_c());
((EntityLivingBase)entity).addPotionEffect(potioneffect);
}
}
示例2: handleEntityEffect
import net.minecraft.network.play.server.S1DPacketEntityEffect; //导入方法依赖的package包/类
public void handleEntityEffect(S1DPacketEntityEffect packetIn) {
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getEntityId());
if (entity instanceof EntityLivingBase) {
PotionEffect potioneffect = new PotionEffect(packetIn.getEffectId(), packetIn.getDuration(),
packetIn.getAmplifier(), false, packetIn.func_179707_f());
potioneffect.setPotionDurationMax(packetIn.func_149429_c());
((EntityLivingBase) entity).addPotionEffect(potioneffect);
}
}