本文整理汇总了Java中net.minecraft.network.play.server.S0DPacketCollectItem类的典型用法代码示例。如果您正苦于以下问题:Java S0DPacketCollectItem类的具体用法?Java S0DPacketCollectItem怎么用?Java S0DPacketCollectItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
S0DPacketCollectItem类属于net.minecraft.network.play.server包,在下文中一共展示了S0DPacketCollectItem类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onItemPickup
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
/**
* Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize
*/
public void onItemPickup(Entity p_71001_1_, int p_71001_2_)
{
if (!p_71001_1_.isDead && !this.worldObj.isRemote)
{
EntityTracker entitytracker = ((WorldServer)this.worldObj).getEntityTracker();
if (p_71001_1_ instanceof EntityItem)
{
entitytracker.sendToAllTrackingEntity(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId()));
}
if (p_71001_1_ instanceof EntityArrow)
{
entitytracker.sendToAllTrackingEntity(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId()));
}
if (p_71001_1_ instanceof EntityXPOrb)
{
entitytracker.sendToAllTrackingEntity(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId()));
}
}
}
示例2: handleCollectItem
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
public void handleCollectItem(S0DPacketCollectItem 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.thePlayer;
}
if (entity != null)
{
if (entity instanceof EntityXPOrb)
{
this.clientWorldController.playSoundAtEntity(entity, "random.orb", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
else
{
this.clientWorldController.playSoundAtEntity(entity, "random.pop", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
this.gameController.effectRenderer.addEffect(new EntityPickupFX(this.clientWorldController, entity, entitylivingbase, 0.5F));
this.clientWorldController.removeEntityFromWorld(packetIn.getCollectedItemEntityID());
}
}
示例3: handleCollectItem
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
public void handleCollectItem(S0DPacketCollectItem 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.thePlayer;
}
if (entity != null) {
if (entity instanceof EntityXPOrb) {
this.clientWorldController.playSoundAtEntity(entity, "random.orb", 0.2F,
((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
} else {
this.clientWorldController.playSoundAtEntity(entity, "random.pop", 0.2F,
((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
this.gameController.effectRenderer
.addEffect(new EntityPickupFX(this.clientWorldController, entity, entitylivingbase, 0.5F));
this.clientWorldController.removeEntityFromWorld(packetIn.getCollectedItemEntityID());
}
}
示例4: onItemPickup
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
public void onItemPickup(Entity p_71001_1_, int p_71001_2_) {
;
;
;
if ((!p_71001_1_.isDead) && (!this.worldObj.isRemote)) {
EntityTracker entitytracker = ((WorldServer) this.worldObj)
.getEntityTracker();
if ((p_71001_1_ instanceof EntityItem)) {
entitytracker.func_151247_a(p_71001_1_,
new S0DPacketCollectItem(p_71001_1_.getEntityId(),
getEntityId()));
}
if ((p_71001_1_ instanceof EntityArrow)) {
entitytracker.func_151247_a(p_71001_1_,
new S0DPacketCollectItem(p_71001_1_.getEntityId(),
getEntityId()));
}
if ((p_71001_1_ instanceof EntityXPOrb)) {
entitytracker.func_151247_a(p_71001_1_,
new S0DPacketCollectItem(p_71001_1_.getEntityId(),
getEntityId()));
}
}
}
示例5: onItemPickup
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
/**
* Called whenever an item is picked up from walking over it. Args: pickedUpEntity, stackSize
*/
public void onItemPickup(Entity par1Entity, int par2)
{
if (!par1Entity.isDead && !this.worldObj.isClient)
{
EntityTracker var3 = ((WorldServer)this.worldObj).getEntityTracker();
if (par1Entity instanceof EntityItem)
{
var3.func_151247_a(par1Entity, new S0DPacketCollectItem(par1Entity.getEntityId(), this.getEntityId()));
}
if (par1Entity instanceof EntityArrow)
{
var3.func_151247_a(par1Entity, new S0DPacketCollectItem(par1Entity.getEntityId(), this.getEntityId()));
}
if (par1Entity instanceof EntityXPOrb)
{
var3.func_151247_a(par1Entity, new S0DPacketCollectItem(par1Entity.getEntityId(), this.getEntityId()));
}
}
}
示例6: handleCollectItem
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
public void handleCollectItem(S0DPacketCollectItem p_147246_1_)
{
Entity var2 = this.clientWorldController.getEntityByID(p_147246_1_.func_149354_c());
Object var3 = (EntityLivingBase)this.clientWorldController.getEntityByID(p_147246_1_.func_149353_d());
if (var3 == null)
{
var3 = this.gameController.thePlayer;
}
if (var2 != null)
{
if (var2 instanceof EntityXPOrb)
{
this.clientWorldController.playSoundAtEntity(var2, "random.orb", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
else
{
this.clientWorldController.playSoundAtEntity(var2, "random.pop", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
this.gameController.effectRenderer.addEffect(new EntityPickupFX(this.gameController.theWorld, var2, (Entity)var3, -0.5F));
this.clientWorldController.removeEntityFromWorld(p_147246_1_.func_149354_c());
}
}
示例7: onItemPickup
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
public void onItemPickup(Entity p_71001_1_, int p_71001_2_)
{
if (!p_71001_1_.isDead && !this.worldObj.isRemote)
{
EntityTracker entitytracker = ((WorldServer)this.worldObj).getEntityTracker();
if (p_71001_1_ instanceof EntityItem)
{
entitytracker.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId()));
}
if (p_71001_1_ instanceof EntityArrow)
{
entitytracker.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId()));
}
if (p_71001_1_ instanceof EntityXPOrb)
{
entitytracker.func_151247_a(p_71001_1_, new S0DPacketCollectItem(p_71001_1_.getEntityId(), this.getEntityId()));
}
}
}
示例8: handleCollectItem
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
public void handleCollectItem(S0DPacketCollectItem p_147246_1_)
{
Entity entity = this.clientWorldController.getEntityByID(p_147246_1_.func_149354_c());
Object object = (EntityLivingBase)this.clientWorldController.getEntityByID(p_147246_1_.func_149353_d());
if (object == null)
{
object = this.gameController.thePlayer;
}
if (entity != null)
{
if (entity instanceof EntityXPOrb)
{
this.clientWorldController.playSoundAtEntity(entity, "random.orb", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
else
{
this.clientWorldController.playSoundAtEntity(entity, "random.pop", 0.2F, ((this.avRandomizer.nextFloat() - this.avRandomizer.nextFloat()) * 0.7F + 1.0F) * 2.0F);
}
this.gameController.effectRenderer.addEffect(new EntityPickupFX(this.gameController.theWorld, entity, (Entity)object, -0.5F));
this.clientWorldController.removeEntityFromWorld(p_147246_1_.func_149354_c());
}
}
示例9: collectItem
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
@Override
public Packet collectItem(int entityItemID, int collectorID) {
return (Packet) new S0DPacketCollectItem(entityItemID, collectorID);
}
示例10: handleCollectItem
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
void handleCollectItem(S0DPacketCollectItem packetIn);
示例11: handleCollectItem
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
void handleCollectItem(S0DPacketCollectItem var1);
示例12: handleCollectItem
import net.minecraft.network.play.server.S0DPacketCollectItem; //导入依赖的package包/类
void handleCollectItem(S0DPacketCollectItem p_147246_1_);