@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!"); }
@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); } } }
public void swingArm(EnumHand hand) { //-ZMod-ghost--------------------------------------------------------- if (!ZHandle.handle("allowSwing", true)) return; //-------------------------------------------------------------------- super.swingArm(hand); this.connection.sendPacket(new CPacketAnimation(hand)); }
@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); }
public static void swingArmPacket() { WConnection.sendPacket(new CPacketAnimation(EnumHand.MAIN_HAND)); }
public void handleAnimation(CPacketAnimation packetIn) { PacketThreadUtil.checkThreadAndEnqueue(packetIn, this, this.playerEntity.getServerWorld()); this.playerEntity.markPlayerActive(); this.playerEntity.swingArm(packetIn.getHand()); }
public static void swingArmPacket() { if (isNull()) { return; } Minecraft.getMinecraft().player.connection.sendPacket(new CPacketAnimation(EnumHand.MAIN_HAND)); }
public void swingArm(EnumHand hand) { super.swingArm(hand); this.connection.sendPacket(new CPacketAnimation(hand)); }
@Override public void handleAnimation(CPacketAnimation packetIn) { }
@Override public void handleAnimation(@Nonnull CPacketAnimation packetIn) { }
void handleAnimation(CPacketAnimation packetIn);