More fixes

- Fixed Jigsaws not placing TileStates
- Fixed NPE when banners, signs or skulls try to be rotated to be up or down
This commit is contained in:
StrangeOne101 2021-06-19 22:49:32 +12:00 committed by DanLT
parent b6bc269505
commit 9644693de3
2 changed files with 8 additions and 3 deletions

View File

@ -245,7 +245,9 @@ public class IrisObjectRotation
BlockVector bv = new BlockVector(f.getModX(), f.getModY(), f.getModZ());
bv = rotate(bv.clone(), spinx, spiny, spinz);
BlockFace t = getFace(bv);
g.setRotation(t);
if (t.getModY() == 0) {
g.setRotation(t);
}
}
else if(d instanceof Orientable)

View File

@ -9,6 +9,7 @@ import com.volmit.iris.util.KList;
import com.volmit.iris.util.RNG;
import lombok.Data;
import org.bukkit.World;
import org.bukkit.block.BlockState;
import org.bukkit.block.TileState;
import org.bukkit.block.data.BlockData;
import org.bukkit.util.BlockVector;
@ -163,7 +164,7 @@ public class PlannedPiece {
@Override
public boolean isSolid(int x, int y, int z) {
return false;
return world.getBlockAt(x,y,z).getType().isSolid();
}
@Override
@ -183,7 +184,9 @@ public class PlannedPiece {
@Override
public void setTile(int xx, int yy, int zz, TileData<? extends TileState> tile) {
BlockState state = world.getBlockAt(xx,yy,zz).getState();
tile.toBukkitTry(state);
state.update();
}
}, piece.getPlacementOptions(), new RNG(), getData());
}