@Override public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) { this.func_146276_q_(); int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); this.func_73732_a(this.field_146289_q, "Forge Mod Loader could not connect to this server", this.field_146294_l / 2, offset, 0xFFFFFF); offset += 10; this.func_73732_a(this.field_146289_q, "The mods and versions listed below could not be found", this.field_146294_l / 2, offset, 0xFFFFFF); offset += 10; this.func_73732_a(this.field_146289_q, "They are required to play on this server", this.field_146294_l / 2, offset, 0xFFFFFF); offset += 5; for (ArtifactVersion v : modsMissing.missingMods) { offset += 10; this.func_73732_a(this.field_146289_q, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.field_146294_l / 2, offset, 0xEEEEEE); } super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); }
@Override public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) { this.func_146276_q_(); int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); this.func_73732_a(this.field_146289_q, "Forge Mod Loader has found a problem with your minecraft installation", this.field_146294_l / 2, offset, 0xFFFFFF); offset+=10; this.func_73732_a(this.field_146289_q, "The mods and versions listed below could not be found", this.field_146294_l / 2, offset, 0xFFFFFF); offset+=5; for (ArtifactVersion v : modsMissing.missingMods) { offset+=10; if (v instanceof DefaultArtifactVersion) { DefaultArtifactVersion dav = (DefaultArtifactVersion)v; if (dav.getRange() != null && dav.getRange().isUnboundedAbove()) { this.func_73732_a(this.field_146289_q, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.field_146294_l / 2, offset, 0xEEEEEE); continue; } } this.func_73732_a(this.field_146289_q, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.field_146294_l / 2, offset, 0xEEEEEE); } offset+=20; this.func_73732_a(this.field_146289_q, "The file 'logs/fml-client-latest.log' contains more information", this.field_146294_l / 2, offset, 0xFFFFFF); }
@Override public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { this.drawDefaultBackground(); int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader could not connect to this server", this.width / 2, offset, 0xFFFFFF); offset += 10; this.drawCenteredString(this.fontRendererObj, "The mods and versions listed below could not be found", this.width / 2, offset, 0xFFFFFF); offset += 10; this.drawCenteredString(this.fontRendererObj, "They are required to play on this server", this.width / 2, offset, 0xFFFFFF); offset += 5; for (ArtifactVersion v : modsMissing.missingMods) { offset += 10; this.drawCenteredString(this.fontRendererObj, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE); } super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_); }
@Override public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_) { this.drawDefaultBackground(); int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); this.drawCenteredString(this.fontRendererObj, "Forge Mod Loader has found a problem with your minecraft installation", this.width / 2, offset, 0xFFFFFF); offset+=10; this.drawCenteredString(this.fontRendererObj, "The mods and versions listed below could not be found", 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 && dav.getRange().isUnboundedAbove()) { this.drawCenteredString(this.fontRendererObj, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), 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; this.drawCenteredString(this.fontRendererObj, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF); }
@Override public int compareTo(ArtifactVersion artifactVersion) { if (artifactVersion instanceof ModVersion) { return compareTo((ModVersion) artifactVersion); } if (artifactVersion instanceof ReleaseVersion) { ReleaseVersion releaseVersion = (ReleaseVersion) artifactVersion; if (label.equals(releaseVersion.getLabel())) { return modVersion.compareTo(releaseVersion); } else if ("Minecraft".equals(releaseVersion.getLabel())) { return minecraftVersion.compareTo(releaseVersion); } } return 0; }
@Override public int compareTo(ArtifactVersion artifactVersion) { if (artifactVersion instanceof ReleaseVersion) { return compareTo((ReleaseVersion) artifactVersion); } if (artifactVersion instanceof ModVersion) { ModVersion modVersion = (ModVersion) artifactVersion; if (label.equals(modVersion.getLabel())) { return compareTo(modVersion.getModVersion()); } else if (label.equals("Minecraft")) { return compareTo(modVersion.getMinecraftVersion()); } } return 0; }
@Override public int compareTo(ArtifactVersion o) { if (o instanceof ModVersion) { return compareTo((ModVersion) o); } if (o instanceof ReleaseVersion) { ReleaseVersion r = (ReleaseVersion) o; if (_label.equals(r.getLabel())) { return _modVer.compareTo(r); } else if ("Minecraft".equals(r.getLabel())) { return _mcVer.compareTo(r); } } return 0; }
@Override public int compareTo(ArtifactVersion o) { if (o instanceof ReleaseVersion) { return compareTo((ReleaseVersion) o); } if (o instanceof ModVersion) { ModVersion r = (ModVersion) o; if (_label.equals(r.getLabel())) { return compareTo(r.modVersion()); } else if ("Minecraft".equals(_label)) { return compareTo(r.minecraftVersion()); } } return 0; }
private <T extends Collection<ArtifactVersion>> T processReferences(Object refs, Class<? extends T> retType) { T res = null; try { res = retType.newInstance(); } catch (Exception e) { // unpossible } if (refs == null) { return res; } for (String ref : ((List<String>)refs)) { res.add(VersionParser.parseVersionReference(ref)); } return res; }
@Override /** * Draws the screen and all the components in it. */ public void drawScreen(int par1, int par2, float par3) { this.drawDefaultBackground(); int offset = Math.max(85 - modsMissing.getModList().size() * 10, 10); this.drawCenteredString(this.fontRenderer, "Forge Mod Loader could not connect to this server", this.width / 2, offset, 0xFFFFFF); offset += 10; this.drawCenteredString(this.fontRenderer, "The mods and versions listed below could not be found", this.width / 2, offset, 0xFFFFFF); offset += 10; this.drawCenteredString(this.fontRenderer, "They are required to play on this server", this.width / 2, offset, 0xFFFFFF); offset += 5; for (ArtifactVersion v : modsMissing.getModList()) { offset += 10; this.drawCenteredString(this.fontRenderer, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE); } super.drawScreen(par1, par2, par3); }
@Override public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) { this.func_73873_v_(); int offset = Math.max(85 - modsMissing.getModList().size() * 10, 10); this.func_73732_a(this.field_73886_k, "Forge Mod Loader could not connect to this server", this.field_73880_f / 2, offset, 0xFFFFFF); offset += 10; this.func_73732_a(this.field_73886_k, "The mods and versions listed below could not be found", this.field_73880_f / 2, offset, 0xFFFFFF); offset += 10; this.func_73732_a(this.field_73886_k, "They are required to play on this server", this.field_73880_f / 2, offset, 0xFFFFFF); offset += 5; for (ArtifactVersion v : modsMissing.getModList()) { offset += 10; this.func_73732_a(this.field_73886_k, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.field_73880_f / 2, offset, 0xEEEEEE); } super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); }
@Override public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) { this.func_73873_v_(); int offset = Math.max(85 - modsMissing.missingMods.size() * 10, 10); this.func_73732_a(this.field_73886_k, "Forge Mod Loader has found a problem with your minecraft installation", this.field_73880_f / 2, offset, 0xFFFFFF); offset+=10; this.func_73732_a(this.field_73886_k, "The mods and versions listed below could not be found", this.field_73880_f / 2, offset, 0xFFFFFF); offset+=5; for (ArtifactVersion v : modsMissing.missingMods) { offset+=10; if (v instanceof DefaultArtifactVersion) { DefaultArtifactVersion dav = (DefaultArtifactVersion)v; if (dav.getRange() != null && dav.getRange().isUnboundedAbove()) { this.func_73732_a(this.field_73886_k, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.field_73880_f / 2, offset, 0xEEEEEE); continue; } } this.func_73732_a(this.field_73886_k, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.field_73880_f / 2, offset, 0xEEEEEE); } offset+=20; this.func_73732_a(this.field_73886_k, "The file 'ForgeModLoader-client-0.log' contains more information", this.field_73880_f / 2, offset, 0xFFFFFF); }
private void sendEventToModContainer(FMLEvent stateEvent, ModContainer mc) { String modId = mc.getModId(); Collection<String> requirements = Collections2.transform(mc.getRequirements(),new ArtifactVersionNameFunction()); for (ArtifactVersion av : mc.getDependencies()) { if (av.getLabel()!= null && requirements.contains(av.getLabel()) && modStates.containsEntry(av.getLabel(),ModState.ERRORED)) { FMLLog.log(modId, Level.ERROR, "Skipping event %s and marking errored mod %s since required dependency %s has errored", stateEvent.getEventType(), modId, av.getLabel()); modStates.put(modId, ModState.ERRORED); return; } } activeContainer = mc; stateEvent.applyModContainer(activeContainer()); ThreadContext.put("mod", modId); FMLLog.log(modId, Level.TRACE, "Sending event %s to mod %s", stateEvent.getEventType(), modId); eventChannels.get(modId).post(stateEvent); FMLLog.log(modId, Level.TRACE, "Sent event %s to mod %s", stateEvent.getEventType(), modId); ThreadContext.remove("mod"); activeContainer = null; if (stateEvent instanceof FMLStateEvent) { if (!errors.containsKey(modId)) { modStates.put(modId, ((FMLStateEvent)stateEvent).getModState()); } else { modStates.put(modId, ModState.ERRORED); } } }
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(); }
@Override protected void printStackTrace(WrappedPrintStream stream) { stream.println("Missing Mods:"); for (ArtifactVersion v : missingMods) { stream.println(String.format("\t%s : %s", v.getLabel(), v.getRangeString())); } stream.println(""); }
public static void startVersionCheck() { try { URL url = new URL("https://raw.githubusercontent.com/AziasYur/Minecraft-Vending-Machine-Revamped/master/version.json"); InputStream con = url.openStream(); String data = new String(ByteStreams.toByteArray(con)); con.close(); Map<String, Object> json = new Gson().fromJson(data, Map.class); Map<String, String> versions = (Map<String, String>)json.get("versions"); String ver; if(VendingMachineConfigs.checkBetaUpdate) { ver = versions.get(MinecraftForge.MC_VERSION + "-develop"); } else { ver = versions.get(MinecraftForge.MC_VERSION + "-release"); } ArtifactVersion current = new DefaultArtifactVersion(getVersion()); if(ver!= null) { ArtifactVersion latest = new DefaultArtifactVersion(ver); int diff = latest.compareTo(current); if (diff == 0) { status = Status.UP_TO_DATE; } else if (diff < 0) { status = Status.AHEAD; } else { status = Status.OUTDATED; } } else { status = Status.AHEAD; } } catch (Exception e) { e.printStackTrace(); status = Status.FAILED; } echoStatus(); }
public void init() { boolean TELoaded = Loader.isModLoaded(TE); boolean TDLoaded = Loader.isModLoaded(TD); if (!TELoaded || !TDLoaded) { LogHelper.fatal("Thermal Expansion and Thermal Dynamics is required for Thermal Expansion recipes."); throw new MissingModsException(Collections.singleton((ArtifactVersion) new DefaultArtifactVersion((!TELoaded) ? TE : TD))); } getItems(); setRecipes(); }
private static ArtifactVersion getArtifactVersion(String label, String process) { int index = process.indexOf('R'); if (index > 0 && process.indexOf('C') != index + 1) { return new ModVersion(label, process); } else { return new ReleaseVersion(label, process); } }
private static boolean sameOrNewerVersion(String modid, String version) { final ModContainer modContainer = Loader.instance().getIndexedModList().get(modid); if (modContainer == null) return true; final ArtifactVersion targetVersion = new DefaultArtifactVersion(version); final ArtifactVersion actualVersion = modContainer.getProcessedVersion(); return actualVersion.compareTo(targetVersion) >= 0; }
@Override public List<ArtifactVersion> getDependants() { if (metadata == null || metadata.dependants == null) return new LinkedList<ArtifactVersion>(); else return metadata.dependants; }
private void sendEventToModContainer(FMLEvent stateEvent, ModContainer mc) { String modId = mc.getModId(); Collection<String> requirements = Collections2.transform(mc.getRequirements(),new ArtifactVersionNameFunction()); for (ArtifactVersion av : mc.getDependencies()) { if (av.getLabel()!= null && requirements.contains(av.getLabel()) && modStates.containsEntry(av.getLabel(),ModState.ERRORED)) { FMLLog.log(modId, Level.SEVERE, "Skipping event %s and marking errored mod %s since required dependency %s has errored", stateEvent.getEventType(), modId, av.getLabel()); modStates.put(modId, ModState.ERRORED); return; } } activeContainer = mc; stateEvent.applyModContainer(activeContainer()); FMLLog.log(modId, Level.FINEST, "Sending event %s to mod %s", stateEvent.getEventType(), modId); eventChannels.get(modId).post(stateEvent); FMLLog.log(modId, Level.FINEST, "Sent event %s to mod %s", stateEvent.getEventType(), modId); activeContainer = null; if (stateEvent instanceof FMLStateEvent) { if (!errors.containsKey(modId)) { modStates.put(modId, ((FMLStateEvent)stateEvent).getModState()); } else { modStates.put(modId, ModState.ERRORED); } } }
@Override public List<ArtifactVersion> getDependencies() { return new LinkedList<ArtifactVersion>(getRequirements()); }