summaryrefslogtreecommitdiffstats
path: root/nms-patches
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches')
-rw-r--r--nms-patches/PlayerConnection.patch47
1 files changed, 30 insertions, 17 deletions
diff --git a/nms-patches/PlayerConnection.patch b/nms-patches/PlayerConnection.patch
index 1fb25841..6914c9c8 100644
--- a/nms-patches/PlayerConnection.patch
+++ b/nms-patches/PlayerConnection.patch
@@ -1159,7 +1159,7 @@
+
+ InventoryView inventory = this.player.activeContainer.getBukkitView();
+ SlotType type = CraftInventoryView.getSlotType(inventory, packetplayinwindowclick.b());
-+
+
+ InventoryClickEvent event;
+ ClickType click = ClickType.UNKNOWN;
+ InventoryAction action = InventoryAction.UNKNOWN;
@@ -1412,7 +1412,7 @@
+ }
+ return;
+ }
-
++
+ if (event instanceof CraftItemEvent) {
+ // Need to update the inventory on crafting to
+ // correctly support custom recipes
@@ -1423,7 +1423,20 @@
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
this.player.f = true;
-@@ -958,6 +1974,7 @@
+@@ -886,6 +1902,12 @@
+ public void a(PacketPlayInAutoRecipe packetplayinautorecipe) {
+ PlayerConnectionUtils.ensureMainThread(packetplayinautorecipe, this, this.player.x());
+ this.player.resetIdleTimer();
++ // CraftBukkit start
++ if (!player.getBukkitEntity().hasPermission("minecraft.autocraft")) {
++ player.getBukkitEntity().updateInventory();
++ return;
++ }
++ // CraftBukkit end
+ if (this.player.activeContainer.windowId == packetplayinautorecipe.a() && this.player.activeContainer.c(this.player)) {
+ this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinautorecipe.a(), packetplayinautorecipe.b(), true));
+ Iterator iterator;
+@@ -958,6 +1980,7 @@
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
@@ -1431,7 +1444,7 @@
this.player.resetIdleTimer();
if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
this.player.activeContainer.a(this.player, packetplayinenchantitem.b());
-@@ -991,7 +2008,45 @@
+@@ -991,7 +2014,45 @@
}
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
@@ -1478,7 +1491,7 @@
if (flag1 && flag2) {
if (itemstack.isEmpty()) {
-@@ -1015,6 +2070,7 @@
+@@ -1015,6 +2076,7 @@
public void a(PacketPlayInTransaction packetplayintransaction) {
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
@@ -1486,7 +1499,7 @@
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
-@@ -1025,6 +2081,7 @@
+@@ -1025,6 +2087,7 @@
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
@@ -1494,7 +1507,7 @@
this.player.resetIdleTimer();
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
BlockPosition blockposition = packetplayinupdatesign.a();
-@@ -1041,14 +2098,30 @@
+@@ -1041,14 +2104,30 @@
if (!tileentitysign.a() || tileentitysign.e() != this.player) {
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
@@ -1526,7 +1539,7 @@
tileentitysign.update();
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
-@@ -1071,11 +2144,27 @@
+@@ -1071,11 +2150,27 @@
public void a(PacketPlayInAbilities packetplayinabilities) {
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
@@ -1555,7 +1568,7 @@
ArrayList arraylist = Lists.newArrayList();
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
-@@ -1101,6 +2190,13 @@
+@@ -1101,6 +2196,13 @@
ItemStack itemstack1;
if ("MC|BEdit".equals(s)) {
@@ -1569,7 +1582,7 @@
packetdataserializer = packetplayincustompayload.b();
try {
-@@ -1119,15 +2215,25 @@
+@@ -1119,15 +2221,25 @@
}
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
@@ -1595,7 +1608,7 @@
packetdataserializer = packetplayincustompayload.b();
try {
-@@ -1161,10 +2267,11 @@
+@@ -1161,10 +2273,11 @@
}
itemstack2.a("pages", (NBTBase) nbttaglist);
@@ -1608,7 +1621,7 @@
}
} else if ("MC|TrSel".equals(s)) {
try {
-@@ -1176,6 +2283,7 @@
+@@ -1176,6 +2289,7 @@
}
} catch (Exception exception2) {
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
@@ -1616,7 +1629,7 @@
}
} else {
TileEntity tileentity;
-@@ -1225,6 +2333,7 @@
+@@ -1225,6 +2339,7 @@
}
} catch (Exception exception3) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
@@ -1624,7 +1637,7 @@
}
} else if ("MC|AutoCmd".equals(s)) {
if (!this.minecraftServer.getEnableCommandBlock()) {
-@@ -1292,6 +2401,7 @@
+@@ -1292,6 +2407,7 @@
}
} catch (Exception exception4) {
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
@@ -1632,7 +1645,7 @@
}
} else {
int k;
-@@ -1315,6 +2425,7 @@
+@@ -1315,6 +2431,7 @@
}
} catch (Exception exception5) {
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
@@ -1640,7 +1653,7 @@
}
}
} else if ("MC|ItemName".equals(s)) {
-@@ -1401,6 +2512,7 @@
+@@ -1401,6 +2518,7 @@
}
} catch (Exception exception6) {
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
@@ -1648,7 +1661,7 @@
}
} else if ("MC|PickItem".equals(s)) {
packetdataserializer = packetplayincustompayload.b();
-@@ -1413,11 +2525,49 @@
+@@ -1413,11 +2531,49 @@
this.player.playerConnection.sendPacket(new PacketPlayOutHeldItemSlot(this.player.inventory.itemInHandIndex));
} catch (Exception exception7) {
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);