summaryrefslogtreecommitdiff
path: root/src/main/java/net/cshift
diff options
context:
space:
mode:
authorKyle Gunger <kgunger12@gmail.com>2021-01-22 21:10:46 -0500
committerKyle Gunger <kgunger12@gmail.com>2021-01-22 21:11:32 -0500
commitb0f364399bfaa952c8692925efda9ffdf2fbd75e (patch)
treea7e3ddb9ec8f74d6de1173c58af4cf576fcc4305 /src/main/java/net/cshift
parentd45be1d289816e0262e0872d4b06b09208e82153 (diff)
1.0.0
Diffstat (limited to 'src/main/java/net/cshift')
-rw-r--r--src/main/java/net/cshift/transit/basic/system/AbstractSystem.java13
-rw-r--r--src/main/java/net/cshift/transit/basic/system/AbstractSystemNode.java12
-rw-r--r--src/main/java/net/cshift/transit/type/Type.java15
3 files changed, 8 insertions, 32 deletions
diff --git a/src/main/java/net/cshift/transit/basic/system/AbstractSystem.java b/src/main/java/net/cshift/transit/basic/system/AbstractSystem.java
deleted file mode 100644
index ef6254c..0000000
--- a/src/main/java/net/cshift/transit/basic/system/AbstractSystem.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package net.cshift.transit.basic.system;
-
-import net.cshift.transit.network.system.*;
-
-public abstract class AbstractSystem implements ISystem {
-
- @Override
- public INode[] getNodes() {
- // TODO Auto-generated method stub
- return null;
- }
-
-}
diff --git a/src/main/java/net/cshift/transit/basic/system/AbstractSystemNode.java b/src/main/java/net/cshift/transit/basic/system/AbstractSystemNode.java
deleted file mode 100644
index a246588..0000000
--- a/src/main/java/net/cshift/transit/basic/system/AbstractSystemNode.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package net.cshift.transit.basic.system;
-
-import net.cshift.transit.basic.*;
-import net.minecraft.block.entity.*;
-
-public abstract class AbstractSystemNode extends AbstractNode {
-
- public AbstractSystemNode(BlockEntityType<?> type) {
- super(type);
- }
-
-}
diff --git a/src/main/java/net/cshift/transit/type/Type.java b/src/main/java/net/cshift/transit/type/Type.java
index 586a891..2ea5bf4 100644
--- a/src/main/java/net/cshift/transit/type/Type.java
+++ b/src/main/java/net/cshift/transit/type/Type.java
@@ -11,6 +11,7 @@ public class Type<T>
protected final String typeID;
protected final String groupID;
+ // Should not override, but you can if you must
public Type(String tID, String gID)
{
typeID = tID;
@@ -129,7 +130,7 @@ public class Type<T>
* @param data The data to convert
* @return The data formatted in this type
*/
- public T convertFrom(Type<T> from, String group, T data) {
+ public T convertFrom(Type<T> from, T data, String group) {
return this.fromBase(from.toBase(data, group), group);
}
@@ -140,7 +141,7 @@ public class Type<T>
* @return The data formatted in this type
*/
public final T convertFrom(Type<T> from, T data) {
- return convertFrom(from, from.groupID, data);
+ return convertFrom(from, data, from.groupID);
}
/** Convert a packet using another type to a packet using this type within the given group.
@@ -150,7 +151,7 @@ public class Type<T>
* @return The new packet formatted in this type
*/
public final IStaticPacket<T> convertFrom(IStaticPacket<T> packet, String group) {
- return new StaticPacket<T>(convertFrom(packet.getType(), group, packet.getData()), this);
+ return new StaticPacket<T>(convertFrom(packet.getType(), packet.getData(), group), this);
}
/** Convert a packet using another type to a packet using this type within the default group.
@@ -175,8 +176,8 @@ public class Type<T>
* @param data The data to convert
* @return The data formatted in this type
*/
- public final T convertTo(Type<T> to, String group, T data) {
- return to.convertFrom(this, group, data);
+ public final T convertTo(Type<T> to, T data, String group) {
+ return to.convertFrom(this, data, group);
}
/** Convert data from this type to another type in the default group.
@@ -186,7 +187,7 @@ public class Type<T>
* @return The data formatted in this type
*/
public final T convertTo(Type<T> to, T data) {
- return to.convertFrom(this, groupID, data);
+ return to.convertFrom(this, data, this.groupID);
}
/** Convert a packet using this type to a packet using another type within the given group.
@@ -205,7 +206,7 @@ public class Type<T>
* @return The new packet formatted in this type
*/
public final IStaticPacket<T> convertTo(Type<T> to, IStaticPacket<T> packet) {
- return to.convertFrom(packet, groupID);
+ return to.convertFrom(packet, this.groupID);
}