Skip to content

Commit

Permalink
Potential fix for #1533
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Feb 1, 2017
1 parent 3eb39a7 commit b17f8a7
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,24 +108,30 @@ else if (arg.startsWith("iconcrack_")) {
}
else if (arg.startsWith("blockcrack_")) {
String shrunk = arg.getValue().substring("blockcrack_".length());
Element typeId = new Element(shrunk);
String[] split = shrunk.split(",");
Element typeId = new Element(split[0]);
if (typeId.isInt() && typeId.asInt() > 0 && Material.getMaterial(typeId.asInt()) != null) {
scriptEntry.addObject("iconcrack", typeId);
}
else {
dB.echoError("Invalid blockcrack_[id]. Must be a valid Material ID, besides 0.");
}
Element dataId = new Element(split.length <= 1 ? "0" : split[1]);
scriptEntry.addObject("iconcrack_data", dataId);
scriptEntry.addObject("iconcrack_type", new Element("blockcrack"));
}
else if (arg.startsWith("blockdust_")) {
String shrunk = arg.getValue().substring("blockdust_".length());
Element typeId = new Element(shrunk);
String[] split = shrunk.split(",");
Element typeId = new Element(split[0]);
if (typeId.isInt() && typeId.asInt() > 0 && Material.getMaterial(typeId.asInt()) != null) {
scriptEntry.addObject("iconcrack", typeId);
}
else {
dB.echoError("Invalid blockdust_[id]. Must be a valid Material ID, besides 0.");
}
Element dataId = new Element(split.length <= 1 ? "0" : split[1]);
scriptEntry.addObject("iconcrack_data", dataId);
scriptEntry.addObject("iconcrack_type", new Element("blockdust"));
}
else if (particleHelper.hasEffect(arg.getValue())) {
Expand Down Expand Up @@ -278,9 +284,6 @@ else if (particleEffect != null) {

// Play an iconcrack (item break) effect
else {
float osX = (float) offset.getX();
float osY = (float) offset.getY();
float osZ = (float) offset.getZ();
List<Player> players = new ArrayList<Player>();
if (targets == null) {
float rad = radius.asFloat();
Expand Down

0 comments on commit b17f8a7

Please sign in to comment.