diff --git a/gradle.properties b/gradle.properties index f53dcddf1..959be0bc5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Sets default memory used for gradle commands. Can be overridden by user or command line properties. # This is required to provide enough memory for the Minecraft decompilation process. org.gradle.jvmargs=-Xmx3G -mod_version=1.12.2 +mod_version=1.12.3 minecraft_version=1.12.2 teslacorelib_version=1.0.15.+ teslacorelib_mc_version=1.12.2 diff --git a/src/main/java/com/buuz135/industrial/tile/agriculture/AnimalStockIncreaserTile.java b/src/main/java/com/buuz135/industrial/tile/agriculture/AnimalStockIncreaserTile.java index 12f749da9..2ce0a70e9 100644 --- a/src/main/java/com/buuz135/industrial/tile/agriculture/AnimalStockIncreaserTile.java +++ b/src/main/java/com/buuz135/industrial/tile/agriculture/AnimalStockIncreaserTile.java @@ -21,9 +21,11 @@ */ package com.buuz135.industrial.tile.agriculture; +import com.buuz135.industrial.proxy.BlockRegistry; import com.buuz135.industrial.tile.CustomColoredItemHandler; import com.buuz135.industrial.tile.WorkingAreaElectricMachine; import com.buuz135.industrial.utils.WorkUtils; +import net.minecraft.entity.EntityList; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityLlama; @@ -78,7 +80,7 @@ public float work() { List animals = this.world.getEntitiesWithinAABB(EntityAnimal.class, area); if (animals.size() == 0 || animals.size() > 35) return 0; //Removing from the list animals that can't breed - animals.removeIf(entityAnimal -> entityAnimal.isChild() || entityAnimal.getGrowingAge() != 0 || getFirstBreedingItem(entityAnimal).isEmpty() || entityAnimal.isInLove()); + animals.removeIf(entityAnimal -> entityAnimal.isChild() || entityAnimal.getGrowingAge() != 0 || getFirstBreedingItem(entityAnimal).isEmpty() || entityAnimal.isInLove() || BlockRegistry.animalStockIncreaserBlock.entityBlacklist.contains(EntityList.getKey(entityAnimal).toString())); for (EntityAnimal firstParent : animals) { for (EntityAnimal secondParent : animals) { if (!firstParent.equals(secondParent) && firstParent.getClass().equals(secondParent.getClass())) { diff --git a/src/main/java/com/buuz135/industrial/tile/block/AnimalStockIncreaserBlock.java b/src/main/java/com/buuz135/industrial/tile/block/AnimalStockIncreaserBlock.java index 4e34ddbd9..292d5b574 100644 --- a/src/main/java/com/buuz135/industrial/tile/block/AnimalStockIncreaserBlock.java +++ b/src/main/java/com/buuz135/industrial/tile/block/AnimalStockIncreaserBlock.java @@ -22,16 +22,23 @@ package com.buuz135.industrial.tile.block; import com.buuz135.industrial.book.BookCategory; +import com.buuz135.industrial.config.CustomConfiguration; import com.buuz135.industrial.proxy.ItemRegistry; import com.buuz135.industrial.tile.agriculture.AnimalStockIncreaserTile; import com.buuz135.industrial.utils.RecipeUtils; import net.minecraft.block.material.Material; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import net.minecraftforge.common.config.Configuration; import net.ndrei.teslacorelib.items.MachineCaseItem; +import java.util.Arrays; +import java.util.List; + public class AnimalStockIncreaserBlock extends CustomAreaOrientedBlock { + public List entityBlacklist; + public AnimalStockIncreaserBlock() { super("animal_stock_increaser", AnimalStockIncreaserTile.class, Material.ROCK, 400, 20, RangeType.FRONT, 5, 1, true); } @@ -51,4 +58,10 @@ public BookCategory getCategory() { return BookCategory.ANIMAL_HUSBANDRY; } + @Override + public void getMachineConfig() { + super.getMachineConfig(); + entityBlacklist = Arrays.asList(CustomConfiguration.config.getStringList("entityBlacklist", "machines" + Configuration.CATEGORY_SPLITTER + this.getRegistryName().getPath().toString(), + new String[]{}, "A list of entities blacklist from being fed with the machine")); + } }