net.minecraftforge.fml.common.ModContainer Java Examples

The following examples show how to use net.minecraftforge.fml.common.ModContainer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Util.java    From IGW-mod with GNU General Public License v2.0 6 votes vote down vote up
public static String getModIdForEntity(Class<? extends Entity> entity){
    if(reflectionFailed) return "minecraft";
    if(entityNames == null) {
        try {
            entityNames = (HashMap<String, ModContainer>)ReflectionHelper.findField(EntityRegistry.class, "entityNames").get(EntityRegistry.instance());
        } catch(Exception e) {
            IGWLog.warning("IGW-Mod failed to perform reflection! A result of this is that wiki pages related to Entities will not be found. Report to MineMaarten please!");
            e.printStackTrace();
            reflectionFailed = true;
            return "minecraft";
        }
    }
    EntityRegistration entityReg = EntityRegistry.instance().lookupModSpawn(entity, true);
    if(entityReg == null) return "minecraft";
    ModContainer mod = entityNames.get(entityReg.getEntityName());
    if(mod == null) {
        IGWLog.info("Couldn't find the owning mod of the entity " + entityReg.getEntityName() + " even though it's registered through the EntityRegistry!");
        return "minecraft";
    } else {
        return mod.getModId().toLowerCase();
    }
}
 
Example #2
Source File: Utils.java    From SkyblockAddons with MIT License 6 votes vote down vote up
/**
 * Check if another mod is loaded.
 *
 * @param modId The modid to check.
 * @param version The version of the mod to match (optional).
 */
public boolean isModLoaded(String modId, String version) {
    boolean isLoaded = Loader.isModLoaded(modId); // Check for the modid...

    if (isLoaded && version != null) { // Check for the specific version...
        for (ModContainer modContainer : Loader.instance().getModList()) {
            if (modContainer.getModId().equals(modId) && modContainer.getVersion().equals(version)) {
                return true;
            }
        }

        return false;
    }

    return isLoaded;
}
 
Example #3
Source File: ClassDiscoverer.java    From CodeChickenCore with MIT License 6 votes vote down vote up
private void findClasspathMods() {
    List<ModContainer> mods = Loader.instance().getActiveModList();
    HashSet<String> searched = new HashSet<String>();
    for (ModContainer mod : mods) {
        File source = mod.getSource();
        if(source == null || searched.contains(source.getAbsolutePath()))
            continue;
        searched.add(source.getAbsolutePath());

        if (source.isFile()) {
            CodeChickenCorePlugin.logger.debug("Found a mod container %s, examining for codechicken classes", source.getAbsolutePath());
            try {
                readFromZipFile(source);
            } catch (Exception e) {
                CodeChickenCorePlugin.logger.error("Failed to scan " + source.getAbsolutePath() + ", the zip file is invalid", e);
            }
        } else if (source.isDirectory()) {
            CodeChickenCorePlugin.logger.debug("Found a minecraft related directory at %s, examining for codechicken classes", source.getAbsolutePath());
            readFromDirectory(source, source);
        }
    }
}
 
Example #4
Source File: ActionOpenModConfig.java    From Custom-Main-Menu with MIT License 6 votes vote down vote up
@Override
public void perform(Object source, GuiCustom parent)
{
	for (ModContainer mod : Loader.instance().getModList())
	{
		if (mod.getModId().equals(modid))
		{
			IModGuiFactory guiFactory = FMLClientHandler.instance().getGuiFactoryFor(mod);

			if (guiFactory != null)
			{
				GuiScreen newScreen = guiFactory.createConfigGui(parent);
				Minecraft.getMinecraft().displayGuiScreen(newScreen);
			}
		}
	}
}
 
