Java 类net.minecraft.network.play.client.C0BPacketEntityAction 实例源码

项目:UsefulPets    文件:JumpPacketMonitor.java   
@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() );
}
项目:BaseClient    文件:Sneak.java   
@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));
    }
}
项目:BaseClient    文件:Blink.java   
@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);
    }
}
项目:BaseClient    文件:Sprint.java   
@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);
    }
}
项目:SerenityCE    文件:Sneak.java   
@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;
}
项目:Providence    文件:Methods.java   
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));
}
项目:EvenWurse    文件:SneakMod.java   
@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));
    }
}
项目:EvenWurse    文件:SneakMod.java   
@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));
}
项目:Resilience-Client-Source    文件:NetHandlerPlayServer.java   
/**
 * 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);
    }
}
项目:Cauldron    文件:NetHandlerPlayServer.java   
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);
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayServer.java   
/**
 * 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!");
    }
}
项目:DecompiledMinecraft    文件:NetHandlerPlayServer.java   
/**
 * 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!");
    }
}
项目:DecompiledMinecraft    文件:EntityPlayerSP.java   
protected void sendHorseJump()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.RIDING_JUMP, (int)(this.getHorseJumpPower() * 100.0F)));
}
项目:DecompiledMinecraft    文件:EntityPlayerSP.java   
public void sendHorseInventory()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.OPEN_INVENTORY));
}
项目:DecompiledMinecraft    文件:GuiSleepMP.java   
private void wakeFromSleep()
{
    NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue;
    nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SLEEPING));
}
项目:BaseClient    文件:Sneak.java   
@Override
public void onDisable() {
    this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C0BPacketEntityAction((Entity)this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SNEAKING));
    super.onDisable();
}
项目:BaseClient    文件:NetHandlerPlayServer.java   
/**
 * 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!");
    }
}
项目:BaseClient    文件:EntityPlayerSP.java   
protected void sendHorseJump()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.RIDING_JUMP, (int)(this.getHorseJumpPower() * 100.0F)));
}
项目:BaseClient    文件:EntityPlayerSP.java   
public void sendHorseInventory()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.OPEN_INVENTORY));
}
项目:BaseClient    文件:GuiSleepMP.java   
private void wakeFromSleep()
{
    NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue;
    nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SLEEPING));
}
项目:BaseClient    文件:NetHandlerPlayServer.java   
/**
 * 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!");
    }
}
项目:BaseClient    文件:EntityPlayerSP.java   
protected void sendHorseJump() {
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.RIDING_JUMP,
            (int) (this.getHorseJumpPower() * 100.0F)));
}
项目:BaseClient    文件:EntityPlayerSP.java   
public void sendHorseInventory() {
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.OPEN_INVENTORY));
}
项目:BaseClient    文件:GuiSleepMP.java   
private void wakeFromSleep()
{
    NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue;
    nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, C0BPacketEntityAction.Action.STOP_SLEEPING));
}
项目:Resilience-Client-Source    文件:EntityClientPlayerMP.java   
protected void func_110318_g()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 6, (int)(this.getHorseJumpPower() * 100.0F)));
}
项目:Resilience-Client-Source    文件:EntityClientPlayerMP.java   
public void func_110322_i()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 7));
}
项目:Resilience-Client-Source    文件:GuiSleepMP.java   
private void func_146418_g()
{
    NetHandlerPlayClient var1 = this.mc.thePlayer.sendQueue;
    var1.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, 3));
}
项目:UsefulPets    文件:PetJumpTicker.java   
@SubscribeEvent
public void tick( TickEvent.ClientTickEvent event )
{
    /*
    if ( !type.contains( TickType.CLIENT ) )
    {
        return;
    }
    //*/

    Minecraft mc = Minecraft.getMinecraft();
    EntityPlayerSP player = mc.thePlayer;

    if ( player == null || player.movementInput == null )
    {
        return;
    }

    // Lazy hack - hope this makes it work outside MCP
    try
    {
        // TODO SEVERE FIXME BUG ETC.
        // Check each update to make sure it works :P

        Class c = EntityPlayerSP.class;
        for ( int i = 0; i < c.getDeclaredFields().length; ++i )
        {
            c.getDeclaredFields()[ i ].setAccessible( true );
        }
        for ( int i = 0; i < c.getDeclaredMethods().length; ++i )
        {
            c.getDeclaredMethods()[ i ].setAccessible( true );
        }
    }
    catch ( Exception exception )
    {
        exception.printStackTrace();
    }

    // Copied from EntityPlayerSP.onLivingUpdate
       boolean flag = player.movementInput.jump;
       if ( player.ridingEntity instanceof PetEntity )
       {
           if (jumpPowerCounter < 0)
           {
               ++jumpPowerCounter;

               if (jumpPowerCounter == 0)
               {
                jumpPower = 0.0F;
               }
           }

           if (prevJump && !player.movementInput.jump)
           {
               jumpPowerCounter = -10;
               // Originally func_110318_g
               ( ( EntityClientPlayerMP ) player ).sendQueue.addToSendQueue(new C0BPacketEntityAction(player, 6, (int)(jumpPower * 100.0F)));
           }
           else if (!prevJump && player.movementInput.jump)
           {
            jumpPowerCounter = 0;
            jumpPower = 0.0F;
           }
           else if (prevJump)
           {
               ++jumpPowerCounter;

               if (jumpPowerCounter < 10)
               {
                jumpPower = (float)jumpPowerCounter * 0.1F;
               }
               else
               {
                jumpPower = 0.8F + 2.0F / (float)(jumpPowerCounter - 9) * 0.1F;
               }
           }
       }

       prevJump = player.movementInput.jump;
}
项目:Gadomancy    文件:FakeNetServerHandler.java   
@Override
public void processEntityAction(C0BPacketEntityAction p_147357_1_) {
}
项目:Cauldron    文件:EntityClientPlayerMP.java   
protected void func_110318_g()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 6, (int)(this.getHorseJumpPower() * 100.0F)));
}
项目:Cauldron    文件:EntityClientPlayerMP.java   
public void func_110322_i()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 7));
}
项目:Cauldron    文件:GuiSleepMP.java   
private void func_146418_g()
{
    NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue;
    nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, 3));
}
项目:Cauldron    文件:EntityClientPlayerMP.java   
protected void func_110318_g()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 6, (int)(this.getHorseJumpPower() * 100.0F)));
}
项目:Cauldron    文件:EntityClientPlayerMP.java   
public void func_110322_i()
{
    this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, 7));
}
项目:Cauldron    文件:GuiSleepMP.java   
private void func_146418_g()
{
    NetHandlerPlayClient nethandlerplayclient = this.mc.thePlayer.sendQueue;
    nethandlerplayclient.addToSendQueue(new C0BPacketEntityAction(this.mc.thePlayer, 3));
}
项目:DecompiledMinecraft    文件:INetHandlerPlayServer.java   
/**
 * 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
 */
void processEntityAction(C0BPacketEntityAction packetIn);
项目:DecompiledMinecraft    文件:INetHandlerPlayServer.java   
/**
 * 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
 */
void processEntityAction(C0BPacketEntityAction packetIn);
项目:BaseClient    文件:INetHandlerPlayServer.java   
/**
 * 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
 */
void processEntityAction(C0BPacketEntityAction packetIn);
项目:BaseClient    文件:INetHandlerPlayServer.java   
/**
 * 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
 */
void processEntityAction(C0BPacketEntityAction packetIn);
项目:Resilience-Client-Source    文件:INetHandlerPlayServer.java   
/**
 * 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
 */
void processEntityAction(C0BPacketEntityAction var1);