Skip to content

Commit 5fd4f7c

Browse files
committed
noticed something that might be an issue later and fixed it
1 parent 2fc42f7 commit 5fd4f7c

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/main/java/gregapi/GT_API_Proxy.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1487,8 +1487,7 @@ public void onCheckSpawnEvent(LivingSpawnEvent.CheckSpawn aEvent) {
14871487

14881488
if (SPAWN_NO_BATS && aMobClass == EntityBat.class && aWorld.getBlock(aX, aY-2, aZ) != Blocks.stone && aWorld.getBlock(aX, aY+2, aZ) != Blocks.stone) {aEvent.setResult(Result.DENY); return;}
14891489

1490-
if (!WD.dimOverworldLike(aWorld)) return;
1491-
if (SPAWN_HOSTILES_ONLY_IN_DARKNESS) try {
1490+
if (SPAWN_HOSTILES_ONLY_IN_DARKNESS && WD.dimOverworldLike(aWorld)) try {
14921491
Chunk tChunk = aWorld.getChunkFromBlockCoords(aX, aZ);
14931492
if (tChunk != null && tChunk.getBlockStorageArray() != null && tChunk.getBlockStorageArray()[aY >> 4] != null && tChunk.getBlockStorageArray()[aY >> 4].getExtBlocklightValue(aX & 15, aY & 15, aZ & 15) > 0) {
14941493
// Vanilla Mobs only, just in case.
@@ -1500,28 +1499,29 @@ public void onCheckSpawnEvent(LivingSpawnEvent.CheckSpawn aEvent) {
15001499
}
15011500
} catch(Throwable e) {e.printStackTrace(ERR);}
15021501

1503-
if (aWorld.provider.dimensionId != 0 || aY + 16 < WD.waterLevel(aWorld)) return;
1504-
if (GENERATE_BIOMES) {
1505-
if (UT.Code.inside(-96, 95, aX) && UT.Code.inside(-96, 95, aZ)) {aEvent.setResult(Result.DENY); return;}
1506-
} else if (GENERATE_NEXUS) {
1507-
if (UT.Code.inside( 0, 48, aX) && UT.Code.inside(-64, -16, aZ)) {aEvent.setResult(Result.DENY); return;}
1502+
if (aWorld.provider.dimensionId == 0 && aY >= WD.waterLevel(aWorld) - 16) {
1503+
if (GENERATE_BIOMES) {
1504+
if (UT.Code.inside(-96, 95, aX) && UT.Code.inside(-96, 95, aZ)) {aEvent.setResult(Result.DENY); return;}
1505+
} else if (GENERATE_NEXUS) {
1506+
if (UT.Code.inside( 0, 48, aX) && UT.Code.inside(-64, -16, aZ)) {aEvent.setResult(Result.DENY); return;}
1507+
}
1508+
if (GENERATE_STREETS && (UT.Code.inside(-48, 48, aX) || UT.Code.inside(-48, 48, aZ))) {aEvent.setResult(Result.DENY); return;}
1509+
if (SPAWN_ZONE_MOB_PROTECTION && UT.Code.inside(-144, 144, aX-aWorld.getWorldInfo().getSpawnX()) && UT.Code.inside(-144, 144, aZ-aWorld.getWorldInfo().getSpawnZ()) && WD.opq(aWorld, aX, 0, aZ, F, F)) {aEvent.setResult(Result.DENY); return;}
15081510
}
1509-
if (GENERATE_STREETS && (UT.Code.inside(-48, 48, aX) || UT.Code.inside(-48, 48, aZ))) {aEvent.setResult(Result.DENY); return;}
1510-
if (SPAWN_ZONE_MOB_PROTECTION && UT.Code.inside(-144, 144, aX-aWorld.getWorldInfo().getSpawnX()) && UT.Code.inside(-144, 144, aZ-aWorld.getWorldInfo().getSpawnZ()) && WD.opq(aWorld, aX, 0, aZ, F, F)) {aEvent.setResult(Result.DENY); return;}
1511+
15111512
//if (aEvent.entity instanceof EntityMob && !(aEvent.entity instanceof IBossDisplayData) && ((EntityMob)aEvent.entity).getCanSpawnHere()) mMobsToFastDespawn.add((EntityLiving)aEvent.entityLiving);
1513+
15121514
for (int i = 0; i < MOB_SPAWN_INHIBITORS.size(); i++) {
15131515
ITileEntityMobSpawnInhibitor tTileEntity = MOB_SPAWN_INHIBITORS.get(i);
15141516
if (tTileEntity.isDead()) {
15151517
MOB_SPAWN_INHIBITORS.remove(i--);
15161518
tTileEntity.onUnregisterInhibitor();
1517-
} else {
1518-
try {
1519-
if (tTileEntity.inhibitMobSpawn(aEvent, aWorld, aX, aY, aZ)) {aEvent.setResult(Result.DENY); return;}
1520-
} catch(Throwable e) {
1521-
MOB_SPAWN_INHIBITORS.remove(i--);
1522-
tTileEntity.setError("Mob Spawn Inhibitor - " + e);
1523-
e.printStackTrace(ERR);
1524-
}
1519+
} else try {
1520+
if (tTileEntity.inhibitMobSpawn(aEvent, aWorld, aX, aY, aZ)) {aEvent.setResult(Result.DENY); return;}
1521+
} catch(Throwable e) {
1522+
MOB_SPAWN_INHIBITORS.remove(i--);
1523+
tTileEntity.setError("Spawn Inhibitor - " + e);
1524+
e.printStackTrace(ERR);
15251525
}
15261526
}
15271527
}

0 commit comments

Comments
 (0)