Compare commits

..
2 Commits
Author SHA1 Message Date
Zereff06 834d7b9d4a add setting to config-> disable butterflies spawn
+ default disable is false
2023-03-09 11:34:07 +02:00
Zereff06 3d55aa887f bs 2023-03-09 00:14:54 +02:00
4 changed files with 6 additions and 6 deletions

No files matched your search

@@ -31,7 +31,7 @@ import forestry.mail.gui.GuiMailboxInfo;
public class Config {
public static boolean disableButterfly;
public static Boolean DISABLE_BUTTERFLY;
public static final String CATEGORY_COMMON = "common";
public static final String CATEGORY_FLUIDS = "fluids";
@@ -147,7 +147,7 @@ public class Config {
configCommon = new LocalizedConfiguration(configFileCommon, "1.2.0");
disableButterfly = configCommon.getBooleanLocalized("mobs", "disable.butterfly", false);
DISABLE_BUTTERFLY = configCommon.getBooleanLocalized("mobs", "disable.butterfly", false);
gameMode = configCommon
.getStringLocalized("difficulty", "game.mode", "EASY", new String[] { "OP, EASY, NORMAL, HARD" });
@@ -23,7 +23,7 @@ public class ButterflySpawner implements ILeafTickHandler {
@Override
public boolean onRandomLeafTick(ITree tree, World world, int x, int y, int z, boolean isDestroyed) {
if (Config.disableButterfly) {
if (Config.DISABLE_BUTTERFLY) {
return false;
}
@@ -370,7 +370,7 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly
@Override
protected boolean canDespawn() {
if (Config.disableButterfly) {
if (Config.DISABLE_BUTTERFLY) {
this.setDead();
}
return ticksExisted > MAX_LIFESPAN;
@@ -92,7 +92,7 @@ public class ItemButterflyGE extends ItemGE {
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) {
super.addInformation(itemstack, player, list, flag);
if (Config.disableButterfly && type == EnumFlutterType.BUTTERFLY) list.add(ChatFormatting.RED + "Disabled");
if (Config.DISABLE_BUTTERFLY && type == EnumFlutterType.BUTTERFLY) list.add(ChatFormatting.RED + "Disabled");
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@@ -115,7 +115,7 @@ public class ItemButterflyGE extends ItemGE {
@Override
public boolean onEntityItemUpdate(EntityItem entityItem) {
if (type != EnumFlutterType.BUTTERFLY || Config.disableButterfly) {
if (type != EnumFlutterType.BUTTERFLY || Config.DISABLE_BUTTERFLY) {
return false;
}
if (entityItem.worldObj.isRemote || entityItem.ticksExisted < 80) {