Skip to content

Commit

Permalink
Add workaround to support CustomMobs; resolves #204
Browse files Browse the repository at this point in the history
  • Loading branch information
Sataniel98 committed Feb 23, 2017
1 parent 7d2d3ff commit 6342103
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ public String getRawCommand() {

@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
Expand Down

0 comments on commit 6342103

Please sign in to comment.