From 9c071a9d077a11865a83246152fffc8ea09e2666 Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Wed, 15 Apr 2020 16:05:25 -0400 Subject: [Update] Version 0.6.2 --- src/main/java/net/transit/type/TFluid.java | 33 ++++++++++++++++++++++ src/main/java/net/transit/type/TMana.java | 31 ++++++++++++++++++++ .../transit/type/group/simple/SimpleGroups.java | 21 ++++++++++---- .../java/net/transit/type/simple/SimpleTypes.java | 22 +++++++++++---- src/main/resources/fabric.mod.json | 2 +- 5 files changed, 97 insertions(+), 12 deletions(-) create mode 100644 src/main/java/net/transit/type/TFluid.java create mode 100644 src/main/java/net/transit/type/TMana.java (limited to 'src') diff --git a/src/main/java/net/transit/type/TFluid.java b/src/main/java/net/transit/type/TFluid.java new file mode 100644 index 0000000..fbceb0e --- /dev/null +++ b/src/main/java/net/transit/type/TFluid.java @@ -0,0 +1,33 @@ +package net.transit.type; + +import net.minecraft.fluid.Fluid; + +/** Units of fluid. + * @author Kyle Gunger + */ +public class TFluid { + private Fluid fluid; + private Number millibuckets; + + /** Constructor + * + * @param f Fluid stored (Water/Lava/etc.) + * @param ct Count of fluid (mB) + */ + public TFluid(Fluid f, Number mb) { + fluid = f; + millibuckets = mb; + } + + /** Get the fluid stored. + */ + public Fluid getFluid() { + return fluid; + } + + /** Get the millibuckets stored. + */ + public Number getMilliBuckets() { + return millibuckets; + } +} \ No newline at end of file diff --git a/src/main/java/net/transit/type/TMana.java b/src/main/java/net/transit/type/TMana.java new file mode 100644 index 0000000..3a60d52 --- /dev/null +++ b/src/main/java/net/transit/type/TMana.java @@ -0,0 +1,31 @@ +package net.transit.type; + +/** Units of mana. + * @author Kyle Gunger + */ +public class TMana { + private String type; + private Number count; + + /** Constructor + * + * @param t Type of mana (Fire/Water/Dark/Light/etc.) + * @param ct Count of mana + */ + public TMana(String t, Number ct) { + type = t; + count = ct; + } + + /** Get the mana type. + */ + public String getType() { + return type; + } + + /** Get the mana stored. + */ + public Number getCount() { + return count; + } +} diff --git a/src/main/java/net/transit/type/group/simple/SimpleGroups.java b/src/main/java/net/transit/type/group/simple/SimpleGroups.java index b4fcb76..f3e2ad2 100644 --- a/src/main/java/net/transit/type/group/simple/SimpleGroups.java +++ b/src/main/java/net/transit/type/group/simple/SimpleGroups.java @@ -1,16 +1,27 @@ package net.transit.type.group.simple; -import net.minecraft.fluid.Fluid; -import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.transit.type.group.GroupRegistry; import net.transit.type.group.TypeGroup; import net.transit.type.simple.SimpleTypes; +import net.transit.type.*; public final class SimpleGroups { + /** Transfers energy. Basic unit is TJoule (Transit Joule). + */ public static final TypeGroup ENERGY_GROUP = new TypeGroup(SimpleTypes.TransitJoule); - public static final TypeGroup MANA_GROUP = new TypeGroup(SimpleTypes.TransitMana); - public static final TypeGroup ITEM_GROUP = new TypeGroup(SimpleTypes.Item); - public static final TypeGroup FLUID_GROUP = new TypeGroup(SimpleTypes.Fluid); + + /** Transfers mana. Basic unit is TMana (Transit Mana). + */ + public static final TypeGroup MANA_GROUP = new TypeGroup(SimpleTypes.TransitMana); + + /** Transfers items. Basic type is ItemStack. + */ + public static final TypeGroup ITEM_GROUP = new TypeGroup(SimpleTypes.Item); + + /** Transfers fluids. Basic unit is TFluid. + */ + public static final TypeGroup FLUID_GROUP = new TypeGroup(SimpleTypes.Fluid); public static final void init() { diff --git a/src/main/java/net/transit/type/simple/SimpleTypes.java b/src/main/java/net/transit/type/simple/SimpleTypes.java index db839aa..cae234f 100644 --- a/src/main/java/net/transit/type/simple/SimpleTypes.java +++ b/src/main/java/net/transit/type/simple/SimpleTypes.java @@ -1,12 +1,22 @@ package net.transit.type.simple; -import net.minecraft.fluid.Fluid; -import net.minecraft.item.Item; -import net.transit.type.Type; +import net.minecraft.item.ItemStack; +import net.transit.type.*; public final class SimpleTypes { + /** Transfers energy. Energy is stored as a numeric, base value is TJoule (TransitJoule) + */ public static final Type TransitJoule = new Type("TJoule", "ENERGY"); - public static final Type TransitMana = new Type("TMana", "MANA"); - public static final Type Item = new Type("Item", "ITEM"); - public static final Type Fluid = new Type("Fluid", "FLUID"); + + /** Transfers mana. TMana stores mana count and type. + */ + public static final Type TransitMana = new Type("TMana", "MANA"); + + /** Transfers items in a itemstack. + */ + public static final Type Item = new Type("Item", "ITEM"); + + /** Transfers fluid. TFluid stores fluid and mB. + */ + public static final Type Fluid = new Type("Fluid", "FLUID"); } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 1a5136b..bca1407 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.5.1", + "version": "0.6.2", "name": "Transit API", "description": "General purpose API for transfering fluid, items, energy, anything.", -- cgit v1.2.3