summaryrefslogtreecommitdiff
path: root/src/main/java/lance5057/tDefense/util/TDRegistry.java
diff options
context:
space:
mode:
authorLance5057 <lance5057@gmail.com>2018-05-21 20:40:35 -0500
committerLance5057 <lance5057@gmail.com>2018-05-21 20:40:35 -0500
commitcadbc53521f0966c69004b1c88b284c07ae2f42f (patch)
tree3dd2acfee3498958ce0c0da6f9c3ccfd3c131774 /src/main/java/lance5057/tDefense/util/TDRegistry.java
parenta12793585fc5c4c076cb499b43f0420b8a1f63fe (diff)
Attempting another overhaul for armor.
Changed mod name, new things to come!
Diffstat (limited to 'src/main/java/lance5057/tDefense/util/TDRegistry.java')
-rw-r--r--src/main/java/lance5057/tDefense/util/TDRegistry.java58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/main/java/lance5057/tDefense/util/TDRegistry.java b/src/main/java/lance5057/tDefense/util/TDRegistry.java
new file mode 100644
index 0000000..87fed5b
--- /dev/null
+++ b/src/main/java/lance5057/tDefense/util/TDRegistry.java
@@ -0,0 +1,58 @@
+package lance5057.tDefense.util;
+
+import java.util.Set;
+
+import com.google.common.collect.ImmutableSet;
+import com.google.common.collect.Sets;
+
+import gnu.trove.set.hash.TLinkedHashSet;
+import lance5057.tDefense.core.tools.bases.ArmorCore;
+import slimeknights.tconstruct.library.TinkerRegistry;
+import slimeknights.tconstruct.library.tinkering.PartMaterialType;
+import slimeknights.tconstruct.library.tools.IToolPart;
+import slimeknights.tconstruct.library.tools.ToolCore;
+
+public class TDRegistry {
+ private static final Set<ArmorCore> armor = new TLinkedHashSet<>();
+ private static final Set<IToolPart> armorParts = new TLinkedHashSet<>();
+ private static final Set<ArmorCore> armorStationCrafting = Sets.newLinkedHashSet();
+ private static final Set<ArmorCore> armorForgeCrafting = Sets.newLinkedHashSet();
+
+ public static void registerTool(ArmorCore tool) {
+ armor.add(tool);
+
+ for(PartMaterialType pmt : tool.getRequiredComponents()) {
+ for(IToolPart tp : pmt.getPossibleParts()) {
+ TinkerRegistry.registerToolPart(tp);
+ }
+ }
+ }
+
+ /** Adds a armor to the Crafting UI of both the armor Station as well as the armor Forge */
+ public static void registerArmorCrafting(ArmorCore armor) {
+ registerArmorStationCrafting(armor);
+ registerArmorForgeCrafting(armor);
+ }
+
+ /** Adds a armor to the Crafting UI of the armor Station */
+ public static void registerArmorStationCrafting(ArmorCore armor) {
+ armorStationCrafting.add(armor);
+ }
+
+ public static ImmutableSet<ArmorCore> getArmorStationCrafting() {
+ return ImmutableSet.copyOf(armorStationCrafting);
+ }
+
+ /** Adds a armor to the Crafting UI of the armor Forge */
+ public static void registerArmorForgeCrafting(ArmorCore armor) {
+ armorForgeCrafting.add(armor);
+ }
+
+ public static ImmutableSet<ArmorCore> getArmorForgeCrafting() {
+ return ImmutableSet.copyOf(armorForgeCrafting);
+ }
+
+ public static Set<ArmorCore> getArmor() {
+ return ImmutableSet.copyOf(armor);
+ }
+}