Example #5
Source File: ItemInfo.java    From NotEnoughItems with MIT License 6 votes vote down vote up
private static void parseModItems() {
    HashMap<String, ItemStackSet> modSubsets = new HashMap<String, ItemStackSet>();
    for (Item item : (Iterable<Item>) Item.itemRegistry) {
        UniqueIdentifier ident = GameRegistry.findUniqueIdentifierFor(item);
        if(ident == null) {
            NEIClientConfig.logger.error("Failed to find identifier for: "+item);
            continue;
        }
        String modId = GameRegistry.findUniqueIdentifierFor(item).modId;
        itemOwners.put(item, modId);
        ItemStackSet itemset = modSubsets.get(modId);
        if(itemset == null)
            modSubsets.put(modId, itemset = new ItemStackSet());
        itemset.with(item);
    }

    API.addSubset("Mod.Minecraft", modSubsets.remove("minecraft"));
    for(Entry<String, ItemStackSet> entry : modSubsets.entrySet()) {
        ModContainer mc = FMLCommonHandler.instance().findContainerFor(entry.getKey());
        if(mc == null)
            NEIClientConfig.logger.error("Missing container for "+entry.getKey());
        else
            API.addSubset("Mod."+mc.getName(), entry.getValue());
    }
}
 
Example #6
Source File: PacketCustom.java    From CodeChickenLib with GNU Lesser General Public License v2.1 6 votes vote down vote up
public static String channelName(Object channelKey) {
    if (channelKey instanceof String)
        return (String) channelKey;
    if (channelKey instanceof ModContainer) {
        String s = ((ModContainer) channelKey).getModId();
        if(s.length() > 20)
            throw new IllegalArgumentException("Mod ID ("+s+") too long for use as channel (20 chars). Use a string identifier");
        return s;
    }

    ModContainer mc = FMLCommonHandler.instance().findContainerFor(channelKey);
    if (mc != null)
        return mc.getModId();

    throw new IllegalArgumentException("Invalid channel: " + channelKey);
}
 
