mirror of
https://github.com/GTNewHorizons/Universal-Singularities.git
synced 2026-11-22 13:10:03 +00:00
Now disabled singularities will be hidden in nei, there is also a config option to disable this behavior.
now some singularities are disabled by default, in order to apply this change, you must delete your old config file.
This commit is contained in:
1 parent
894c885e46
commit
d6db69be1f
11 files changed
+80
-31
No files matched your search
+14
@@ -0,0 +1,14 @@
|
||||
.gradle/
|
||||
build/
|
||||
out/
|
||||
run/
|
||||
server/
|
||||
eclipse/
|
||||
src/META-INF/
|
||||
/*.iws
|
||||
/*.ipr
|
||||
/*.iml
|
||||
bin/
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
package wealthyturtle.uiesingularities;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public final class NEI
|
||||
{
|
||||
private NEI() {}
|
||||
|
||||
public static void hide(@Nonnull final ItemStack itemStack)
|
||||
{
|
||||
API.hideItem(itemStack);
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ public final class UniversalSingularityWrapper
|
||||
public final int recipeBaseValue;
|
||||
public final int cColor;
|
||||
public final int dColor;
|
||||
public final boolean enabled;
|
||||
|
||||
public UniversalSingularityWrapper(@Nonnull final String name, @Nonnull final String oreName, final int recipeBaseValue, final int cColor, final int dColor)
|
||||
{
|
||||
@@ -25,5 +26,16 @@ public final class UniversalSingularityWrapper
|
||||
this.recipeBaseValue = recipeBaseValue;
|
||||
this.cColor = cColor;
|
||||
this.dColor = dColor;
|
||||
this.enabled = true;
|
||||
}
|
||||
|
||||
public UniversalSingularityWrapper(@Nonnull final String name, @Nonnull final String oreName, final int recipeBaseValue, final int cColor, final int dColor, final boolean enabled)
|
||||
{
|
||||
this.name = name;
|
||||
this.oreName = oreName;
|
||||
this.recipeBaseValue = recipeBaseValue;
|
||||
this.cColor = cColor;
|
||||
this.dColor = dColor;
|
||||
this.enabled = enabled;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package wealthyturtle.uiesingularities.proxy;
|
||||
|
||||
import fox.spiteful.avaritia.render.FancyHaloRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public final class ClientProxy extends CommonProxy
|
||||
|
||||
@@ -1,10 +1,14 @@
|
||||
package wealthyturtle.uiesingularities.proxy;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import fox.spiteful.avaritia.crafting.CompressorManager;
|
||||
import fox.spiteful.avaritia.crafting.Grinder;
|
||||
import gnu.trove.list.TIntList;
|
||||
import gnu.trove.list.array.TIntArrayList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import wealthyturtle.uiesingularities.NEI;
|
||||
import wealthyturtle.uiesingularities.UniversalSingularity;
|
||||
import wealthyturtle.uiesingularities.UniversalSingularityItem;
|
||||
import wealthyturtle.uiesingularities.UniversalSingularityWrapper;
|
||||
@@ -21,6 +25,7 @@ import static java.io.File.separatorChar;
|
||||
|
||||
public class CommonProxy
|
||||
{
|
||||
private final boolean hideDisabledSingularities;
|
||||
protected final List<UniversalSingularityItem> singularities = new ArrayList<>();
|
||||
|
||||
private final Map<String, Set<String>> allowed = new HashMap<>();
|
||||
@@ -57,9 +62,9 @@ public class CommonProxy
|
||||
new UniversalSingularityWrapper("salt", "blockSalt", 87, 0xEFEFEF, 0xDDE7E8),
|
||||
new UniversalSingularityWrapper("sapphire", "blockSapphire", 86, 0x5173D1, 0x466ACE),
|
||||
new UniversalSingularityWrapper("steel", "blockSteel", 88, 0x9F9F9F, 0x888888),
|
||||
new UniversalSingularityWrapper("titanium", "blockTitanium", 90, 0x1C242E, 0x192029),
|
||||
new UniversalSingularityWrapper("tungsten", "blockTungsten", 79, 0xD6D6D6, 0xCACACA),
|
||||
new UniversalSingularityWrapper("uranium", "blockUranium", 86, 0x00CB40, 0x00C43E),
|
||||
new UniversalSingularityWrapper("titanium", "blockTitanium", 90, 0x1C242E, 0x192029, false),
|
||||
new UniversalSingularityWrapper("tungsten", "blockTungsten", 79, 0xD6D6D6, 0xCACACA, false),
|
||||
new UniversalSingularityWrapper("uranium", "blockUranium", 86, 0x00CB40, 0x00C43E, false),
|
||||
new UniversalSingularityWrapper("zinc", "blockZinc", 76, 0xBFC55C, 0x939836)
|
||||
)),
|
||||
// Big Reactors Singularities
|
||||
@@ -73,7 +78,7 @@ public class CommonProxy
|
||||
// Draconic Evolution Singularities
|
||||
new UniversalSingularity("draconicEvolution", Arrays.asList(
|
||||
new UniversalSingularityWrapper("draconium", "blockDraconium", 89, 0x8E5CC0, 0x7C4AAE),
|
||||
new UniversalSingularityWrapper("draconiumAwakened", "blockDraconiumAwakened", 83, 0xFF7200, 0xFF6600)
|
||||
new UniversalSingularityWrapper("draconiumAwakened", "blockDraconiumAwakened", 83, 0xFF7200, 0xFF6600, false)
|
||||
)),
|
||||
// Ender IO Singularities
|
||||
new UniversalSingularity("enderIO", Arrays.asList(
|
||||
@@ -88,12 +93,12 @@ public class CommonProxy
|
||||
)),
|
||||
// ExtraPlanets Singularities
|
||||
new UniversalSingularity("extraPlanets", Arrays.asList(
|
||||
new UniversalSingularityWrapper("blueGem", "blockBlueGem", 95, 0x38D7FF, 0x03C6F6),
|
||||
new UniversalSingularityWrapper("carbon", "blockCarbon", 66, 0x1D1D1D, 0x0F0F0F),
|
||||
new UniversalSingularityWrapper("crystal", "blockCrystal", 78, 0xE2E2E2, 0xC1C1C1),
|
||||
new UniversalSingularityWrapper("palladium", "blockPalladium", 93, 0xF0F0F0, 0xE2E2E2),
|
||||
new UniversalSingularityWrapper("redGem", "blockRedGem", 68, 0xFF3B0C, 0xF93100),
|
||||
new UniversalSingularityWrapper("whiteGem", "blockWhiteGem", 70, 0xC6C6C6, 0xA5A5A5)
|
||||
new UniversalSingularityWrapper("blueGem", "blockBlueGem", 95, 0x38D7FF, 0x03C6F6, false),
|
||||
new UniversalSingularityWrapper("carbon", "blockCarbon", 66, 0x1D1D1D, 0x0F0F0F, false),
|
||||
new UniversalSingularityWrapper("crystal", "blockCrystal", 78, 0xE2E2E2, 0xC1C1C1, false),
|
||||
new UniversalSingularityWrapper("palladium", "blockPalladium", 93, 0xF0F0F0, 0xE2E2E2, false),
|
||||
new UniversalSingularityWrapper("redGem", "blockRedGem", 68, 0xFF3B0C, 0xF93100, false),
|
||||
new UniversalSingularityWrapper("whiteGem", "blockWhiteGem", 70, 0xC6C6C6, 0xA5A5A5, false)
|
||||
)),
|
||||
// ExtraTiC Singularities
|
||||
new UniversalSingularity("extraTiC", Arrays.asList(
|
||||
@@ -113,21 +118,21 @@ public class CommonProxy
|
||||
new UniversalSingularityWrapper("saltpeter", "blockSaltpeter", 71, 0xF0F0F0, 0xE1E1E1),
|
||||
new UniversalSingularityWrapper("sulfur", "blockSulfur", 66, 0xFFF200, 0xFCD703),
|
||||
//Alloys - Base
|
||||
new UniversalSingularityWrapper("angmallen", "blockAngmallen", 65, 0xE1D78A, 0xD6C761),
|
||||
new UniversalSingularityWrapper("damascusSteel", "blockDamascusSteel", 84, 0x996D4D, 0x583F2C),
|
||||
new UniversalSingularityWrapper("hepatizon", "blockHepatizon", 82, 0x755E75, 0x614E61),
|
||||
new UniversalSingularityWrapper("angmallen", "blockAngmallen", 65, 0xE1D78A, 0xD6C761, false),
|
||||
new UniversalSingularityWrapper("damascusSteel", "blockDamascusSteel", 84, 0x996D4D, 0x583F2C, false),
|
||||
new UniversalSingularityWrapper("hepatizon", "blockHepatizon", 82, 0x755E75, 0x614E61, false),
|
||||
//Alloys - Ender
|
||||
new UniversalSingularityWrapper("desichalkos", "blockDesichalkos", 88, 0x722FA8, 0x502176),
|
||||
new UniversalSingularityWrapper("desichalkos", "blockDesichalkos", 88, 0x722FA8, 0x502176, false),
|
||||
//Alloys - Fantasy
|
||||
new UniversalSingularityWrapper("blackSteel", "blockBlackSteel", 70, 0x395679, 0x314966),
|
||||
new UniversalSingularityWrapper("celenegil", "blockCelenegil", 81, 0x94CC48, 0x649128),
|
||||
new UniversalSingularityWrapper("haderoth", "blockHaderoth", 72, 0x77341E, 0x592817),
|
||||
new UniversalSingularityWrapper("quicksilver", "blockQuicksilver", 79, 0x7CD3C7, 0x2B8073),
|
||||
new UniversalSingularityWrapper("tartarite", "blockTartarite", 83, 0xAE3400, 0x792400),
|
||||
new UniversalSingularityWrapper("blackSteel", "blockBlackSteel", 70, 0x395679, 0x314966, false),
|
||||
new UniversalSingularityWrapper("celenegil", "blockCelenegil", 81, 0x94CC48, 0x649128, false),
|
||||
new UniversalSingularityWrapper("haderoth", "blockHaderoth", 72, 0x77341E, 0x592817, false),
|
||||
new UniversalSingularityWrapper("quicksilver", "blockQuicksilver", 79, 0x7CD3C7, 0x2B8073, false),
|
||||
new UniversalSingularityWrapper("tartarite", "blockTartarite", 83, 0xAE3400, 0x792400, false),
|
||||
//Alloys - Nether
|
||||
new UniversalSingularityWrapper("amordrine", "blockAmordrine", 68, 0xA98DB1, 0x8F6B9A),
|
||||
new UniversalSingularityWrapper("inolashite", "blockInolashite", 67, 0x40AA7D, 0x338864),
|
||||
new UniversalSingularityWrapper("shadowSteel", "blockShadowSteel", 77, 0x887362, 0x766354)
|
||||
new UniversalSingularityWrapper("amordrine", "blockAmordrine", 68, 0xA98DB1, 0x8F6B9A, false),
|
||||
new UniversalSingularityWrapper("inolashite", "blockInolashite", 67, 0x40AA7D, 0x338864, false),
|
||||
new UniversalSingularityWrapper("shadowSteel", "blockShadowSteel", 77, 0x887362, 0x766354, false)
|
||||
/*Important Note:
|
||||
* The Rest of the Metallurgy Singularities (That are Non-Utility and Non-Alloy) Can be Found if AOBD Singularities is Used.
|
||||
* For the Other Metallurgy Singularities to be Added, Use AOBD Singularities, with Metallurgy.
|
||||
@@ -146,7 +151,7 @@ public class CommonProxy
|
||||
new UniversalSingularityWrapper("ardite", "blockArdite", 86, 0xD24900, 0x960000),
|
||||
new UniversalSingularityWrapper("cobalt", "blockCobalt", 67, 0x2376DD, 0x023C9B),
|
||||
new UniversalSingularityWrapper("ender", "blockEnder", 74, 0x00B293, 0x00927C),
|
||||
new UniversalSingularityWrapper("glue", "blockGlue", 85, 0xDBD0D0, 0xCEBFBF),
|
||||
new UniversalSingularityWrapper("glue", "blockGlue", 85, 0xDBD0D0, 0xCEBFBF, false),
|
||||
new UniversalSingularityWrapper("manyullyn", "blockManyullyn", 73, 0xA97DE0, 0x926AC3)
|
||||
))
|
||||
/*Removed
|
||||
@@ -154,15 +159,17 @@ public class CommonProxy
|
||||
*/
|
||||
);
|
||||
final Configuration config = new Configuration(new File("." + separatorChar + "config" + separatorChar + "UniversalSingularities.cfg"));
|
||||
hideDisabledSingularities = config.get(Configuration.CATEGORY_GENERAL, "hideDisabledSingularitiesInNei", true).getBoolean() && Loader.isModLoaded("NotEnoughItems");
|
||||
universalSingularities.forEach(universalSingularity -> {
|
||||
if (config.get(universalSingularity.name, "enabled", true).getBoolean()) {
|
||||
universalSingularity.singularities.forEach(universalSingularityWrapper -> {
|
||||
if (config.get(universalSingularity.name, universalSingularityWrapper.name, true).getBoolean()) {
|
||||
for (int i = 0; i < universalSingularity.singularities.size(); i++) {
|
||||
final UniversalSingularityWrapper universalSingularityWrapper = universalSingularity.singularities.get(i);
|
||||
if (config.get(universalSingularity.name, universalSingularityWrapper.name, universalSingularityWrapper.enabled).getBoolean()) {
|
||||
if (!allowed.containsKey(universalSingularity.name))
|
||||
allowed.put(universalSingularity.name, new HashSet<>());
|
||||
allowed.get(universalSingularity.name).add(universalSingularityWrapper.name);
|
||||
}
|
||||
});
|
||||
}
|
||||
singularities.add(new UniversalSingularityItem(universalSingularity.name, universalSingularity.singularities));
|
||||
}
|
||||
});
|
||||
@@ -188,13 +195,15 @@ public class CommonProxy
|
||||
singularities.forEach(singularity -> {
|
||||
for (int i = 0; i < singularity.universalSingularities.size(); i++) {
|
||||
final UniversalSingularityWrapper universalSingularityWrapper = singularity.universalSingularities.get(i);
|
||||
if (allowed.get(singularity.name).contains(universalSingularityWrapper.name)) {
|
||||
if (allowed.containsKey(singularity.name) && allowed.get(singularity.name).contains(universalSingularityWrapper.name)) {
|
||||
final List<ItemStack> oreList = OreDictionary.getOres(universalSingularityWrapper.oreName, false);
|
||||
if (oreList != null && !oreList.isEmpty()) {
|
||||
CompressorManager.addOreRecipe(new ItemStack(singularity, 1, i), universalSingularityWrapper.recipeBaseValue, universalSingularityWrapper.oreName);
|
||||
Grinder.catalyst.getInput().add(new ItemStack(singularity, 1, i));
|
||||
}
|
||||
}
|
||||
} else if (hideDisabledSingularities)
|
||||
NEI.hide(new ItemStack(singularity, 1, i));
|
||||
} else if (hideDisabledSingularities)
|
||||
NEI.hide(new ItemStack(singularity, 1, i));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user