当前位置: 首页>>代码示例>>Java>>正文


Java SPacketEntityStatus类代码示例

本文整理汇总了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));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:23,代码来源:PlayerList.java

示例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());
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:24,代码来源:NetHandlerPlayClient.java

示例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();
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:16,代码来源:MixinNetHandlerPlayClient.java

示例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()));
}
 
开发者ID:ImpactDevelopment,项目名称:ClientAPI,代码行数:13,代码来源:MixinNetHandlerPlayClient.java

示例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();
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:12,代码来源:EntityPlayerMP.java

示例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());
        }
    }
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:35,代码来源:NetHandlerPlayClient.java

示例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());
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:NetHandlerPlayClient.java

示例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));
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:13,代码来源:CommandGameRule.java

示例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();
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:12,代码来源:EntityPlayerMP.java

示例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));
		}
	}
}
 
开发者ID:lumien231,项目名称:Dimension-Rules,代码行数:13,代码来源:CommandGameRuleD.java

示例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));
        }
    }
}
 
开发者ID:maruohon,项目名称:justenoughdimensions,代码行数:13,代码来源:CommandJEDGameRule.java

示例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));
	}
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:12,代码来源:CommandOp.java

示例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;
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:8,代码来源:EvocationBehavior.java

示例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));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:WorldServer.java

示例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);
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:8,代码来源:INetHandlerPlayClient.java


注:本文中的net.minecraft.network.play.server.SPacketEntityStatus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。