Update to Minecraft 1.17

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2021-06-11 15:00:00 +10:00
parent 75faba7fde
commit b3a8254758
619 changed files with 10708 additions and 8451 deletions

View File

@@ -15,8 +15,8 @@
+
public class InventoryLargeChest implements IInventory {
public final IInventory left;
public final IInventory right;
public final IInventory container1;
public final IInventory container2;
+ // CraftBukkit start - add fields and methods
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
@@ -30,14 +30,14 @@
+ }
+
+ public void onOpen(CraftHumanEntity who) {
+ this.left.onOpen(who);
+ this.right.onOpen(who);
+ this.container1.onOpen(who);
+ this.container2.onOpen(who);
+ transaction.add(who);
+ }
+
+ public void onClose(CraftHumanEntity who) {
+ this.left.onClose(who);
+ this.right.onClose(who);
+ this.container1.onClose(who);
+ this.container2.onClose(who);
+ transaction.remove(who);
+ }
+
@@ -50,13 +50,13 @@
+ }
+
+ public void setMaxStackSize(int size) {
+ this.left.setMaxStackSize(size);
+ this.right.setMaxStackSize(size);
+ this.container1.setMaxStackSize(size);
+ this.container2.setMaxStackSize(size);
+ }
+
+ @Override
+ public Location getLocation() {
+ return left.getLocation(); // TODO: right?
+ return container1.getLocation(); // TODO: right?
+ }
+ // CraftBukkit end
+
@@ -67,8 +67,8 @@
@Override
public int getMaxStackSize() {
- return this.left.getMaxStackSize();
+ return Math.min(this.left.getMaxStackSize(), this.right.getMaxStackSize()); // CraftBukkit - check both sides
- return this.container1.getMaxStackSize();
+ return Math.min(this.container1.getMaxStackSize(), this.container2.getMaxStackSize()); // CraftBukkit - check both sides
}
@Override