Skip to content

Commit

Permalink
Safety checks for MC version (forces 1.10.2), build_bumber++
Browse files Browse the repository at this point in the history
  • Loading branch information
EdwinMindcraft committed Mar 20, 2018
1 parent 442ce17 commit 1fcee6c
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 72 deletions.
2 changes: 1 addition & 1 deletion build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Sat Dec 24 21:55:56 PST 2016
mcmapping=snapshot_20161111
version=1.5.0C
build_number=7
build_number=9
jei_version=3.7.8.+
mcversion=1.10.2
mod_name=ArsMagica2
2 changes: 1 addition & 1 deletion src/main/java/am2/ArsMagica2.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import net.minecraftforge.fml.relauncher.Side;


@Mod(modid=ArsMagica2.MODID, version=ArsMagica2.VERSION, guiFactory=ArsMagica2.GUIFACTORY, canBeDeactivated=false)
@Mod(modid=ArsMagica2.MODID, version=ArsMagica2.VERSION, guiFactory=ArsMagica2.GUIFACTORY, canBeDeactivated=false, acceptedMinecraftVersions = "[1.10.2,1.11)")
public class ArsMagica2 {

public static final String MODID = "arsmagica2";
Expand Down
141 changes: 71 additions & 70 deletions src/main/java/am2/common/asm/Preloader.java
Original file line number Diff line number Diff line change
@@ -1,70 +1,71 @@
package am2.common.asm;

import java.io.File;
import java.util.Map;

import am2.common.LogHelper;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.DependsOn;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.SortingIndex;

@Name("ArsMagica2-Preloader")
@DependsOn("arsmagica2")
@SortingIndex(1001)
public class Preloader implements IFMLLoadingPlugin {

public static boolean isDevEnvironment;
public static boolean foundThaumcraft;

@Override
public String[] getASMTransformerClass() {
return new String[] {"am2.common.asm.Transformer"};
}

@Override
public String getModContainerClass() {
return null;
}

@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(Map<String, Object> data) {
File loc = (File)data.get("mcLocation");

LogHelper.trace("MC located at: " + loc.getAbsolutePath());
isDevEnvironment = !(Boolean)data.get("runtimeDeobfuscationEnabled");

File mcFolder = new File(loc.getAbsolutePath() + File.separatorChar + "mods");
File[] subfiles = mcFolder.listFiles();
for (File file : subfiles){
String name = file.getName();
if (name != null) {
name = name.toLowerCase();
if (name.endsWith(".jar") || name.endsWith(".zip")){
if (name.contains("thaumcraft")){
LogHelper.info("Core: Located Thaumcraft in " + file.getName());
foundThaumcraft = true;
}
// else if (name.contains("optifine")){
// LogHelper.info("Core: Located OptiFine in " + file.getName() + ". We'll to confirm that...");
// foundOptiFine = true;
// }else if (name.contains("dragonapi")){
// LogHelper.info("Core: Located DragonAPI in " + file.getName());
// foundDragonAPI = true;
// }
}
}
}
}

@Override
public String getAccessTransformerClass() {
return null;
}

}
package am2.common.asm;

import am2.common.LogHelper;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.DependsOn;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.Name;
import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin.SortingIndex;

import java.io.File;
import java.util.Map;

@IFMLLoadingPlugin.Name("ArsMagica2-Preloader")
@IFMLLoadingPlugin.DependsOn("arsmagica2")
@IFMLLoadingPlugin.SortingIndex(1001)
@IFMLLoadingPlugin.MCVersion("1.10.2")
public class Preloader implements IFMLLoadingPlugin {

public static boolean isDevEnvironment;
public static boolean foundThaumcraft;

@Override
public String[] getASMTransformerClass() {
return new String[]{"am2.common.asm.Transformer"};
}

@Override
public String getModContainerClass() {
return null;
}

@Override
public String getSetupClass() {
return null;
}

@Override
public void injectData(Map<String, Object> data) {
File loc = (File) data.get("mcLocation");

LogHelper.trace("MC located at: " + loc.getAbsolutePath());
isDevEnvironment = !(Boolean) data.get("runtimeDeobfuscationEnabled");

File mcFolder = new File(loc.getAbsolutePath() + File.separatorChar + "mods");
File[] subfiles = mcFolder.listFiles();
for (File file : subfiles) {
String name = file.getName();
if (name != null) {
name = name.toLowerCase();
if (name.endsWith(".jar") || name.endsWith(".zip")) {
if (name.contains("thaumcraft")) {
LogHelper.info("Core: Located Thaumcraft in " + file.getName());
foundThaumcraft = true;
}
// else if (name.contains("optifine")){
// LogHelper.info("Core: Located OptiFine in " + file.getName() + ". We'll to confirm that...");
// foundOptiFine = true;
// }else if (name.contains("dragonapi")){
// LogHelper.info("Core: Located DragonAPI in " + file.getName());
// foundDragonAPI = true;
// }
}
}
}
}

@Override
public String getAccessTransformerClass() {
return null;
}

}

0 comments on commit 1fcee6c

Please sign in to comment.