mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-11 18:26:08 +00:00
fix Directional rotations
This commit is contained in:
@@ -102,14 +102,14 @@ public class TerraFlora implements Flora {
|
||||
|
||||
List<BlockFace> faces = doRotation ? getFaces(location.clone().add(0, c, 0).getBlock()) : new GlueList<>();
|
||||
if(doRotation && faces.size() == 0) return false; // Don't plant if no faces are valid.
|
||||
BlockFace oneFace = doRotation ? faces.get(new FastRandom(location.getBlockX() ^ location.getBlockZ()).nextInt(faces.size())) : null; // Get random face.
|
||||
|
||||
for(int i = 0; FastMath.abs(i) < size; i += c) { // Down if ceiling, up if floor
|
||||
int lvl = (FastMath.abs(i));
|
||||
BlockData data = floraPalette.get((ceiling ? lvl : size - lvl - 1), location.getX(), location.getY(), location.getZ()).clone();
|
||||
if(doRotation) {
|
||||
BlockFace oneFace = faces.get(new FastRandom(location.getBlockX() ^ location.getBlockZ()).nextInt(faces.size())); // Get random face.
|
||||
if(data instanceof Directional) {
|
||||
((Directional) data).setFacing(oneFace);
|
||||
((Directional) data).setFacing(oneFace.getOppositeFace());
|
||||
} else if(data instanceof MultipleFacing) {
|
||||
MultipleFacing o = (MultipleFacing) data;
|
||||
for(BlockFace face : o.getFaces()) o.setFace(face, false);
|
||||
|
||||
Reference in New Issue
Block a user