本文整理汇总了Java中net.minecraft.network.play.server.SPacketEntityStatus类的典型用法代码示例。如果您正苦于以下问题:Java SPacketEntityStatus类的具体用法?Java SPacketEntityStatus怎么用?Java SPacketEntityStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SPacketEntityStatus类属于net.minecraft.network.play.server包,在下文中一共展示了SPacketEntityStatus类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendPlayerPermissionLevel
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
private void sendPlayerPermissionLevel(EntityPlayerMP player, int permLevel)
{
if (player != null && player.connection != null)
{
byte b0;
if (permLevel <= 0)
{
b0 = 24;
}
else if (permLevel >= 4)
{
b0 = 28;
}
else
{
b0 = (byte)(24 + permLevel);
}
player.connection.sendPacket(new SPacketEntityStatus(player, b0));
}
}
示例2: handleEntityStatus
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null)
{
if (packetIn.getOpCode() == 21)
{
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
}
else
{
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
示例3: preHandleEntityStatus
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
@Inject(method = "handleEntityStatus", at = @At("HEAD"), cancellable = true)
private void preHandleEntityStatus(SPacketEntityStatus packet, CallbackInfo ci) {
if (mc.world == null)
return;
Entity entity = packet.getEntity(mc.world);
// noinspection ConstantConditions
if (entity == null)
return;
EntityStatusEvent event = new EntityStatusEvent(EventState.PRE, entity, packet.getOpCode());
ClientAPI.EVENT_BUS.post(event);
if (event.isCancelled())
ci.cancel();
}
示例4: postHandleEntityStatus
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
@Inject(method = "handleEntityStatus", at = @At("RETURN"))
private void postHandleEntityStatus(SPacketEntityStatus packet, CallbackInfo ci) {
if (mc.world == null)
return;
Entity entity = packet.getEntity(mc.world);
// noinspection ConstantConditions
if (entity == null)
return;
ClientAPI.EVENT_BUS.post(new EntityStatusEvent(EventState.POST, entity, packet.getOpCode()));
}
示例5: onItemUseFinish
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
/**
* Used for when item use count runs out, ie: eating completed
*/
protected void onItemUseFinish()
{
if (!this.activeItemStack.func_190926_b() && this.isHandActive())
{
this.connection.sendPacket(new SPacketEntityStatus(this, (byte)9));
super.onItemUseFinish();
}
}
示例6: handleEntityStatus
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null)
{
if (packetIn.getOpCode() == 21)
{
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
}
else if (packetIn.getOpCode() == 35)
{
int i = 40;
this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false);
if (entity == this.gameController.player)
{
this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY));
}
}
else
{
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
示例7: handleEntityStatus
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
public void handleEntityStatus(SPacketEntityStatus packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.gameController);
Entity entity = packetIn.getEntity(this.clientWorldController);
if (entity != null)
{
if (packetIn.getOpCode() == 21)
{
this.gameController.getSoundHandler().playSound(new GuardianSound((EntityGuardian)entity));
}
else if (packetIn.getOpCode() == 35)
{
int i = 40;
this.gameController.effectRenderer.func_191271_a(entity, EnumParticleTypes.TOTEM, 30);
this.clientWorldController.playSound(entity.posX, entity.posY, entity.posZ, SoundEvents.field_191263_gW, entity.getSoundCategory(), 1.0F, 1.0F, false);
if (entity == this.gameController.player)
{
if (!Hacks.findMod(AntiTotemAnimation.class).isEnabled()) {
this.gameController.entityRenderer.func_190565_a(new ItemStack(Items.field_190929_cY));
}
}
}
else
{
entity.handleStatusUpdate(packetIn.getOpCode());
}
}
}
示例8: notifyGameRuleChange
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
public static void notifyGameRuleChange(GameRules rules, String p_184898_1_, MinecraftServer server)
{
if ("reducedDebugInfo".equals(p_184898_1_))
{
byte b0 = (byte)(rules.getBoolean(p_184898_1_) ? 22 : 23);
for (EntityPlayerMP entityplayermp : server.getPlayerList().getPlayerList())
{
entityplayermp.connection.sendPacket(new SPacketEntityStatus(entityplayermp, b0));
}
}
}
示例9: onItemUseFinish
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
/**
* Used for when item use count runs out, ie: eating completed
*/
protected void onItemUseFinish()
{
if (this.activeItemStack != null && this.isHandActive())
{
this.connection.sendPacket(new SPacketEntityStatus(this, (byte)9));
super.onItemUseFinish();
}
}
示例10: func_175773_a
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
public static void func_175773_a(GameRules p_175773_0_, String p_175773_1_)
{
if ("reducedDebugInfo".equals(p_175773_1_))
{
byte b0 = (byte) (p_175773_0_.getBoolean(p_175773_1_) ? 22 : 23);
for (EntityPlayerMP entityplayermp : FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().getPlayers())
{
entityplayermp.connection.sendPacket(new SPacketEntityStatus(entityplayermp, b0));
}
}
}
示例11: notifyGameRuleChange
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
static void notifyGameRuleChange(GameRules rules, String key, World world)
{
if (key.equals("reducedDebugInfo"))
{
byte opCode = (byte)(rules.getBoolean(key) ? 22 : 23);
for (EntityPlayerMP player : world.getPlayers(EntityPlayerMP.class, Predicates.alwaysTrue()))
{
player.connection.sendPacket(new SPacketEntityStatus(player, opCode));
}
}
}
示例12: sendPlayerPermissionLevel
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
private void sendPlayerPermissionLevel(EntityPlayerMP player, int permLevel) {
if (player != null && player.connection != null) {
byte b;
if (permLevel <= 0) b = 24;
else if (permLevel >= 4) b = 28;
else b = (byte) (24 + permLevel);
player.connection.sendPacket(new SPacketEntityStatus(player, b));
}
}
示例13: executeActivateBehavior
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
@Override
public int executeActivateBehavior(TileEntityTrophy tile, EntityPlayer player) {
if (player instanceof EntityPlayerMP) {
((EntityPlayerMP)player).connection.sendPacket(new SPacketEntityStatus(player, (byte)35));
}
return 100;
}
示例14: setEntityState
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
/**
* sends a Packet 38 (Entity Status) to all tracked players of that entity
*/
public void setEntityState(Entity entityIn, byte state)
{
this.getEntityTracker().sendToTrackingAndSelf(entityIn, new SPacketEntityStatus(entityIn, state));
}
示例15: handleEntityStatus
import net.minecraft.network.play.server.SPacketEntityStatus; //导入依赖的package包/类
/**
* Invokes the entities' handleUpdateHealth method which is implemented in LivingBase (hurt/death),
* MinecartMobSpawner (spawn delay), FireworkRocket & MinecartTNT (explosion), IronGolem (throwing,...), Witch
* (spawn particles), Zombie (villager transformation), Animal (breeding mode particles), Horse (breeding/smoke
* particles), Sheep (...), Tameable (...), Villager (particles for breeding mode, angry and happy), Wolf (...)
*/
void handleEntityStatus(SPacketEntityStatus packetIn);