aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/og/net/minecraft/world/inventory/ContainerAccess.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/og/net/minecraft/world/inventory/ContainerAccess.patch')
-rw-r--r--patch-remap/og/net/minecraft/world/inventory/ContainerAccess.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patch-remap/og/net/minecraft/world/inventory/ContainerAccess.patch b/patch-remap/og/net/minecraft/world/inventory/ContainerAccess.patch
new file mode 100644
index 0000000000..72e419a336
--- /dev/null
+++ b/patch-remap/og/net/minecraft/world/inventory/ContainerAccess.patch
@@ -0,0 +1,42 @@
+--- a/net/minecraft/world/inventory/ContainerAccess.java
++++ b/net/minecraft/world/inventory/ContainerAccess.java
+@@ -8,6 +8,20 @@
+
+ public interface ContainerAccess {
+
++ // CraftBukkit start
++ default World getWorld() {
++ throw new UnsupportedOperationException("Not supported yet.");
++ }
++
++ default BlockPosition 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
++
+ ContainerAccess NULL = new ContainerAccess() {
+ @Override
+ public <T> Optional<T> evaluate(BiFunction<World, BlockPosition, T> bifunction) {
+@@ -17,6 +31,18 @@
+
+ static ContainerAccess create(final World world, final BlockPosition blockposition) {
+ return new ContainerAccess() {
++ // CraftBukkit start
++ @Override
++ public World getWorld() {
++ return world;
++ }
++
++ @Override
++ public BlockPosition getPosition() {
++ return blockposition;
++ }
++ // CraftBukkit end
++
+ @Override
+ public <T> Optional<T> evaluate(BiFunction<World, BlockPosition, T> bifunction) {
+ return Optional.of(bifunction.apply(world, blockposition));