Figura

Figura

509k Downloads

Incorrect error thrown from WorldAPI.newBlock

joey-drake opened this issue ยท 1 comments

commented

Issue

When passing an invalid parameter to WorldAPI.newBlock, the function throws an inaccurate error.

Cause

When parseVec3 fails and throws an error it gets eaten by the try catch in newBlock

public static BlockStateAPI newBlock(@LuaNotNil String string, Object x, Double y, Double z) {
try {
BlockState block = BlockStateArgument.block(new CommandBuildContext(RegistryAccess.BUILTIN.get())).parse(new StringReader(string)).getState();
return new BlockStateAPI(block, LuaUtils.parseVec3("newBlock", x, y, z).asBlockPos());
} catch (Exception e) {
throw new LuaError("Could not parse block state from string: " + string);
}
}

image

commented

fixed at 1cfe97c