mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 11:44:19 +01:00
9da047989c
By: md_5 <git@md-5.net>
42 lines
1.8 KiB
Diff
42 lines
1.8 KiB
Diff
--- a/net/minecraft/world/inventory/Containers.java
|
|
+++ b/net/minecraft/world/inventory/Containers.java
|
|
@@ -2,6 +2,10 @@
|
|
|
|
import net.minecraft.core.IRegistry;
|
|
|
|
+// CraftBukkit start
|
|
+import net.minecraft.world.entity.player.PlayerInventory;
|
|
+// CraftBukkit end
|
|
+
|
|
public class Containers<T extends Container> {
|
|
|
|
public static final Containers<ContainerChest> GENERIC_9X1 = a("generic_9x1", ContainerChest::a);
|
|
@@ -21,7 +25,7 @@
|
|
public static final Containers<ContainerGrindstone> GRINDSTONE = a("grindstone", ContainerGrindstone::new);
|
|
public static final Containers<ContainerHopper> HOPPER = a("hopper", ContainerHopper::new);
|
|
public static final Containers<ContainerLectern> LECTERN = a("lectern", (i, playerinventory) -> {
|
|
- return new ContainerLectern(i);
|
|
+ return new ContainerLectern(i, playerinventory); // CraftBukkit
|
|
});
|
|
public static final Containers<ContainerLoom> LOOM = a("loom", ContainerLoom::new);
|
|
public static final Containers<ContainerMerchant> MERCHANT = a("merchant", ContainerMerchant::new);
|
|
@@ -33,12 +37,17 @@
|
|
private final Containers.Supplier<T> y;
|
|
|
|
private static <T extends Container> Containers<T> a(String s, Containers.Supplier<T> containers_supplier) {
|
|
- return (Containers) IRegistry.a(IRegistry.MENU, s, (Object) (new Containers<>(containers_supplier)));
|
|
+ return (Containers) IRegistry.a(IRegistry.MENU, s, (new Containers<>(containers_supplier))); // CraftBukkit - decompile error
|
|
}
|
|
|
|
private Containers(Containers.Supplier<T> containers_supplier) {
|
|
this.y = containers_supplier;
|
|
}
|
|
|
|
- interface Supplier<T extends Container> {}
|
|
+ // CraftBukkit start
|
|
+ interface Supplier<T extends Container> {
|
|
+
|
|
+ T supply(int id, PlayerInventory playerinventory);
|
|
+ }
|
|
+ // CraftBukkit end
|
|
}
|