Massive package and class rework
This commit is contained in:
parent
92a0c5248f
commit
6feb886340
61 changed files with 167 additions and 229 deletions
|
@ -1,4 +1,4 @@
|
|||
package dark.library;
|
||||
package dark.core;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.logging.Logger;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api;
|
||||
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
|
@ -47,19 +47,5 @@ public enum ColorCode
|
|||
return NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* checks to see if the liquidStack is valid for the given color
|
||||
*/
|
||||
public boolean isValidLiquid(LiquidStack stack)
|
||||
{
|
||||
if (stack == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!FluidRestrictionHandler.hasRestrictedStack(this.ordinal()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return FluidRestrictionHandler.hasRestrictedStack(this.ordinal()) && FluidRestrictionHandler.getStackForColor(this).isLiquidEqual(stack);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api;
|
||||
|
||||
|
||||
public interface IColorCoded
|
|
@ -1,13 +1,13 @@
|
|||
package dark.faction.api;
|
||||
package dark.core.api.faction;
|
||||
|
||||
import dark.faction.core.FactionInstance;
|
||||
import dark.core.faction.FactionInstance;
|
||||
|
||||
public interface IFactionObject
|
||||
{
|
||||
/**
|
||||
* Gets the faction this is linked too. Will return Neutral rather than null
|
||||
*/
|
||||
public FactionInstance getFactinon();
|
||||
public FactionInstance getFaction();
|
||||
|
||||
public boolean setFaction(FactionInstance faction, boolean override);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.hydraulic;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
|
@ -1,6 +1,6 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.network;
|
||||
|
||||
import dark.hydraulic.network.TileNetwork;
|
||||
import dark.core.hydraulic.network.NetworkTileEntities;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public interface INetworkPart extends ITileConnector
|
||||
|
@ -18,10 +18,10 @@ public interface INetworkPart extends ITileConnector
|
|||
/**
|
||||
* Gets the networkPart's primary network
|
||||
*/
|
||||
public TileNetwork getTileNetwork();
|
||||
public NetworkTileEntities getTileNetwork();
|
||||
|
||||
/**
|
||||
* Sets the networkPart's primary network
|
||||
*/
|
||||
public void setTileNetwork(TileNetwork fluidNetwok);
|
||||
public void setTileNetwork(NetworkTileEntities fluidNetwok);
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.network;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
|
@ -1,5 +1,7 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.network.fluid;
|
||||
|
||||
import dark.core.api.IColorCoded;
|
||||
import dark.core.api.network.INetworkPart;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.network.fluid;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
|
@ -1,4 +1,6 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.presure;
|
||||
|
||||
import dark.core.api.network.ITileConnector;
|
||||
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.access.interfaces;
|
||||
package dark.core.api.terminal;
|
||||
|
||||
public interface IScroll
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.access.interfaces;
|
||||
package dark.core.api.terminal;
|
||||
|
||||
|
||||
import java.util.List;
|
|
@ -1,8 +1,9 @@
|
|||
package dark.library.access.interfaces;
|
||||
package dark.core.api.terminal;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface ITerminal extends ISpecialAccess, IScroll
|
||||
{
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.thermal;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.thermal;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.api.tools;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.faction.core;
|
||||
package dark.core.faction;
|
||||
|
||||
public class FactionCreationEvent
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.faction.core;
|
||||
package dark.core.faction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
@ -6,11 +6,11 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import dark.helpers.Pair;
|
||||
import dark.helpers.Time;
|
||||
import dark.library.access.AccessLevel;
|
||||
import dark.library.access.GlobalAccessManager;
|
||||
import dark.library.access.UserAccess;
|
||||
import dark.library.helpers.Pair;
|
||||
import dark.library.helpers.Time;
|
||||
|
||||
/**
|
||||
* Class used to track and manage a player/NPC faction
|
6
src/minecraft/dark/core/faction/FactionMain.java
Normal file
6
src/minecraft/dark/core/faction/FactionMain.java
Normal file
|
@ -0,0 +1,6 @@
|
|||
package dark.core.faction;
|
||||
|
||||
public class FactionMain
|
||||
{
|
||||
|
||||
}
|
|
@ -1,10 +1,10 @@
|
|||
package dark.faction.core;
|
||||
package dark.core.faction;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import dark.faction.api.IFactionObject;
|
||||
import dark.core.api.faction.IFactionObject;
|
||||
|
||||
public class FactionManager
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ public class FactionManager
|
|||
}
|
||||
if (entity instanceof IFactionObject)
|
||||
{
|
||||
return faction.isEqual(((IFactionObject) entity).getFactinon());
|
||||
return faction.isEqual(((IFactionObject) entity).getFaction());
|
||||
}
|
||||
return false;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package dark.faction.entity;
|
||||
package dark.core.faction.entity;
|
||||
|
||||
public enum CharStats
|
||||
{
|
|
@ -1,23 +1,21 @@
|
|||
package dark.faction.entity;
|
||||
package dark.core.faction.entity;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.entity.EntityCreature;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import dark.faction.api.IFactionObject;
|
||||
import dark.faction.core.FactionInstance;
|
||||
import dark.faction.core.FactionManager;
|
||||
import dark.core.api.faction.IFactionObject;
|
||||
import dark.core.faction.FactionInstance;
|
||||
import dark.core.faction.FactionManager;
|
||||
import dark.library.math.MathHelper;
|
||||
import dark.library.npc.IAdvancedNpc;
|
||||
|
||||
/**
|
||||
* NPC that simulate being players in an empire controlled environment
|
||||
*
|
||||
* @author Darkguardsman
|
||||
*/
|
||||
public class EntityNpc extends EntityCreature implements IAdvancedNpc, IFactionObject
|
||||
public class EntityNpc extends EntityCreature implements IFactionObject
|
||||
{
|
||||
protected Random random = new Random();
|
||||
|
||||
|
@ -73,17 +71,6 @@ public class EntityNpc extends EntityCreature implements IAdvancedNpc, IFactionO
|
|||
return 10 + this.getStat(CharStats.endurance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FactionInstance getFaction()
|
||||
{
|
||||
if(this.faction == null)
|
||||
{
|
||||
this.faction = FactionManager.loadFaction(this.factionName);
|
||||
}
|
||||
return this.faction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName()
|
||||
{
|
||||
return humanName;
|
||||
|
@ -106,7 +93,7 @@ public class EntityNpc extends EntityCreature implements IAdvancedNpc, IFactionO
|
|||
}
|
||||
|
||||
@Override
|
||||
public FactionInstance getFactinon()
|
||||
public FactionInstance getFaction()
|
||||
{
|
||||
if (this.faction == null || this.faction.isInvalid())
|
||||
{
|
|
@ -7,7 +7,7 @@
|
|||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package dark.hydraulic.helpers;
|
||||
package dark.core.hydraulic.helpers;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.helpers;
|
||||
package dark.core.hydraulic.helpers;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.api;
|
||||
package dark.core.hydraulic.helpers;
|
||||
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
import net.minecraftforge.liquids.LiquidDictionary;
|
||||
|
@ -8,6 +8,8 @@ import net.minecraftforge.liquids.LiquidStack;
|
|||
import com.google.common.collect.BiMap;
|
||||
import com.google.common.collect.HashBiMap;
|
||||
|
||||
import dark.core.api.ColorCode;
|
||||
|
||||
public class FluidRestrictionHandler
|
||||
{
|
||||
private static BiMap<ColorCode, LiquidStack> restrictedStacks = HashBiMap.create();
|
||||
|
@ -64,4 +66,19 @@ public class FluidRestrictionHandler
|
|||
{
|
||||
return restrictedStacks.get(color);
|
||||
}
|
||||
/**
|
||||
* checks to see if the liquidStack is valid for the given color
|
||||
*/
|
||||
public static boolean isValidLiquid(ColorCode color, LiquidStack stack)
|
||||
{
|
||||
if (stack == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(!FluidRestrictionHandler.hasRestrictedStack(color.ordinal()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return FluidRestrictionHandler.hasRestrictedStack(color.ordinal()) && FluidRestrictionHandler.getStackForColor(color).isLiquidEqual(stack);
|
||||
}
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
* 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
package dark.hydraulic.helpers;
|
||||
package dark.core.hydraulic.helpers;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -22,7 +22,7 @@ import net.minecraftforge.liquids.LiquidStack;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import dark.hydraulic.helpers.RenderEntityBlock.BlockInterface;
|
||||
import dark.core.hydraulic.helpers.RenderEntityBlock.BlockInterface;
|
||||
|
||||
/**
|
||||
*
|
|
@ -7,7 +7,7 @@
|
|||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package dark.hydraulic.helpers;
|
||||
package dark.core.hydraulic.helpers;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.helpers;
|
||||
package dark.core.hydraulic.helpers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
|
@ -1,16 +1,14 @@
|
|||
package dark.hydraulic.network;
|
||||
package dark.core.hydraulic.network;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import dark.hydraulic.api.ColorCode;
|
||||
import dark.hydraulic.api.INetworkFluidPart;
|
||||
import dark.hydraulic.api.INetworkPart;
|
||||
|
||||
import universalelectricity.core.vector.Vector2;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import dark.core.api.ColorCode;
|
||||
import dark.core.api.network.INetworkPart;
|
||||
import dark.core.api.network.fluid.INetworkFluidPart;
|
||||
import dark.core.hydraulic.network.fluid.NetworkFluidTiles;
|
||||
|
||||
/**
|
||||
* Side note: the network should act like this when done {@link http
|
||||
|
@ -20,10 +18,10 @@ import net.minecraftforge.liquids.LiquidStack;
|
|||
* @author Rseifert
|
||||
*
|
||||
*/
|
||||
public class ContainerNetwork extends FluidNetwork
|
||||
public class NetworkFluidContainers extends NetworkFluidTiles
|
||||
{
|
||||
|
||||
public ContainerNetwork(ColorCode color, INetworkPart... parts)
|
||||
public NetworkFluidContainers(ColorCode color, INetworkPart... parts)
|
||||
{
|
||||
super(color, parts);
|
||||
}
|
||||
|
@ -155,9 +153,9 @@ public class ContainerNetwork extends FluidNetwork
|
|||
}
|
||||
|
||||
@Override
|
||||
public void postMergeProcessing(TileNetwork network)
|
||||
public void postMergeProcessing(NetworkTileEntities network)
|
||||
{
|
||||
ContainerNetwork newNetwork = new ContainerNetwork(this.color);
|
||||
NetworkFluidContainers newNetwork = new NetworkFluidContainers(this.color);
|
||||
newNetwork.getNetworkMemebers().addAll(this.getNetworkMemebers());
|
||||
newNetwork.getNetworkMemebers().addAll(network.getNetworkMemebers());
|
||||
|
|
@ -1,26 +1,25 @@
|
|||
package dark.hydraulic.network;
|
||||
package dark.core.hydraulic.network;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import dark.hydraulic.api.INetworkPart;
|
||||
import dark.hydraulic.api.INetworkPipe;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.core.path.IPathCallBack;
|
||||
import universalelectricity.core.path.Pathfinder;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import dark.core.api.network.INetworkPart;
|
||||
import dark.core.api.network.fluid.INetworkPipe;
|
||||
|
||||
/**
|
||||
* Check if a conductor connects with another.
|
||||
*/
|
||||
public class PathfinderCheckerPipes extends Pathfinder
|
||||
public class NetworkPathFinder extends Pathfinder
|
||||
{
|
||||
public PathfinderCheckerPipes(final World world, final INetworkPart connectedBlockB, final INetworkPart splitPoint)
|
||||
public NetworkPathFinder(final World world, final INetworkPart connectedBlockB, final INetworkPart splitPoint)
|
||||
{
|
||||
super(new IPathCallBack()
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.network;
|
||||
package dark.core.hydraulic.network;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -11,14 +11,14 @@ import net.minecraft.world.World;
|
|||
import universalelectricity.core.path.Pathfinder;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import dark.hydraulic.api.INetworkPart;
|
||||
import dark.core.api.network.INetworkPart;
|
||||
|
||||
public class TileNetwork
|
||||
public class NetworkTileEntities
|
||||
{
|
||||
/* BLOCK THAT ACT AS FLUID CONVEYORS ** */
|
||||
public final List<INetworkPart> networkMember = new ArrayList<INetworkPart>();
|
||||
|
||||
public TileNetwork(INetworkPart... parts)
|
||||
public NetworkTileEntities(INetworkPart... parts)
|
||||
{
|
||||
this.networkMember.addAll(Arrays.asList(parts));
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ public class TileNetwork
|
|||
* @param network
|
||||
* @param part
|
||||
*/
|
||||
public void merge(TileNetwork network, INetworkPart part)
|
||||
public void merge(NetworkTileEntities network, INetworkPart part)
|
||||
{
|
||||
if (network != null && network != this && network.getClass().equals(this.getClass()))
|
||||
{
|
||||
|
@ -155,7 +155,7 @@ public class TileNetwork
|
|||
*
|
||||
* @return false if the merge needs to be canceled
|
||||
*/
|
||||
public boolean preMergeProcessing(TileNetwork network, INetworkPart part)
|
||||
public boolean preMergeProcessing(NetworkTileEntities network, INetworkPart part)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -164,9 +164,9 @@ public class TileNetwork
|
|||
* Finalizing the merge of two networks by creating the new network and importing all network
|
||||
* parts
|
||||
*/
|
||||
public void postMergeProcessing(TileNetwork network)
|
||||
public void postMergeProcessing(NetworkTileEntities network)
|
||||
{
|
||||
TileNetwork newNetwork = new TileNetwork();
|
||||
NetworkTileEntities newNetwork = new NetworkTileEntities();
|
||||
newNetwork.getNetworkMemebers().addAll(this.getNetworkMemebers());
|
||||
newNetwork.getNetworkMemebers().addAll(network.getNetworkMemebers());
|
||||
|
||||
|
@ -201,7 +201,7 @@ public class TileNetwork
|
|||
|
||||
if (connectedBlockA != connectedBlockB && connectedBlockB instanceof INetworkPart)
|
||||
{
|
||||
Pathfinder finder = new PathfinderCheckerPipes(world, (INetworkPart) connectedBlockB, splitPoint);
|
||||
Pathfinder finder = new NetworkPathFinder(world, (INetworkPart) connectedBlockB, splitPoint);
|
||||
finder.init(new Vector3(connectedBlockA));
|
||||
|
||||
if (finder.results.size() > 0)
|
||||
|
@ -222,7 +222,7 @@ public class TileNetwork
|
|||
else
|
||||
{
|
||||
/* NO LONGER CONNECTED ELSE WHERE SO SPLIT AND REFRESH */
|
||||
TileNetwork newNetwork = new TileNetwork();
|
||||
NetworkTileEntities newNetwork = new NetworkTileEntities();
|
||||
int parts = 0;
|
||||
for (Vector3 node : finder.closedSet)
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.network;
|
||||
package dark.core.hydraulic.network.fluid;
|
||||
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
|
@ -1,12 +1,13 @@
|
|||
package dark.hydraulic.network;
|
||||
package dark.core.hydraulic.network.fluid;
|
||||
|
||||
import dark.hydraulic.api.IDrain;
|
||||
import dark.hydraulic.api.INetworkPart;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import universalelectricity.core.vector.VectorHelper;
|
||||
import dark.core.api.hydraulic.IDrain;
|
||||
import dark.core.api.network.INetworkPart;
|
||||
import dark.core.hydraulic.network.NetworkTileEntities;
|
||||
|
||||
public class HydraulicNetworkHelper
|
||||
{
|
||||
|
@ -23,12 +24,12 @@ public class HydraulicNetworkHelper
|
|||
|
||||
if (checkTile instanceof INetworkPart)
|
||||
{
|
||||
TileNetwork network = ((INetworkPart) checkTile).getTileNetwork();
|
||||
NetworkTileEntities network = ((INetworkPart) checkTile).getTileNetwork();
|
||||
|
||||
if (network != null && network instanceof FluidNetwork)
|
||||
if (network != null && network instanceof NetworkFluidTiles)
|
||||
{
|
||||
network.removeEntity(tileEntity);
|
||||
for (ITankContainer tank : ((FluidNetwork) network).connectedTanks)
|
||||
for (ITankContainer tank : ((NetworkFluidTiles) network).connectedTanks)
|
||||
{
|
||||
if (tank instanceof IDrain)
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.network;
|
||||
package dark.core.hydraulic.network.fluid;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -7,7 +7,6 @@ import java.util.List;
|
|||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidContainerRegistry;
|
||||
import net.minecraftforge.liquids.LiquidDictionary;
|
||||
|
@ -15,13 +14,14 @@ import net.minecraftforge.liquids.LiquidStack;
|
|||
import net.minecraftforge.liquids.LiquidTank;
|
||||
import universalelectricity.core.path.Pathfinder;
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import dark.hydraulic.api.ColorCode;
|
||||
import dark.hydraulic.api.INetworkFluidPart;
|
||||
import dark.hydraulic.api.INetworkPart;
|
||||
import dark.hydraulic.helpers.FluidHelper;
|
||||
import dark.core.api.ColorCode;
|
||||
import dark.core.api.network.INetworkPart;
|
||||
import dark.core.api.network.fluid.INetworkFluidPart;
|
||||
import dark.core.hydraulic.helpers.FluidHelper;
|
||||
import dark.core.hydraulic.network.NetworkPathFinder;
|
||||
import dark.core.hydraulic.network.NetworkTileEntities;
|
||||
|
||||
public class FluidNetwork extends TileNetwork
|
||||
public class NetworkFluidTiles extends NetworkTileEntities
|
||||
{
|
||||
/* MACHINES THAT ARE FLUID BASED AND CONNECTED BUT NOT PART OF THE NETWORK ** */
|
||||
public final List<ITankContainer> connectedTanks = new ArrayList<ITankContainer>();
|
||||
|
@ -32,7 +32,7 @@ public class FluidNetwork extends TileNetwork
|
|||
public ColorCode color = ColorCode.NONE;
|
||||
protected boolean loadedLiquids = false;
|
||||
|
||||
public FluidNetwork(ColorCode color, INetworkPart... parts)
|
||||
public NetworkFluidTiles(ColorCode color, INetworkPart... parts)
|
||||
{
|
||||
super(parts);
|
||||
this.color = color;
|
||||
|
@ -210,7 +210,7 @@ public class FluidNetwork extends TileNetwork
|
|||
|
||||
if (connectedBlockA != connectedBlockB && connectedBlockB instanceof INetworkPart)
|
||||
{
|
||||
Pathfinder finder = new PathfinderCheckerPipes(world, (INetworkPart) connectedBlockB, splitPoint);
|
||||
Pathfinder finder = new NetworkPathFinder(world, (INetworkPart) connectedBlockB, splitPoint);
|
||||
finder.init(new Vector3(connectedBlockA));
|
||||
|
||||
if (finder.results.size() > 0)
|
||||
|
@ -231,7 +231,7 @@ public class FluidNetwork extends TileNetwork
|
|||
else
|
||||
{
|
||||
/* NO LONGER CONNECTED ELSE WHERE SO SPLIT AND REFRESH */
|
||||
PipeNetwork newNetwork = new PipeNetwork(this.color);
|
||||
NetworkPipes newNetwork = new NetworkPipes(this.color);
|
||||
int parts = 0;
|
||||
for (Vector3 node : finder.closedSet)
|
||||
{
|
||||
|
@ -257,11 +257,11 @@ public class FluidNetwork extends TileNetwork
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean preMergeProcessing(TileNetwork net, INetworkPart part)
|
||||
public boolean preMergeProcessing(NetworkTileEntities net, INetworkPart part)
|
||||
{
|
||||
if (net instanceof FluidNetwork && ((FluidNetwork) net).color == this.color)
|
||||
if (net instanceof NetworkFluidTiles && ((NetworkFluidTiles) net).color == this.color)
|
||||
{
|
||||
FluidNetwork network = (FluidNetwork) net;
|
||||
NetworkFluidTiles network = (NetworkFluidTiles) net;
|
||||
|
||||
this.balanceColletiveTank(true);
|
||||
network.balanceColletiveTank(true);
|
||||
|
@ -287,9 +287,9 @@ public class FluidNetwork extends TileNetwork
|
|||
}
|
||||
|
||||
@Override
|
||||
public void postMergeProcessing(TileNetwork network)
|
||||
public void postMergeProcessing(NetworkTileEntities network)
|
||||
{
|
||||
FluidNetwork newNetwork = new FluidNetwork(this.color);
|
||||
NetworkFluidTiles newNetwork = new NetworkFluidTiles(this.color);
|
||||
newNetwork.getNetworkMemebers().addAll(this.getNetworkMemebers());
|
||||
newNetwork.getNetworkMemebers().addAll(network.getNetworkMemebers());
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package dark.hydraulic.network;
|
||||
package dark.core.hydraulic.network.fluid;
|
||||
|
||||
|
||||
import java.util.HashMap;
|
||||
|
@ -10,10 +10,11 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import dark.hydraulic.api.ColorCode;
|
||||
import dark.hydraulic.api.INetworkPart;
|
||||
import dark.hydraulic.api.INetworkPipe;
|
||||
import dark.library.helpers.ConnectionHelper;
|
||||
import dark.core.api.ColorCode;
|
||||
import dark.core.api.network.INetworkPart;
|
||||
import dark.core.api.network.fluid.INetworkPipe;
|
||||
import dark.core.hydraulic.helpers.FluidRestrictionHandler;
|
||||
import dark.helpers.ConnectionHelper;
|
||||
|
||||
/**
|
||||
* Side note: the network should act like this when done {@link http
|
||||
|
@ -23,7 +24,7 @@ import dark.library.helpers.ConnectionHelper;
|
|||
* @author Rseifert
|
||||
*
|
||||
*/
|
||||
public class PipeNetwork extends FluidNetwork
|
||||
public class NetworkPipes extends NetworkFluidTiles
|
||||
{
|
||||
|
||||
/* MACHINES THAT USE THE PRESSURE SYSTEM TO DO WORK ** */
|
||||
|
@ -36,7 +37,7 @@ public class PipeNetwork extends FluidNetwork
|
|||
/* IS IT PROCESSING AN ADD LIQUID EVENT */
|
||||
private boolean processingRequest = false;
|
||||
|
||||
public PipeNetwork(ColorCode color, INetworkPart... parts)
|
||||
public NetworkPipes(ColorCode color, INetworkPart... parts)
|
||||
{
|
||||
super(color, parts);
|
||||
}
|
||||
|
@ -202,7 +203,7 @@ public class PipeNetwork extends FluidNetwork
|
|||
LiquidStack prevCombined = this.combinedStorage().getLiquid();
|
||||
LiquidStack stack = sta.copy();
|
||||
|
||||
if (!this.processingRequest && stack != null && color.isValidLiquid(stack))
|
||||
if (!this.processingRequest && stack != null && FluidRestrictionHandler.isValidLiquid(color,stack))
|
||||
{
|
||||
this.processingRequest = true;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library;
|
||||
package dark.core.power;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.helpers;
|
||||
package dark.helpers;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.helpers;
|
||||
package dark.helpers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.helpers;
|
||||
package dark.helpers;
|
||||
|
||||
/**
|
||||
* Used by machines that only rotate to 4 directions
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.helpers;
|
||||
package dark.helpers;
|
||||
|
||||
public class Pair<L, R>
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.helpers;
|
||||
package dark.helpers;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.helpers;
|
||||
package dark.helpers;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
|
@ -1 +0,0 @@
|
|||
Most of the workings of hydraulics is credited to universal electric and its creator Calclavia. hydraulics though is not a fully copy but a revised version of UE to function for Liquid Systems.
|
|
@ -1,15 +0,0 @@
|
|||
package dark.hydraulic;
|
||||
|
||||
public class INFO
|
||||
{
|
||||
/**
|
||||
* I would place a txt file here but the reob would just ignore it
|
||||
*
|
||||
* Anyways if you use the hydraulics system to make your mod more compatible with fluid
|
||||
* mechanics you only need the api file. However, if you wish to make your own pipes you need
|
||||
* the core folder as well. As well you will need to register your mod threw the Hydraulics
|
||||
* class to activate it.
|
||||
*
|
||||
*
|
||||
*/
|
||||
}
|
|
@ -12,7 +12,7 @@ import net.minecraft.world.World;
|
|||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import universalelectricity.core.vector.Vector3;
|
||||
import dark.library.DarkMain;
|
||||
import dark.core.DarkMain;
|
||||
|
||||
/**
|
||||
* Based off Thaumcraft's Beam Renderer.
|
||||
|
|
|
@ -5,7 +5,7 @@ import net.minecraft.client.gui.GuiButton;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import dark.library.DarkMain;
|
||||
import dark.core.DarkMain;
|
||||
|
||||
public class GuiButtonArrow extends GuiButton
|
||||
{
|
||||
|
|
|
@ -17,9 +17,9 @@ import org.lwjgl.opengl.GL11;
|
|||
import universalelectricity.core.vector.Vector2;
|
||||
import universalelectricity.prefab.GuiBase;
|
||||
import universalelectricity.prefab.vector.Region2;
|
||||
import dark.library.DarkMain;
|
||||
import dark.core.DarkMain;
|
||||
import dark.core.api.terminal.IScroll;
|
||||
import dark.library.access.UserAccess;
|
||||
import dark.library.access.interfaces.IScroll;
|
||||
|
||||
public class GuiGlobalList extends GuiBase implements IScroll
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import calclavia.lib.TileEntityUniversalRunnable;
|
||||
import dark.library.PowerSystems;
|
||||
import dark.core.power.PowerSystems;
|
||||
|
||||
public class TileEntityRunnableMachine extends TileEntityUniversalRunnable
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
|
|||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import dark.library.helpers.Pair;
|
||||
import dark.helpers.Pair;
|
||||
|
||||
/**
|
||||
* Rewrite of the imprinter crafting system into its own manageable class
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.terminal;
|
||||
package dark.library.machine.terminal;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
|
@ -1,4 +1,4 @@
|
|||
package dark.library.terminal;
|
||||
package dark.library.machine.terminal;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
|
@ -20,12 +20,12 @@ import com.google.common.io.ByteArrayDataInput;
|
|||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.network.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.Player;
|
||||
import dark.core.api.terminal.ISpecialAccess;
|
||||
import dark.core.api.terminal.ITerminal;
|
||||
import dark.library.access.AccessLevel;
|
||||
import dark.library.access.UserAccess;
|
||||
import dark.library.access.interfaces.ISpecialAccess;
|
||||
import dark.library.access.interfaces.ITerminal;
|
||||
import dark.library.machine.TileEntityRunnableMachine;
|
||||
import dark.library.terminal.commands.CommandRegistry;
|
||||
import dark.library.machine.terminal.commands.CommandRegistry;
|
||||
|
||||
/**
|
||||
*
|
|
@ -1,12 +1,12 @@
|
|||
package dark.library.terminal.commands;
|
||||
package dark.library.machine.terminal.commands;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import dark.library.access.interfaces.ISpecialAccess;
|
||||
import dark.library.access.interfaces.ITerminal;
|
||||
import dark.core.api.terminal.ISpecialAccess;
|
||||
import dark.core.api.terminal.ITerminal;
|
||||
|
||||
public class CommandHelp extends TerminalCommand
|
||||
{
|
|
@ -1,11 +1,11 @@
|
|||
package dark.library.terminal.commands;
|
||||
package dark.library.machine.terminal.commands;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import dark.library.access.interfaces.ITerminal;
|
||||
import dark.core.api.terminal.ITerminal;
|
||||
/**
|
||||
*
|
||||
* @author Calclavia, DarkGuardsman
|
|
@ -1,12 +1,12 @@
|
|||
package dark.library.terminal.commands;
|
||||
package dark.library.machine.terminal.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import dark.core.api.terminal.ISpecialAccess;
|
||||
import dark.core.api.terminal.ITerminal;
|
||||
import dark.library.access.AccessLevel;
|
||||
import dark.library.access.interfaces.ISpecialAccess;
|
||||
import dark.library.access.interfaces.ITerminal;
|
||||
|
||||
public class CommandUser extends TerminalCommand
|
||||
{
|
|
@ -1,11 +1,11 @@
|
|||
package dark.library.terminal.commands;
|
||||
package dark.library.machine.terminal.commands;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import dark.library.access.interfaces.ISpecialAccess;
|
||||
import dark.library.access.interfaces.ITerminal;
|
||||
import dark.core.api.terminal.ISpecialAccess;
|
||||
import dark.core.api.terminal.ITerminal;
|
||||
/**
|
||||
*
|
||||
* @author Calclavia, DarkGuardsman
|
|
@ -1,11 +0,0 @@
|
|||
package dark.library.npc;
|
||||
|
||||
import dark.faction.core.FactionInstance;
|
||||
import net.minecraft.entity.INpc;
|
||||
|
||||
public interface IAdvancedNpc extends INpc
|
||||
{
|
||||
public FactionInstance getFaction();
|
||||
|
||||
public String getName();
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
TASK: Collection
|
||||
From: tile.chest ore
|
||||
To: tile.furnace 0
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
package dark.library.npc;
|
||||
|
||||
import universalelectricity.prefab.TranslationHelper;
|
||||
|
||||
public enum TaskGroup
|
||||
{
|
||||
/* Collection of items for ground or inventories */
|
||||
COLLECTION("collection"),
|
||||
/* Defence of an area from NPCs or Players */
|
||||
DEFENCE("Guardsman"),
|
||||
/* Attack of an area against NPCs or Players */
|
||||
OFFENCE("Soldier"),
|
||||
/* Creation or repair of items/blocks */
|
||||
CRAFTING("Crafter");
|
||||
|
||||
public String unlocalizedName;
|
||||
|
||||
private TaskGroup(String name)
|
||||
{
|
||||
this.unlocalizedName = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the localized name of a task for GUIs/etc
|
||||
*/
|
||||
public String getLocalizedName()
|
||||
{
|
||||
return TranslationHelper.getLocal("npc.task." + this.unlocalizedName);
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ import java.util.HashMap;
|
|||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import dark.library.helpers.Pair;
|
||||
import dark.helpers.Pair;
|
||||
import dark.library.math.LinearAlg;
|
||||
import dark.library.math.Quaternion;
|
||||
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package dark.hydraulic.prefab.tile;
|
||||
|
||||
package dark.prefab.tile.fluid;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import dark.hydraulic.api.IReadOut;
|
||||
import dark.hydraulic.api.ITileConnector;
|
||||
import dark.hydraulic.network.HydraulicNetworkHelper;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import universalelectricity.prefab.tile.TileEntityAdvanced;
|
||||
import dark.core.api.network.ITileConnector;
|
||||
import dark.core.api.tools.IReadOut;
|
||||
import dark.core.hydraulic.network.fluid.HydraulicNetworkHelper;
|
||||
|
||||
public abstract class TileEntityFluidDevice extends TileEntityAdvanced implements IReadOut, ITileConnector
|
||||
{
|
|
@ -1,7 +1,5 @@
|
|||
package dark.hydraulic.prefab.tile;
|
||||
package dark.prefab.tile.fluid;
|
||||
|
||||
import dark.hydraulic.api.IColorCoded;
|
||||
import dark.hydraulic.helpers.FluidHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -12,6 +10,9 @@ import net.minecraftforge.liquids.LiquidContainerRegistry;
|
|||
import net.minecraftforge.liquids.LiquidDictionary;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidTank;
|
||||
import dark.core.api.IColorCoded;
|
||||
import dark.core.hydraulic.helpers.FluidHelper;
|
||||
import dark.core.hydraulic.helpers.FluidRestrictionHandler;
|
||||
|
||||
public abstract class TileEntityFluidStorage extends TileEntityFluidDevice implements ITankContainer, IColorCoded
|
||||
{
|
||||
|
@ -56,7 +57,7 @@ public abstract class TileEntityFluidStorage extends TileEntityFluidDevice imple
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
else if (!getColor().isValidLiquid(resource))
|
||||
else if (!FluidRestrictionHandler.isValidLiquid(getColor(),resource))
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue