Update CommandIrisStructureCreate.java

Fix even number entering
This commit is contained in:
BuildTools 2020-10-23 00:18:04 +02:00
parent 5241182520
commit d8cb9f2c03

View File

@ -69,6 +69,12 @@ public class CommandIrisStructureCreate extends MortarCommand
height = Integer.parseInt(args[3]); height = Integer.parseInt(args[3]);
} }
if (width % 2 == 0 || height % 2 == 0){
sender.sendMessage("Width and/or height is an even number. Adding one");
width += width % 2 == 0 ? 1 : 0;
height += height % 2 == 0 ? 1 : 0;
}
sender.sendMessage("Creating new Structure"); sender.sendMessage("Creating new Structure");
new StructureTemplate(args[0], args[1], p, p.getLocation(), 5, width, height, d3); new StructureTemplate(args[0], args[1], p, p.getLocation(), 5, width, height, d3);