terraScript random is no more

This commit is contained in:
Zoë
2022-08-19 23:18:42 -05:00
parent e658a5d917
commit 5d5408e142
22 changed files with 84 additions and 176 deletions
@@ -1,6 +1,8 @@
package com.dfsek.terra.mod.mixin.gameplay;
import com.dfsek.terra.api.world.World;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.entity.ai.brain.task.BoneMealTask;
@@ -43,14 +45,13 @@ public class BoneMealTaskMixin {
if(canGrow != null) {
RandomGenerator random = MinecraftAdapter.adapt(world.getRandom());
cir.setReturnValue(canGrow.generate(
Vector3Int.of(pos.getX(), pos.getY(), pos.getZ()), (WritableWorld) world, random, Rotation.NONE));
Vector3Int.of(pos.getX(), pos.getY(), pos.getZ()), (WritableWorld) world, Rotation.NONE, world.getSeed() + random.nextLong(Long.MAX_VALUE)));
return;
}
cir.setReturnValue(true);
return;
}
cir.setReturnValue(false);
return;
}
}
}
@@ -27,7 +27,7 @@ public class FertilizableUtil {
Structure canGrow = config.getCanGrow();
if(canGrow != null) {
if(!canGrow.generate(
Vector3Int.of(pos.getX(), pos.getY(), pos.getZ()), (WritableWorld) world, random, Rotation.NONE)) {
Vector3Int.of(pos.getX(), pos.getY(), pos.getZ()), (WritableWorld) world, Rotation.NONE, world.getSeed() + random.nextLong(Long.MAX_VALUE))) {
return false;
}
}
@@ -38,7 +38,7 @@ public class FertilizableUtil {
}
}
config.getStructures().get(random).generate(
Vector3Int.of(pos.getX(), pos.getY(), pos.getZ()), (WritableWorld) world, random, Rotation.NONE);
Vector3Int.of(pos.getX(), pos.getY(), pos.getZ()), (WritableWorld) world, Rotation.NONE, world.getSeed() + random.nextLong(Long.MAX_VALUE));
return true;
}
}