fixed typo gtceu -> gteu

This commit is contained in:
PrototypeTrousers
2022-02-22 22:37:28 -03:00
parent c3dd6dabe1
commit fd95d3de47
19 changed files with 460 additions and 480 deletions
@@ -29,7 +29,7 @@ public enum PowerUnits
AE( "gui.appliedenergistics2.units.appliedenergstics" ), // Native Units - AE Energy AE( "gui.appliedenergistics2.units.appliedenergstics" ), // Native Units - AE Energy
EU( "gui.appliedenergistics2.units.ic2" ), // IndustrialCraft 2 - Energy Units EU( "gui.appliedenergistics2.units.ic2" ), // IndustrialCraft 2 - Energy Units
RF( "gui.appliedenergistics2.units.rf" ), // RF - Redstone Flux RF( "gui.appliedenergistics2.units.rf" ), // RF - Redstone Flux
GTCEU( "gui.appliedenergistics2.units.gtceu" ); // RF - Redstone Flux GTEU( "gui.appliedenergistics2.units.gteu" ); // RF - Redstone Flux
/** /**
* unlocalized name for the power unit. * unlocalized name for the power unit.
@@ -47,14 +47,13 @@ public enum PowerUnits
/** /**
* do power conversion using AE's conversion rates. * do power conversion using AE's conversion rates.
* * <p>
* Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 ); * Example: PowerUnits.EU.convertTo( PowerUnits.AE, 32 );
* * <p>
* will normally returns 64, as it will convert the EU, to AE with AE's power settings. * will normally returns 64, as it will convert the EU, to AE with AE's power settings.
* *
* @param target target power unit * @param target target power unit
* @param value value * @param value value
*
* @return value converted to target units, from this units. * @return value converted to target units, from this units.
*/ */
public double convertTo( final PowerUnits target, final double value ) public double convertTo( final PowerUnits target, final double value )
@@ -29,7 +29,7 @@ public enum TunnelType
ME, // Network Tunnel ME, // Network Tunnel
IC2_POWER, // EU Tunnel IC2_POWER, // EU Tunnel
FE_POWER, // Forge Energy tunnel FE_POWER, // Forge Energy tunnel
GTCEU_POWER, // Forge Energy tunnel GTEU_POWER, // Forge Energy tunnel
REDSTONE, // Redstone Tunnel REDSTONE, // Redstone Tunnel
FLUID, // Fluid Tunnel FLUID, // Fluid Tunnel
ITEM, // Item Tunnel ITEM, // Item Tunnel
@@ -88,7 +88,7 @@ public interface IParts
IItemDefinition p2PTunnelFE(); IItemDefinition p2PTunnelFE();
IItemDefinition p2PTunnelGTCEU(); IItemDefinition p2PTunnelGTEU();
IItemDefinition p2PTunnelLight(); IItemDefinition p2PTunnelLight();
@@ -87,7 +87,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
this.registerApp( 16 * 10, Settings.POWER_UNITS, PowerUnits.AE, ButtonToolTips.PowerUnits, PowerUnits.AE.unlocalizedName ); this.registerApp( 16 * 10, Settings.POWER_UNITS, PowerUnits.AE, ButtonToolTips.PowerUnits, PowerUnits.AE.unlocalizedName );
this.registerApp( 16 * 10 + 1, Settings.POWER_UNITS, PowerUnits.EU, ButtonToolTips.PowerUnits, PowerUnits.EU.unlocalizedName ); this.registerApp( 16 * 10 + 1, Settings.POWER_UNITS, PowerUnits.EU, ButtonToolTips.PowerUnits, PowerUnits.EU.unlocalizedName );
this.registerApp( 16 * 10 + 4, Settings.POWER_UNITS, PowerUnits.RF, ButtonToolTips.PowerUnits, PowerUnits.RF.unlocalizedName ); this.registerApp( 16 * 10 + 4, Settings.POWER_UNITS, PowerUnits.RF, ButtonToolTips.PowerUnits, PowerUnits.RF.unlocalizedName );
this.registerApp( 16 * 10 + 1, Settings.POWER_UNITS, PowerUnits.GTCEU, ButtonToolTips.PowerUnits, PowerUnits.EU.unlocalizedName ); this.registerApp( 16 * 10 + 1, Settings.POWER_UNITS, PowerUnits.GTEU, ButtonToolTips.PowerUnits, PowerUnits.EU.unlocalizedName );
this.registerApp( 3, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE, ButtonToolTips.RedstoneMode, ButtonToolTips.AlwaysActive ); this.registerApp( 3, Settings.REDSTONE_CONTROLLED, RedstoneMode.IGNORE, ButtonToolTips.RedstoneMode, ButtonToolTips.AlwaysActive );
this.registerApp( 0, Settings.REDSTONE_CONTROLLED, RedstoneMode.LOW_SIGNAL, ButtonToolTips.RedstoneMode, ButtonToolTips.ActiveWithoutSignal ); this.registerApp( 0, Settings.REDSTONE_CONTROLLED, RedstoneMode.LOW_SIGNAL, ButtonToolTips.RedstoneMode, ButtonToolTips.ActiveWithoutSignal );
@@ -109,15 +109,11 @@ public class GuiImgButton extends GuiButton implements ITooltip
this.registerApp( 16 * 2 + 3, Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_Auto ); this.registerApp( 16 * 2 + 3, Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_Auto );
this.registerApp( 16 * 2 + 4, Settings.SEARCH_MODE, SearchBoxMode.MANUAL_SEARCH, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_Standard ); this.registerApp( 16 * 2 + 4, Settings.SEARCH_MODE, SearchBoxMode.MANUAL_SEARCH, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_Standard );
this.registerApp( 16 * 2 + 5, Settings.SEARCH_MODE, SearchBoxMode.JEI_AUTOSEARCH, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_JEIAuto ); this.registerApp( 16 * 2 + 5, Settings.SEARCH_MODE, SearchBoxMode.JEI_AUTOSEARCH, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_JEIAuto );
this.registerApp( 16 * 2 + 6, Settings.SEARCH_MODE, SearchBoxMode.JEI_MANUAL_SEARCH, ButtonToolTips.SearchMode, this.registerApp( 16 * 2 + 6, Settings.SEARCH_MODE, SearchBoxMode.JEI_MANUAL_SEARCH, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_JEIStandard );
ButtonToolTips.SearchMode_JEIStandard );
this.registerApp( 16 * 2 + 7, Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH_KEEP, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_AutoKeep ); this.registerApp( 16 * 2 + 7, Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH_KEEP, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_AutoKeep );
this.registerApp( 16 * 2 + 8, Settings.SEARCH_MODE, SearchBoxMode.MANUAL_SEARCH_KEEP, ButtonToolTips.SearchMode, this.registerApp( 16 * 2 + 8, Settings.SEARCH_MODE, SearchBoxMode.MANUAL_SEARCH_KEEP, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_StandardKeep );
ButtonToolTips.SearchMode_StandardKeep ); this.registerApp( 16 * 2 + 9, Settings.SEARCH_MODE, SearchBoxMode.JEI_AUTOSEARCH_KEEP, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_JEIAutoKeep );
this.registerApp( 16 * 2 + 9, Settings.SEARCH_MODE, SearchBoxMode.JEI_AUTOSEARCH_KEEP, ButtonToolTips.SearchMode, this.registerApp( 16 * 2 + 10, Settings.SEARCH_MODE, SearchBoxMode.JEI_MANUAL_SEARCH_KEEP, ButtonToolTips.SearchMode, ButtonToolTips.SearchMode_JEIStandardKeep );
ButtonToolTips.SearchMode_JEIAutoKeep );
this.registerApp( 16 * 2 + 10, Settings.SEARCH_MODE, SearchBoxMode.JEI_MANUAL_SEARCH_KEEP, ButtonToolTips.SearchMode,
ButtonToolTips.SearchMode_JEIStandardKeep );
this.registerApp( 16 * 5 + 3, Settings.LEVEL_TYPE, LevelType.ENERGY_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Energy ); this.registerApp( 16 * 5 + 3, Settings.LEVEL_TYPE, LevelType.ENERGY_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Energy );
this.registerApp( 16 * 4 + 3, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Item ); this.registerApp( 16 * 4 + 3, Settings.LEVEL_TYPE, LevelType.ITEM_LEVEL, ButtonToolTips.LevelType, ButtonToolTips.LevelType_Item );
@@ -175,19 +171,15 @@ public class GuiImgButton extends GuiButton implements ITooltip
this.registerApp( 16 * 11 + 2, Settings.CRAFT_VIA_REDSTONE, YesNo.YES, ButtonToolTips.EmitterMode, ButtonToolTips.CraftViaRedstone ); this.registerApp( 16 * 11 + 2, Settings.CRAFT_VIA_REDSTONE, YesNo.YES, ButtonToolTips.EmitterMode, ButtonToolTips.CraftViaRedstone );
this.registerApp( 16 * 11 + 1, Settings.CRAFT_VIA_REDSTONE, YesNo.NO, ButtonToolTips.EmitterMode, ButtonToolTips.EmitWhenCrafting ); this.registerApp( 16 * 11 + 1, Settings.CRAFT_VIA_REDSTONE, YesNo.NO, ButtonToolTips.EmitterMode, ButtonToolTips.EmitWhenCrafting );
this.registerApp( 16 * 3 + 5, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY, ButtonToolTips.ReportInaccessibleItems, this.registerApp( 16 * 3 + 5, Settings.STORAGE_FILTER, StorageFilter.EXTRACTABLE_ONLY, ButtonToolTips.ReportInaccessibleItems, ButtonToolTips.ReportInaccessibleItemsNo );
ButtonToolTips.ReportInaccessibleItemsNo ); this.registerApp( 16 * 3 + 6, Settings.STORAGE_FILTER, StorageFilter.NONE, ButtonToolTips.ReportInaccessibleItems, ButtonToolTips.ReportInaccessibleItemsYes );
this.registerApp( 16 * 3 + 6, Settings.STORAGE_FILTER, StorageFilter.NONE, ButtonToolTips.ReportInaccessibleItems,
ButtonToolTips.ReportInaccessibleItemsYes );
this.registerApp( 16 * 14, Settings.PLACE_BLOCK, YesNo.YES, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementYes ); this.registerApp( 16 * 14, Settings.PLACE_BLOCK, YesNo.YES, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementYes );
this.registerApp( 16 * 14 + 1, Settings.PLACE_BLOCK, YesNo.NO, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementNo ); this.registerApp( 16 * 14 + 1, Settings.PLACE_BLOCK, YesNo.NO, ButtonToolTips.BlockPlacement, ButtonToolTips.BlockPlacementNo );
this.registerApp( 16 * 15, Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT, ButtonToolTips.SchedulingMode, ButtonToolTips.SchedulingModeDefault ); this.registerApp( 16 * 15, Settings.SCHEDULING_MODE, SchedulingMode.DEFAULT, ButtonToolTips.SchedulingMode, ButtonToolTips.SchedulingModeDefault );
this.registerApp( 16 * 15 + 1, Settings.SCHEDULING_MODE, SchedulingMode.ROUNDROBIN, ButtonToolTips.SchedulingMode, this.registerApp( 16 * 15 + 1, Settings.SCHEDULING_MODE, SchedulingMode.ROUNDROBIN, ButtonToolTips.SchedulingMode, ButtonToolTips.SchedulingModeRoundRobin );
ButtonToolTips.SchedulingModeRoundRobin ); this.registerApp( 16 * 15 + 2, Settings.SCHEDULING_MODE, SchedulingMode.RANDOM, ButtonToolTips.SchedulingMode, ButtonToolTips.SchedulingModeRandom );
this.registerApp( 16 * 15 + 2, Settings.SCHEDULING_MODE, SchedulingMode.RANDOM, ButtonToolTips.SchedulingMode,
ButtonToolTips.SchedulingModeRandom );
} }
} }
@@ -337,7 +329,7 @@ public class GuiImgButton extends GuiButton implements ITooltip
{ {
i = 0; i = 0;
} }
while( i + 30 < sb.length() && ( i = sb.lastIndexOf( " ", i + 30 ) ) != -1 ) while ( i + 30 < sb.length() && ( i = sb.lastIndexOf( " ", i + 30 ) ) != -1 )
{ {
sb.replace( i, i + 1, "\n" ); sb.replace( i, i + 1, "\n" );
} }
+2 -2
View File
@@ -112,7 +112,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
// Default Energy Conversion Rates // Default Energy Conversion Rates
private static final double DEFAULT_IC2_EXCHANGE = 2.0; private static final double DEFAULT_IC2_EXCHANGE = 2.0;
private static final double DEFAULT_GTCEU_EXCHANGE = 2.0; private static final double DEFAULT_GTEU_EXCHANGE = 2.0;
private static final double DEFAULT_RF_EXCHANGE = 0.5; private static final double DEFAULT_RF_EXCHANGE = 0.5;
private final IConfigManager settings = new ConfigManager( this ); private final IConfigManager settings = new ConfigManager( this );
@@ -190,7 +190,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE ); PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ForgeEnergy", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE ); PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ForgeEnergy", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
PowerUnits.GTCEU.conversionRatio = this.get( "PowerRatios", "GTCEU", DEFAULT_GTCEU_EXCHANGE ).getDouble( DEFAULT_GTCEU_EXCHANGE ); PowerUnits.GTEU.conversionRatio = this.get( "PowerRatios", "GTEU", DEFAULT_GTEU_EXCHANGE ).getDouble( DEFAULT_GTEU_EXCHANGE );
final double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 ); final double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective ); PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective );
@@ -70,7 +70,7 @@ public final class ApiParts implements IParts
private final IItemDefinition p2PTunnelFluids; private final IItemDefinition p2PTunnelFluids;
private final IItemDefinition p2PTunnelEU; private final IItemDefinition p2PTunnelEU;
private final IItemDefinition p2PTunnelFE; private final IItemDefinition p2PTunnelFE;
private final IItemDefinition p2PTunnelGTCEU; private final IItemDefinition p2PTunnelGTEU;
private final IItemDefinition p2PTunnelLight; private final IItemDefinition p2PTunnelLight;
// private final IItemDefinition p2PTunnelOpenComputers; // private final IItemDefinition p2PTunnelOpenComputers;
private final IItemDefinition cableAnchor; private final IItemDefinition cableAnchor;
@@ -92,9 +92,7 @@ public final class ApiParts implements IParts
public ApiParts( FeatureFactory registry, PartModels partModels ) public ApiParts( FeatureFactory registry, PartModels partModels )
{ {
final ItemPart itemPart = new ItemPart(); final ItemPart itemPart = new ItemPart();
registry.item( "part", () -> itemPart ) registry.item( "part", () -> itemPart ).rendering( new ItemPartRendering( partModels, itemPart ) ).build();
.rendering( new ItemPartRendering( partModels, itemPart ) )
.build();
// Register all part models // Register all part models
for( PartType partType : PartType.values() ) for( PartType partType : PartType.values() )
@@ -123,8 +121,7 @@ public final class ApiParts implements IParts
this.levelEmitter = new DamagedItemDefinition( "part.level_emitter", itemPart.createPart( PartType.LEVEL_EMITTER ) ); this.levelEmitter = new DamagedItemDefinition( "part.level_emitter", itemPart.createPart( PartType.LEVEL_EMITTER ) );
this.fluidLevelEmitter = new DamagedItemDefinition( "part.fluid_level_emitter", itemPart.createPart( PartType.FLUID_LEVEL_EMITTER ) ); this.fluidLevelEmitter = new DamagedItemDefinition( "part.fluid_level_emitter", itemPart.createPart( PartType.FLUID_LEVEL_EMITTER ) );
this.annihilationPlane = new DamagedItemDefinition( "part.plane.annihilation", itemPart.createPart( PartType.ANNIHILATION_PLANE ) ); this.annihilationPlane = new DamagedItemDefinition( "part.plane.annihilation", itemPart.createPart( PartType.ANNIHILATION_PLANE ) );
this.identityAnnihilationPlane = new DamagedItemDefinition( "part.plane.annihiliation.identity", itemPart this.identityAnnihilationPlane = new DamagedItemDefinition( "part.plane.annihiliation.identity", itemPart.createPart( PartType.IDENTITY_ANNIHILATION_PLANE ) );
.createPart( PartType.IDENTITY_ANNIHILATION_PLANE ) );
this.fluidAnnihilationPlane = new DamagedItemDefinition( "part.plane.fluid_annihilation", itemPart.createPart( PartType.FLUID_ANNIHILATION_PLANE ) ); this.fluidAnnihilationPlane = new DamagedItemDefinition( "part.plane.fluid_annihilation", itemPart.createPart( PartType.FLUID_ANNIHILATION_PLANE ) );
this.formationPlane = new DamagedItemDefinition( "part.plane.formation", itemPart.createPart( PartType.FORMATION_PLANE ) ); this.formationPlane = new DamagedItemDefinition( "part.plane.formation", itemPart.createPart( PartType.FORMATION_PLANE ) );
this.fluidFormationPlane = new DamagedItemDefinition( "part.plane.fluid_formation", itemPart.createPart( PartType.FLUID_FORMATION_PLANE ) ); this.fluidFormationPlane = new DamagedItemDefinition( "part.plane.fluid_formation", itemPart.createPart( PartType.FLUID_FORMATION_PLANE ) );
@@ -134,7 +131,7 @@ public final class ApiParts implements IParts
this.p2PTunnelFluids = new DamagedItemDefinition( "part.tunnel.fluid", itemPart.createPart( PartType.P2P_TUNNEL_FLUIDS ) ); this.p2PTunnelFluids = new DamagedItemDefinition( "part.tunnel.fluid", itemPart.createPart( PartType.P2P_TUNNEL_FLUIDS ) );
this.p2PTunnelEU = new DamagedItemDefinition( "part.tunnel.eu", itemPart.createPart( PartType.P2P_TUNNEL_IC2 ) ); this.p2PTunnelEU = new DamagedItemDefinition( "part.tunnel.eu", itemPart.createPart( PartType.P2P_TUNNEL_IC2 ) );
this.p2PTunnelFE = new DamagedItemDefinition( "part.tunnel.fe", itemPart.createPart( PartType.P2P_TUNNEL_FE ) ); this.p2PTunnelFE = new DamagedItemDefinition( "part.tunnel.fe", itemPart.createPart( PartType.P2P_TUNNEL_FE ) );
this.p2PTunnelGTCEU = new DamagedItemDefinition( "part.tunnel.gtceu", itemPart.createPart( PartType.P2P_TUNNEL_GTCEU ) ); this.p2PTunnelGTEU = new DamagedItemDefinition( "part.tunnel.gteu", itemPart.createPart( PartType.P2P_TUNNEL_GTEU ) );
this.p2PTunnelLight = new DamagedItemDefinition( "part.tunnel.light", itemPart.createPart( PartType.P2P_TUNNEL_LIGHT ) ); this.p2PTunnelLight = new DamagedItemDefinition( "part.tunnel.light", itemPart.createPart( PartType.P2P_TUNNEL_LIGHT ) );
// this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart( // this.p2PTunnelOpenComputers = new DamagedItemDefinition( itemMultiPart.createPart(
// PartType.P2PTunnelOpenComputers ) ); // PartType.P2PTunnelOpenComputers ) );
@@ -341,9 +338,9 @@ public final class ApiParts implements IParts
return this.p2PTunnelFE; return this.p2PTunnelFE;
} }
public IItemDefinition p2PTunnelGTCEU() public IItemDefinition p2PTunnelGTEU()
{ {
return this.p2PTunnelGTCEU; return this.p2PTunnelGTEU;
} }
@Override @Override
@@ -126,7 +126,7 @@ public enum AEFeature
P2P_TUNNEL_REDSTONE( "P2PTunnelRedstone", Constants.CATEGORY_P2P_TUNNELS ), P2P_TUNNEL_REDSTONE( "P2PTunnelRedstone", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_EU( "P2PTunnelEU", Constants.CATEGORY_P2P_TUNNELS ), P2P_TUNNEL_EU( "P2PTunnelEU", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_FE( "P2PTunnelFE", Constants.CATEGORY_P2P_TUNNELS ), P2P_TUNNEL_FE( "P2PTunnelFE", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_GTCEU( "P2PTunnelGTCEU", Constants.CATEGORY_P2P_TUNNELS ), P2P_TUNNEL_GTEU( "P2PTunnelGTEU", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_FLUIDS( "P2PTunnelFluids", Constants.CATEGORY_P2P_TUNNELS ), P2P_TUNNEL_FLUIDS( "P2PTunnelFluids", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_LIGHT( "P2PTunnelLight", Constants.CATEGORY_P2P_TUNNELS ), P2P_TUNNEL_LIGHT( "P2PTunnelLight", Constants.CATEGORY_P2P_TUNNELS ),
P2P_TUNNEL_OPEN_COMPUTERS( "P2PTunnelOpenComputers", Constants.CATEGORY_P2P_TUNNELS ), P2P_TUNNEL_OPEN_COMPUTERS( "P2PTunnelOpenComputers", Constants.CATEGORY_P2P_TUNNELS ),
@@ -55,7 +55,8 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
private final Map<String, TunnelType> modIdTunnels = new HashMap<>( INITIAL_CAPACITY ); private final Map<String, TunnelType> modIdTunnels = new HashMap<>( INITIAL_CAPACITY );
private final Map<Capability<?>, TunnelType> capTunnels = new HashMap<>( INITIAL_CAPACITY ); private final Map<Capability<?>, TunnelType> capTunnels = new HashMap<>( INITIAL_CAPACITY );
public void configure() { public void configure()
{
final IDefinitions definitions = AEApi.instance().definitions(); final IDefinitions definitions = AEApi.instance().definitions();
final IBlocks blocks = definitions.blocks(); final IBlocks blocks = definitions.blocks();
@@ -64,24 +65,25 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
/** /**
* light! * light!
*/ */
this.addNewAttunement(new ItemStack(Blocks.TORCH), TunnelType.LIGHT); this.addNewAttunement( new ItemStack( Blocks.TORCH ), TunnelType.LIGHT );
this.addNewAttunement(new ItemStack(Blocks.GLOWSTONE), TunnelType.LIGHT); this.addNewAttunement( new ItemStack( Blocks.GLOWSTONE ), TunnelType.LIGHT );
List<String> gtceOreDict = new ArrayList<>(); List<String> gtceOreDict = new ArrayList<>();
gtceOreDict.add("wireGtHex"); gtceOreDict.add( "wireGtHex" );
gtceOreDict.add("wireGtOctal"); gtceOreDict.add( "wireGtOctal" );
gtceOreDict.add("wireGtQuadruple"); gtceOreDict.add( "wireGtQuadruple" );
gtceOreDict.add("wireGtDouble"); gtceOreDict.add( "wireGtDouble" );
gtceOreDict.add("wireGtSingle"); gtceOreDict.add( "wireGtSingle" );
gtceOreDict.add("cableGtHex"); gtceOreDict.add( "cableGtHex" );
gtceOreDict.add("cableGtOctal"); gtceOreDict.add( "cableGtOctal" );
gtceOreDict.add("cableGtQuadruple"); gtceOreDict.add( "cableGtQuadruple" );
gtceOreDict.add("cableGtDouble"); gtceOreDict.add( "cableGtDouble" );
gtceOreDict.add("cableGtSingle"); gtceOreDict.add( "cableGtSingle" );
for(String oreDict : gtceOreDict) { for( String oreDict : gtceOreDict )
{
Arrays.stream( OreDictionary.getOreNames() ).filter( oreName -> oreName.startsWith( oreDict ) ).forEach( oreName -> { Arrays.stream( OreDictionary.getOreNames() ).filter( oreName -> oreName.startsWith( oreDict ) ).forEach( oreName -> {
OreHelper.INSTANCE.getCachedOres( oreName ).forEach( stack -> this.addNewAttunement( stack, TunnelType.GTCEU_POWER ) ); OreHelper.INSTANCE.getCachedOres( oreName ).forEach( stack -> this.addNewAttunement( stack, TunnelType.GTEU_POWER ) );
} ); } );
} }
@@ -145,12 +147,12 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
this.addNewAttunement( this.getModItem( "enderio", "itemitemconduit", OreDictionary.WILDCARD_VALUE ), TunnelType.ITEM ); this.addNewAttunement( this.getModItem( "enderio", "itemitemconduit", OreDictionary.WILDCARD_VALUE ), TunnelType.ITEM );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 0 ), TunnelType.ITEM ); // itemduct this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 0 ), TunnelType.ITEM ); // itemduct
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 1 ), TunnelType.ITEM ); // itemduct this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 1 ), TunnelType.ITEM ); // itemduct
// (opaque) // (opaque)
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 2 ), TunnelType.ITEM ); // impulse this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 2 ), TunnelType.ITEM ); // impulse
// itemduct // itemduct
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 3 ), TunnelType.ITEM ); // impulse this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_32", 3 ), TunnelType.ITEM ); // impulse
// itemduct // itemduct
// (opaque) // (opaque)
/** /**
* attune based on lots of random item related stuff * attune based on lots of random item related stuff
@@ -166,12 +168,12 @@ public final class P2PTunnelRegistry implements IP2PTunnelRegistry
this.addNewAttunement( this.getModItem( "enderio", "itemliquidconduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID ); this.addNewAttunement( this.getModItem( "enderio", "itemliquidconduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 0 ), TunnelType.FLUID ); // fluiduct this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 0 ), TunnelType.FLUID ); // fluiduct
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 1 ), TunnelType.FLUID ); // fluiduct this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 1 ), TunnelType.FLUID ); // fluiduct
// (opaque) // (opaque)
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 2 ), TunnelType.FLUID ); // fluiduct this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 2 ), TunnelType.FLUID ); // fluiduct
// hardened // hardened
this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 3 ), TunnelType.FLUID ); // fluiduct this.addNewAttunement( this.getModItem( "thermaldynamics", "duct_16", 3 ), TunnelType.FLUID ); // fluiduct
// hardened // hardened
// (opaque) // (opaque)
for( final AEColor c : AEColor.values() ) for( final AEColor c : AEColor.values() )
{ {
@@ -99,7 +99,7 @@ public enum GuiText
OCTunnel, OCTunnel,
LightTunnel, LightTunnel,
FETunnel, FETunnel,
GTCEUTunnel, GTEUTunnel,
PressureTunnel, PressureTunnel,
// spatial // spatial
+69 -82
View File
@@ -74,96 +74,84 @@ public enum PartType
INVALID_TYPE( -1, "invalid", EnumSet.of( AEFeature.CORE ), EnumSet.noneOf( IntegrationType.class ), null ), INVALID_TYPE( -1, "invalid", EnumSet.of( AEFeature.CORE ), EnumSet.noneOf( IntegrationType.class ), null ),
CABLE_GLASS( 0, "cable_glass", EnumSet.of( AEFeature.GLASS_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableGlass.class ) CABLE_GLASS( 0, "cable_glass", EnumSet.of( AEFeature.GLASS_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableGlass.class )
{ {
@Override @Override
public boolean isCable() public boolean isCable()
{ {
return true; return true;
} }
@Override @Override
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName ) protected List<ModelResourceLocation> createItemModels( String baseName )
{ {
return Arrays.stream( AEColor.values() ) return Arrays.stream( AEColor.values() ).map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ).collect( Collectors.toList() );
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ) }
.collect( Collectors.toList() ); },
}
},
CABLE_COVERED( 20, "cable_covered", EnumSet.of( AEFeature.COVERED_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableCovered.class ) CABLE_COVERED( 20, "cable_covered", EnumSet.of( AEFeature.COVERED_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableCovered.class )
{ {
@Override @Override
public boolean isCable() public boolean isCable()
{ {
return true; return true;
} }
@Override @Override
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName ) protected List<ModelResourceLocation> createItemModels( String baseName )
{ {
return Arrays.stream( AEColor.values() ) return Arrays.stream( AEColor.values() ).map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ).collect( Collectors.toList() );
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ) }
.collect( Collectors.toList() ); },
}
},
CABLE_SMART( 40, "cable_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.SMART_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableSmart.class ) CABLE_SMART( 40, "cable_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.SMART_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartCableSmart.class )
{ {
@Override @Override
public boolean isCable() public boolean isCable()
{ {
return true; return true;
} }
@Override @Override
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName ) protected List<ModelResourceLocation> createItemModels( String baseName )
{ {
return Arrays.stream( AEColor.values() ) return Arrays.stream( AEColor.values() ).map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ).collect( Collectors.toList() );
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ) }
.collect( Collectors.toList() ); },
}
},
CABLE_DENSE_SMART( 60, "cable_dense_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet CABLE_DENSE_SMART( 60, "cable_dense_smart", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartDenseCableSmart.class )
.noneOf( IntegrationType.class ), PartDenseCableSmart.class ) {
{ @Override
@Override public boolean isCable()
public boolean isCable() {
{ return true;
return true; }
}
@Override @Override
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName ) protected List<ModelResourceLocation> createItemModels( String baseName )
{ {
return Arrays.stream( AEColor.values() ) return Arrays.stream( AEColor.values() ).map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ).collect( Collectors.toList() );
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ) }
.collect( Collectors.toList() ); },
}
},
CABLE_DENSE_COVERED( 500, "cable_dense_covered", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet CABLE_DENSE_COVERED( 500, "cable_dense_covered", EnumSet.of( AEFeature.CHANNELS, AEFeature.DENSE_CABLES ), EnumSet.noneOf( IntegrationType.class ), PartDenseCableCovered.class )
.noneOf( IntegrationType.class ), PartDenseCableCovered.class ) {
{ @Override
@Override public boolean isCable()
public boolean isCable() {
{ return true;
return true; }
}
@Override @Override
@SideOnly( Side.CLIENT ) @SideOnly( Side.CLIENT )
protected List<ModelResourceLocation> createItemModels( String baseName ) protected List<ModelResourceLocation> createItemModels( String baseName )
{ {
return Arrays.stream( AEColor.values() ) return Arrays.stream( AEColor.values() ).map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ).collect( Collectors.toList() );
.map( color -> modelFromBaseName( baseName + "_" + color.name().toLowerCase() ) ) }
.collect( Collectors.toList() ); },
}
},
TOGGLE_BUS( 80, "toggle_bus", EnumSet.of( AEFeature.TOGGLE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartToggleBus.class ), TOGGLE_BUS( 80, "toggle_bus", EnumSet.of( AEFeature.TOGGLE_BUS ), EnumSet.noneOf( IntegrationType.class ), PartToggleBus.class ),
@@ -282,7 +270,7 @@ public enum PartType
} }
}, },
P2P_TUNNEL_GTCEU( 470, "p2p_tunnel_gtceu", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_GTCEU ), EnumSet.of( IntegrationType.GTCE ), PartP2PGTCEPower.class, GuiText.GTCEUTunnel ) P2P_TUNNEL_GTEU( 470, "p2p_tunnel_gteu", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_GTEU ), EnumSet.of( IntegrationType.GTCE ), PartP2PGTCEPower.class, GuiText.GTEUTunnel )
{ {
@Override @Override
String getUnlocalizedName() String getUnlocalizedName()
@@ -335,8 +323,7 @@ public enum PartType
this.oreName = oreDict; this.oreName = oreDict;
// The part is enabled if all features + integrations it needs are enabled // The part is enabled if all features + integrations it needs are enabled
this.enabled = features.stream().allMatch( AEConfig.instance()::isFeatureEnabled ) && integrations.stream() this.enabled = features.stream().allMatch( AEConfig.instance()::isFeatureEnabled ) && integrations.stream().allMatch( IntegrationRegistry.INSTANCE::isEnabled );
.allMatch( IntegrationRegistry.INSTANCE::isEnabled );
if( this.enabled ) if( this.enabled )
{ {
@@ -20,289 +20,289 @@ import java.util.Queue;
public class PartP2PGTCEPower extends PartP2PTunnel<PartP2PGTCEPower> public class PartP2PGTCEPower extends PartP2PTunnel<PartP2PGTCEPower>
{ {
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_gtceu" ); private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_gteu" );
private static final IEnergyContainer NULL_ENERGY_STORAGE = new NullEnergyStorage(); private static final IEnergyContainer NULL_ENERGY_STORAGE = new NullEnergyStorage();
private final IEnergyContainer inputHandler = new InputEnergyStorage(); private final IEnergyContainer inputHandler = new InputEnergyStorage();
private final IEnergyContainer outputHandler = new OutputEnergyStorage(); private final IEnergyContainer outputHandler = new OutputEnergyStorage();
private final Queue<PartP2PGTCEPower> outputs = new ArrayDeque<>(); private final Queue<PartP2PGTCEPower> outputs = new ArrayDeque<>();
public PartP2PGTCEPower( ItemStack is ) public PartP2PGTCEPower( ItemStack is )
{ {
super( is ); super( is );
} }
@PartModels @PartModels
public static List<IPartModel> getModels() public static List<IPartModel> getModels()
{ {
return MODELS.getModels(); return MODELS.getModels();
} }
@Override @Override
public IPartModel getStaticModels() public IPartModel getStaticModels()
{ {
return MODELS.getModel( this.isPowered(), this.isActive() ); return MODELS.getModel( this.isPowered(), this.isActive() );
} }
@Override @Override
public void onTunnelNetworkChange() public void onTunnelNetworkChange()
{ {
this.getHost().notifyNeighbors(); this.getHost().notifyNeighbors();
} }
private IEnergyContainer getAttachedEnergyStorage() private IEnergyContainer getAttachedEnergyStorage()
{ {
if( this.isActive() ) if( this.isActive() )
{ {
final TileEntity self = this.getTile(); final TileEntity self = this.getTile();
final TileEntity te = self.getWorld().getTileEntity( self.getPos().offset( this.getSide().getFacing() ) ); final TileEntity te = self.getWorld().getTileEntity( self.getPos().offset( this.getSide().getFacing() ) );
if( te != null && te.hasCapability( GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER, this.getSide().getOpposite().getFacing() ) ) if( te != null && te.hasCapability( GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER, this.getSide().getOpposite().getFacing() ) )
{ {
return te.getCapability( GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER, this.getSide().getOpposite().getFacing() ); return te.getCapability( GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER, this.getSide().getOpposite().getFacing() );
} }
} }
return NULL_ENERGY_STORAGE; return NULL_ENERGY_STORAGE;
} }
@Override @Override
public boolean hasCapability( @Nonnull Capability<?> capability ) public boolean hasCapability( @Nonnull Capability<?> capability )
{ {
if( capability == GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER ) if( capability == GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER )
{ {
return true; return true;
} }
return super.hasCapability( capability ); return super.hasCapability( capability );
} }
@Nullable @Nullable
@Override @Override
public <T> T getCapability( @Nonnull Capability<T> capability ) public <T> T getCapability( @Nonnull Capability<T> capability )
{ {
if( capability == GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER ) if( capability == GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER )
{ {
if( this.isOutput() ) if( this.isOutput() )
{ {
return (T) this.outputHandler; return (T) this.outputHandler;
} }
return (T) this.inputHandler; return (T) this.inputHandler;
} }
return super.getCapability( capability ); return super.getCapability( capability );
} }
class InputEnergyStorage implements IEnergyContainer class InputEnergyStorage implements IEnergyContainer
{ {
@Override @Override
public long getEnergyCanBeInserted() public long getEnergyCanBeInserted()
{ {
long canInsert = 0; long canInsert = 0;
if( outputs.isEmpty() ) if( outputs.isEmpty() )
{ {
try try
{ {
for( PartP2PGTCEPower o : PartP2PGTCEPower.this.getOutputs() ) for( PartP2PGTCEPower o : PartP2PGTCEPower.this.getOutputs() )
outputs.add( o ); outputs.add( o );
} }
catch( GridAccessException e ) catch( GridAccessException e )
{ {
e.printStackTrace(); e.printStackTrace();
} }
} }
while ( !outputs.isEmpty() ) while ( !outputs.isEmpty() )
{ {
PartP2PGTCEPower target = outputs.poll(); PartP2PGTCEPower target = outputs.poll();
final IEnergyContainer output = target.getAttachedEnergyStorage(); final IEnergyContainer output = target.getAttachedEnergyStorage();
if( output == null || output.getEnergyCanBeInserted() <= 0 ) if( output == null || output.getEnergyCanBeInserted() <= 0 )
{ {
continue; continue;
} }
canInsert += output.getEnergyCanBeInserted(); canInsert += output.getEnergyCanBeInserted();
} }
return canInsert; return canInsert;
} }
@Override @Override
public long acceptEnergyFromNetwork( EnumFacing facing, long voltage, long amperage ) public long acceptEnergyFromNetwork( EnumFacing facing, long voltage, long amperage )
{ {
long amperesUsed = 0L; long amperesUsed = 0L;
if( outputs.isEmpty() ) if( outputs.isEmpty() )
{ {
try try
{ {
for( PartP2PGTCEPower o : PartP2PGTCEPower.this.getOutputs() ) for( PartP2PGTCEPower o : PartP2PGTCEPower.this.getOutputs() )
outputs.add( o ); outputs.add( o );
} }
catch( GridAccessException e ) catch( GridAccessException e )
{ {
e.printStackTrace(); e.printStackTrace();
} }
} }
while ( !outputs.isEmpty() ) while ( !outputs.isEmpty() )
{ {
PartP2PGTCEPower target = outputs.poll(); PartP2PGTCEPower target = outputs.poll();
final IEnergyContainer output = target.getAttachedEnergyStorage(); final IEnergyContainer output = target.getAttachedEnergyStorage();
if( output == null || !output.inputsEnergy( facing ) || output.getEnergyCanBeInserted() <= 0 ) if( output == null || !output.inputsEnergy( facing ) || output.getEnergyCanBeInserted() <= 0 )
{ {
continue; continue;
} }
if( voltage > 0 ) if( voltage > 0 )
{ {
amperesUsed += output.acceptEnergyFromNetwork( facing, voltage, amperage - amperesUsed ); amperesUsed += output.acceptEnergyFromNetwork( facing, voltage, amperage - amperesUsed );
} }
if( amperage == amperesUsed ) if( amperage == amperesUsed )
{ {
break; break;
} }
} }
return amperesUsed; return amperesUsed;
} }
@Override @Override
public boolean inputsEnergy( EnumFacing enumFacing ) public boolean inputsEnergy( EnumFacing enumFacing )
{ {
return true; return true;
} }
@Override @Override
public long changeEnergy( long l ) public long changeEnergy( long l )
{ {
return 0; return 0;
} }
@Override @Override
public long getEnergyStored() public long getEnergyStored()
{ {
return 0; return 0;
} }
@Override @Override
public long getEnergyCapacity() public long getEnergyCapacity()
{ {
return 0; return 0;
} }
@Override @Override
public long getInputAmperage() public long getInputAmperage()
{ {
return 0; return 0;
} }
@Override @Override
public long getInputVoltage() public long getInputVoltage()
{ {
return 0; return 0;
} }
} }
class OutputEnergyStorage implements IEnergyContainer class OutputEnergyStorage implements IEnergyContainer
{ {
@Override @Override
public long acceptEnergyFromNetwork( EnumFacing facing, long voltage, long amperage ) public long acceptEnergyFromNetwork( EnumFacing facing, long voltage, long amperage )
{ {
if( facing == getSide().getFacing() ) if( facing == getSide().getFacing() )
{ {
return 0; return 0;
} }
final IEnergyContainer output = getAttachedEnergyStorage(); final IEnergyContainer output = getAttachedEnergyStorage();
voltage *= 0.95; voltage *= 0.95;
if( voltage > 0 ) if( voltage > 0 )
{ {
return output.acceptEnergyFromNetwork( facing, voltage, amperage ); return output.acceptEnergyFromNetwork( facing, voltage, amperage );
} }
return 0; return 0;
} }
@Override @Override
public boolean inputsEnergy( EnumFacing enumFacing ) public boolean inputsEnergy( EnumFacing enumFacing )
{ {
return false; return false;
} }
@Override @Override
public boolean outputsEnergy( EnumFacing side ) public boolean outputsEnergy( EnumFacing side )
{ {
return true; return true;
} }
@Override @Override
public long changeEnergy( long l ) public long changeEnergy( long l )
{ {
return 0; return 0;
} }
@Override @Override
public long getEnergyStored() public long getEnergyStored()
{ {
return 0; return 0;
} }
@Override @Override
public long getEnergyCapacity() public long getEnergyCapacity()
{ {
return 0; return 0;
} }
@Override @Override
public long getInputAmperage() public long getInputAmperage()
{ {
return 0; return 0;
} }
@Override @Override
public long getInputVoltage() public long getInputVoltage()
{ {
return 0; return 0;
} }
} }
static class NullEnergyStorage implements IEnergyContainer static class NullEnergyStorage implements IEnergyContainer
{ {
@Override @Override
public long acceptEnergyFromNetwork( EnumFacing enumFacing, long l, long l1 ) public long acceptEnergyFromNetwork( EnumFacing enumFacing, long l, long l1 )
{ {
return 0; return 0;
} }
@Override @Override
public boolean inputsEnergy( EnumFacing enumFacing ) public boolean inputsEnergy( EnumFacing enumFacing )
{ {
return false; return false;
} }
@Override @Override
public long changeEnergy( long l ) public long changeEnergy( long l )
{ {
return 0; return 0;
} }
@Override @Override
public long getEnergyStored() public long getEnergyStored()
{ {
return 0; return 0;
} }
@Override @Override
public long getEnergyCapacity() public long getEnergyCapacity()
{ {
return 0; return 0;
} }
@Override @Override
public long getInputAmperage() public long getInputAmperage()
{ {
return 0; return 0;
} }
@Override @Override
public long getInputVoltage() public long getInputVoltage()
{ {
return 0; return 0;
} }
} }
} }
@@ -208,7 +208,8 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
boolean pasteAsOutput = true; boolean pasteAsOutput = true;
ItemStack is = player.getHeldItem( hand ); ItemStack is = player.getHeldItem( hand );
if (is.isEmpty()) { if( is.isEmpty() )
{
pasteAsOutput = false; pasteAsOutput = false;
is = player.getHeldItemOffhand(); is = player.getHeldItemOffhand();
} }
@@ -282,7 +283,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
final IParts parts = AEApi.instance().definitions().parts(); final IParts parts = AEApi.instance().definitions().parts();
switch( tt ) switch ( tt )
{ {
case LIGHT: case LIGHT:
newType = parts.p2PTunnelLight().maybeStack( 1 ).orElse( ItemStack.EMPTY ); newType = parts.p2PTunnelLight().maybeStack( 1 ).orElse( ItemStack.EMPTY );
@@ -292,8 +293,8 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
newType = parts.p2PTunnelFE().maybeStack( 1 ).orElse( ItemStack.EMPTY ); newType = parts.p2PTunnelFE().maybeStack( 1 ).orElse( ItemStack.EMPTY );
break; break;
case GTCEU_POWER: case GTEU_POWER:
newType = parts.p2PTunnelGTCEU().maybeStack( 1 ).orElse( ItemStack.EMPTY ); newType = parts.p2PTunnelGTEU().maybeStack( 1 ).orElse( ItemStack.EMPTY );
break; break;
case FLUID: case FLUID:
@@ -455,8 +456,10 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
final AEColor[] colors = Platform.p2p().toColors( this.getFrequency() ); final AEColor[] colors = Platform.p2p().toColors( this.getFrequency() );
final int[] colorCode = new int[]{ final int[] colorCode = new int[]{
colors[0].ordinal(), colors[0].ordinal(), colors[1].ordinal(), colors[1].ordinal(), colors[0].ordinal(), colors[0].ordinal(),
colors[2].ordinal(), colors[2].ordinal(), colors[3].ordinal(), colors[3].ordinal(), colors[1].ordinal(), colors[1].ordinal(),
colors[2].ordinal(), colors[2].ordinal(),
colors[3].ordinal(), colors[3].ordinal(),
}; };
data.setIntArray( "colorCode", colorCode ); data.setIntArray( "colorCode", colorCode );
@@ -8,82 +8,82 @@ import net.minecraft.util.EnumFacing;
public class GTCEEnergyAdapter implements IEnergyContainer public class GTCEEnergyAdapter implements IEnergyContainer
{ {
private final IExternalPowerSink sink; private final IExternalPowerSink sink;
double EUBuffer; double EUBuffer;
GTCEEnergyAdapter( IExternalPowerSink sink ) GTCEEnergyAdapter( IExternalPowerSink sink )
{ {
this.sink = sink; this.sink = sink;
} }
@Override @Override
public long acceptEnergyFromNetwork( EnumFacing enumFacing, long voltage, long amperage ) public long acceptEnergyFromNetwork( EnumFacing enumFacing, long voltage, long amperage )
{ {
final double power = voltage * amperage; final double power = voltage * amperage;
final double oldBuffer = EUBuffer; final double oldBuffer = EUBuffer;
EUBuffer = this.sink.injectExternalPower( PowerUnits.GTCEU, power + EUBuffer, Actionable.MODULATE ); EUBuffer = this.sink.injectExternalPower( PowerUnits.GTEU, power + EUBuffer, Actionable.MODULATE );
// if the overflow went down, all inputs were consumed // if the overflow went down, all inputs were consumed
if ( EUBuffer <= oldBuffer ) if( EUBuffer <= oldBuffer )
{ {
return amperage; return amperage;
} }
// if overflow is greater than the inputs, nothing was consumed // if overflow is greater than the inputs, nothing was consumed
if ( EUBuffer >= power ) if( EUBuffer >= power )
{ {
EUBuffer -= power; EUBuffer -= power;
return 0; return 0;
} }
// determine how many amps are being used // determine how many amps are being used
final double usedEU = power + oldBuffer - EUBuffer; final double usedEU = power + oldBuffer - EUBuffer;
final long ampsUsed = (long) Math.ceil( usedEU / ( (double) voltage ) ); final long ampsUsed = (long) Math.ceil( usedEU / ( (double) voltage ) );
// adjust the overflow // adjust the overflow
EUBuffer += usedEU % voltage; EUBuffer += usedEU % voltage;
return ampsUsed; return ampsUsed;
} }
@Override @Override
public boolean inputsEnergy( EnumFacing enumFacing ) public boolean inputsEnergy( EnumFacing enumFacing )
{ {
return true; return true;
} }
@Override @Override
public long changeEnergy( long l ) public long changeEnergy( long l )
{ {
return 0; return 0;
} }
@Override @Override
public long getEnergyStored() public long getEnergyStored()
{ {
return (long) Math.floor( PowerUnits.AE.convertTo( PowerUnits.GTCEU, this.sink.getAECurrentPower() ) ); return (long) Math.floor( PowerUnits.AE.convertTo( PowerUnits.GTEU, this.sink.getAECurrentPower() ) );
} }
@Override @Override
public long getEnergyCapacity() public long getEnergyCapacity()
{ {
return (long) Math.floor( PowerUnits.AE.convertTo( PowerUnits.GTCEU, this.sink.getAEMaxPower() ) ); return (long) Math.floor( PowerUnits.AE.convertTo( PowerUnits.GTEU, this.sink.getAEMaxPower() ) );
} }
@Override @Override
public long getInputAmperage() public long getInputAmperage()
{ {
return 0; return 0;
} }
@Override @Override
public long getInputVoltage() public long getInputVoltage()
{ {
return 0; return 0;
} }
@Override @Override
public long getEnergyCanBeInserted() public long getEnergyCanBeInserted()
{ {
return this.getEnergyCapacity() - this.getEnergyStored(); return this.getEnergyCapacity() - this.getEnergyStored();
} }
} }
@@ -102,7 +102,7 @@ gui.appliedenergistics2.FluidTunnel=Fluid
gui.appliedenergistics2.RedstoneTunnel=Redstone gui.appliedenergistics2.RedstoneTunnel=Redstone
gui.appliedenergistics2.EUTunnel=EU gui.appliedenergistics2.EUTunnel=EU
gui.appliedenergistics2.FETunnel=FE gui.appliedenergistics2.FETunnel=FE
gui.appliedenergistics2.GTCEUTunnel=GTCEU gui.appliedenergistics2.GTEUTunnel=GTEU
gui.appliedenergistics2.LightTunnel=Light gui.appliedenergistics2.LightTunnel=Light
gui.appliedenergistics2.OCTunnel=OpenComputers gui.appliedenergistics2.OCTunnel=OpenComputers
gui.appliedenergistics2.PressureTunnel=Pressure gui.appliedenergistics2.PressureTunnel=Pressure
@@ -376,7 +376,7 @@ gui.tooltips.appliedenergistics2.HighlightInterface=Highlight interface
gui.appliedenergistics2.units.appliedenergstics=AE gui.appliedenergistics2.units.appliedenergstics=AE
gui.appliedenergistics2.units.ic2=Energy Units gui.appliedenergistics2.units.ic2=Energy Units
gui.appliedenergistics2.units.rf=Redstone Flux gui.appliedenergistics2.units.rf=Redstone Flux
gui.appliedenergistics2.units.gtceu=GTCEU gui.appliedenergistics2.units.gteu=GTEU
// Colors // Colors
gui.appliedenergistics2.White=White gui.appliedenergistics2.White=White
@@ -1,6 +0,0 @@
{
"parent": "appliedenergistics2:item/part/p2p_tunnel",
"textures": {
"type": "appliedenergistics2:parts/p2p/power_gtceu"
}
}
@@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:item/part/p2p_tunnel",
"textures": {
"type": "appliedenergistics2:parts/p2p/power_gteu"
}
}
@@ -1,6 +0,0 @@
{
"parent": "appliedenergistics2:part/p2p/p2p_tunnel_base",
"textures": {
"type": "appliedenergistics2:parts/p2p/power_gtceu"
}
}
@@ -0,0 +1,6 @@
{
"parent": "appliedenergistics2:part/p2p/p2p_tunnel_base",
"textures": {
"type": "appliedenergistics2:parts/p2p/power_gteu"
}
}