Fixes to retro gen

This commit is contained in:
modmuss50 2019-01-24 21:35:39 +00:00
parent 5a9349ced4
commit f4a24d7c25
2 changed files with 5 additions and 4 deletions

View file

@ -74,6 +74,7 @@ public class TechRebornDevCommand extends CommandBase {
blocksToRemove.add(Blocks.DIRT);
blocksToRemove.add(Blocks.STONE);
blocksToRemove.add(Blocks.END_STONE);
blocksToRemove.add(Blocks.NETHERRACK);
for (int x = 0; x < 25; x++) {
for (int z = 0; z < 25; z++) {
for (int y = 0; y < playerMP.posY; y++) {

View file

@ -48,7 +48,7 @@ public class TechRebornRetroGen {
private final Deque<ChunkCoord> chunksToRetroGen = new ArrayDeque<>(64);
private boolean isChunkEligibleForRetroGen(ChunkDataEvent.Load event) {
return Core.worldGen.config.retroGenOres && event.getWorld().provider.getDimension() == 0
return Core.worldGen.config.retroGenOres
&& event.getData().getString(RETROGEN_TAG).isEmpty();
}
@ -57,7 +57,7 @@ public class TechRebornRetroGen {
}
private boolean isTickEligibleForRetroGen(TickEvent.WorldTickEvent event) {
return event.phase == TickEvent.Phase.END || event.side == Side.SERVER;
return event.phase == TickEvent.Phase.END && event.side == Side.SERVER;
}
@SubscribeEvent
@ -72,7 +72,7 @@ public class TechRebornRetroGen {
final Random rng = new Random(seed);
final long xSeed = rng.nextLong() >> 2 + 1L;
final long zSeed = rng.nextLong() >> 2 + 1L;
final long chunkSeed = (xSeed * coord.getX() + zSeed * coord.getZ()) * seed;
final long chunkSeed = (xSeed * coord.getX() + zSeed * coord.getZ()) ^ seed;
rng.setSeed(chunkSeed);
Core.worldGen.generate(rng, coord.getX(), coord.getZ(), world, null, null);
}
@ -84,7 +84,7 @@ public class TechRebornRetroGen {
public void onChunkLoad(ChunkDataEvent.Load event) {
if (isChunkEligibleForRetroGen(event)) {
final ChunkCoord coord = ChunkCoord.of(event);
Core.logHelper.info("Queueing retro ore gen for " + coord + '.');
Core.logHelper.debug("Queueing retro gen for " + coord + '.');
chunksToRetroGen.addLast(coord);
}
}