From 1f94ea0af4d818c174ab6d7617ba891831a73203 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Fri, 22 Nov 2019 21:56:36 -0500 Subject: [Update] version 0.4.3 ~ Change InitSimpleGroups to SimpleGroups + Add a way to set the node data (mostly for systems) Signed-off-by: Kyle Gunger --- src/main/java/net/transit/InitTransit.java | 4 ++-- src/main/java/net/transit/network/system/Node.java | 9 +++++++++ .../transit/network/system/swap/AcceptorNode.java | 2 +- .../type/group/simple/InitSimpleGroups.java | 22 ---------------------- .../transit/type/group/simple/SimpleGroups.java | 22 ++++++++++++++++++++++ 5 files changed, 34 insertions(+), 25 deletions(-) delete mode 100644 src/main/java/net/transit/type/group/simple/InitSimpleGroups.java create mode 100644 src/main/java/net/transit/type/group/simple/SimpleGroups.java diff --git a/src/main/java/net/transit/InitTransit.java b/src/main/java/net/transit/InitTransit.java index a89f91a..a137040 100644 --- a/src/main/java/net/transit/InitTransit.java +++ b/src/main/java/net/transit/InitTransit.java @@ -1,13 +1,13 @@ package net.transit; import net.fabricmc.api.ModInitializer; -import net.transit.type.group.simple.InitSimpleGroups; +import net.transit.type.group.simple.SimpleGroups; public class InitTransit implements ModInitializer { @Override public void onInitialize() { - InitSimpleGroups.init(); + SimpleGroups.init(); } } diff --git a/src/main/java/net/transit/network/system/Node.java b/src/main/java/net/transit/network/system/Node.java index 9ab9812..6a661f3 100644 --- a/src/main/java/net/transit/network/system/Node.java +++ b/src/main/java/net/transit/network/system/Node.java @@ -28,6 +28,15 @@ public interface Node */ public Object getData(String groupID); + + /** Set the group data for the node + * + * @param dat + * @param groupID + */ + public void setData(Object dat, String groupID); + + /** Get the nodes that this node is connected to * * @return Node[] diff --git a/src/main/java/net/transit/network/system/swap/AcceptorNode.java b/src/main/java/net/transit/network/system/swap/AcceptorNode.java index 69c07e7..2dfd7a5 100644 --- a/src/main/java/net/transit/network/system/swap/AcceptorNode.java +++ b/src/main/java/net/transit/network/system/swap/AcceptorNode.java @@ -12,7 +12,7 @@ public interface AcceptorNode extends Node * @param group * @return */ - public boolean linkProvider(Node requestor, String group); + public boolean linkProvider(Node requester, String group); /** Unlink a provider from the acceptor diff --git a/src/main/java/net/transit/type/group/simple/InitSimpleGroups.java b/src/main/java/net/transit/type/group/simple/InitSimpleGroups.java deleted file mode 100644 index 50a268a..0000000 --- a/src/main/java/net/transit/type/group/simple/InitSimpleGroups.java +++ /dev/null @@ -1,22 +0,0 @@ -package net.transit.type.group.simple; - -import net.minecraft.block.FluidBlock; -import net.minecraft.item.Item; -import net.transit.type.group.GroupRegistry; -import net.transit.type.group.TypeGroup; -import net.transit.type.simple.SimpleTypes; - -public final class InitSimpleGroups { - public static final TypeGroup ENERGY_GROUP = new TypeGroup(SimpleTypes.ENERGY); - public static final TypeGroup MANA_GROUP = new TypeGroup(SimpleTypes.MANA); - public static final TypeGroup ITEM_GROUP = new TypeGroup(SimpleTypes.ITEM); - public static final TypeGroup FLUID_GROUP = new TypeGroup(SimpleTypes.FLUID); - - public static final void init() - { - GroupRegistry.addGroup(ENERGY_GROUP); - GroupRegistry.addGroup(MANA_GROUP); - GroupRegistry.addGroup(ITEM_GROUP); - GroupRegistry.addGroup(FLUID_GROUP); - } -} diff --git a/src/main/java/net/transit/type/group/simple/SimpleGroups.java b/src/main/java/net/transit/type/group/simple/SimpleGroups.java new file mode 100644 index 0000000..eb45a36 --- /dev/null +++ b/src/main/java/net/transit/type/group/simple/SimpleGroups.java @@ -0,0 +1,22 @@ +package net.transit.type.group.simple; + +import net.minecraft.block.FluidBlock; +import net.minecraft.item.Item; +import net.transit.type.group.GroupRegistry; +import net.transit.type.group.TypeGroup; +import net.transit.type.simple.SimpleTypes; + +public final class SimpleGroups { + public static final TypeGroup ENERGY_GROUP = new TypeGroup(SimpleTypes.ENERGY); + public static final TypeGroup MANA_GROUP = new TypeGroup(SimpleTypes.MANA); + public static final TypeGroup ITEM_GROUP = new TypeGroup(SimpleTypes.ITEM); + public static final TypeGroup FLUID_GROUP = new TypeGroup(SimpleTypes.FLUID); + + public static final void init() + { + GroupRegistry.addGroup(ENERGY_GROUP); + GroupRegistry.addGroup(MANA_GROUP); + GroupRegistry.addGroup(ITEM_GROUP); + GroupRegistry.addGroup(FLUID_GROUP); + } +} -- cgit v1.2.3