-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/mDiyo/TinkersConstruct
- Loading branch information
Showing
5 changed files
with
89 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package tconstruct.compat; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
|
||
import net.minecraftforge.common.Configuration; | ||
|
||
public class Tforest { | ||
public static void initProps (File location) | ||
{ | ||
/* Here we will set up the config file for the mod | ||
* First: Create a folder inside the config folder | ||
* Second: Create the actual config file | ||
* Note: Configs are a pain, but absolutely necessary for every mod. | ||
*/ | ||
//File file = new File(TConstruct.proxy.getLocation() + "/config"); | ||
//file.mkdir(); | ||
//File newFile = new File(TConstruct.proxy.getLocation() + "/config/TinkersWorkshop.txt"); | ||
|
||
File newFile = new File(location + "/TwilightForest.cfg"); | ||
if( newFile.exists()){ | ||
|
||
/* [Forge] Configuration class, used as config method */ | ||
Configuration config = new Configuration(newFile); | ||
|
||
/* Load the configuration file */ | ||
config.load(); | ||
|
||
tfdimid = config.get("Dimension", "DimensionID", true).getInt(); | ||
} | ||
else { | ||
tfdimid = -100; | ||
} | ||
} | ||
public static int tfdimid; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package tconstruct.compat.dimensions; | ||
|
||
import java.util.ArrayList; | ||
|
||
import tconstruct.compat.Tforest; | ||
import tconstruct.util.PHConstruct; | ||
|
||
public class dimblacklist { | ||
public static ArrayList<Integer> blacklist = new ArrayList<Integer>(); | ||
public static void getbaddimensions(){ | ||
blacklist.add(1); | ||
if (Tforest.tfdimid != -100){ | ||
blacklist.add(Tforest.tfdimid); | ||
} | ||
if(PHConstruct.cfgDimBlackList.length > 0){ | ||
for (int numdim = 0; numdim< PHConstruct.cfgDimBlackList.length; numdim ++){ | ||
blacklist.add(PHConstruct.cfgDimBlackList[numdim]); | ||
} | ||
} | ||
|
||
} | ||
public static boolean isDimInBlacklist(int dim){ | ||
if (dim<0) | ||
return false; | ||
if(PHConstruct.slimeIslGenDim0Only && dim != 0){ | ||
return false; | ||
} | ||
for (int len = 0;len< blacklist.size(); len++){ | ||
if (blacklist.get(len) == dim) | ||
return false; | ||
} | ||
return true; | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters