Spawnrates.
This commit is contained in:
parent
e7ec977e08
commit
ab6faadecd
|
@ -45,9 +45,12 @@ public class BronzeDungeon extends AetherDungeon {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (random.nextInt(25) != 0)
|
||||
if (random.nextInt(40) != 0)
|
||||
{
|
||||
return false;
|
||||
if (random.nextInt(60) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
setBlocks(this.lockedBlock(), this.lockedLightBlock(), 20);
|
||||
|
|
|
@ -2,12 +2,10 @@ package com.legacy.aether.world.gen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import com.legacy.aether.world.util.AetherRandomTracker;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.structure.MapGenStructure;
|
||||
import net.minecraft.world.gen.structure.StructureComponent;
|
||||
import net.minecraft.world.gen.structure.StructureStart;
|
||||
|
||||
import com.legacy.aether.world.gen.components.ComponentGoldenDungeon;
|
||||
|
@ -26,17 +24,15 @@ public class MapGenGoldenDungeon extends MapGenStructure {
|
|||
|
||||
@Override
|
||||
protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) {
|
||||
AetherRandomTracker tracker = AetherRandomTracker.INSTANCE;
|
||||
int rand = tracker.testRandom(this.rand, 180);
|
||||
if (this.rand.nextInt(120) != 0)
|
||||
{
|
||||
if (this.rand.nextInt(140) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (rand != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return chunkX % 10 == 0 && chunkZ % 10 == 0;
|
||||
}
|
||||
return chunkX % 10 == 0 && chunkZ % 10 == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -2,7 +2,6 @@ package com.legacy.aether.world.gen;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import com.legacy.aether.world.util.AetherRandomTracker;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.structure.MapGenStructure;
|
||||
|
@ -22,17 +21,15 @@ public class MapGenSilverDungeon extends MapGenStructure {
|
|||
|
||||
@Override
|
||||
protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) {
|
||||
AetherRandomTracker tracker = AetherRandomTracker.INSTANCE;
|
||||
int rand = tracker.testRandom(this.rand, 60);
|
||||
if (this.rand.nextInt(60) != 0)
|
||||
{
|
||||
if (this.rand.nextInt(80) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (rand != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return chunkX % 6 == 0 && chunkZ % 6 == 0;
|
||||
}
|
||||
return chunkX % 6 == 0 && chunkZ % 6 == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
package com.legacy.aether.world.util;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class AetherRandomTracker
|
||||
{
|
||||
public static AetherRandomTracker INSTANCE = new AetherRandomTracker();
|
||||
public int lastRand = -1;
|
||||
|
||||
public int testRandom(Random random, int bound)
|
||||
{
|
||||
int inputRandom = random.nextInt(bound);
|
||||
|
||||
if (inputRandom != this.lastRand)
|
||||
{
|
||||
this.lastRand = inputRandom;
|
||||
return inputRandom;
|
||||
}
|
||||
else
|
||||
{
|
||||
testRandom(random, bound);
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue