lazy //deform AIOOB fix.

Fixes #495
This commit is contained in:
dordsor21 2020-07-03 16:45:28 +01:00
parent f7d375c76c
commit e2ab87cc07
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -2506,8 +2506,15 @@ public class EditSession extends PassthroughExtent implements AutoCloseable {
int yv = (int) (y.getValue() * unit.getY() + zero2.getY());
int zv = (int) (z.getValue() * unit.getZ() + zero2.getZ());
BlockState get;
if (yv >= 0 && yv < 265) {
get = getBlock(xv, yv, zv);
} else {
get = BlockTypes.AIR.getDefaultState();
}
// read block from world
return setBlock(position, getBlock(xv, yv, zv));
return setBlock(position, get);
} catch (EvaluationException e) {
throw new RuntimeException(e);
}