/** * Called to update the entity's position/logic. */ public void onUpdate() { if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) { super.onUpdate(); if (this.isRiding()) { this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); } else { this.onUpdateWalkingPlayer(); } } }
private void attack(final EntityLivingBase ent, final boolean crit) { this.swingItem(); if (crit) { this.crit(); } else { this.mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer()); } final float sharpLevel = EnchantmentHelper.func_152377_a(this.mc.thePlayer.getHeldItem(), ent.getCreatureAttribute()); final boolean vanillaCrit = this.mc.thePlayer.fallDistance > 0.0f && !this.mc.thePlayer.onGround && !this.mc.thePlayer.isOnLadder() && !this.mc.thePlayer.isInWater() && !this.mc.thePlayer.isPotionActive(Potion.blindness) && this.mc.thePlayer.ridingEntity == null; this.mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(ent, C02PacketUseEntity.Action.ATTACK)); if (crit || vanillaCrit) { this.mc.thePlayer.onCriticalHit(ent); } if (sharpLevel > 0.0f) { this.mc.thePlayer.onEnchantmentCritical(ent); } }
/** * Called to update the entity's position/logic. */ public void onUpdate() { EventUpdate update = new EventUpdate(); update.call(); if (this.worldObj.isBlockLoaded(new BlockPos(this.posX, 0.0D, this.posZ))) { super.onUpdate(); if (this.isRiding()) { this.sendQueue.addToSendQueue( new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); } else { this.onUpdateWalkingPlayer(); // TODO:CLIENT EventPostMotionUpdates post = new EventPostMotionUpdates(this.rotationYaw, this.rotationPitch, this.onGround, this.posY); post.call(); } } }
private void flush() { // lastFlushPosition = null; if (isFlushing) return; lastFlushPosition = new Vector3(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ); isFlushing = true; for (Packet packet : outboundPackets) { mc.getNetHandler().getNetworkManager().sendPacket(packet); if (packet instanceof C03PacketPlayer) { C03PacketPlayer player = (C03PacketPlayer) packet; if (player.isMoving()) { lastFlushPosition = new Vector3(player.getPositionX(), player.getPositionY(), player.getPositionZ()); } } } outboundPackets.clear(); isFlushing = false; }
@Override public void onUpdate() { if (Minecraft.getMinecraft().thePlayer.getHealth() > 0 && (Minecraft.getMinecraft().thePlayer.onGround || Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) && Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem() != null && Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem() instanceof ItemBow && Minecraft.getMinecraft().gameSettings.keyBindUseItem.pressed) { Minecraft.getMinecraft().playerController .sendUseItem(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem()); Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem() .onItemRightClick(Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem(), Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer); for (int i = 0; i < 20; i++) { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(false)); } Minecraft.getMinecraft().getNetHandler().addToSendQueue( new C07PacketPlayerDigging(Action.RELEASE_USE_ITEM, new BlockPos(0, 0, 0), EnumFacing.DOWN)); Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem() .onPlayerStoppedUsing(Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem(), Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer, 10); } }
@Override public void onEnable() { WurstClient.INSTANCE.mods.disableModsByClass(JetpackMod.class); if (WurstClient.INSTANCE.mods.getModByClass(YesCheatMod.class).isActive() || WurstClient.INSTANCE.mods.getModByClass(AntiMacMod.class).isActive()) { double startX = Minecraft.getMinecraft().thePlayer.posX; startY = Minecraft.getMinecraft().thePlayer.posY; double startZ = Minecraft.getMinecraft().thePlayer.posZ; for (int i = 0; i < 4; i++) { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue( new C03PacketPlayer.C04PacketPlayerPosition(startX, startY + 1.01, startZ, false)); Minecraft.getMinecraft().thePlayer.sendQueue .addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(startX, startY, startZ, false)); } Minecraft.getMinecraft().thePlayer.jump(); } WurstClient.INSTANCE.events.add(UpdateListener.class, this); }
@Override public void onOutwardPacket(EventOnOutwardPacket event){ if(!invoker.isOnGround()) return; Packet packet = event.getPacket(); if (packet instanceof C08PacketPlayerBlockPlacement) { if(Item.getIdFromItem(invoker.getCurrentItem().getItem()) != 261) return; C08PacketPlayerBlockPlacement packetBlockPlacement = (C08PacketPlayerBlockPlacement) packet; if (packetBlockPlacement.func_149576_c() != -1 || packetBlockPlacement.func_149571_d() != -1 || packetBlockPlacement.func_149570_e() != -1 || packetBlockPlacement.func_149568_f() != 255) { return; } event.addPacketToList(new C09PacketHeldItemChange(Minecraft.getMinecraft().thePlayer.inventory.currentItem)); for (int i = 0; i < 40; i++) { event.addPacketToList(new C03PacketPlayer(false)); } event.addPacketToList(new C07PacketPlayerDigging(5, 0, 0, 0, 255)); } }
@Override public void onOutwardPacket(EventOnOutwardPacket event){ if(!invoker.isOnGround()) return; Packet packet = event.getPacket(); if (packet instanceof C08PacketPlayerBlockPlacement) { if(!(invoker.getCurrentItem().getItem() instanceof ItemFood)) return; C08PacketPlayerBlockPlacement packetBlockPlacement = (C08PacketPlayerBlockPlacement) packet; if (packetBlockPlacement.func_149576_c() != -1 || packetBlockPlacement.func_149571_d() != -1 || packetBlockPlacement.func_149570_e() != -1 || packetBlockPlacement.func_149568_f() != 255) { return; } event.addPacketToList(new C09PacketHeldItemChange(Minecraft.getMinecraft().thePlayer.inventory.currentItem)); for (int i = 0; i < 40; i++) { event.addPacketToList(new C03PacketPlayer(false)); } event.addPacketToList(new C07PacketPlayerDigging(5, 0, 0, 0, 255)); } }
/** * Called to update the entity's position/logic. */ public void onUpdate() { if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { super.onUpdate(); if (this.isRiding()) { this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); } else { this.sendMotionUpdates(); } } }
/** * Handles changes in player positioning and rotation such as when travelling to a new dimension, (re)spawning, * mounting horses etc. Seems to immediately reply to the server with the clients post-processing perspective on the * player positioning */ public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_) { EntityClientPlayerMP var2 = this.gameController.thePlayer; double var3 = p_147258_1_.func_148932_c(); double var5 = p_147258_1_.func_148928_d(); double var7 = p_147258_1_.func_148933_e(); float var9 = p_147258_1_.func_148931_f(); float var10 = p_147258_1_.func_148930_g(); var2.ySize = 0.0F; var2.motionX = var2.motionY = var2.motionZ = 0.0D; var2.setPositionAndRotation(var3, var5, var7, var9, var10); this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(var2.posX, var2.boundingBox.minY, var2.posY, var2.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h()), new GenericFutureListener[0]); if (!this.doneLoadingTerrain) { this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX; this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY; this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ; this.doneLoadingTerrain = true; this.gameController.displayGuiScreen((GuiScreen)null); } }
public void onUpdate() { if (this.worldObj.blockExists(MathHelper.floor_double(this.posX), 0, MathHelper.floor_double(this.posZ))) { super.onUpdate(); if (this.isRiding()) { this.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(this.rotationYaw, this.rotationPitch, this.onGround)); this.sendQueue.addToSendQueue(new C0CPacketInput(this.moveStrafing, this.moveForward, this.movementInput.jump, this.movementInput.sneak)); } else { this.sendMotionUpdates(); } } }
public void handlePlayerPosLook(S08PacketPlayerPosLook p_147258_1_) { EntityClientPlayerMP entityclientplayermp = this.gameController.thePlayer; double d0 = p_147258_1_.func_148932_c(); double d1 = p_147258_1_.func_148928_d(); double d2 = p_147258_1_.func_148933_e(); float f = p_147258_1_.func_148931_f(); float f1 = p_147258_1_.func_148930_g(); entityclientplayermp.ySize = 0.0F; entityclientplayermp.motionX = entityclientplayermp.motionY = entityclientplayermp.motionZ = 0.0D; entityclientplayermp.setPositionAndRotation(d0, d1, d2, f, f1); this.netManager.scheduleOutboundPacket(new C03PacketPlayer.C06PacketPlayerPosLook(entityclientplayermp.posX, entityclientplayermp.boundingBox.minY, entityclientplayermp.posY, entityclientplayermp.posZ, p_147258_1_.func_148931_f(), p_147258_1_.func_148930_g(), p_147258_1_.func_148929_h()), new GenericFutureListener[0]); if (!this.doneLoadingTerrain) { this.gameController.thePlayer.prevPosX = this.gameController.thePlayer.posX; this.gameController.thePlayer.prevPosY = this.gameController.thePlayer.posY; this.gameController.thePlayer.prevPosZ = this.gameController.thePlayer.posZ; this.doneLoadingTerrain = true; this.gameController.displayGuiScreen((GuiScreen)null); } }
@EventTarget private void onPostUpdate(UpdateEvent event) { if (event.state == Event.State.PRE && this.mc.thePlayer.getItemInUse().getItem() instanceof ItemBow && this.mc.thePlayer.getItemInUseDuration() == 16) { int i = 0; while (i < 5) { this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer(true)); ++i; } this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN)); this.mc.thePlayer.stopUsingItem(); } }
private void crit() { final double posY = this.mc.thePlayer.posY + Speed.yOffset; this.mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, posY + 0.0625, this.mc.thePlayer.posZ, true)); this.mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, posY, this.mc.thePlayer.posZ, false)); this.mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, posY + 1.1E-5, this.mc.thePlayer.posZ, false)); this.mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, posY, this.mc.thePlayer.posZ, false)); }
@EventTarget private void onUpdate(UpdateEvent event) { int foodSlot; if (event.state == Event.State.PRE && (foodSlot = this.getFoodSlotInHotbar()) != -1 && (double)this.mc.thePlayer.getFoodStats().getFoodLevel() < this.hunger * 2.0 && this.mc.thePlayer.isCollidedVertically) { this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C09PacketHeldItemChange(foodSlot)); this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C08PacketPlayerBlockPlacement(this.mc.thePlayer.inventory.mainInventory[foodSlot])); int i = 0; while (i < 32) { this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer(false)); ++i; } this.mc.thePlayer.stopUsingItem(); this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C09PacketHeldItemChange(this.mc.thePlayer.inventory.currentItem)); } }
@EventTarget private void onUpdate(UpdateEvent event) { if (event.state == Event.State.POST && (double)this.mc.thePlayer.getHealth() < this.health * 2.0 && this.mc.thePlayer.isCollidedVertically) { int i = 0; while ((double)i < this.packets) { this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer(true)); ++i; } } }
@EventTarget private void onPostUpdate(UpdateEvent event) { if (event.state == Event.State.PRE && this.mc.thePlayer.getItemInUseDuration() == 16 && !(this.mc.thePlayer.getItemInUse().getItem() instanceof ItemBow)) { int i = 0; while (i < 17) { this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer(true)); ++i; } this.mc.getNetHandler().getNetworkManager().dispatchPacket((Packet)new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN), null); } }
@Override public void onEnable() { if (this.mc.thePlayer != null) { int i = 0; while ((double)i < 80.0 + 40.0 * (this.damage - 0.5)) { this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY + 0.1D, this.mc.thePlayer.posZ, false)); this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ, false)); ++i; } this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY, this.mc.thePlayer.posZ, true)); } }
@EventTarget private void onPreUpdate(UpdateEvent event) { if ((this.mc.thePlayer.isCollidedHorizontally) && (!this.mc.thePlayer.isOnLadder())) { float direction = this.mc.thePlayer.rotationYaw; double x = Math.cos((direction + 90) * Math.PI / 180) * 0.2D; double z = Math.sin((direction + 90) * Math.PI / 180) * 0.2D; this.mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX + x, this.mc.thePlayer.posY, this.mc.thePlayer.posZ + z, false)); for (int i = 1; i < 20; i++) { this.mc.getNetHandler().addToSendQueue(new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, 8.988465674311579E307D, this.mc.thePlayer.posZ, false)); } this.mc.thePlayer.setPosition(this.mc.thePlayer.posX + x, this.mc.thePlayer.posY, this.mc.thePlayer.posZ + z); return; } }
@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); } }
@Override public void onEnable() { if (this.damage && this.mc.thePlayer.isCollidedVertically) { double val = ValueManager.getValue((String)"damage", (Module)ModuleManager.getModule(Damage.class)).value; ValueManager.getValue("damage", ModuleManager.getModule(Damage.class)).setValue(0.5); ModuleManager.getModule(Damage.class).toggle(); ValueManager.getValue("damage", ModuleManager.getModule(Damage.class)).setValue(val); this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer.C04PacketPlayerPosition(this.mc.thePlayer.posX, this.mc.thePlayer.posY + 0.01, this.mc.thePlayer.posZ, false)); } super.onEnable(); }
@EventTarget private void onUseItem(final UseItemEvent event) { float yaw = 2.14748365E9f; float pitch = 2.14748365E9f; final float yawDifference = 2.14748365E9f; for (final Object o : this.mc.theWorld.playerEntities) { final EntityPlayer player = (EntityPlayer)o; final String name = player.getDisplayName().getFormattedText(); final Character colorFormatCharacter = new Character('§'); final boolean validTarget = this.mc.thePlayer != player && this.mc.thePlayer.getDistanceToEntity((Entity)player) <= this.range && name.contains(colorFormatCharacter + "c"); if (validTarget) { float diff = RotationUtils.getDistanceBetweenAngles(this.mc.thePlayer.rotationYaw, RotationUtils.getRotations((Entity)player)[0]); if (diff > yawDifference) { continue; } diff = yawDifference; yaw = RotationUtils.getRotations((Entity)player)[0]; pitch = RotationUtils.getRotations((Entity)player)[1]; } } if (event.state == Event.State.PRE) { if (yaw != 2.14748365E9f) { this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, true)); } } else if (event.state == Event.State.POST && yaw != 2.14748365E9f) { this.mc.thePlayer.sendQueue.addToSendQueue((Packet)new C03PacketPlayer.C05PacketPlayerLook(this.mc.thePlayer.rotationYaw, this.mc.thePlayer.rotationPitch, true)); } }
@Override public void call(SendPacket event) { if (event.getPacket() instanceof C03PacketPlayer) { C03PacketPlayer packet = (C03PacketPlayer) event.getPacket(); double x = packet.isMoving() ? packet.getPositionX() : mc.thePlayer.posX; double y = packet.isMoving() ? packet.getPositionY() : mc.thePlayer.posY; double z = packet.isMoving() ? packet.getPositionZ() : mc.thePlayer.posZ; float yaw = packet.getRotating() ? packet.getYaw() : mc.thePlayer.rotationYaw; float pitch = packet.getRotating() ? packet.getPitch() : mc.thePlayer.rotationPitch; NetMovingUpdate updateEvent = new NetMovingUpdate(x, y, z, yaw, pitch, packet.isOnGround()); EventManager.post(updateEvent); boolean moved = x != updateEvent.getX() || y != updateEvent.getY() || z != updateEvent.getZ(); moved = moved || packet.isMoving(); boolean rotated = yaw != updateEvent.getYaw() || pitch != updateEvent.getPitch(); rotated = rotated || packet.getRotating(); if (!moved && !rotated) event.setPacket(new C03PacketPlayer(updateEvent.getOnGround())); if (moved && !rotated) event.setPacket(new C03PacketPlayer.C04PacketPlayerPosition(updateEvent.getX(), updateEvent.getY(), updateEvent.getZ(), updateEvent.getOnGround())); if (rotated && !moved) event.setPacket(new C03PacketPlayer.C05PacketPlayerLook(updateEvent.getYaw(), updateEvent.getPitch(), updateEvent.getOnGround())); if (moved && rotated) event.setPacket(new C03PacketPlayer.C06PacketPlayerPosLook(updateEvent.getX(), updateEvent.getY(), updateEvent.getZ(), updateEvent.getYaw(), updateEvent.getPitch(), updateEvent.getOnGround())); } }
@Override public void onUpdate() { if (Minecraft.getMinecraft().thePlayer.getHealth() > 0 && (Minecraft.getMinecraft().thePlayer.onGround || Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode) && Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem() != null && Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem() instanceof ItemBow && Minecraft.getMinecraft().gameSettings.keyBindUseItem.pressed) { new Thread(() -> { Minecraft.getMinecraft().playerController .sendUseItem(Minecraft.getMinecraft().thePlayer, Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem()); Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem() .onItemRightClick(Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem(), Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer); String configKey = "Charge Level (1 - 20)"; int iters = ModuleConfiguration.forModule(this).getInt(configKey, 3); if (iters > 20 || iters < 1) { iters = 1; Chat.sendWarning("BowSpam charge level range out of range, resetting!"); ModuleConfiguration.forModule(this).putString(configKey, String.valueOf(iters)); } for (int i = 0; i < iters; i++) { try { Thread.sleep(ModuleConfiguration.forModule(this).getInt("Delay between charges (ms)", 10)); } catch (InterruptedException ignored) { } Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(false)); } Minecraft.getMinecraft().getNetHandler().addToSendQueue( new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, new BlockPos(0, 0, 0), EnumFacing.DOWN)); Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem() .onPlayerStoppedUsing(Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem(), Minecraft.getMinecraft().theWorld, Minecraft.getMinecraft().thePlayer, 10); }).start(); } }
@Override public void onUpdate() { en = EntityUtils.getClosestEntity(true, 360, false); double xDist = Math.abs(mc.thePlayer.posX - entity.posX); double yDist = Math.abs(mc.thePlayer.posY - entity.posY); double zDist = Math.abs(mc.thePlayer.posZ - entity.posZ); if(Math.sqrt((Math.pow(xDist, 2) + Math.pow(zDist, 2))) < 1D && zDist < 2D) for (int i = 0; i < 30000; i++) { Minecraft.getMinecraft().getNetHandler() .addToSendQueue(new C03PacketPlayer(Minecraft.getMinecraft().thePlayer.onGround)); } }
public static void faceBlockPacket(BlockPos blockPos) { double diffX = blockPos.getX() + 0.5 - Minecraft.getMinecraft().thePlayer.posX; double diffY = blockPos.getY() + 0.5 - (Minecraft.getMinecraft().thePlayer.posY + Minecraft.getMinecraft().thePlayer.getEyeHeight()); double diffZ = blockPos.getZ() + 0.5 - Minecraft.getMinecraft().thePlayer.posZ; double dist = MathHelper.sqrt_double(diffX * diffX + diffZ * diffZ); float yaw = (float) (Math.atan2(diffZ, diffX) * 180.0D / Math.PI) - 90.0F; float pitch = (float) -(Math.atan2(diffY, dist) * 180.0D / Math.PI); Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook( Minecraft.getMinecraft().thePlayer.rotationYaw + MathHelper.wrapAngleTo180_float(yaw - Minecraft.getMinecraft().thePlayer.rotationYaw), Minecraft.getMinecraft().thePlayer.rotationPitch + MathHelper.wrapAngleTo180_float(pitch - Minecraft.getMinecraft().thePlayer.rotationPitch), Minecraft.getMinecraft().thePlayer.onGround)); }
@Override public void onUpdate() { if (!Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode && Minecraft.getMinecraft().thePlayer.onGround && Minecraft.getMinecraft().thePlayer.isBurning()) { for (int i = 0; i < 100; i++) { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer()); } } }
@Override public void onUpdate() { if (Minecraft.getMinecraft().thePlayer.getHealth() > 0 && Minecraft.getMinecraft().thePlayer.onGround && Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem() != null && Minecraft.getMinecraft().thePlayer.inventory.getCurrentItem().getItem() instanceof ItemFood && Minecraft.getMinecraft().thePlayer.getFoodStats().needFood() && Minecraft.getMinecraft().gameSettings.keyBindUseItem.pressed) { for (int i = 0; i < 100; i++) { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(false)); } } }
@Override public void onUpdate() { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue( new C03PacketPlayer.C05PacketPlayerLook(Minecraft.getMinecraft().thePlayer.rotationYaw, (float) Math.sin(Minecraft.getMinecraft().thePlayer.ticksExisted % 20 / 10d * Math.PI) * 90, Minecraft.getMinecraft().thePlayer.onGround)); }
@Override public void onUpdate() { EntityLivingBase en = EntityUtils.getClosestEntity(true); if (Minecraft.getMinecraft().thePlayer.onGround && en != null && en.getDistanceToEntity(Minecraft.getMinecraft().thePlayer) < 1) { for (int i = 0; i < 1000; i++) { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer(true)); } } }
@Override public void onUpdate() { float yaw = Minecraft.getMinecraft().thePlayer.rotationYaw + (float) (Math.random() * 360 - 180); float pitch = (float) (Math.random() * 180 - 90); Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue( new C03PacketPlayer.C05PacketPlayerLook(yaw, pitch, Minecraft.getMinecraft().thePlayer.onGround)); }
@Override public void onUpdate() { EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; if (!player.capabilities.isCreativeMode && player.onGround && !player.getActivePotionEffects().isEmpty()) { if (player.isPotionActive(Potion.hunger) || player.isPotionActive(Potion.moveSlowdown) || player.isPotionActive(Potion.digSlowdown) || player.isPotionActive(Potion.harm) || player.isPotionActive(Potion.confusion) || player.isPotionActive(Potion.blindness) || player.isPotionActive(Potion.weakness) || player.isPotionActive(Potion.wither) || player.isPotionActive(Potion.poison)) { for (int i = 0; i < 1000; i++) { player.sendQueue.addToSendQueue(new C03PacketPlayer()); } } } }
@Override public void onUpdate() { if (!Minecraft.getMinecraft().thePlayer.capabilities.isCreativeMode && Minecraft.getMinecraft().thePlayer.getFoodStats().getFoodLevel() > 17 && Minecraft.getMinecraft().thePlayer.getHealth() < 20 && Minecraft.getMinecraft().thePlayer.getHealth() != 0 && Minecraft.getMinecraft().thePlayer.onGround) { for (int i = 0; i < 1000; i++) { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer()); } } }
@Override public void onUpdate() { Minecraft.getMinecraft().thePlayer.sendQueue.addToSendQueue( new C03PacketPlayer.C05PacketPlayerLook(Minecraft.getMinecraft().thePlayer.rotationYaw, Minecraft.getMinecraft().thePlayer.ticksExisted % 100, Minecraft.getMinecraft().thePlayer.onGround)); }
@Override public void onUpdate(EventOnUpdate event){ if(invoker.getFoodLevel()>17 && !invoker.isInCreativeMode() && invoker.getHealth() < 19 && invoker.isOnGround() && shouldHeal){ shouldHeal = false; new Thread(){ public void run(){ for(short s=0; s<Resilience.getInstance().getValues().regenSpeed.getValue(); s++){ invoker.sendPacket(new C03PacketPlayer()); } shouldHeal = true; } }.start(); } }
@Override public void onOutwardPacket(EventOnOutwardPacket event){ Packet packet = event.getPacket(); if(packet instanceof C03PacketPlayer){ savedPackets.add(packet); event.setCancelled(true); } }
private boolean func_183006_b(C03PacketPlayer p_183006_1_) { return !Doubles.isFinite(p_183006_1_.getPositionX()) || !Doubles.isFinite(p_183006_1_.getPositionY()) || !Doubles.isFinite(p_183006_1_.getPositionZ()) || !Floats.isFinite(p_183006_1_.getPitch()) || !Floats.isFinite(p_183006_1_.getYaw()); }