Example #7
Source File: ManaRecipes.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void copyAllRecipes(File directory) {
	Map<String, ModContainer> modList = Loader.instance().getIndexedModList();
	for (Map.Entry<String, ModContainer> entry : modList.entrySet() ) {
		for (String recipeName : getResourceListing(entry.getKey(), "fluid_recipes")) {
			if (recipeName.isEmpty()) continue;

			InputStream stream = LibrarianLib.PROXY.getResource(entry.getKey(), "fluid_recipes/" + recipeName);
			if (stream == null) {
				Wizardry.LOGGER.fatal("    > SOMETHING WENT WRONG! Could not read recipe " + recipeName + " from mod jar of '" + entry.getKey() + "'! Report this to the devs on Github!");
				continue;
			}

			try {
				FileUtils.copyInputStreamToFile(stream, new File(directory, recipeName));
				Wizardry.LOGGER.info("    > Mana recipe " + recipeName + " copied successfully from mod jar.");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
 
Example #8
Source File: FireRecipes.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void copyAllRecipes(File directory)
{
	Map<String, ModContainer> modList = Loader.instance().getIndexedModList();
	for (Map.Entry<String, ModContainer> entry : modList.entrySet() ) {
		for (String recipeName : getResourceListing(entry.getKey(), "fire_recipes")) {
			if (recipeName.isEmpty()) continue;

			InputStream stream = LibrarianLib.PROXY.getResource(entry.getKey(), "fire_recipes/" + recipeName);
			if (stream == null) {
				Wizardry.LOGGER.fatal("    > SOMETHING WENT WRONG! Could not read recipe " + recipeName + " from mod jar of '" + entry.getKey() + "'! Report this to the devs on Github!");
				continue;
			}
			
			try {
				FileUtils.copyInputStreamToFile(stream, new File(directory, recipeName));
				Wizardry.LOGGER.info("    > Fire recipe " + recipeName + " copied successfully from mod jar.");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
 
Example #9
Source File: ModuleRegistry.java    From Wizardry with GNU Lesser General Public License v3.0 6 votes vote down vote up
public void copyAllModules(File directory) {
	Map<String, ModContainer> modList = Loader.instance().getIndexedModList();
	for (Map.Entry<String, ModContainer> entry : modList.entrySet()) {
		for (ModuleInstance module : modules) {
			InputStream stream = LibrarianLib.PROXY.getResource(entry.getKey(), "wizmodules/" + module.getNBTKey() + ".json");
			if (stream == null) {
				Wizardry.LOGGER.error("    > SOMETHING WENT WRONG! Could not read module " + module.getNBTKey() + " from mod jar of '" + entry.getKey() + "'! Report this to the devs on Github!");
				continue;
			}

			try {
				FileUtils.copyInputStreamToFile(stream, new File(directory + "/wizmodules/", module.getNBTKey() + ".json"));
				Wizardry.LOGGER.info("    > Module " + module.getNBTKey() + " copied successfully from mod jar.");
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
 
Example #10
Source File: MixinCrashReport.java    From VanillaFix with MIT License 6 votes vote down vote up
/** @reason Adds a list of mods which may have caused the crash to the report. */
@Inject(method = "populateEnvironment", at = @At("TAIL"))
private void afterPopulateEnvironment(CallbackInfo ci) {
    systemDetailsCategory.addDetail("Suspected Mods", () -> {
        try {
            suspectedMods = ModIdentifier.identifyFromStacktrace(cause);

            String modListString = "Unknown";
            List<String> modNames = new ArrayList<>();
            for (ModContainer mod : suspectedMods) {
                modNames.add(mod.getName() + " (" + mod.getModId() + ")");
            }

            if (!modNames.isEmpty()) {
                modListString = StringUtils.join(modNames, ", ");
            }
            return modListString;
        } catch (Throwable e) {
            return ExceptionUtils.getStackTrace(e).replace("\t", "    ");
        }
    });
}
 
Example #11
Source File: ResourcePackFix.java    From GregTech with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void fixResourcePackLocation(ModContainer selfContainer) {
    File sourceFile = selfContainer.getSource();
    if (sourceFile.isDirectory()) {
        AbstractResourcePack resourcePack = getModResourcePack(selfContainer.getModId());
        File actualPackRoot = ObfuscationReflectionHelper.getPrivateValue(AbstractResourcePack.class, resourcePack, "field_110597_b");
        File expectedPackRoot = getGTCEResourcePackRoot();

        if (!expectedPackRoot.getAbsolutePath().equals(actualPackRoot.getAbsolutePath())) {
            System.out.println("[GTCE] Found unexpected resource pack path in dev environment");
            System.out.println("[GTCE] Expected path: " + expectedPackRoot.getAbsolutePath());
            System.out.println("[GTCE] Actual path: " + actualPackRoot.getAbsolutePath());
            System.out.println("[GTCE] Fixed resource pack patch automatically.");
            ObfuscationReflectionHelper.setPrivateValue(AbstractResourcePack.class, resourcePack, expectedPackRoot, "field_110597_b");
            setModResourcePack(selfContainer.getModId(), resourcePack);
        }
    }
}
 
Example #12
Source File: GuiProblemScreen.java    From VanillaFix with MIT License 6 votes vote down vote up
protected String getModListString() {
    if (modListString == null) {
        final Set<ModContainer> suspectedMods = ((IPatchedCrashReport) report).getSuspectedMods();
        if (suspectedMods == null) {
            return modListString = I18n.format("vanillafix.crashscreen.identificationErrored");
        }
        List<String> modNames = new ArrayList<>();
        for (ModContainer mod : suspectedMods) {
            modNames.add(mod.getName());
        }
        if (modNames.isEmpty()) {
            modListString = I18n.format("vanillafix.crashscreen.unknownCause");
        } else {
            modListString = StringUtils.join(modNames, ", ");
        }
    }
    return modListString;
}
 
Example #13
Source File: ModIdentifier.java    From VanillaFix with MIT License 6 votes vote down vote up
private static Map<File, Set<ModContainer>> makeModMap() {
    Map<File, Set<ModContainer>> modMap = new HashMap<>();
    for (ModContainer mod : Loader.instance().getModList()) {
        Set<ModContainer> currentMods = modMap.getOrDefault(mod.getSource(), new HashSet<>());
        currentMods.add(mod);
        try {
            modMap.put(mod.getSource().getCanonicalFile(), currentMods);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    try {
        modMap.remove(Loader.instance().getMinecraftModContainer().getSource()); // Ignore minecraft jar (minecraft)
        modMap.remove(Loader.instance().getIndexedModList().get("FML").getSource()); // Ignore forge jar (FML, forge)
    } catch (NullPointerException ignored) {
        // Workaround for https://github.com/MinecraftForge/MinecraftForge/issues/4919
    }

    return modMap;
}
 
Example #14
Source File: IGWSupportNotifier.java    From IGW-mod with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Needs to be instantiated somewhere in your mod's loading stage.
 */
public IGWSupportNotifier(){
    if(FMLCommonHandler.instance().getSide() == Side.CLIENT && !Loader.isModLoaded("IGWMod")) {
        File dir = new File(".", "config");
        Configuration config = new Configuration(new File(dir, "IGWMod.cfg"));
        config.load();

        if(config.get(Configuration.CATEGORY_GENERAL, "enable_missing_notification", true, "When enabled, this will notify players when IGW-Mod is not installed even though mods add support.").getBoolean()) {
            ModContainer mc = Loader.instance().activeModContainer();
            String modid = mc.getModId();
            List<ModContainer> loadedMods = Loader.instance().getActiveModList();
            for(ModContainer container : loadedMods) {
                if(container.getModId().equals(modid)) {
                    supportingMod = container.getName();
                    MinecraftForge.EVENT_BUS.register(this);
                    ClientCommandHandler.instance.registerCommand(new CommandDownloadIGW());
                    break;
                }
            }
        }
        config.save();
    }
}
 
Example #15
Source File: ModIdentifier.java    From VanillaFix with MIT License 6 votes vote down vote up
public static Set<ModContainer> identifyFromStacktrace(Throwable e) {
    Map<File, Set<ModContainer>> modMap = makeModMap();

    // Get the set of classes
    HashSet<String> classes = new LinkedHashSet<>();
    while (e != null) {
        for (StackTraceElement element : e.getStackTrace()) {
            classes.add(element.getClassName());
        }
        e = e.getCause();
    }

    Set<ModContainer> mods = new LinkedHashSet<>();
    for (String className : classes) {
        Set<ModContainer> classMods = identifyFromClass(className, modMap);
        if (classMods != null) mods.addAll(classMods);
    }
    return mods;
}
 
Example #16
Source File: VersionChecker.java    From LunatriusCore with MIT License 5 votes vote down vote up
public static void registerMod(final ModContainer container, final String forgeVersion) {
    REGISTERED_MODS.add(container);

    final ModMetadata metadata = container.getMetadata();
    if (metadata.description != null) {
        metadata.description += "\n---\nCompiled against Forge " + forgeVersion;
    }
}
 
Example #17
Source File: ClassSourceCollector.java    From OpenModsLib with MIT License 5 votes vote down vote up
public ClassMeta getClassInfo(Class<?> cls) {
	final Package pkg = cls.getPackage();

	URL loadedFrom = null;

	try {
		loadedFrom = cls.getProtectionDomain().getCodeSource().getLocation();
	} catch (Throwable t) {
		Log.warn(t, "Failed to get source for %s", cls);
	}

	final API apiAnnotation = pkg.getAnnotation(API.class);
	final ApiInfo apiInfo = apiAnnotation != null? new ApiInfo(apiAnnotation) : null;

	Map<File, Set<String>> mods = Maps.newHashMap();
	for (ModCandidate candidate : table.getCandidatesFor(pkg.getName())) {
		if (!candidate.getClassList().contains(cls.getName().replace('.', '/'))) continue;

		final File candidateFile = candidate.getModContainer();

		Set<String> modIds = Sets.newHashSet();
		mods.put(candidateFile, modIds);
		for (ModContainer mod : candidate.getContainedMods())
			modIds.add(mod.getModId());
	}

	return new ClassMeta(cls, loadedFrom, apiInfo, mods);
}
 
Example #18
Source File: PlatformCommand.java    From YUNoMakeGoodMap with Apache License 2.0 5 votes vote down vote up
protected List<ResourceLocation> getPlatforms()
{
    if (platforms.size() == 0)
    {
        for (ModContainer mc : Loader.instance().getModList())
        {
            File src = mc.getSource();
            if (src == null)
                continue;

            InputStream is = getClass().getResourceAsStream("/assets/" + mc.getModId() + "/structures/sky_block_platforms.txt");
            if (is == null)
                continue;
            try
            {
                for (String line : CharStreams.readLines(new InputStreamReader(is)))
                {
                    if (getClass().getResourceAsStream("/assets/" + mc.getModId() + "/structures/" + line + ".nbt") != null)
                        platforms.add(new ResourceLocation(mc.getModId(), line));
                }
            } catch (IOException e)
            {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

        for (File f : YUNoMakeGoodMap.instance.getStructFolder().listFiles())
        {
            if (!f.isFile() || !f.getName().endsWith(".nbt"))
                continue;
            platforms.add(new ResourceLocation("/config/", f.getName().substring(0, f.getName().length() - 4)));
        }
    }

    return platforms;
}
 
Example #19
Source File: ModHelper.java    From VersionChecker with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static ModContainer getModContainer(String modId)
{
    for (ModContainer mod : Loader.instance().getActiveModList())
    {
        if (mod.getModId().equalsIgnoreCase(modId))
        {
            return mod;
        }
    }
    return null;
}
 
Example #20
Source File: UpdateChecker.java    From VersionChecker with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void addModToCheck(ModContainer mod, String url)
{
    if (mod == null || url == null || url.isEmpty() || modsToCheck.keySet().contains(mod))
        return;

    modsToCheck.put(mod, url);
}
 
Example #21
Source File: UpdateChecker.java    From VersionChecker with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void logResult(ModContainer mod, CheckState result, VersionContainer.Version version)
{
    if (result == CheckState.CURRENT || result == CheckState.OUTDATED)
    {
        LogHandler.info(getResultMessage(mod, result, version));
    }
    else
    {
        LogHandler.warning(getResultMessage(mod, result, version));
    }
}
 
Example #22
Source File: UpdateChecker.java    From VersionChecker with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static String getResultMessage(ModContainer mod, CheckState result, VersionContainer.Version version)
{
    if (result == CheckState.UNINITIALIZED)
    {
        return String.format("Version Checker Status for %s: UNINITIALIZED", mod.getName());
    }
    else if (result == CheckState.CURRENT)
    {
        return String.format("Version Checker Status for %s: CURRENT", mod.getName());
    }
    else if (result == CheckState.OUTDATED && version != null)
    {
        return String.format("Version Checker Status for %s: OUTDATED! Using %s, latest %s", mod.getName(), mod.getVersion(), version.getModVersion());
    }
    else if (result == CheckState.ERROR)
    {
        return String.format("Version Checker Status for %s: ERROR", mod.getName());
    }
    else if (result == CheckState.MC_VERSION_NOT_FOUND)
    {
        return String.format("Version Checker Status for %s: MC VERSION NOT SUPPORTED", mod.getName());
    }
    else
    {
        return String.format("Version Checker Status for %s: ERROR", mod.getName());
    }
}
 
Example #23
Source File: UpdateChecker.java    From VersionChecker with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void addUpdateToList(ModContainer mod, VersionContainer.Version version)
{
    Update update = new Update(mod.getModId());
    update.displayName = mod.getName();
    update.oldVersion = mod.getVersion();
    update.newVersion = version.getModVersion();

    if (version.getUpdateURL() != null && !version.getUpdateURL().isEmpty())
    {
        update.updateURL = version.getUpdateURL();
    }
    update.isDirectLink = version.isDirectLink();

    if (!version.getChangeLog().isEmpty())
    {
        StringBuilder builder = new StringBuilder();
        for (String changeLogLine : version.getChangeLog())
        {
            builder.append(changeLogLine).append("\n");
        }
        update.changeLog = builder.toString();
    }

    if (version.getNewFileName() != null && !version.getNewFileName().isEmpty())
    {
        update.newFileName = version.getNewFileName();
    }

    UpdateHandler.addUpdate(update);
}
 
Example #24
Source File: ModIdentifier.java    From OpenModsLib with MIT License 5 votes vote down vote up
public ModContainer getModForItem(Item item) {
	if (itemCache.containsKey(item)) return itemCache.get(item);

	ModContainer result = identifyItem(item);
	itemCache.put(item, result);
	return result;
}
 
Example #25
Source File: ConfigStorage.java    From OpenModsLib with MIT License 5 votes vote down vote up
public void register(Configuration value) {
	ModContainer mod = Loader.instance().activeModContainer();
	Preconditions.checkNotNull(mod, "Can't register outside initialization");
	final String modId = mod.getModId();

	configs.put(modId, value);
}
 
Example #26
Source File: FeatureRegistry.java    From OpenModsLib with MIT License 5 votes vote down vote up
private void addValue(Entry entry) {
	ModContainer mod = Loader.instance().activeModContainer();
	Preconditions.checkNotNull(mod, "Can't register outside initialization");
	final String modId = mod.getModId();

	final Entry prev = features.put(modId, entry);
	Preconditions.checkState(prev == null, "Duplicate on modid: " + modId);
}
 
Example #27
Source File: ModIdentifier.java    From OpenModsLib with MIT License 5 votes vote down vote up
public ModContainer getModForBlock(Block block) {
	if (blockCache.containsKey(block)) return blockCache.get(block);

	ModContainer result = identifyBlock(block);
	blockCache.put(block, result);
	return result;
}
 
Example #28
Source File: OpenBlock.java    From OpenModsLib with MIT License 5 votes vote down vote up
@Override
public void setupBlock(ModContainer container, String id, Class<? extends TileEntity> tileEntity, ItemBlock itemBlock) {
	this.modInstance = container.getMod();

	if (tileEntity != null) {
		this.teClass = tileEntity;
		hasTileEntity = true;

		for (TileEntityCapability capability : TileEntityCapability.values())
			if (capability.intf.isAssignableFrom(teClass))
				teCapabilities.add(capability);
	}
}
 
Example #29
Source File: ManifestHandler.java    From Wizardry with GNU Lesser General Public License v3.0 5 votes vote down vote up
public void loadNewInternalManifest(String... categories) {
	Map<String, ModContainer> modList = Loader.instance().getIndexedModList();
	for (Map.Entry<String, ModContainer> entry : modList.entrySet()) {
		for (String category : categories) {

			try {
				for (String fileName : ManaRecipes.getResourceListing(entry.getKey(), category)) {
					if (fileName.isEmpty()) continue;

					InputStream stream = LibrarianLib.PROXY.getResource(entry.getKey(), category + "/" + fileName);
					if (stream == null) {
						Wizardry.LOGGER.error("    > SOMETHING WENT WRONG! Could not read " + fileName + " in " + category + " from mod jar! Report this to the devs on Github!");
						continue;
					}
					try (BufferedReader br = new BufferedReader(new InputStreamReader(stream, Charset.defaultCharset()))) {
						StringBuilder sb = new StringBuilder();
						String line;
						while ((line = br.readLine()) != null) {
							sb.append(line);
							sb.append('\n');
						}
						addItemToManifest(category, entry.getKey(), Files.getNameWithoutExtension(fileName), sb.toString().hashCode() + "");
					}
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
 
Example #30
Source File: Seppuku.java    From seppuku with GNU General Public License v3.0 5 votes vote down vote up
public void unload() {
    this.moduleManager.unload();
    this.apiManager.unload();
    this.commandManager.unload();
    this.friendManager.unload();
    this.waypointManager.unload();
    this.macroManager.unload();
    this.tickRateManager.unload();
    this.chatManager.unload();
    this.ignoredManager.unload();
    this.capeManager.unload();
    this.joinLeaveManager.unload();
    this.hudManager.unload();
    this.animationManager.unload();
    this.notificationManager.unload();
    this.seppukuMainMenu.unload();
    this.cameraManager.unload();

    this.getEventManager().dispatchEvent(new EventUnload());

    ModContainer seppukuModContainer = null;

    for (ModContainer modContainer : Loader.instance().getActiveModList()) {
        if (modContainer.getModId().equals("seppukumod")) {
            seppukuModContainer = modContainer;
        }
    }

    if (seppukuModContainer != null) {
        Loader.instance().getActiveModList().remove(seppukuModContainer);
    }

    Display.setTitle(this.prevTitle);
    Minecraft.getMinecraft().ingameGUI.getChatGUI().clearChatMessages(true);
    System.gc();
}