Fixed monolith spawning
This commit is contained in:
@@ -5,8 +5,12 @@ import java.util.Random;
|
||||
|
||||
import StevenDimDoors.mod_pocketDim.DDProperties;
|
||||
import StevenDimDoors.mod_pocketDim.mod_pocketDim;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.dimHelper;
|
||||
import StevenDimDoors.mod_pocketDim.helpers.yCoordHelper;
|
||||
import StevenDimDoors.mod_pocketDim.ticking.MobObelisk;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
import net.minecraft.util.IProgressUpdate;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@@ -173,7 +177,48 @@ public class LimboGenerator extends ChunkProviderGenerate implements IChunkProvi
|
||||
@Override
|
||||
public void populate(IChunkProvider var1, int var2, int var3)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
|
||||
if(true)
|
||||
{
|
||||
return;
|
||||
}
|
||||
int y =0;
|
||||
int x = var2*16 + rand.nextInt(16);
|
||||
int z = var3*16 + rand.nextInt(16);
|
||||
int yTest;
|
||||
do
|
||||
{
|
||||
|
||||
x = var2*16 + rand.nextInt(16);
|
||||
z = var3*16 + rand.nextInt(16);
|
||||
|
||||
while(this.worldObj.getBlockId(x, y, z)==0&&y<255)
|
||||
{
|
||||
y++;
|
||||
}
|
||||
y = yCoordHelper.getFirstUncovered(this.worldObj,x , y+2, z);
|
||||
|
||||
Entity mob = new MobObelisk(this.worldObj);
|
||||
mob.setLocationAndAngles(x, y, z, 1, 1);
|
||||
|
||||
yTest=yCoordHelper.getFirstUncovered(this.worldObj,x , y+5, z);
|
||||
if(yTest>245)
|
||||
{
|
||||
return;
|
||||
}
|
||||
this.worldObj.spawnEntityInWorld(mob);
|
||||
|
||||
}
|
||||
while(yTest >y);
|
||||
|
||||
|
||||
|
||||
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user