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


Java CPacketAnimation类代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:fr1kin,项目名称:ForgeHax,代码行数:15,代码来源:AntiAfkMod.java

示例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));
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:9,代码来源:EntityPlayerSP.java

示例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!");
}
 
开发者ID:WurstSDK-Team,项目名称:WurstSDK,代码行数:17,代码来源:CrashCommand.java

示例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);
}
 
开发者ID:wizards-of-lua,项目名称:wizards-of-lua,代码行数:10,代码来源:WolChannelInboundHandlerAdapter.java

示例5: swingArmPacket

import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
public static void swingArmPacket()
{
	WConnection.sendPacket(new CPacketAnimation(EnumHand.MAIN_HAND));
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-MC-1.12-OF,代码行数:5,代码来源:WPlayer.java

示例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());
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:7,代码来源:NetHandlerPlayServer.java

示例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));
}
 
开发者ID:Moudoux,项目名称:EMC,代码行数:7,代码来源:IEntityPlayer.java

示例8: swingArm

import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
public void swingArm(EnumHand hand)
{
    super.swingArm(hand);
    this.connection.sendPacket(new CPacketAnimation(hand));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:6,代码来源:EntityPlayerSP.java

示例9: handleAnimation

import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
@Override
public void handleAnimation(CPacketAnimation packetIn) {

}
 
开发者ID:p455w0rd,项目名称:DankNull,代码行数:5,代码来源:NetServerHandlerFake.java

示例10: handleAnimation

import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
@Override
public void handleAnimation(@Nonnull CPacketAnimation packetIn) {

}
 
开发者ID:SleepyTrousers,项目名称:EnderIO,代码行数:5,代码来源:FakeNetHandlerPlayServer.java

示例11: handleAnimation

import net.minecraft.network.play.client.CPacketAnimation; //导入依赖的package包/类
void handleAnimation(CPacketAnimation packetIn); 
开发者ID:sudofox,项目名称:Backmemed,代码行数:2,代码来源:INetHandlerPlayServer.java


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