Covered dense cables (#3030)
* Renamed all dense smart cable related things to include smart * Added dense covered cables * Added abstract PartDenseCable to reduce redundant code * Added dense covered recipes * Ensures ItemPart ordering to be consitent. Now takes the metadata into account to preserve the ordering for colored items instead of just the part type name and depend on the insertion order of a hashmap.
This commit is contained in:
@@ -128,9 +128,13 @@ public class PartCable extends AEBasePart implements IPartCable
|
||||
{
|
||||
newPart = parts.cableSmart().stack( newColor, 1 );
|
||||
}
|
||||
else if( this.getCableConnectionType() == AECableType.DENSE_COVERED )
|
||||
{
|
||||
newPart = parts.cableDenseCovered().stack( newColor, 1 );
|
||||
}
|
||||
else if( this.getCableConnectionType() == AECableType.DENSE_SMART )
|
||||
{
|
||||
newPart = parts.cableDense().stack( newColor, 1 );
|
||||
newPart = parts.cableDenseSmart().stack( newColor, 1 );
|
||||
}
|
||||
|
||||
boolean hasPermission = true;
|
||||
|
||||
@@ -36,7 +36,7 @@ import appeng.helpers.Reflected;
|
||||
import appeng.util.Platform;
|
||||
|
||||
|
||||
public class PartDenseCable extends PartCable
|
||||
public abstract class PartDenseCable extends PartCable
|
||||
{
|
||||
@Reflected
|
||||
public PartDenseCable( final ItemStack is )
|
||||
@@ -52,12 +52,6 @@ public class PartDenseCable extends PartCable
|
||||
return BusSupport.DENSE_CABLE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType()
|
||||
{
|
||||
return AECableType.DENSE_SMART;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBoxes( final IPartCollisionHelper bch )
|
||||
{
|
||||
@@ -135,25 +129,16 @@ public class PartDenseCable extends PartCable
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isSmart( final AEPartLocation of )
|
||||
{
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( this.getTile().getPos().offset( of.getFacing() ) );
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.SMART;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isDense( final AEPartLocation of )
|
||||
{
|
||||
final TileEntity te = this.getTile().getWorld().getTileEntity( this.getTile().getPos().offset( of.getFacing() ) );
|
||||
|
||||
if( te instanceof IGridHost )
|
||||
{
|
||||
final AECableType t = ( (IGridHost) te ).getCableConnectionType( of.getOpposite() );
|
||||
return t == AECableType.DENSE_SMART;
|
||||
return t == AECableType.DENSE_COVERED || t == AECableType.DENSE_SMART;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.parts.networking;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.util.AECableType;
|
||||
|
||||
|
||||
public class PartDenseCableCovered extends PartDenseCable
|
||||
{
|
||||
|
||||
public PartDenseCableCovered( ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType()
|
||||
{
|
||||
return AECableType.DENSE_COVERED;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.parts.networking;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.util.AECableType;
|
||||
|
||||
|
||||
public class PartDenseCableSmart extends PartDenseCable
|
||||
{
|
||||
|
||||
public PartDenseCableSmart( ItemStack is )
|
||||
{
|
||||
super( is );
|
||||
}
|
||||
|
||||
@Override
|
||||
public AECableType getCableConnectionType()
|
||||
{
|
||||
return AECableType.DENSE_SMART;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user