From 63421037ad778a26b19993abd57d30b315d33aba Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Thu, 23 Feb 2017 17:27:30 +0100 Subject: [PATCH] Add workaround to support CustomMobs; resolves #204 --- .../dre2n/dungeonsxl/mob/ExternalMobPlugin.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobPlugin.java b/core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobPlugin.java index 650caa09..84958fda 100644 --- a/core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobPlugin.java +++ b/core/src/main/java/io/github/dre2n/dungeonsxl/mob/ExternalMobPlugin.java @@ -50,7 +50,17 @@ public enum ExternalMobPlugin implements ExternalMobProvider { @Override public String getCommand(String mob, String world, double x, double y, double z) { - return command.replaceAll("%mob%", mob).replaceAll("%world%", world).replaceAll("%x%", String.valueOf(x)).replaceAll("%y%", String.valueOf(y)).replaceAll("%z%", String.valueOf(z)); + String xStr, yStr, zStr; + if (this == CUSTOM_MOBS) { + xStr = String.valueOf(Location.locToBlock(x)); + yStr = String.valueOf(Location.locToBlock(y)); + zStr = String.valueOf(Location.locToBlock(z)); + } else { + xStr = String.valueOf(x); + yStr = String.valueOf(y); + zStr = String.valueOf(z); + } + return command.replaceAll("%mob%", mob).replaceAll("%world%", world).replaceAll("%x%", xStr).replaceAll("%y%", yStr).replaceAll("%z%", zStr); } @Override