本文整理汇总了Java中net.minecraft.network.play.client.CPacketAnimation类的典型用法代码示例。如果您正苦于以下问题:Java CPacketAnimation类的具体用法?Java CPacketAnimation怎么用?Java CPacketAnimation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CPacketAnimation类属于net.minecraft.network.play.client包,在下文中一共展示了CPacketAnimation类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onUpdate
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
@SubscribeEvent
public void onUpdate(LocalPlayerUpdateEvent event) {
if(!timer.isStarted())
timer.start();
else {
if(timer.hasTimeElapsed(delay.get())) {
timer.start(); // restart timer
if (silent.getAsBoolean())
getNetworkManager().sendPacket(new CPacketAnimation(EnumHand.MAIN_HAND));
else
getLocalPlayer().swingArm(EnumHand.MAIN_HAND);
}
}
}
示例2: swingArm
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
public void swingArm(EnumHand hand)
{
//-ZMod-ghost---------------------------------------------------------
if (!ZHandle.handle("allowSwing", true)) return;
//--------------------------------------------------------------------
super.swingArm(hand);
this.connection.sendPacket(new CPacketAnimation(hand));
}
示例3: call
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
@Override
public void call(String[] args) throws CmdException {
if (args.length != 1)
throw new CmdSyntaxError(this.getCmdName() + " " + this.getSyntax()[0]);
if (!NumberUtils.isNumber(args[0])) {
Chat.error("No number!");
return;
}
int number = (int) (NumberUtils.createDouble(args[0]) * 1000);
Chat.message("Trying to crash using " + args[0] + " packets...");
for (int i = 0; i < number; i++) {
Objects.requireNonNull(mc.getConnection()).sendPacketBypass(new CPacketAnimation());
}
Chat.message(ChatColor.DARK_BLUE + "Done!");
}
示例4: channelRead
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
@Override
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
if (msg instanceof CPacketAnimation) {
CPacketAnimation animation = (CPacketAnimation) msg;
ItemStack item = player.getHeldItem(animation.getHand());
MinecraftForge.EVENT_BUS.post(new SwingArmEvent(player, animation.getHand(), item));
}
super.channelRead(ctx, msg);
}
示例5: swingArmPacket
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
public static void swingArmPacket()
{
WConnection.sendPacket(new CPacketAnimation(EnumHand.MAIN_HAND));
}
示例6: handleAnimation
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
public void handleAnimation(CPacketAnimation packetIn)
{
PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld());
this.playerEntity.markPlayerActive();
this.playerEntity.swingArm(packetIn.getHand());
}
示例7: swingArmPacket
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
public static void swingArmPacket() {
if (isNull()) {
return;
}
Minecraft.getMinecraft().player.connection.sendPacket(new CPacketAnimation(EnumHand.MAIN_HAND));
}
示例8: swingArm
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
public void swingArm(EnumHand hand)
{
super.swingArm(hand);
this.connection.sendPacket(new CPacketAnimation(hand));
}
示例9: handleAnimation
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
@Override
public void handleAnimation(CPacketAnimation packetIn) {
}
示例10: handleAnimation
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
@Override
public void handleAnimation(@Nonnull CPacketAnimation packetIn) {
}
示例11: handleAnimation
import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
void handleAnimation(CPacketAnimation packetIn);