From 5443704ab07bb39f81e3beff8ca5144169898530 Mon Sep 17 00:00:00 2001 From: tgame14 Date: Wed, 16 Apr 2014 16:11:39 +0300 Subject: [PATCH] Cleanup and adding comparator for sorting most probably target for IItemTransfer --- .../electrical/itemrailing/GridRailing.java | 19 +++++++++ .../itemrailing/ItemRailingTransfer.java | 8 ++-- .../electrical/itemrailing/PartRailing.java | 16 ++++---- .../itemrailing/PathfinderRailing.java | 40 ------------------- .../itemrailing/interfaces/IItemRailing.java | 10 +---- 5 files changed, 34 insertions(+), 59 deletions(-) delete mode 100644 electrical/src/main/scala/resonantinduction/electrical/itemrailing/PathfinderRailing.java diff --git a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/GridRailing.java b/electrical/src/main/scala/resonantinduction/electrical/itemrailing/GridRailing.java index 653b30326..f3b4eea3e 100644 --- a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/GridRailing.java +++ b/electrical/src/main/scala/resonantinduction/electrical/itemrailing/GridRailing.java @@ -1,6 +1,10 @@ package resonantinduction.electrical.itemrailing; import calclavia.lib.grid.NodeGrid; +import resonantinduction.electrical.itemrailing.interfaces.IItemRailing; +import resonantinduction.electrical.itemrailing.interfaces.IItemRailingTransfer; + +import java.util.Comparator; /** * @since 18/03/14 @@ -12,4 +16,19 @@ public class GridRailing extends NodeGrid { super(type); } + + public IItemRailing findTargetForIItemTransfer(IItemRailingTransfer itemRailingTransfer) + { + + } + + public static class ComparatorRailing implements Comparator + { + + @Override + public int compare(IItemRailing o1, IItemRailing o2) + { + return 0; + } + } } diff --git a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/ItemRailingTransfer.java b/electrical/src/main/scala/resonantinduction/electrical/itemrailing/ItemRailingTransfer.java index 00fed6b44..f95876cd6 100644 --- a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/ItemRailingTransfer.java +++ b/electrical/src/main/scala/resonantinduction/electrical/itemrailing/ItemRailingTransfer.java @@ -7,7 +7,7 @@ import resonantinduction.electrical.itemrailing.interfaces.IItemRailingTransfer; import calclavia.lib.render.EnumColor; /** - * An object that Transfers all + * An object that is a wrapper for all items through railings * * @since 16/03/14 * @author tgame14 @@ -16,7 +16,7 @@ public class ItemRailingTransfer implements IItemRailingTransfer { private ItemStack stack; private EnumColor color; - private PartRailing railing; + private IItemRailing railing; public ItemRailingTransfer(ItemStack stack, PartRailing railing) { @@ -49,13 +49,13 @@ public class ItemRailingTransfer implements IItemRailingTransfer } @Override - public PartRailing getRailing() + public IItemRailing getRailing() { return this.railing; } @Override - public IItemRailingTransfer setRailing(PartRailing railing) + public IItemRailingTransfer setRailing(IItemRailing railing) { this.railing = railing; return this; diff --git a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/PartRailing.java b/electrical/src/main/scala/resonantinduction/electrical/itemrailing/PartRailing.java index 4bf97fa5d..32f711de9 100644 --- a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/PartRailing.java +++ b/electrical/src/main/scala/resonantinduction/electrical/itemrailing/PartRailing.java @@ -17,6 +17,8 @@ import resonantinduction.electrical.itemrailing.interfaces.IItemRailing; import resonantinduction.electrical.itemrailing.interfaces.IItemRailingTransfer; import universalelectricity.api.energy.IConductor; import universalelectricity.api.energy.IEnergyNetwork; +import universalelectricity.api.vector.IVectorWorld; +import universalelectricity.api.vector.VectorWorld; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; @@ -28,7 +30,7 @@ import java.lang.reflect.InvocationTargetException; public class PartRailing extends PartFramedConnection implements IConductor, TSlottedPart, JNormalOcclusion, IHollowConnect, IItemRailing { - public enum EnumRailing + public static enum EnumRailing { DEFAULT, EXTENTION; } @@ -94,13 +96,13 @@ public class PartRailing extends PartFramedConnection getConnectedNodes (Pathfinder finder, Vector3 currentNode) - { - return null; - } - - @Override - public boolean onSearch (Pathfinder finder, Vector3 start, Vector3 currentNode) - { - return false; - } - } - - -} diff --git a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java b/electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java index 6a9969662..cac97191d 100644 --- a/electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java +++ b/electrical/src/main/scala/resonantinduction/electrical/itemrailing/interfaces/IItemRailing.java @@ -4,6 +4,7 @@ import calclavia.lib.grid.INodeProvider; import calclavia.lib.render.EnumColor; import net.minecraft.world.World; import net.minecraftforge.common.ForgeDirection; +import universalelectricity.api.vector.IVectorWorld; /** * implement on Part Railings. @@ -21,14 +22,7 @@ public interface IItemRailing extends INodeProvider public IItemRailing setRailingColor (EnumColor color); - /** an easy implementation for tiles / parts that already have this method in them */ - public World getWorldObj (); - - public int x (); - - public int y (); - - public int z (); + public IVectorWorld getWorldPos();