From 6c42ba434288263f8c67a904a29dd6d7e2dd8f9d Mon Sep 17 00:00:00 2001 From: Robert S Date: Thu, 5 Jun 2014 00:10:37 -0400 Subject: [PATCH] Cleaned up gear packages moving a few things around --- .../mechanical/MultipartMechanical.java | 2 +- .../mechanical/gear/ConnectionLogic.java | 86 ------------------- .../mechanical/gear/GearNode.java | 1 + .../mechanical/gear/ItemGear.java | 1 + .../mechanical/gearshaft/GearShaftNode.java | 1 - .../mechanical/gearshaft/ItemGearShaft.java | 1 - .../{gear => gearshaft}/PartGearShaft.java | 4 +- .../mechanical/gearshaft/RenderGearShaft.java | 1 - .../mechanical/gearshaft/ShaftGrid.java | 12 --- .../mechanical/gearshaft/ShaftSubNode.java | 19 ---- 10 files changed, 4 insertions(+), 124 deletions(-) delete mode 100644 mechanical/src/main/scala/resonantinduction/mechanical/gear/ConnectionLogic.java rename mechanical/src/main/scala/resonantinduction/mechanical/{gear => gearshaft}/PartGearShaft.java (94%) delete mode 100644 mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ShaftGrid.java delete mode 100644 mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ShaftSubNode.java diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/MultipartMechanical.java b/mechanical/src/main/scala/resonantinduction/mechanical/MultipartMechanical.java index c5666a31..faaa308f 100644 --- a/mechanical/src/main/scala/resonantinduction/mechanical/MultipartMechanical.java +++ b/mechanical/src/main/scala/resonantinduction/mechanical/MultipartMechanical.java @@ -2,7 +2,7 @@ package resonantinduction.mechanical; import resonantinduction.mechanical.fluid.pipe.PartPipe; import resonantinduction.mechanical.gear.PartGear; -import resonantinduction.mechanical.gear.PartGearShaft; +import resonantinduction.mechanical.gearshaft.PartGearShaft; import codechicken.multipart.MultiPartRegistry; import codechicken.multipart.MultiPartRegistry.IPartFactory; import codechicken.multipart.MultipartGenerator; diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/ConnectionLogic.java b/mechanical/src/main/scala/resonantinduction/mechanical/gear/ConnectionLogic.java deleted file mode 100644 index b49d829c..00000000 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gear/ConnectionLogic.java +++ /dev/null @@ -1,86 +0,0 @@ -package resonantinduction.mechanical.gear; - -import java.util.HashMap; - -import net.minecraftforge.common.ForgeDirection; -import resonant.lib.utility.WorldUtility; -import universalelectricity.api.vector.Vector3; - -/** - * Used for testing. NO-OP - * - * @author Calclavia - * - */ -@Deprecated -public abstract class ConnectionLogic -{ - protected final Vector3 self; - - /** - * Relative coordinates of connections allowed. - */ - protected HashMap connections = new HashMap(); - - public ConnectionLogic(Vector3 self) - { - this.self = self; - } - - /** - * - * @param rotation - * @param other - * @param from - Incoming direction - * @return - */ - public boolean canConnect(ForgeDirection rotation, Vector3 other, ForgeDirection from) - { - Vector3 relative = other.clone().subtract(self); - Vector3 rotated = relative.clone(); - WorldUtility.rotateVectorFromDirection(rotated, rotation); - rotated = rotated.round(); - - Vector3 fromDir = new Vector3(from); - WorldUtility.rotateVectorFromDirection(fromDir, rotation); - fromDir = fromDir.round(); - - return connections.get(rotated) == fromDir.toForgeDirection(); - } - - /** - * By default, gears are facing UP, on the DOWN face. - */ - public static class ConnectionGearSmall extends ConnectionLogic - { - public ConnectionGearSmall(Vector3 self) - { - super(self); - - // Flat connection - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != ForgeDirection.UP) - { - connections.put(new Vector3(dir), dir); - connections.put(new Vector3(), dir.getOpposite()); - } - } - } - } - - public static class ConnectionGearLarge extends ConnectionLogic - { - public ConnectionGearLarge(Vector3 self) - { - super(self); - - // Flat connection and side connections - for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) - { - if (dir != ForgeDirection.UP) - connections.put(new Vector3(dir), dir); - } - } - } -} diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/GearNode.java b/mechanical/src/main/scala/resonantinduction/mechanical/gear/GearNode.java index aa2fbb57..0c2dd446 100644 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gear/GearNode.java +++ b/mechanical/src/main/scala/resonantinduction/mechanical/gear/GearNode.java @@ -5,6 +5,7 @@ import net.minecraftforge.common.ForgeDirection; import resonant.api.grid.INodeProvider; import resonantinduction.core.interfaces.IMechanicalNode; import resonantinduction.mechanical.energy.grid.MechanicalNode; +import resonantinduction.mechanical.gearshaft.PartGearShaft; import codechicken.lib.vec.Rotation; import codechicken.multipart.TMultiPart; import codechicken.multipart.TileMultipart; diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/ItemGear.java b/mechanical/src/main/scala/resonantinduction/mechanical/gear/ItemGear.java index ad4dcade..39a253e6 100644 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gear/ItemGear.java +++ b/mechanical/src/main/scala/resonantinduction/mechanical/gear/ItemGear.java @@ -8,6 +8,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import resonantinduction.core.prefab.part.IHighlight; +import resonantinduction.mechanical.gearshaft.PartGearShaft; import codechicken.lib.vec.BlockCoord; import codechicken.lib.vec.Vector3; import codechicken.microblock.FacePlacementGrid$; diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java index 5d9d2bc9..18fea18e 100644 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java +++ b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/GearShaftNode.java @@ -10,7 +10,6 @@ import resonant.api.grid.INodeProvider; import resonantinduction.core.interfaces.IMechanicalNode; import resonantinduction.mechanical.energy.grid.MechanicalNode; import resonantinduction.mechanical.gear.PartGear; -import resonantinduction.mechanical.gear.PartGearShaft; public class GearShaftNode extends MechanicalNode { diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java index 32f01b24..9bb97ff7 100644 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java +++ b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ItemGearShaft.java @@ -7,7 +7,6 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import resonantinduction.core.prefab.part.IHighlight; -import resonantinduction.mechanical.gear.PartGearShaft; import codechicken.lib.vec.BlockCoord; import codechicken.lib.vec.Vector3; import codechicken.multipart.JItemMultiPart; diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gear/PartGearShaft.java b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/PartGearShaft.java similarity index 94% rename from mechanical/src/main/scala/resonantinduction/mechanical/gear/PartGearShaft.java rename to mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/PartGearShaft.java index 42ce2aa4..c357370d 100644 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gear/PartGearShaft.java +++ b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/PartGearShaft.java @@ -1,4 +1,4 @@ -package resonantinduction.mechanical.gear; +package resonantinduction.mechanical.gearshaft; import java.util.Collection; import java.util.HashSet; @@ -8,8 +8,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.ForgeDirection; import resonantinduction.mechanical.Mechanical; import resonantinduction.mechanical.energy.grid.PartMechanical; -import resonantinduction.mechanical.gearshaft.GearShaftNode; -import resonantinduction.mechanical.gearshaft.RenderGearShaft; import codechicken.lib.raytracer.IndexedCuboid6; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Vector3; diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java index caa940bc..c998b606 100644 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java +++ b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/RenderGearShaft.java @@ -11,7 +11,6 @@ import org.lwjgl.opengl.GL11; import resonant.api.items.ISimpleItemRenderer; import resonant.lib.render.RenderUtility; import resonantinduction.core.Reference; -import resonantinduction.mechanical.gear.PartGearShaft; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ShaftGrid.java b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ShaftGrid.java deleted file mode 100644 index bd2f392e..00000000 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ShaftGrid.java +++ /dev/null @@ -1,12 +0,0 @@ -package resonantinduction.mechanical.gearshaft; - -import resonant.lib.grid.NodeGrid; - -public class ShaftGrid extends NodeGrid -{ - public ShaftGrid(ShaftSubNode node) - { - super(ShaftSubNode.class); - add(node); - } -} diff --git a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ShaftSubNode.java b/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ShaftSubNode.java deleted file mode 100644 index 5a1b7576..00000000 --- a/mechanical/src/main/scala/resonantinduction/mechanical/gearshaft/ShaftSubNode.java +++ /dev/null @@ -1,19 +0,0 @@ -package resonantinduction.mechanical.gearshaft; - -import resonant.api.grid.INodeProvider; -import resonant.lib.grid.Node; -import resonantinduction.mechanical.gear.PartGearShaft; - -public class ShaftSubNode extends Node -{ - public ShaftSubNode(PartGearShaft parent) - { - super(parent); - } - - @Override - protected ShaftGrid newGrid() - { - return new ShaftGrid(this); - } -}