@NetworkCheckHandler public static boolean networkCheck(Map<String, String> mods, Side side) { if (mods.containsKey(MODID)) { if (COMPATIBLE_RANGE.containsVersion(new DefaultArtifactVersion(mods.get(MODID)))) { LOG.info("{} version {} compatible with version {} {}, allowing connection", MODID, VERSION, mods.get(MODID), side); return true; } LOG.info("{} version {} not compatible with version {} {}, denying connection", MODID, VERSION, mods.get(MODID), side); return false; } LOG.info("{} not found on {}, denying connection", MODID, side); return false; }
/** * Draws the screen and all the components in it. */ @Override public void drawScreen(int mouseX, int mouseY, float partialTicks) { this.drawDefaultBackground(); int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); String modMissingDependenciesText = I18n.format("fml.messages.mod.missing.dependencies", TextFormatting.BOLD + modsMissing.getModName() + TextFormatting.RESET); this.drawCenteredString(this.fontRendererObj, modMissingDependenciesText, this.width / 2, offset, 0xFFFFFF); offset+=10; String fixMissingDependenciesText = I18n.format("fml.messages.mod.missing.dependencies.fix", modsMissing.getModName()); this.drawCenteredString(this.fontRendererObj, fixMissingDependenciesText, this.width / 2, offset, 0xFFFFFF); offset+=5; for (ArtifactVersion v : modsMissing.missingMods) { offset+=10; if (v instanceof DefaultArtifactVersion) { DefaultArtifactVersion dav = (DefaultArtifactVersion)v; if (dav.getRange() != null) { String message = String.format(TextFormatting.BOLD + "%s " + TextFormatting.RESET + "%s", v.getLabel(), dav.getRange().toStringFriendly()); this.drawCenteredString(this.fontRendererObj, message, this.width / 2, offset, 0xEEEEEE); continue; } } this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE); } offset+=20; String seeLogText = I18n.format("fml.messages.mod.missing.dependencies.see.log", clientLog.getName()); this.drawCenteredString(this.fontRendererObj, seeLogText, this.width / 2, offset, 0xFFFFFF); for (int i = 0; i < this.buttonList.size(); ++i) { this.buttonList.get(i).drawButton(this.mc, mouseX, mouseY); } }
public boolean acceptVersion(String version) { if (acceptableRange!=null) { return acceptableRange.containsVersion(new DefaultArtifactVersion(version)); } return container.getVersion().equals(version); }
public APIContainer(String providedAPI, String apiVersion, File source, ArtifactVersion ownerMod) { this.providedAPI = providedAPI; this.version = apiVersion; this.ownerMod = ownerMod; this.ourVersion = new DefaultArtifactVersion(providedAPI, apiVersion); this.referredMods = Lists.newArrayList(); this.source = source; this.currentReferents = Sets.newHashSet(); this.packages = Sets.newHashSet(); }
private static void onMiss() { MissingModsException e = new MissingModsException(Sets.newHashSet(new DefaultArtifactVersion("5.0.0")), "BiomesOPlenty", "Biomes O' Plenty"); RuntimeException ex = new RuntimeException("Could not find a premise mod: Biomes O' Plenty", e); JFXDialog.showThrowableAndWait(ex); throw ex; }
/** * Initialize the mod */ public ModContainer() { super(meta = new ModMetadata()); meta.authorList = Arrays.asList("cazzar"); meta.description = "The core library for cazzar's mods"; meta.modId = Reference.MOD_ID; meta.name = "Cazzar Core Lib"; meta.dependants = Arrays.asList((ArtifactVersion) new DefaultArtifactVersion("jukeboxreloaded", true)); meta.url = "http://www.cazzar.net/"; meta.version = getVersionFromJar(); }
public static void processModsList(Map<String, Object> json) { for(ModVersionInfo info : registeredMods) { Map<String, String> versionInfo = (Map<String, String>)json.get(info.modName); if(versionInfo != null && versionInfo.containsKey(info.mcVersion)) { ArtifactVersion current = new DefaultArtifactVersion(info.modVersion); String lat = versionInfo.get(info.mcVersion); ArtifactVersion latest = new DefaultArtifactVersion(lat); int diff = latest.compareTo(current); if(diff > 0) { info.modVersionNew = lat.trim(); modsWithUpdates.add(info); if(requireLogging && !info.isModClientOnly) { iChunUtil.LOGGER.info("[NEW UPDATE AVAILABLE] " + info.modName + " - " + info.modVersionNew); } } } } requireLogging = false; updatesChecked = true; }