Fix height placement on structures

This commit is contained in:
cyberpwn 2021-08-22 03:55:39 -04:00
parent 858c5a27ad
commit 7933f5e357

View File

@ -114,9 +114,26 @@ public class PlannedStructure {
int xx = i.getPosition().getX() + sx; int xx = i.getPosition().getX() + sx;
int zz = i.getPosition().getZ() + sz; int zz = i.getPosition().getZ() + sz;
int offset = i.getPosition().getY() - startHeight; int offset = i.getPosition().getY() - startHeight;
int height = (i.getStructure().getStructure().getLockY() == -1 ? i.getStructure().getStructure().getOverrideYRange() != null int height = 0;
? (int)i.getStructure().getStructure().getOverrideYRange().get(rng, xx, zz, getData())
: i.getStructure().getStructure().getLockY() : placer.getHighest(xx, zz, getData())) + offset + (v.getH() / 2); if(i.getStructure().getStructure().getLockY() == -1)
{
if(i.getStructure().getStructure().getOverrideYRange() != null)
{
height = (int)i.getStructure().getStructure().getOverrideYRange().get(rng, xx, zz, getData());
}
else
{
height = placer.getHighest(xx, zz, getData());
}
}
else{
height = i.getStructure().getStructure().getLockY();
}
height += offset + (v.getH() / 2);
if (options.getMode().equals(ObjectPlaceMode.PAINT) || options.isVacuum()) { if (options.getMode().equals(ObjectPlaceMode.PAINT) || options.isVacuum()) {
height = -1; height = -1;