use of net.minecraft.network.play.client.CPacketPlayer in project Wurst-MC-1.12 by Wurst-Imperium.
the class FastBowMod method onUpdate.
@Override
public void onUpdate() {
// check if right-clicking
if (!mc.gameSettings.keyBindUseItem.pressed)
return;
// check fly-kick
if (!WMinecraft.getPlayer().onGround && !WMinecraft.getPlayer().capabilities.isCreativeMode)
return;
// check health
if (WMinecraft.getPlayer().getHealth() <= 0)
return;
// check held item
ItemStack stack = WMinecraft.getPlayer().inventory.getCurrentItem();
if (WItem.isNullOrEmpty(stack) || !(stack.getItem() instanceof ItemBow))
return;
WPlayerController.processRightClick();
for (int i = 0; i < 20; i++) WConnection.sendPacket(new CPacketPlayer(false));
mc.playerController.onStoppedUsingItem(WMinecraft.getPlayer());
}
use of net.minecraft.network.play.client.CPacketPlayer in project Wurst-MC-1.12 by Wurst-Imperium.
the class FlightMod method onUpdate.
@Override
public void onUpdate() {
switch(mode.getSelected()) {
case 0:
// Normal
WMinecraft.getPlayer().capabilities.isFlying = false;
WMinecraft.getPlayer().motionX = 0;
WMinecraft.getPlayer().motionY = 0;
WMinecraft.getPlayer().motionZ = 0;
WMinecraft.getPlayer().jumpMovementFactor = speed.getValueF();
if (mc.gameSettings.keyBindJump.pressed)
WMinecraft.getPlayer().motionY += speed.getValue();
if (mc.gameSettings.keyBindSneak.pressed)
WMinecraft.getPlayer().motionY -= speed.getValue();
if (flightKickBypass != null && flightKickBypass.isChecked()) {
updateMS();
updateFlyHeight();
WConnection.sendPacket(new CPacketPlayer(true));
if (flyHeight <= 290 && hasTimePassedM(500) || flyHeight > 290 && hasTimePassedM(100)) {
goToGround();
updateLastMS();
}
}
break;
case 1:
// Mineplex
updateMS();
if (!WMinecraft.getPlayer().onGround)
if (mc.gameSettings.keyBindJump.pressed && hasTimePassedS(2)) {
WMinecraft.getPlayer().setPosition(WMinecraft.getPlayer().posX, WMinecraft.getPlayer().posY + 8, WMinecraft.getPlayer().posZ);
updateLastMS();
} else if (mc.gameSettings.keyBindSneak.pressed)
WMinecraft.getPlayer().motionY = -0.4;
else
WMinecraft.getPlayer().motionY = -0.02;
WMinecraft.getPlayer().jumpMovementFactor = 0.04F;
break;
case 2:
// Old NCP
if (!WMinecraft.getPlayer().onGround)
if (mc.gameSettings.keyBindJump.pressed && WMinecraft.getPlayer().posY < startY - 1)
WMinecraft.getPlayer().motionY = 0.2;
else
WMinecraft.getPlayer().motionY = -0.02;
break;
}
}
Aggregations