Disables Grinder for Demons too
Because instakilling is silly
This commit is contained in:
parent
f79d50f084
commit
ee44f2a979
|
@ -9,13 +9,16 @@ import java.io.IOException;
|
|||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.PrintWriter;
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Method;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import WayofTime.alchemicalWizardry.common.rituals.*;
|
||||
import cpw.mods.fml.common.*;
|
||||
import cpw.mods.fml.common.event.*;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
|
@ -38,6 +41,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
|||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
|
||||
import org.apache.logging.log4j.Level;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
|
@ -239,12 +243,8 @@ import WayofTime.alchemicalWizardry.common.tileEntity.TETeleposer;
|
|||
import WayofTime.alchemicalWizardry.common.tileEntity.TEWritingTable;
|
||||
import WayofTime.alchemicalWizardry.common.tileEntity.gui.GuiHandler;
|
||||
import WayofTime.alchemicalWizardry.common.tweaker.MineTweakerIntegration;
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.registry.EntityRegistry;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
@ -1156,9 +1156,39 @@ public class AlchemicalWizardry
|
|||
"WaterElemental","EarthElemental","FireElemental","ShadeElemental","HolyElemental","MinorDemonGrunt","MinorDemonGruntFire","MinorDemonGruntWind",
|
||||
"MinorDemonGruntIce","MinorDemonGruntEarth", "MinorDemonGruntGuardian","MinorDemonGruntGuardianFire","MinorDemonGruntGuardianWind","MinorDemonGruntGuardianIce",
|
||||
"MinorDemonGruntGuardianEarth"};
|
||||
Class[] mobClasses = new Class[]{EntityFallenAngel.class,EntityLowerGuardian.class,EntityBileDemon.class,EntityWingedFireDemon.class,EntitySmallEarthGolem.class,EntityIceDemon.class,
|
||||
EntityBoulderFist.class,EntityShade.class,EntityAirElemental.class,EntityWaterElemental.class,EntityEarthElemental.class,EntityFireElemental.class,EntityShadeElemental.class,
|
||||
EntityHolyElemental.class,EntityMinorDemonGrunt.class,EntityMinorDemonGruntFire.class,EntityMinorDemonGruntWind.class,EntityMinorDemonGruntIce.class,
|
||||
EntityMinorDemonGruntEarth.class,EntityMinorDemonGruntGuardian.class,EntityMinorDemonGruntGuardianFire.class,EntityMinorDemonGruntGuardianWind.class,
|
||||
EntityMinorDemonGruntGuardianIce.class,EntityMinorDemonGruntGuardianEarth.class};
|
||||
if (Loader.isModLoaded("MineFactoryReloaded"))
|
||||
{
|
||||
for (String demon:mobs) FMLInterModComms.sendMessage("MineFactoryReloaded", "registerAutoSpawnerBlacklist", demon);
|
||||
ModContainer bloodMagic = Loader.instance().activeModContainer();
|
||||
Method method = null;
|
||||
Constructor<FMLInterModComms.IMCMessage> constructor = null;
|
||||
try
|
||||
{
|
||||
constructor = FMLInterModComms.IMCMessage.class.getDeclaredConstructor(String.class, Object.class);
|
||||
constructor.setAccessible(true);
|
||||
method = FMLInterModComms.class.getDeclaredMethod("enqueueMessage", Object.class, String.class, FMLInterModComms.IMCMessage.class);
|
||||
method.setAccessible(true);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
logger.log(Level.ERROR, "Grinder Message reflection failed");
|
||||
}
|
||||
for (int i = 0; i<mobs.length; i++)
|
||||
{
|
||||
FMLInterModComms.sendMessage("MineFactoryReloaded", "registerAutoSpawnerBlacklist", mobs[i]);
|
||||
if (method == null) continue;
|
||||
try{
|
||||
FMLInterModComms.IMCMessage message = constructor.newInstance("registerGrinderBlacklist",mobClasses[i]);
|
||||
method.invoke(null, bloodMagic, "MineFactoryReloaded", message);
|
||||
}catch (Exception e)
|
||||
{
|
||||
logger.log(Level.ERROR, "Failed to blacklist Grinder for "+ mobs[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Loader.isModLoaded("EnderIO"))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue