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

@@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/ContainerLectern.java
+++ b/net/minecraft/world/inventory/ContainerLectern.java
@@ -5,16 +5,43 @@
@@ -5,8 +5,33 @@
import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.item.ItemStack;
@@ -26,13 +26,17 @@
+ return bukkitEntity;
+ }
+
+ CraftInventoryLectern inventory = new CraftInventoryLectern(this.inventory);
+ CraftInventoryLectern inventory = new CraftInventoryLectern(this.lectern);
+ bukkitEntity = new CraftInventoryView(this.player, inventory, this);
+ return bukkitEntity;
+ }
+ // CraftBukkit end
private final IInventory inventory;
private final IContainerProperties containerProperties;
private static final int DATA_COUNT = 1;
private static final int SLOT_COUNT = 1;
public static final int BUTTON_PREV_PAGE = 1;
@@ -16,11 +41,13 @@
private final IInventory lectern;
private final IContainerProperties lecternData;
- public ContainerLectern(int i) {
- this(i, new InventorySubcontainer(1), new ContainerProperties(1));
@@ -47,7 +51,7 @@
super(Containers.LECTERN, i);
a(iinventory, 1);
a(icontainerproperties, 1);
@@ -28,6 +55,7 @@
@@ -34,6 +61,7 @@
}
});
this.a(icontainerproperties);
@@ -55,7 +59,7 @@
}
@Override
@@ -53,6 +81,13 @@
@@ -59,6 +87,13 @@
return false;
}
@@ -66,15 +70,15 @@
+ return false;
+ }
+ // CraftBukkit end
ItemStack itemstack = this.inventory.splitWithoutUpdate(0);
ItemStack itemstack = this.lectern.splitWithoutUpdate(0);
this.inventory.update();
@@ -75,6 +110,8 @@
this.lectern.update();
@@ -81,6 +116,8 @@
@Override
public boolean canUse(EntityHuman entityhuman) {
+ if (inventory instanceof LecternInventory && !((LecternInventory) inventory).getLectern().hasBook()) return false; // CraftBukkit
+ if (lectern instanceof LecternInventory && !((LecternInventory) lectern).getLectern().hasBook()) return false; // CraftBukkit
+ if (!this.checkReachable) return true; // CraftBukkit
return this.inventory.a(entityhuman);
return this.lectern.a(entityhuman);
}
}