ME Cables now attune to ME in stead of Items
This commit is contained in:
parent
d937a4e4e3
commit
8aa96bd426
|
@ -11,6 +11,7 @@ import appeng.api.config.TunnelType;
|
||||||
import appeng.api.definitions.Blocks;
|
import appeng.api.definitions.Blocks;
|
||||||
import appeng.api.definitions.Parts;
|
import appeng.api.definitions.Parts;
|
||||||
import appeng.api.features.IP2PTunnelRegistry;
|
import appeng.api.features.IP2PTunnelRegistry;
|
||||||
|
import appeng.api.util.AEColor;
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||||
|
@ -31,8 +32,10 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||||
addNewAttunement( new ItemStack( Block.redstoneComparatorIdle ), TunnelType.REDSTONE );
|
addNewAttunement( new ItemStack( Block.redstoneComparatorIdle ), TunnelType.REDSTONE );
|
||||||
addNewAttunement( new ItemStack( Block.redstoneRepeaterActive ), TunnelType.REDSTONE );
|
addNewAttunement( new ItemStack( Block.redstoneRepeaterActive ), TunnelType.REDSTONE );
|
||||||
addNewAttunement( new ItemStack( Block.redstoneRepeaterIdle ), TunnelType.REDSTONE );
|
addNewAttunement( new ItemStack( Block.redstoneRepeaterIdle ), TunnelType.REDSTONE );
|
||||||
|
addNewAttunement( new ItemStack( Block.daylightSensor ), TunnelType.REDSTONE );
|
||||||
addNewAttunement( new ItemStack( Block.redstoneWire ), TunnelType.REDSTONE );
|
addNewAttunement( new ItemStack( Block.redstoneWire ), TunnelType.REDSTONE );
|
||||||
addNewAttunement( new ItemStack( Block.blockRedstone ), TunnelType.REDSTONE );
|
addNewAttunement( new ItemStack( Block.blockRedstone ), TunnelType.REDSTONE );
|
||||||
|
addNewAttunement( new ItemStack( Block.lever ), TunnelType.REDSTONE );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* attune based on lots of random item related stuff
|
* attune based on lots of random item related stuff
|
||||||
|
@ -56,13 +59,21 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||||
addNewAttunement( new ItemStack( Item.bucketLava ), TunnelType.FLUID );
|
addNewAttunement( new ItemStack( Item.bucketLava ), TunnelType.FLUID );
|
||||||
addNewAttunement( new ItemStack( Item.bucketMilk ), TunnelType.FLUID );
|
addNewAttunement( new ItemStack( Item.bucketMilk ), TunnelType.FLUID );
|
||||||
addNewAttunement( new ItemStack( Item.bucketWater ), TunnelType.FLUID );
|
addNewAttunement( new ItemStack( Item.bucketWater ), TunnelType.FLUID );
|
||||||
|
|
||||||
|
for (AEColor c : AEColor.values())
|
||||||
|
{
|
||||||
|
addNewAttunement( Parts.partCableGlass.stack( c, 1 ), TunnelType.ME );
|
||||||
|
addNewAttunement( Parts.partCableCovered.stack( c, 1 ), TunnelType.ME );
|
||||||
|
addNewAttunement( Parts.partCableSmart.stack( c, 1 ), TunnelType.ME );
|
||||||
|
addNewAttunement( Parts.partCableDense.stack( c, 1 ), TunnelType.ME );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addNewAttunement(ItemStack trigger, TunnelType type)
|
public void addNewAttunement(ItemStack trigger, TunnelType type)
|
||||||
{
|
{
|
||||||
if ( type == null )
|
if ( type == null )
|
||||||
throw new RuntimeException( "Invalid Tunnel Type." );
|
return;
|
||||||
|
|
||||||
Tunnels.put( trigger, type );
|
Tunnels.put( trigger, type );
|
||||||
}
|
}
|
||||||
|
@ -75,7 +86,7 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
|
||||||
|
|
||||||
for (ItemStack is : Tunnels.keySet())
|
for (ItemStack is : Tunnels.keySet())
|
||||||
{
|
{
|
||||||
if ( Platform.isSameItemType( is, trigger ) )
|
if ( Platform.isSameItem( is, trigger ) )
|
||||||
return Tunnels.get( is );
|
return Tunnels.get( is );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue