public ItemElectricBase() { super(); this.setMaxStackSize(1); this.setMaxDamage(100); this.setNoRepair(); this.setMaxTransfer(); this.mcVersion = new DefaultArtifactVersion((String) FMLInjectionData.data()[4]); if (EnergyConfigHandler.isIndustrialCraft2Loaded()) { if (VersionParser.parseRange("[1.7.2]").containsVersion(mcVersion)) { itemManagerIC2 = new ElectricItemManagerIC2(); } else { itemManagerIC2 = new ElectricItemManagerIC2_1710(); } } }
@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 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 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); }
public boolean acceptVersion(String version) { if (checkHandler != null) { try { return (Boolean)checkHandler.invoke(container.getMod(), version); } catch (Exception e) { FMLLog.log(Level.WARNING, e, "There was a problem invoking the checkhandler method %s for network mod id %s", checkHandler.getName(), container.getModId()); return false; } } if (acceptableRange!=null) { return acceptableRange.containsVersion(new DefaultArtifactVersion(version)); } return container.getVersion().equals(version); }
public static void versionCheck(String reqVersion, String mod) { final String mcVersion = (String) FMLInjectionData.data()[4]; if (!VersionParser.parseRange(reqVersion).containsVersion(new DefaultArtifactVersion(mcVersion))) { final String err = "This version of " + mod + " does not support minecraft version " + mcVersion; System.err.println(err); final JEditorPane ep = new JEditorPane("text/html", "<html>" + err + "<br>Remove it from your mods folder and check <a href=\"http://micdoodle8.com\">here</a> for updates" + "</html>"); ep.setEditable(false); ep.setOpaque(false); ep.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent event) { try { if (event.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) { Desktop.getDesktop().browse(event.getURL().toURI()); } } catch (final Exception e) { } } }); JOptionPane.showMessageDialog(null, ep, "Fatal error", JOptionPane.ERROR_MESSAGE); System.exit(1); } }
public static void versionCheck(String reqVersion, String mod) { String mcVersion = (String) FMLInjectionData.data()[4]; if (!VersionParser.parseRange(reqVersion).containsVersion(new DefaultArtifactVersion(mcVersion))) { String err = "This version of " + mod + " does not support minecraft version " + mcVersion; logger.error(err); JEditorPane ep = new JEditorPane("text/html", "<html>" + err + "<br>Remove it from your coremods folder and check <a href=\"http://www.minecraftforum.net/topic/909223-\">here</a> for updates" + "</html>"); ep.setEditable(false); ep.setOpaque(false); ep.addHyperlinkListener(new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent event) { try { if (event.getEventType().equals(HyperlinkEvent.EventType.ACTIVATED)) Desktop.getDesktop().browse(event.getURL().toURI()); } catch (Exception ignored) {} } }); JOptionPane.showMessageDialog(null, ep, "Fatal error", JOptionPane.ERROR_MESSAGE); System.exit(1); } }
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(); }
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 NewRadicalBotany() { super(new ModMetadata()); ModMetadata metadata = getMetadata(); metadata.modId = NewRadicalBotany.MODID; metadata.version = NewRadicalBotany.VERSION; metadata.name = "New Radical Botany"; metadata.authorList = ImmutableList.of("Cannibalvox"); metadata.url = "http://www.technicpack.net/"; metadata.credits = "Developed by Technic"; metadata.description = "Can't forget, you only get what you give."; metadata.requiredMods.add(new DefaultArtifactVersion("Botania", false)); metadata.dependencies.add(new DefaultArtifactVersion("Botania", false)); }
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 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; }
public static boolean isModLoaded(String modid, String versionRangeString) { if (!isModLoaded(modid)) { return false; } ModContainer mod = Loader.instance().getIndexedModList().get(modid); VersionRange versionRange = VersionParser.parseRange(versionRangeString); DefaultArtifactVersion required = new DefaultArtifactVersion(modid, versionRange); return required.containsVersion(mod.getProcessedVersion()); }
@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.missingMods.size() * 10, 10); this.drawCenteredString(this.fontRenderer, "Forge Mod Loader has found a problem with your minecraft installation", 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+=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.fontRenderer, String.format("%s : minimum version required is %s", v.getLabel(), dav.getRange().getLowerBoundString()), this.width / 2, offset, 0xEEEEEE); continue; } } this.drawCenteredString(this.fontRenderer, String.format("%s : %s", v.getLabel(), v.getRangeString()), this.width / 2, offset, 0xEEEEEE); } offset+=20; this.drawCenteredString(this.fontRenderer, "The file 'ForgeModLoader-client-0.log' contains more information", this.width / 2, offset, 0xFFFFFF); }
public static void startVersionCheck() { new Thread("Forge Version Check") { @SuppressWarnings("unchecked") @Override public void run() { try { URL url = new URL("http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json"); InputStream con = url.openStream(); String data = new String(ByteStreams.toByteArray(con)); con.close(); Map<String, Object> json = new Gson().fromJson(data, Map.class); //String homepage = (String)json.get("homepage"); Map<String, String> promos = (Map<String, String>)json.get("promos"); String rec = promos.get(MinecraftForge.MC_VERSION + "-recommended"); String lat = promos.get(MinecraftForge.MC_VERSION + "-latest"); ArtifactVersion current = new DefaultArtifactVersion(getVersion()); if (rec != null) { ArtifactVersion recommended = new DefaultArtifactVersion(rec); int diff = recommended.compareTo(current); if (diff == 0) status = UP_TO_DATE; else if (diff < 0) { status = AHEAD; if (lat != null) { if (current.compareTo(new DefaultArtifactVersion(lat)) < 0) { status = OUTDATED; target = lat; } } } else { status = OUTDATED; target = rec; } } else if (lat != null) { if (current.compareTo(new DefaultArtifactVersion(lat)) < 0) { status = BETA_OUTDATED; target = lat; } else status = BETA; } else status = BETA; } catch (Exception e) { e.printStackTrace(); status = FAILED; } } }.start(); }