mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-02-22 14:00:47 +00:00
why didn't it do that to begin with?
This commit is contained in:
parent
2c6d5f9fde
commit
a57a284d1c
@ -47,42 +47,25 @@ public class EntityFalloutRain extends Entity {
|
|||||||
|
|
||||||
if(!worldObj.isRemote) {
|
if(!worldObj.isRemote) {
|
||||||
|
|
||||||
|
long start = System.currentTimeMillis();
|
||||||
|
|
||||||
if(firstTick) {
|
if(firstTick) {
|
||||||
if (chunksToProcess.isEmpty() && outerChunksToProcess.isEmpty()) gatherChunks();
|
if(chunksToProcess.isEmpty() && outerChunksToProcess.isEmpty()) gatherChunks();
|
||||||
firstTick = false;
|
firstTick = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tickDelay == 0) {
|
if(tickDelay == 0) {
|
||||||
tickDelay = BombConfig.fDelay;
|
tickDelay = BombConfig.fDelay;
|
||||||
|
|
||||||
if (!chunksToProcess.isEmpty()) {
|
while(System.currentTimeMillis() < start + BombConfig.mk5) {
|
||||||
long chunkPos = chunksToProcess.remove(chunksToProcess.size() - 1); // Just so it doesn't shift the whole list every time
|
if(!chunksToProcess.isEmpty()) {
|
||||||
int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE);
|
long chunkPos = chunksToProcess.remove(chunksToProcess.size() - 1); // Just so it doesn't shift the whole list every time
|
||||||
int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE);
|
int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE);
|
||||||
boolean biomeModified = false;
|
int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE);
|
||||||
for(int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) {
|
boolean biomeModified = false;
|
||||||
for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) {
|
for(int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) {
|
||||||
double percent = Math.hypot(x - posX, z - posZ) * 100 / getScale();
|
for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) {
|
||||||
stomp(x, z, percent);
|
double percent = Math.hypot(x - posX, z - posZ) * 100 / getScale();
|
||||||
BiomeGenBase biome = getBiomeChange(percent, getScale(), worldObj.getBiomeGenForCoords(x, z));
|
|
||||||
if(biome != null) {
|
|
||||||
WorldUtil.setBiome(worldObj, x, z, biome);
|
|
||||||
biomeModified = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(biomeModified) WorldUtil.syncBiomeChange(worldObj, chunkPosX << 4, chunkPosZ << 4);
|
|
||||||
|
|
||||||
} else if (!outerChunksToProcess.isEmpty()) {
|
|
||||||
long chunkPos = outerChunksToProcess.remove(outerChunksToProcess.size() - 1);
|
|
||||||
int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE);
|
|
||||||
int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE);
|
|
||||||
boolean biomeModified = false;
|
|
||||||
for(int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) {
|
|
||||||
for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) {
|
|
||||||
double distance = Math.hypot(x - posX, z - posZ);
|
|
||||||
if(distance <= getScale()) {
|
|
||||||
double percent = distance * 100 / getScale();
|
|
||||||
stomp(x, z, percent);
|
stomp(x, z, percent);
|
||||||
BiomeGenBase biome = getBiomeChange(percent, getScale(), worldObj.getBiomeGenForCoords(x, z));
|
BiomeGenBase biome = getBiomeChange(percent, getScale(), worldObj.getBiomeGenForCoords(x, z));
|
||||||
if(biome != null) {
|
if(biome != null) {
|
||||||
@ -91,11 +74,33 @@ public class EntityFalloutRain extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(biomeModified) WorldUtil.syncBiomeChange(worldObj, chunkPosX << 4, chunkPosZ << 4);
|
||||||
|
|
||||||
|
} else if (!outerChunksToProcess.isEmpty()) {
|
||||||
|
long chunkPos = outerChunksToProcess.remove(outerChunksToProcess.size() - 1);
|
||||||
|
int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE);
|
||||||
|
int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE);
|
||||||
|
boolean biomeModified = false;
|
||||||
|
for(int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) {
|
||||||
|
for(int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) {
|
||||||
|
double distance = Math.hypot(x - posX, z - posZ);
|
||||||
|
if(distance <= getScale()) {
|
||||||
|
double percent = distance * 100 / getScale();
|
||||||
|
stomp(x, z, percent);
|
||||||
|
BiomeGenBase biome = getBiomeChange(percent, getScale(), worldObj.getBiomeGenForCoords(x, z));
|
||||||
|
if(biome != null) {
|
||||||
|
WorldUtil.setBiome(worldObj, x, z, biome);
|
||||||
|
biomeModified = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(biomeModified) WorldUtil.syncBiomeChange(worldObj, chunkPosX << 4, chunkPosZ << 4);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
setDead();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(biomeModified) WorldUtil.syncBiomeChange(worldObj, chunkPosX << 4, chunkPosZ << 4);
|
|
||||||
|
|
||||||
} else {
|
|
||||||
setDead();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ public class ExplosionNukeRayBatched {
|
|||||||
|
|
||||||
int amountProcessed = 0;
|
int amountProcessed = 0;
|
||||||
|
|
||||||
while (this.gspNumMax >= this.gspNum){
|
while(this.gspNumMax >= this.gspNum){
|
||||||
// Get Cartesian coordinates for spherical coordinates
|
// Get Cartesian coordinates for spherical coordinates
|
||||||
Vec3 vec = this.getSpherical2cartesian();
|
Vec3 vec = this.getSpherical2cartesian();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user