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


Java C0BPacketEntityAction类代码示例

本文整理汇总了Java中net.minecraft.network.play.client.C0BPacketEntityAction的典型用法代码示例。如果您正苦于以下问题:Java C0BPacketEntityAction类的具体用法?Java C0BPacketEntityAction怎么用?Java C0BPacketEntityAction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


C0BPacketEntityAction类属于net.minecraft.network.play.client包,在下文中一共展示了C0BPacketEntityAction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: monitorIncoming

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
@Override
public void monitorIncoming( INetHandler net, net.minecraft.network.Packet packet )
{
	if ( !( net instanceof NetHandlerPlayServer ) || !( packet instanceof C0BPacketEntityAction ) )
	{
		return;
	}
	
	NetHandlerPlayServer server = ( NetHandlerPlayServer ) net;
	C0BPacketEntityAction action = ( C0BPacketEntityAction ) packet;
	
	if ( action.func_149513_d() != 6 || !( server.playerEntity.ridingEntity instanceof PetEntity ) )
	{
		return;
	}
	PetEntity pet = ( PetEntity ) server.playerEntity.ridingEntity;

	pet.setJumpingState( action.func_149512_e() );
}
 
开发者ID:spacechase0,项目名称:UsefulPets,代码行数:20,代码来源:JumpPacketMonitor.java

示例2: onPreUpdate

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
@EventTarget
private void onPreUpdate(UpdateEvent event) {
    if (event.state == Event.State.PRE) {
        if (this.mc.thePlayer.isSneaking() || this.mc.thePlayer.movementInput.moveForward == 0.0f && this.mc.thePlayer.movementInput.moveStrafe == 0.0f) {
            return;
        }
        this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C0BPacketEntityAction((Entity)this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SNEAKING));
    } else if (event.state == Event.State.POST) {
        this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C0BPacketEntityAction((Entity)this.mc.thePlayer, C0BPacketEntityAction.Action.START_SNEAKING));
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:12,代码来源:Sneak.java

