Fix inventories returning null Locations
Wandering Trader, AbstractHorse, Beacon and Composter inventories returned null locations when a block or entity location is readily available Co-authored-by: Lukas Planz <lukas.planz@web.de>
This commit is contained in:
@@ -35,7 +35,20 @@
|
||||
@Override
|
||||
public boolean canPlaceItem(int slot, ItemStack stack) {
|
||||
return stack.is(ItemTags.BEACON_PAYMENT_ITEMS);
|
||||
@@ -69,6 +77,7 @@
|
||||
@@ -44,6 +52,12 @@
|
||||
public int getMaxStackSize() {
|
||||
return 1;
|
||||
}
|
||||
+ // Paper start - Fix inventories returning null Locations
|
||||
+ @Override
|
||||
+ public org.bukkit.Location getLocation() {
|
||||
+ return context.getLocation();
|
||||
+ }
|
||||
+ // Paper end - Fix inventories returning null Locations
|
||||
};
|
||||
checkContainerDataCount(propertyDelegate, 3);
|
||||
this.beaconData = propertyDelegate;
|
||||
@@ -69,6 +83,7 @@
|
||||
|
||||
@Override
|
||||
public boolean stillValid(Player player) {
|
||||
@@ -43,7 +56,7 @@
|
||||
return stillValid(this.access, player, Blocks.BEACON);
|
||||
}
|
||||
|
||||
@@ -148,12 +157,30 @@
|
||||
@@ -148,12 +163,30 @@
|
||||
return BeaconMenu.decodeEffect(this.beaconData.get(2));
|
||||
}
|
||||
|
||||
@@ -76,7 +89,7 @@
|
||||
}
|
||||
|
||||
}
|
||||
@@ -178,4 +205,17 @@
|
||||
@@ -178,4 +211,17 @@
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
+
|
||||
+ @Override
|
||||
+ public Location getLocation() {
|
||||
+ return (this.merchant instanceof Villager) ? ((Villager) this.merchant).getBukkitEntity().getLocation() : null;
|
||||
+ return (this.merchant instanceof AbstractVillager) ? ((AbstractVillager) this.merchant).getBukkitEntity().getLocation() : null; // Paper - Fix inventories returning null Locations
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
|
||||
Reference in New Issue
Block a user