SPIGOT-2272: Add API for virtual Merchants

By: Lukas Hennig <lukas@wirsindwir.de>
This commit is contained in:
CraftBukkit/Spigot
2016-11-21 15:29:36 +11:00
parent 8d52a891a4
commit f6dd4eff69
7 changed files with 207 additions and 37 deletions

View File

@@ -43,12 +43,12 @@
+ }
+
+ public org.bukkit.inventory.InventoryHolder getOwner() {
+ return (CraftVillager) ((EntityVillager) this.merchant).getBukkitEntity();
+ return (merchant instanceof EntityVillager) ? (CraftVillager) ((EntityVillager) this.merchant).getBukkitEntity() : null;
+ }
+
+ @Override
+ public Location getLocation() {
+ return ((EntityVillager) this.merchant).getBukkitEntity().getLocation();
+ return (merchant instanceof EntityVillager) ? ((EntityVillager) this.merchant).getBukkitEntity().getLocation() : null;
+ }
+ // CraftBukkit end
+