示例3: onPacketSend

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
@EventTarget
private void onPacketSend(PacketSendEvent event) {
    if (event.packet instanceof C0BPacketEntityAction || event.packet instanceof C03PacketPlayer || event.packet instanceof C02PacketUseEntity || event.packet instanceof C0APacketAnimation || event.packet instanceof C08PacketPlayerBlockPlacement) {
        this.packetList.add(event.packet);
        event.setCancelled(true);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:8,代码来源:Blink.java

示例4: onPacketSend

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
@EventTarget
private void onPacketSend(PacketSendEvent event) {
    C0BPacketEntityAction packet;
    if (this.fake && event.packet instanceof C0BPacketEntityAction && ((packet = (C0BPacketEntityAction)event.packet).getAction() == C0BPacketEntityAction.Action.START_SPRINTING || packet.getAction() == C0BPacketEntityAction.Action.STOP_SPRINTING)) {
        event.setCancelled(true);
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:8,代码来源:Sprint.java

示例5: onDisable

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
@Override
protected void onDisable() {
    if (!Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode())) {
        KeyBinding.setKeyBindState(mc.gameSettings.keyBindSneak.getKeyCode(), false);
        if (this.sneaking) {
            mc.thePlayer.sendQueue.addToSendQueue(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SNEAKING));
            this.sneaking = false;
        }
    }

    this.sneaking = false;
}
 
开发者ID:SerenityEnterprises,项目名称:SerenityCE,代码行数:13,代码来源:Sneak.java

示例6: damage

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
public static void damage(int hearts) {
    mc.getNetHandler().getNetworkManager().sendPacket(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.START_SPRINTING));
    double[] d = {0.2D, 0.26D};
    for (int a = 0; a < hearts; a++) {
        for (int i = 0; i < d.length; i++) {
            addPlayerOffsetPacket(0, d[i], 0, false);
        }
    }
    mc.getNetHandler().getNetworkManager().sendPacket(new C0BPacketEntityAction(mc.thePlayer, C0BPacketEntityAction.Action.STOP_SPRINTING));
}
 
开发者ID:hvze,项目名称:Providence,代码行数:11,代码来源:Methods.java

示例7: onUpdate

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
@Override
public void onUpdate() {
    if (WurstClient.INSTANCE.mods.getModByClass(YesCheatMod.class).isActive()) {
        NetHandlerPlayClient sendQueue = Minecraft.getMinecraft().thePlayer.sendQueue;
        sendQueue.addToSendQueue(
                new C0BPacketEntityAction(Minecraft.getMinecraft().thePlayer, Action.START_SNEAKING));
        sendQueue.addToSendQueue(
                new C0BPacketEntityAction(Minecraft.getMinecraft().thePlayer, Action.STOP_SNEAKING));
    } else {
        Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(
                new C0BPacketEntityAction(Minecraft.getMinecraft().thePlayer, Action.START_SNEAKING));
    }
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:14,代码来源:SneakMod.java

示例8: onDisable

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
@Override
public void onDisable() {
    WurstClient.INSTANCE.events.remove(UpdateListener.class, this);
    Minecraft.getMinecraft().gameSettings.keyBindSneak.pressed = false;
    Minecraft.getMinecraft().thePlayer.sendQueue
            .addToSendQueue(new C0BPacketEntityAction(Minecraft.getMinecraft().thePlayer, Action.STOP_SNEAKING));
}
 
开发者ID:null-dev,项目名称:EvenWurse,代码行数:8,代码来源:SneakMod.java

示例9: processEntityAction

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
/**
 * Processes a range of action-types: sneaking, sprinting, waking from sleep, opening the inventory or setting jump
 * height of the horse the player is riding
 */
public void processEntityAction(C0BPacketEntityAction p_147357_1_)
{
    this.playerEntity.func_143004_u();

    if (p_147357_1_.func_149513_d() == 1)
    {
        this.playerEntity.setSneaking(true);
    }
    else if (p_147357_1_.func_149513_d() == 2)
    {
        this.playerEntity.setSneaking(false);
    }
    else if (p_147357_1_.func_149513_d() == 4)
    {
        this.playerEntity.setSprinting(true);
    }
    else if (p_147357_1_.func_149513_d() == 5)
    {
        this.playerEntity.setSprinting(false);
    }
    else if (p_147357_1_.func_149513_d() == 3)
    {
        this.playerEntity.wakeUpPlayer(false, true, true);
        this.hasMoved = false;
    }
    else if (p_147357_1_.func_149513_d() == 6)
    {
        if (this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse)
        {
            ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(p_147357_1_.func_149512_e());
        }
    }
    else if (p_147357_1_.func_149513_d() == 7 && this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse)
    {
        ((EntityHorse)this.playerEntity.ridingEntity).openGUI(this.playerEntity);
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:42,代码来源:NetHandlerPlayServer.java

示例10: processEntityAction

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
public void processEntityAction(C0BPacketEntityAction p_147357_1_)
{
    this.playerEntity.func_143004_u();

    if (p_147357_1_.func_149513_d() == 1)
    {
        this.playerEntity.setSneaking(true);
    }
    else if (p_147357_1_.func_149513_d() == 2)
    {
        this.playerEntity.setSneaking(false);
    }
    else if (p_147357_1_.func_149513_d() == 4)
    {
        this.playerEntity.setSprinting(true);
    }
    else if (p_147357_1_.func_149513_d() == 5)
    {
        this.playerEntity.setSprinting(false);
    }
    else if (p_147357_1_.func_149513_d() == 3)
    {
        this.playerEntity.wakeUpPlayer(false, true, true);
        this.hasMoved = false;
    }
    else if (p_147357_1_.func_149513_d() == 6)
    {
        if (this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse)
        {
            ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(p_147357_1_.func_149512_e());
        }
    }
    else if (p_147357_1_.func_149513_d() == 7 && this.playerEntity.ridingEntity != null && this.playerEntity.ridingEntity instanceof EntityHorse)
    {
        ((EntityHorse)this.playerEntity.ridingEntity).openGUI(this.playerEntity);
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:38,代码来源:NetHandlerPlayServer.java

示例11: processEntityAction

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
/**
 * Processes a range of action-types: sneaking, sprinting, waking from sleep, opening the inventory or setting jump
 * height of the horse the player is riding
 */
public void processEntityAction(C0BPacketEntityAction packetIn)
{
    PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerForPlayer());
    this.playerEntity.markPlayerActive();

    switch (packetIn.getAction())
    {
        case START_SNEAKING:
            this.playerEntity.setSneaking(true);
            break;

        case STOP_SNEAKING:
            this.playerEntity.setSneaking(false);
            break;

        case START_SPRINTING:
            this.playerEntity.setSprinting(true);
            break;

        case STOP_SPRINTING:
            this.playerEntity.setSprinting(false);
            break;

        case STOP_SLEEPING:
            this.playerEntity.wakeUpPlayer(false, true, true);
            this.hasMoved = false;
            break;

        case RIDING_JUMP:
            if (this.playerEntity.ridingEntity instanceof EntityHorse)
            {
                ((EntityHorse)this.playerEntity.ridingEntity).setJumpPower(packetIn.getAuxData());
            }

            break;

        case OPEN_INVENTORY:
            if (this.playerEntity.ridingEntity instanceof EntityHorse)
            {
                ((EntityHorse)this.playerEntity.ridingEntity).openGUI(this.playerEntity);
            }

            break;

        default:
            throw new IllegalArgumentException("Invalid client command!");
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:53,代码来源:NetHandlerPlayServer.java

示例12: sendHorseJump

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
protected void sendHorseJump()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.RIDING_JUMP, (int)(this.getHorseJumpPower() * 100.0F)));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:EntityPlayerSP.java

示例13: sendHorseInventory

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
public void sendHorseInventory()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.OPEN_INVENTORY));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:5,代码来源:EntityPlayerSP.java

示例14: wakeFromSleep

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
private void wakeFromSleep()
{
    NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue;
    nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SLEEPING));
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:6,代码来源:GuiSleepMP.java

示例15: onDisable

import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
@Override
public void onDisable() {
    this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C0BPacketEntityAction((Entity)this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SNEAKING));
    super.onDisable();
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:6,代码来源:Sneak.java


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