本文整理汇总了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() );
}
示例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));
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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));
}
示例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));
}
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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!");
}
}
示例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)));
}
示例13: sendHorseInventory
import net.minecraft.network.play.client.C0BPacketEntityAction; //导入依赖的package包/类
public void sendHorseInventory()
{
this.sendQueue.addToSendQueue(new C0BPacketEntityAction(this, C0BPacketEntityAction.Action.OPEN_INVENTORY));
}
示例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));
}
示例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();
}