Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 04:20:08 +01:00
SPIGOT-2960: Fire HOTBAR_MOVE_AND_READD in more cases
Dieser Commit ist enthalten in:
Ursprung
056af8b9c2
Commit
f9e044059f
@ -1136,7 +1136,7 @@
|
|||||||
NonNullList nonnulllist = NonNullList.a();
|
NonNullList nonnulllist = NonNullList.a();
|
||||||
|
|
||||||
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
|
for (int i = 0; i < this.player.activeContainer.c.size(); ++i) {
|
||||||
@@ -836,8 +1567,279 @@
|
@@ -836,8 +1567,274 @@
|
||||||
|
|
||||||
this.player.a(this.player.activeContainer, nonnulllist);
|
this.player.a(this.player.activeContainer, nonnulllist);
|
||||||
} else {
|
} else {
|
||||||
@ -1243,12 +1243,7 @@
|
|||||||
+ if (canCleanSwap) {
|
+ if (canCleanSwap) {
|
||||||
+ action = InventoryAction.HOTBAR_SWAP;
|
+ action = InventoryAction.HOTBAR_SWAP;
|
||||||
+ } else {
|
+ } else {
|
||||||
+ int firstEmptySlot = player.inventory.getFirstEmptySlotIndex();
|
|
||||||
+ if (firstEmptySlot > -1) {
|
|
||||||
+ action = InventoryAction.HOTBAR_MOVE_AND_READD;
|
+ action = InventoryAction.HOTBAR_MOVE_AND_READD;
|
||||||
+ } else {
|
|
||||||
+ action = InventoryAction.NOTHING; // This is not sane! Mojang: You should test for other slots of same type
|
|
||||||
+ }
|
|
||||||
+ }
|
+ }
|
||||||
+ } else if (!clickedSlot.hasItem() && !hotbar.isEmpty() && clickedSlot.isAllowed(hotbar)) {
|
+ } else if (!clickedSlot.hasItem() && !hotbar.isEmpty() && clickedSlot.isAllowed(hotbar)) {
|
||||||
+ action = InventoryAction.HOTBAR_SWAP;
|
+ action = InventoryAction.HOTBAR_SWAP;
|
||||||
@ -1417,7 +1412,7 @@
|
|||||||
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
|
if (ItemStack.matches(packetplayinwindowclick.e(), itemstack)) {
|
||||||
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
|
this.player.playerConnection.sendPacket(new PacketPlayOutTransaction(packetplayinwindowclick.a(), packetplayinwindowclick.d(), true));
|
||||||
this.player.f = true;
|
this.player.f = true;
|
||||||
@@ -866,6 +1868,7 @@
|
@@ -866,6 +1863,7 @@
|
||||||
|
|
||||||
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
|
public void a(PacketPlayInEnchantItem packetplayinenchantitem) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
|
PlayerConnectionUtils.ensureMainThread(packetplayinenchantitem, this, this.player.x());
|
||||||
@ -1425,7 +1420,7 @@
|
|||||||
this.player.resetIdleTimer();
|
this.player.resetIdleTimer();
|
||||||
if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
if (this.player.activeContainer.windowId == packetplayinenchantitem.a() && this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
||||||
this.player.activeContainer.a(this.player, packetplayinenchantitem.b());
|
this.player.activeContainer.a(this.player, packetplayinenchantitem.b());
|
||||||
@@ -899,7 +1902,46 @@
|
@@ -899,7 +1897,46 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
|
boolean flag1 = packetplayinsetcreativeslot.a() >= 1 && packetplayinsetcreativeslot.a() <= 45;
|
||||||
@ -1473,7 +1468,7 @@
|
|||||||
|
|
||||||
if (flag1 && flag2) {
|
if (flag1 && flag2) {
|
||||||
if (itemstack.isEmpty()) {
|
if (itemstack.isEmpty()) {
|
||||||
@@ -923,6 +1965,7 @@
|
@@ -923,6 +1960,7 @@
|
||||||
|
|
||||||
public void a(PacketPlayInTransaction packetplayintransaction) {
|
public void a(PacketPlayInTransaction packetplayintransaction) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
|
PlayerConnectionUtils.ensureMainThread(packetplayintransaction, this, this.player.x());
|
||||||
@ -1481,7 +1476,7 @@
|
|||||||
Short oshort = (Short) this.k.get(this.player.activeContainer.windowId);
|
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()) {
|
if (oshort != null && packetplayintransaction.b() == oshort.shortValue() && this.player.activeContainer.windowId == packetplayintransaction.a() && !this.player.activeContainer.c(this.player) && !this.player.isSpectator()) {
|
||||||
@@ -933,6 +1976,7 @@
|
@@ -933,6 +1971,7 @@
|
||||||
|
|
||||||
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
|
public void a(PacketPlayInUpdateSign packetplayinupdatesign) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
|
PlayerConnectionUtils.ensureMainThread(packetplayinupdatesign, this, this.player.x());
|
||||||
@ -1489,7 +1484,7 @@
|
|||||||
this.player.resetIdleTimer();
|
this.player.resetIdleTimer();
|
||||||
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
WorldServer worldserver = this.minecraftServer.getWorldServer(this.player.dimension);
|
||||||
BlockPosition blockposition = packetplayinupdatesign.a();
|
BlockPosition blockposition = packetplayinupdatesign.a();
|
||||||
@@ -949,14 +1993,30 @@
|
@@ -949,14 +1988,30 @@
|
||||||
|
|
||||||
if (!tileentitysign.a() || tileentitysign.e() != this.player) {
|
if (!tileentitysign.a() || tileentitysign.e() != this.player) {
|
||||||
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
|
this.minecraftServer.warning("Player " + this.player.getName() + " just tried to change non-editable sign");
|
||||||
@ -1521,7 +1516,7 @@
|
|||||||
|
|
||||||
tileentitysign.update();
|
tileentitysign.update();
|
||||||
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
|
worldserver.notify(blockposition, iblockdata, iblockdata, 3);
|
||||||
@@ -979,11 +2039,27 @@
|
@@ -979,11 +2034,27 @@
|
||||||
|
|
||||||
public void a(PacketPlayInAbilities packetplayinabilities) {
|
public void a(PacketPlayInAbilities packetplayinabilities) {
|
||||||
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
|
PlayerConnectionUtils.ensureMainThread(packetplayinabilities, this, this.player.x());
|
||||||
@ -1550,7 +1545,7 @@
|
|||||||
ArrayList arraylist = Lists.newArrayList();
|
ArrayList arraylist = Lists.newArrayList();
|
||||||
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
|
Iterator iterator = this.minecraftServer.tabCompleteCommand(this.player, packetplayintabcomplete.a(), packetplayintabcomplete.b(), packetplayintabcomplete.c()).iterator();
|
||||||
|
|
||||||
@@ -1027,10 +2103,13 @@
|
@@ -1027,10 +2098,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
|
if (itemstack.getItem() == Items.WRITABLE_BOOK && itemstack.getItem() == itemstack1.getItem()) {
|
||||||
@ -1564,7 +1559,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
String s1;
|
String s1;
|
||||||
@@ -1069,10 +2148,11 @@
|
@@ -1069,10 +2143,11 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
itemstack2.a("pages", (NBTBase) nbttaglist);
|
itemstack2.a("pages", (NBTBase) nbttaglist);
|
||||||
@ -1577,7 +1572,7 @@
|
|||||||
}
|
}
|
||||||
} else if ("MC|TrSel".equals(s)) {
|
} else if ("MC|TrSel".equals(s)) {
|
||||||
try {
|
try {
|
||||||
@@ -1084,6 +2164,7 @@
|
@@ -1084,6 +2159,7 @@
|
||||||
}
|
}
|
||||||
} catch (Exception exception2) {
|
} catch (Exception exception2) {
|
||||||
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
|
PlayerConnection.LOGGER.error("Couldn\'t select trade", exception2);
|
||||||
@ -1585,7 +1580,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
TileEntity tileentity;
|
TileEntity tileentity;
|
||||||
@@ -1133,6 +2214,7 @@
|
@@ -1133,6 +2209,7 @@
|
||||||
}
|
}
|
||||||
} catch (Exception exception3) {
|
} catch (Exception exception3) {
|
||||||
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
|
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception3);
|
||||||
@ -1593,7 +1588,7 @@
|
|||||||
}
|
}
|
||||||
} else if ("MC|AutoCmd".equals(s)) {
|
} else if ("MC|AutoCmd".equals(s)) {
|
||||||
if (!this.minecraftServer.getEnableCommandBlock()) {
|
if (!this.minecraftServer.getEnableCommandBlock()) {
|
||||||
@@ -1200,6 +2282,7 @@
|
@@ -1200,6 +2277,7 @@
|
||||||
}
|
}
|
||||||
} catch (Exception exception4) {
|
} catch (Exception exception4) {
|
||||||
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
|
PlayerConnection.LOGGER.error("Couldn\'t set command block", exception4);
|
||||||
@ -1601,7 +1596,7 @@
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int k;
|
int k;
|
||||||
@@ -1223,6 +2306,7 @@
|
@@ -1223,6 +2301,7 @@
|
||||||
}
|
}
|
||||||
} catch (Exception exception5) {
|
} catch (Exception exception5) {
|
||||||
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
|
PlayerConnection.LOGGER.error("Couldn\'t set beacon", exception5);
|
||||||
@ -1609,7 +1604,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if ("MC|ItemName".equals(s)) {
|
} else if ("MC|ItemName".equals(s)) {
|
||||||
@@ -1309,6 +2393,7 @@
|
@@ -1309,6 +2388,7 @@
|
||||||
}
|
}
|
||||||
} catch (Exception exception6) {
|
} catch (Exception exception6) {
|
||||||
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
|
PlayerConnection.LOGGER.error("Couldn\'t set structure block", exception6);
|
||||||
@ -1617,7 +1612,7 @@
|
|||||||
}
|
}
|
||||||
} else if ("MC|PickItem".equals(s)) {
|
} else if ("MC|PickItem".equals(s)) {
|
||||||
packetdataserializer = packetplayincustompayload.b();
|
packetdataserializer = packetplayincustompayload.b();
|
||||||
@@ -1323,9 +2408,31 @@
|
@@ -1323,9 +2403,31 @@
|
||||||
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);
|
PlayerConnection.LOGGER.error("Couldn\'t pick item", exception7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren