From 7c0f352486567ca869c62ecd0ec62a2f36acc57b Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 30 Nov 2014 12:10:30 +0000 Subject: Fix LEFT_CLICK_AIR --- nms-patches/PlayerConnection.patch | 51 +++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 26 deletions(-) (limited to 'nms-patches/PlayerConnection.patch') diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch index 5048a87a..cf70c92a 100644 --- a/nms-patches/PlayerConnection.patch +++ b/nms-patches/PlayerConnection.patch @@ -1,5 +1,5 @@ ---- ../work/decompile-8eb82bde//net/minecraft/server/PlayerConnection.java 2014-11-28 23:05:41.713278672 +0000 -+++ src/main/java/net/minecraft/server/PlayerConnection.java 2014-11-28 22:57:27.221289000 +0000 +--- ../work/decompile-8eb82bde//net/minecraft/server/PlayerConnection.java 2014-11-30 12:10:17.417157726 +0000 ++++ src/main/java/net/minecraft/server/PlayerConnection.java 2014-11-30 12:10:10.193157886 +0000 @@ -16,6 +16,48 @@ import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -556,7 +556,7 @@ ChatMessage chatmessage = new ChatMessage("chat.cannotSend", new Object[0]); chatmessage.getChatModifier().setColor(EnumChatFormat.RED); -@@ -548,39 +852,248 @@ +@@ -548,39 +852,247 @@ for (int i = 0; i < s.length(); ++i) { if (!SharedConstants.isAllowedChatCharacter(s.charAt(i))) { @@ -755,12 +755,11 @@ PlayerConnectionUtils.ensureMainThread(packetplayinarmanimation, this, this.player.u()); this.player.z(); + // CraftBukkit start - Raytrace to look for 'rogue armswings' -+ float f = 1.0F; -+ float f1 = this.player.lastPitch + (this.player.pitch - this.player.lastPitch) * f; -+ float f2 = this.player.lastYaw + (this.player.yaw - this.player.lastYaw) * f; -+ double d0 = this.player.lastX + (this.player.locX - this.player.lastX) * (double) f; -+ double d1 = this.player.lastY + (this.player.locY - this.player.lastY) * (double) f + 1.62D - (double) this.player.getHeadHeight(); -+ double d2 = this.player.lastZ + (this.player.locZ - this.player.lastZ) * (double) f; ++ float f1 = this.player.pitch; ++ float f2 = this.player.yaw; ++ double d0 = this.player.locX; ++ double d1 = this.player.locY + (double) this.player.getHeadHeight(); ++ double d2 = this.player.locZ; + Vec3D vec3d = new Vec3D(d0, d1, d2); + + float f3 = MathHelper.cos(-f2 * 0.017453292F - 3.1415927F); @@ -813,7 +812,7 @@ this.player.z(); switch (SwitchHelperCommandActionType.b[packetplayinentityaction.b().ordinal()]) { case 1: -@@ -601,7 +1114,7 @@ +@@ -601,7 +1113,7 @@ case 5: this.player.a(false, true, true); @@ -822,7 +821,7 @@ break; case 6: -@@ -623,6 +1136,7 @@ +@@ -623,6 +1135,7 @@ } public void a(PacketPlayInUseEntity packetplayinuseentity) { @@ -830,7 +829,7 @@ PlayerConnectionUtils.ensureMainThread(packetplayinuseentity, this, this.player.u()); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); Entity entity = packetplayinuseentity.a((World) worldserver); -@@ -637,18 +1151,72 @@ +@@ -637,18 +1150,72 @@ } if (this.player.h(entity) < d0) { @@ -904,7 +903,7 @@ } } } -@@ -663,7 +1231,8 @@ +@@ -663,7 +1230,8 @@ switch (SwitchHelperCommandActionType.c[enumclientcommand.ordinal()]) { case 1: if (this.player.viewingCredits) { @@ -914,7 +913,7 @@ } else if (this.player.u().getWorldData().isHardcore()) { if (this.minecraftServer.S() && this.player.getName().equals(this.minecraftServer.R())) { this.player.playerConnection.disconnect("You have died. Game over, man, it\'s game over!"); -@@ -694,11 +1263,17 @@ +@@ -694,11 +1262,17 @@ } public void a(PacketPlayInCloseWindow packetplayinclosewindow) { @@ -932,7 +931,7 @@ PlayerConnectionUtils.ensureMainThread(packetplayinwindowclick, this, this.player.u()); this.player.z(); if (this.player.activeContainer.windowId == packetplayinwindowclick.a() && this.player.activeContainer.c(this.player)) { -@@ -711,7 +1286,263 @@ +@@ -711,7 +1285,263 @@ this.player.a(this.player.activeContainer, (List) arraylist); } else { @@ -1197,7 +1196,7 @@ if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) { this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true)); -@@ -772,8 +1603,50 @@ +@@ -772,8 +1602,50 @@ } boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() < 36 + PlayerInventory.getHotbarSize(); @@ -1249,7 +1248,7 @@ if (flag1 && flag2 && flag3) { if (itemstack == null) { -@@ -796,6 +1669,7 @@ +@@ -796,6 +1668,7 @@ } public void a(PacketPlayInTransaction packetplayintransaction) { @@ -1257,7 +1256,7 @@ PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.u()); Short oshort = (Short) this.n.get(this.player.activeContainer.windowId); -@@ -806,6 +1680,7 @@ +@@ -806,6 +1679,7 @@ } public void a(PacketPlayInUpdateSign packetplayinupdatesign) { @@ -1265,7 +1264,7 @@ PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.u()); this.player.z(); WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension); -@@ -822,10 +1697,24 @@ +@@ -822,10 +1696,24 @@ if (!tileentitysign.b() || tileentitysign.c() != this.player) { this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign"); @@ -1291,7 +1290,7 @@ tileentitysign.update(); worldserver.notify(blockposition); } -@@ -847,11 +1736,28 @@ +@@ -847,11 +1735,28 @@ public void a(PacketPlayInAbilities packetplayinabilities) { PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.u()); @@ -1321,7 +1320,7 @@ ArrayList arraylist = Lists.newArrayList(); Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b()).iterator(); -@@ -891,13 +1797,15 @@ +@@ -891,13 +1796,15 @@ itemstack1 = this.player.inventory.getItemInHand(); if (itemstack1 != null) { if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) { @@ -1338,7 +1337,7 @@ return; } finally { packetdataserializer.release(); -@@ -909,27 +1817,31 @@ +@@ -909,27 +1816,31 @@ try { itemstack = packetdataserializer.i(); @@ -1382,7 +1381,7 @@ return; } finally { packetdataserializer.release(); -@@ -946,6 +1858,7 @@ +@@ -946,6 +1857,7 @@ } } catch (Exception exception2) { PlayerConnection.c.error("Couldn\'t select trade", exception2); @@ -1390,7 +1389,7 @@ } } else if ("MC|AdvCdm".equals(packetplayincustompayload.a())) { if (!this.minecraftServer.getEnableCommandBlock()) { -@@ -986,6 +1899,7 @@ +@@ -986,6 +1898,7 @@ } } catch (Exception exception3) { PlayerConnection.c.error("Couldn\'t set command block", exception3); @@ -1398,7 +1397,7 @@ } finally { packetdataserializer.release(); } -@@ -1011,6 +1925,7 @@ +@@ -1011,6 +1924,7 @@ } } catch (Exception exception4) { PlayerConnection.c.error("Couldn\'t set beacon", exception4); @@ -1406,7 +1405,7 @@ } } } else if ("MC|ItemName".equals(packetplayincustompayload.a()) && this.player.activeContainer instanceof ContainerAnvil) { -@@ -1026,6 +1941,27 @@ +@@ -1026,6 +1940,27 @@ containeranvil.a(""); } } -- cgit v1.2.3