mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-21 12:42:36 +00:00
Added config option to disable all slime spawns. I use this in super flat worlds when testing.
This commit is contained in:
1 parent
48d1a63b70
commit
33f31c262d
4 files changed
+16
No files matched your search
@@ -329,6 +329,7 @@ public final class Config {
|
||||
public static int spawnGuardPowerPerTickLevelTwo = 300;
|
||||
public static int spawnGuardRangeLevelThree = 128;
|
||||
public static int spawnGuardPowerPerTickLevelThree = 1000;
|
||||
public static boolean spawnGuardStopAllSlimesDebug = false;
|
||||
|
||||
//Loot Defaults
|
||||
public static boolean lootDarkSteel = true;
|
||||
@@ -904,6 +905,9 @@ public final class Config {
|
||||
"The RF/t power use of a levele 2 spawn guard").getInt(spawnGuardPowerPerTickLevelTwo);
|
||||
spawnGuardPowerPerTickLevelThree = config.get(sectionAttarctor.name, "spawnGuardPowerPerTickLevelThree", spawnGuardPowerPerTickLevelThree,
|
||||
"The RF/t power use of a levele 3 spawn guard").getInt(spawnGuardPowerPerTickLevelThree);
|
||||
spawnGuardStopAllSlimesDebug = config.getBoolean("spawnGuardStopAllSlimesDebug", sectionAttarctor.name, spawnGuardStopAllSlimesDebug,
|
||||
"When true slimes wont be alowed to spawn at all. Only added to aid testing in super flat worlds.");
|
||||
|
||||
|
||||
// Loot Config
|
||||
lootDarkSteel = config.getBoolean("lootDarkSteel", sectionLootConfig.name, lootDarkSteel, "Adds Darksteel Ingots to loot tables");
|
||||
|
||||
@@ -95,6 +95,7 @@ public class EnchanterModelRenderer extends TileEntitySpecialRenderer implements
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef(x, y, z);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
renderModel(ForgeDirection.SOUTH.ordinal());
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
@@ -24,6 +24,10 @@ public class BlockSpawnGuard extends AbstractMachineBlock<TileSpawnGuard> {
|
||||
public static BlockSpawnGuard create() {
|
||||
BlockSpawnGuard res = new BlockSpawnGuard();
|
||||
res.init();
|
||||
|
||||
//Just making sure its loaded
|
||||
SpawnGuardController.instance.toString();
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package crazypants.enderio.machine.spawnguard;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingDropsEvent;
|
||||
@@ -46,6 +47,12 @@ public class SpawnGuardController {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntitySpawn(LivingSpawnEvent evt) {
|
||||
|
||||
if(Config.spawnGuardStopAllSlimesDebug && evt.entity instanceof EntitySlime) {
|
||||
evt.setResult(Result.DENY);
|
||||
return;
|
||||
}
|
||||
|
||||
Map<BlockCoord, TileSpawnGuard> guards = getGuardsForWorld(evt.world);
|
||||
for(TileSpawnGuard guard : guards.values()) {
|
||||
if(guard.isSpawnPrevented(evt.entityLiving)) {
|
||||
|
||||
Reference in new issue
Block a user