aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-vineflower/net/minecraft/world/inventory/ContainerLevelAccess.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-vineflower/net/minecraft/world/inventory/ContainerLevelAccess.java.patch')
-rw-r--r--patch-remap/mache-vineflower/net/minecraft/world/inventory/ContainerLevelAccess.java.patch55
1 files changed, 55 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower/net/minecraft/world/inventory/ContainerLevelAccess.java.patch b/patch-remap/mache-vineflower/net/minecraft/world/inventory/ContainerLevelAccess.java.patch
new file mode 100644
index 0000000000..231e885087
--- /dev/null
+++ b/patch-remap/mache-vineflower/net/minecraft/world/inventory/ContainerLevelAccess.java.patch
@@ -0,0 +1,55 @@
+--- a/net/minecraft/world/inventory/ContainerLevelAccess.java
++++ b/net/minecraft/world/inventory/ContainerLevelAccess.java
+@@ -7,6 +7,21 @@
+ import net.minecraft.world.level.Level;
+
+ public interface ContainerLevelAccess {
++
++ // CraftBukkit start
++ default Level getWorld() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ default BlockPos getPosition() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ default org.bukkit.Location getLocation() {
++ return new org.bukkit.Location(getWorld().getWorld(), getPosition().getX(), getPosition().getY(), getPosition().getZ());
++ }
++ // CraftBukkit end
++
+ ContainerLevelAccess NULL = new ContainerLevelAccess() {
+ @Override
+ public <T> Optional<T> evaluate(BiFunction<Level, BlockPos, T> levelPosConsumer) {
+@@ -16,7 +31,19 @@
+
+ static ContainerLevelAccess create(final Level level, final BlockPos pos) {
+ return new ContainerLevelAccess() {
++ // CraftBukkit start
+ @Override
++ public Level getWorld() {
++ return level;
++ }
++
++ @Override
++ public BlockPos getPosition() {
++ return pos;
++ }
++ // CraftBukkit end
++
++ @Override
+ public <T> Optional<T> evaluate(BiFunction<Level, BlockPos, T> levelPosConsumer) {
+ return Optional.of(levelPosConsumer.apply(level, pos));
+ }
+@@ -30,8 +57,8 @@
+ }
+
+ default void execute(BiConsumer<Level, BlockPos> levelPosConsumer) {
+- this.evaluate((level, pos) -> {
+- levelPosConsumer.accept(level, pos);
++ this.evaluate((world, blockposition) -> {
++ levelPosConsumer.accept(world, blockposition);
+ return Optional.empty();
+ });
+ }