Merge internalhandler and api together

This commit is contained in:
Vincent Lee committed 2020-06-28 20:29:01 -05:00
1 parent 0f9e759307
commit bcecfa188c
27 files changed
+211 -363

No files matched your search

@@ -90,6 +90,7 @@ import vazkii.botania.common.core.proxy.ServerProxy;
import vazkii.botania.common.crafting.ModRecipeTypes;
import vazkii.botania.common.entity.EntityDoppleganger;
import vazkii.botania.common.entity.ModEntities;
import vazkii.botania.common.impl.BotaniaAPIImpl;
import vazkii.botania.common.impl.corporea.CorporeaItemStackMatcher;
import vazkii.botania.common.impl.corporea.CorporeaStringMatcher;
import vazkii.botania.common.item.ItemGrassSeeds;
@@ -295,29 +296,17 @@ public class Botania {
});
}
/* todo 1.13
public void init(FMLInitializationEvent event) {
FMLInterModComms.sendMessage("projecte", "interdictionblacklist", EntityManaBurst.class.getCanonicalName());
for(Block b : new Block[]{ ModBlocks.manaGlass, ModBlocks.elfGlass, ModBlocks.bifrostPerm })
FMLInterModComms.sendMessage("chiselsandbits", "ignoreblocklogic", b.getRegistryName().toString());
}
*/
private void loadComplete(FMLLoadCompleteEvent event) {
finishedLoading = true;
}
// Overriding the internal method handler will break everything as it changes regularly.
// So just don't be a moron and don't override it. Thanks.
private void serverAboutToStart(FMLServerAboutToStartEvent event) {
String clname = BotaniaAPI.instance().internalHandler().getClass().getName();
String expect = "vazkii.botania.common.core.handler.InternalMethodHandler";
if (!clname.equals(expect)) {
throw new IllegalAccessError("The Botania API internal method handler has been overriden. "
if (BotaniaAPI.instance().getClass() != BotaniaAPIImpl.class) {
String clname = BotaniaAPI.instance().getClass().getName();
throw new IllegalAccessError("The Botania API has been overriden. "
+ "This will cause crashes and compatibility issues, and that's why it's marked as"
+ " \"Do not Override\". Whoever had the brilliant idea of overriding it needs to go"
+ " back to elementary school and learn to read. (Expected classname: " + expect + ", Actual classname: " + clname + ")");
+ " back to elementary school and learn to read. (Actual classname: " + clname + ")");
}
}