Fix y-level issues in structure spawn checking

This commit is contained in:
dfsek 2020-10-08 22:47:30 -07:00
parent 506e1e0e23
commit 9a54f364be

View File

@ -126,7 +126,7 @@ public class GaeaStructure implements Serializable {
public boolean checkSpawns(Location origin, Rotation r) { public boolean checkSpawns(Location origin, Rotation r) {
for(StructureContainedBlock b : spawns) { for(StructureContainedBlock b : spawns) {
Vector2 rot = getRotatedCoords(new Vector2(b.getX()-structureInfo.getCenterX(), b.getZ()-structureInfo.getCenterZ()), r); Vector2 rot = getRotatedCoords(new Vector2(b.getX()-structureInfo.getCenterX(), b.getZ()-structureInfo.getCenterZ()), r);
if(!b.getRequirement().matches(origin.getWorld(), (int) rot.getX()+origin.getBlockX(), origin.getBlockY(), (int) rot.getZ()+origin.getBlockZ())) return false; if(!b.getRequirement().matches(origin.getWorld(), (int) rot.getX()+origin.getBlockX(), origin.getBlockY()+b.getY(), (int) rot.getZ()+origin.getBlockZ())) return false;
} }
return true; return true;
} }