Update to Minecraft 1.20

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2023-06-08 01:30:00 +10:00
parent bac55e67d6
commit 9d740b84b0
269 changed files with 2605 additions and 2568 deletions

View File

@@ -74,7 +74,7 @@
k = ((Slot) this.quickcraftSlots.iterator().next()).index;
this.resetQuickCraft();
this.doClick(k, this.quickcraftType, InventoryClickType.PICKUP, entityhuman);
@@ -391,6 +435,7 @@
@@ -396,6 +440,7 @@
l = this.getCarried().getCount();
Iterator iterator = this.quickcraftSlots.iterator();
@@ -82,13 +82,13 @@
while (iterator.hasNext()) {
Slot slot1 = (Slot) iterator.next();
ItemStack itemstack2 = this.getCarried();
@@ -407,12 +452,48 @@
}
@@ -406,12 +451,48 @@
int l1 = Math.min(getQuickCraftPlaceCount(this.quickcraftSlots, this.quickcraftType, itemstack1) + j1, k1);
l -= itemstack3.getCount() - j1;
- slot1.setByPlayer(itemstack3);
+ // slot1.setByPlayer(itemstack3);
+ draggedSlots.put(slot1.index, itemstack3); // CraftBukkit - Put in map instead of setting
l -= l1 - j1;
- slot1.setByPlayer(itemstack1.copyWithCount(l1));
+ // slot1.setByPlayer(itemstack1.copyWithCount(l1));
+ draggedSlots.put(slot1.index, itemstack1.copyWithCount(l1)); // CraftBukkit - Put in map instead of setting
}
}
@@ -108,7 +108,7 @@
+ this.setCarried(CraftItemStack.asNMSCopy(newcursor));
+
+ InventoryDragEvent event = new InventoryDragEvent(view, (newcursor.getType() != org.bukkit.Material.AIR ? newcursor : null), CraftItemStack.asBukkitCopy(oldCursor), this.quickcraftType == 1, eventmap);
+ entityhuman.level.getCraftServer().getPluginManager().callEvent(event);
+ entityhuman.level().getCraftServer().getPluginManager().callEvent(event);
+
+ // Whether or not a change was made to the inventory that requires an update.
+ boolean needsUpdate = event.getResult() != Result.DEFAULT;
@@ -134,7 +134,7 @@
}
this.resetQuickCraft();
@@ -430,8 +511,11 @@
@@ -429,8 +510,11 @@
if (i == -999) {
if (!this.getCarried().isEmpty()) {
if (clickaction == ClickAction.PRIMARY) {
@@ -147,7 +147,7 @@
} else {
entityhuman.drop(this.getCarried().split(1), true);
}
@@ -494,6 +578,15 @@
@@ -493,6 +577,15 @@
}
slot.setChanged();
@@ -163,7 +163,7 @@
}
} else {
Slot slot2;
@@ -607,13 +700,14 @@
@@ -605,13 +698,14 @@
ItemStack itemstack = this.getCarried();
if (!itemstack.isEmpty()) {
@@ -179,7 +179,7 @@
}
}
@@ -827,6 +921,11 @@
@@ -830,6 +924,11 @@
}
public ItemStack getCarried() {