Fixed generic pipe connections

Was doing the connection checks wrong. Now its check for meta data if
the pipe uses the same class file for connections. Its should connection
to any generic pipe of its color and iron pipes. This should allow for
unique pipe networks for generic liquid types. This however will not
allow for a set liquid type filtering or transport.

Also in an earlier push i changed generic pipes to only move 1 bucket a
request but 3 request for non-generic pipes a request.
This commit is contained in:
Rseifert 2013-04-19 01:20:25 -04:00
parent 13c2f1fb6c
commit 299edd1f0f
2 changed files with 15 additions and 4 deletions

View file

@ -42,7 +42,16 @@ public class TileEntityGenericPipe extends TileEntityPipe
@Override
public boolean canPipeConnect(TileEntity entity, ForgeDirection dir)
{
return this.subEntities[dir.ordinal()] == null && entity.getClass().equals(this.getClass());
Vector3 vec = new Vector3(entity);
int meta = vec.getBlockMetadata(this.worldObj);
int blockID = vec.getBlockID(this.worldObj);
if (entity instanceof TileEntityPipe && blockID == this.getBlockType().blockID)
{
return meta == this.getBlockMetadata();
}
return super.canPipeConnect(entity, dir);
}
@Override

View file

@ -6,10 +6,12 @@ import net.minecraftforge.common.ForgeDirection;
public interface IPipeConnection
{
/**
* This method should only be used by pipe like objects to find if they can connect to this
* object
*
* @param entity - the pipe connecting to this object as a TileEntity instance
* @param dir - side connecting too
*
* @param ent - tileEntity trying to connect to this machine
* @param stack - liquid(s) it can accept. It will pass null if the connecting machine has no
* specific stack requirement
* @return true if it can connect
*/
public boolean canPipeConnect(TileEntity entity, ForgeDirection dir);