本文整理汇总了Java中net.minecraft.init.SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP属性的典型用法代码示例。如果您正苦于以下问题:Java SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP属性的具体用法?Java SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP怎么用?Java SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类net.minecraft.init.SoundEvents
的用法示例。
在下文中一共展示了SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleCollectItem
public void handleCollectItem(SPacketCollectItem packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = this.clientWorldController.getEntityByID(packetIn.getCollectedItemEntityID());
EntityLivingBase entitylivingbase = (EntityLivingBase)this.clientWorldController.getEntityByID(packetIn.getEntityID());
if (entitylivingbase == null)
{
entitylivingbase = this.gameController.player;
}
if (entity != null)
{
SoundEvent soundevent = entity instanceof EntityXPOrb ? SoundEvents.ENTITY_EXPERIENCE_ORB_PICKUP : SoundEvents.ENTITY_ITEM_PICKUP;
this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, soundevent, SoundCategory.PLAYERS, 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F, false);
if (entity instanceof EntityItem)
{
((EntityItem)entity).getEntityItem().func_190920_e(packetIn.func_191208_c());
}
this.gameController.effectRenderer.addEffect(new ParticleItemPickup(this.clientWorldController, entity, entitylivingbase, 0.5F));
this.clientWorldController.removeEntityFromWorld(packetIn.getCollectedItemEntityID());
}
}