summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gradle.properties2
-rw-r--r--src/main/java/net/corechg/transit/type/group/GroupRegistry.java15
-rw-r--r--src/main/resources/fabric.mod.json2
3 files changed, 13 insertions, 6 deletions
diff --git a/gradle.properties b/gradle.properties
index 3e1cb60..7002a70 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.8.2+build.194
# Mod Properties
- mod_version = 0.11.3
+ mod_version = 0.11.4
maven_group = net.transit
archives_base_name = transit-api
diff --git a/src/main/java/net/corechg/transit/type/group/GroupRegistry.java b/src/main/java/net/corechg/transit/type/group/GroupRegistry.java
index 3929973..0b04913 100644
--- a/src/main/java/net/corechg/transit/type/group/GroupRegistry.java
+++ b/src/main/java/net/corechg/transit/type/group/GroupRegistry.java
@@ -30,20 +30,27 @@ public class GroupRegistry {
return true;
}
- public static final TypeGroup<?> groupByID(String groupID)
+ @SuppressWarnings("unchecked")
+ public static final <T> TypeGroup<T> groupByID(String groupID)
{
for(TypeGroup<?> g : GROUPS)
{
- if(g.getGroup().equals(groupID)) return g;
+ if(g.getGroup().equals(groupID)){
+ try{
+ return (TypeGroup<T>) g;
+ }catch(ClassCastException e) {
+ return null;
+ }
+ }
}
return null;
}
- public static final Type<?> typeByIdentity(String groupID, String typeID)
+ public static final <T> Type<T> typeByIdentity(String groupID, String typeID)
{
- return groupByID(groupID).getType(typeID);
+ return GroupRegistry.<T>groupByID(groupID).getType(typeID);
}
}
diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json
index d5986f2..d54a617 100644
--- a/src/main/resources/fabric.mod.json
+++ b/src/main/resources/fabric.mod.json
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "transit-api",
- "version": "0.11.3",
+ "version": "0.11.4",
"name": "Transit API",
"description": "Move about!",