add setting in config

by default mobs cannot Spawn
This commit is contained in:
Zereff06 committed 2023-01-29 23:02:26 +02:00
1 parent c2f1c134bd
commit 82de7905b1
3 files changed
+10 -2

No files matched your search

@@ -19,11 +19,13 @@ import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import team.chisel.config.Configurations;
public class BlockCarvable extends Block implements ICarvable {
public CarvableHelper carverHelper;
private boolean isAlpha;
private static final boolean canMobsSpawnOnTheChiselBlocks = Configurations.canMobsSpawnOnTheChiselBlocks;
public BlockCarvable() {
this(Material.rock);
@@ -182,6 +184,6 @@ public class BlockCarvable extends Block implements ICarvable {
}
@Override
public boolean canCreatureSpawn(EnumCreatureType type, IBlockAccess world, int x, int y, int z) {
return false;
return canMobsSpawnOnTheChiselBlocks;
}
}
@@ -28,6 +28,7 @@ public class Configurations {
public static boolean enableFMP;
public static boolean chiselStoneToCobbleBricks;
public static boolean chiselBackToVanillaLeaves;
public static boolean canMobsSpawnOnTheChiselBlocks;
public static int marbleAmount;
public static int limestoneAmount;
@@ -82,6 +83,7 @@ public class Configurations {
chiselStoneToCobbleBricks = config.get(category, "chiselStoneToCobbleBricks", true, "Chisel stone to cobblestone and bricks by left clicking.").getBoolean(false);
chiselBackToVanillaLeaves = config
.get(category, "chiselBackToVanillaLeaves", false, "If this is true, you can chisel from the chisel leaves back to vanilla ones. If it is false, you cannot.").getBoolean(false);
canMobsSpawnOnTheChiselBlocks = config.get(category, "canMobsSpawnOnTheChiselBlocks", false, "Can mobs Spawn on the Chisel Blocks").getBoolean();
/* worldgen */
category = "worldgen";
@@ -23,6 +23,8 @@ public class ItemCarvable extends ItemBlock {
setHasSubtypes(true);
}
private static final boolean canMobsSpawnOnTheChiselBlocks = Configurations.canMobsSpawnOnTheChiselBlocks;
@Override
public int getMetadata(int i) {
return i;
@@ -53,6 +55,8 @@ public class ItemCarvable extends ItemBlock {
return;
lines.add(var.getDescription());
lines.add(StatCollector.translateToLocal("item.chisel.nomobspawnsonthisblock.desc"));
if (!canMobsSpawnOnTheChiselBlocks)
lines.add(StatCollector.translateToLocal("item.chisel.nomobspawnsonthisblock.desc"));
}
}