#1181: Consolidate Location conversion code

By: Doc <nachito94@msn.com>
This commit is contained in:
CraftBukkit/Spigot
2023-04-19 19:59:19 +10:00
parent 2ffb1d2479
commit b99d3df2d8
43 changed files with 424 additions and 316 deletions

View File

@@ -1,11 +1,12 @@
--- a/net/minecraft/world/inventory/InventoryEnderChest.java
+++ b/net/minecraft/world/inventory/InventoryEnderChest.java
@@ -8,13 +8,31 @@
@@ -8,13 +8,32 @@
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.entity.TileEntityEnderChest;
+// CraftBukkit start
+import org.bukkit.Location;
+import org.bukkit.craftbukkit.util.CraftLocation;
+import org.bukkit.inventory.InventoryHolder;
+// CraftBukkit end
+
@@ -22,7 +23,7 @@
+
+ @Override
+ public Location getLocation() {
+ return this.activeChest != null ? new Location(this.activeChest.getLevel().getWorld(), this.activeChest.getBlockPos().getX(), this.activeChest.getBlockPos().getY(), this.activeChest.getBlockPos().getZ()) : null;
+ return this.activeChest != null ? CraftLocation.toBukkit(this.activeChest.getBlockPos(), this.activeChest.getLevel().getWorld()) : null;
+ }
- public InventoryEnderChest() {