1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-17 10:41:41 +01:00

fix various menus with empty level accesses

This commit is contained in:
Jake Potrebic 2021-07-11 12:52:56 -07:00
parent b2c22e9470
commit 37fa505050

View file

@ -1,6 +1,6 @@
--- a/net/minecraft/world/inventory/ContainerLevelAccess.java
+++ b/net/minecraft/world/inventory/ContainerLevelAccess.java
@@ -8,6 +8,20 @@
@@ -8,16 +8,48 @@
public interface ContainerLevelAccess {
@ -21,7 +21,15 @@
ContainerLevelAccess NULL = new ContainerLevelAccess() {
@Override
public <T> Optional<T> evaluate(BiFunction<Level, BlockPos, T> getter) {
@@ -17,7 +31,19 @@
return Optional.empty();
}
+ // Paper start - fix menus with empty level accesses
+ @Override
+ public org.bukkit.Location getLocation() {
+ return null;
+ }
+ // Paper end - fix menus with empty level accesses
};
static ContainerLevelAccess create(final Level world, final BlockPos pos) {
return new ContainerLevelAccess() {