Merge branch 'gtceu-p2p' into AE2-Omnifactory
This commit is contained in:
+1
-1
@@ -57,7 +57,7 @@ tasks.withType(JavaCompile) {
|
|||||||
options.encoding = 'UTF-8'
|
options.encoding = 'UTF-8'
|
||||||
}
|
}
|
||||||
|
|
||||||
version = trousers + "-" + aeversion + "-" + aechannel + "-" + aebuild + "-" + trousersversion
|
version = extended + "-" + aeversion + "-" + aechannel + "-" + aebuild + "-" + extendedversion
|
||||||
group = aegroup
|
group = aegroup
|
||||||
archivesBaseName = aebasename
|
archivesBaseName = aebasename
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -3,15 +3,14 @@ aechannel=stable
|
|||||||
aebuild=7
|
aebuild=7
|
||||||
aegroup=appeng
|
aegroup=appeng
|
||||||
aebasename=appliedenergistics2
|
aebasename=appliedenergistics2
|
||||||
trousers=trousers_edition
|
extended=extended_life
|
||||||
trousersversion=v49s
|
extendedversion=v49u
|
||||||
#########################################################
|
#########################################################
|
||||||
# Versions #
|
# Versions #
|
||||||
#########################################################
|
#########################################################
|
||||||
minecraft_version=1.12.2
|
minecraft_version=1.12.2
|
||||||
mcp_mappings=snapshot_20171003
|
mcp_mappings=snapshot_20171003
|
||||||
forge_version=14.23.5.2847
|
forge_version=14.23.5.2847
|
||||||
|
|
||||||
#########################################################
|
#########################################################
|
||||||
# Installable #
|
# Installable #
|
||||||
#########################################################
|
#########################################################
|
||||||
|
|||||||
@@ -80,8 +80,6 @@ configurations {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly "gregtechce:gregtech:1.12.2:1.15.1.735"
|
|
||||||
|
|
||||||
// installable runtime dependencies
|
// installable runtime dependencies
|
||||||
mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
mods "mcp.mobius.waila:Hwyla:${hwyla_version}"
|
||||||
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
|
mods "net.industrial-craft:industrialcraft-2:${ic2_version}:dev"
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ 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
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* unlocalized name for the power unit.
|
* unlocalized name for the power unit.
|
||||||
|
|||||||
@@ -29,6 +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
|
||||||
REDSTONE, // Redstone Tunnel
|
REDSTONE, // Redstone Tunnel
|
||||||
FLUID, // Fluid Tunnel
|
FLUID, // Fluid Tunnel
|
||||||
ITEM, // Item Tunnel
|
ITEM, // Item Tunnel
|
||||||
|
|||||||
@@ -88,6 +88,8 @@ public interface IParts
|
|||||||
|
|
||||||
IItemDefinition p2PTunnelFE();
|
IItemDefinition p2PTunnelFE();
|
||||||
|
|
||||||
|
IItemDefinition p2PTunnelGTCEU();
|
||||||
|
|
||||||
IItemDefinition p2PTunnelLight();
|
IItemDefinition p2PTunnelLight();
|
||||||
|
|
||||||
// IItemDefinition p2PTunnelOpenComputers();
|
// IItemDefinition p2PTunnelOpenComputers();
|
||||||
|
|||||||
@@ -87,6 +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( 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 );
|
||||||
|
|||||||
@@ -71,6 +71,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_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 );
|
||||||
@@ -148,6 +149,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 );
|
||||||
|
|
||||||
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,6 +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 p2PTunnelLight;
|
private final IItemDefinition p2PTunnelLight;
|
||||||
// private final IItemDefinition p2PTunnelOpenComputers;
|
// private final IItemDefinition p2PTunnelOpenComputers;
|
||||||
private final IItemDefinition cableAnchor;
|
private final IItemDefinition cableAnchor;
|
||||||
@@ -133,6 +134,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.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 ) );
|
||||||
@@ -339,6 +341,11 @@ public final class ApiParts implements IParts
|
|||||||
return this.p2PTunnelFE;
|
return this.p2PTunnelFE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public IItemDefinition p2PTunnelGTCEU()
|
||||||
|
{
|
||||||
|
return this.p2PTunnelGTCEU;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IItemDefinition p2PTunnelLight()
|
public IItemDefinition p2PTunnelLight()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -126,6 +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_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 ),
|
||||||
|
|||||||
@@ -19,13 +19,14 @@
|
|||||||
package appeng.core.features.registries;
|
package appeng.core.features.registries;
|
||||||
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.*;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
import javax.annotation.Nonnull;
|
import javax.annotation.Nonnull;
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
|
import appeng.core.AELog;
|
||||||
|
import appeng.util.item.OreHelper;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
@@ -54,8 +55,7 @@ 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,8 +64,26 @@ 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<>();
|
||||||
|
gtceOreDict.add("wireGtHex");
|
||||||
|
gtceOreDict.add("wireGtOctal");
|
||||||
|
gtceOreDict.add("wireGtQuadruple");
|
||||||
|
gtceOreDict.add("wireGtDouble");
|
||||||
|
gtceOreDict.add("wireGtSingle");
|
||||||
|
gtceOreDict.add("cableGtHex");
|
||||||
|
gtceOreDict.add("cableGtOctal");
|
||||||
|
gtceOreDict.add("cableGtQuadruple");
|
||||||
|
gtceOreDict.add("cableGtDouble");
|
||||||
|
gtceOreDict.add("cableGtSingle");
|
||||||
|
|
||||||
|
for(String oreDict : gtceOreDict) {
|
||||||
|
Arrays.stream( OreDictionary.getOreNames() ).filter( oreName -> oreName.startsWith( oreDict ) ).forEach( oreName -> {
|
||||||
|
OreHelper.INSTANCE.getCachedOres( oreName ).forEach( stack -> this.addNewAttunement( stack, TunnelType.GTCEU_POWER ) );
|
||||||
|
} );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forge energy tunnel items
|
* Forge energy tunnel items
|
||||||
|
|||||||
@@ -99,6 +99,7 @@ public enum GuiText
|
|||||||
OCTunnel,
|
OCTunnel,
|
||||||
LightTunnel,
|
LightTunnel,
|
||||||
FETunnel,
|
FETunnel,
|
||||||
|
GTCEUTunnel,
|
||||||
PressureTunnel,
|
PressureTunnel,
|
||||||
|
|
||||||
// spatial
|
// spatial
|
||||||
|
|||||||
@@ -30,35 +30,37 @@ import appeng.integration.modules.waila.WailaModule;
|
|||||||
public enum IntegrationType
|
public enum IntegrationType
|
||||||
{
|
{
|
||||||
IC2( IntegrationSide.BOTH, "Industrial Craft 2", "ic2" )
|
IC2( IntegrationSide.BOTH, "Industrial Craft 2", "ic2" )
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public IIntegrationModule createInstance()
|
public IIntegrationModule createInstance()
|
||||||
{
|
{
|
||||||
return Integrations.setIc2( new IC2Module() );
|
return Integrations.setIc2( new IC2Module() );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
GTCE( IntegrationSide.BOTH, "GregTech", "gregtech" ),
|
||||||
|
|
||||||
RC( IntegrationSide.BOTH, "Railcraft", "railcraft" ),
|
RC( IntegrationSide.BOTH, "Railcraft", "railcraft" ),
|
||||||
|
|
||||||
MFR( IntegrationSide.BOTH, "Mine Factory Reloaded", "minefactoryreloaded" ),
|
MFR( IntegrationSide.BOTH, "Mine Factory Reloaded", "minefactoryreloaded" ),
|
||||||
|
|
||||||
Waila( IntegrationSide.BOTH, "Waila", "waila" )
|
Waila( IntegrationSide.BOTH, "Waila", "waila" )
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public IIntegrationModule createInstance()
|
public IIntegrationModule createInstance()
|
||||||
{
|
{
|
||||||
return new WailaModule();
|
return new WailaModule();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
InvTweaks( IntegrationSide.CLIENT, "Inventory Tweaks", "inventorytweaks" )
|
InvTweaks( IntegrationSide.CLIENT, "Inventory Tweaks", "inventorytweaks" )
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public IIntegrationModule createInstance()
|
public IIntegrationModule createInstance()
|
||||||
{
|
{
|
||||||
return Integrations.setInvTweaks( new InventoryTweaksModule() );
|
return Integrations.setInvTweaks( new InventoryTweaksModule() );
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
JEI( IntegrationSide.CLIENT, "Just Enough Items", "jei" )
|
JEI( IntegrationSide.CLIENT, "Just Enough Items", "jei" )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import java.util.Set;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import appeng.parts.misc.*;
|
import appeng.parts.misc.*;
|
||||||
|
import appeng.parts.p2p.*;
|
||||||
import appeng.parts.reporting.*;
|
import appeng.parts.reporting.*;
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
@@ -65,13 +66,6 @@ import appeng.parts.networking.PartCableSmart;
|
|||||||
import appeng.parts.networking.PartDenseCableCovered;
|
import appeng.parts.networking.PartDenseCableCovered;
|
||||||
import appeng.parts.networking.PartDenseCableSmart;
|
import appeng.parts.networking.PartDenseCableSmart;
|
||||||
import appeng.parts.networking.PartQuartzFiber;
|
import appeng.parts.networking.PartQuartzFiber;
|
||||||
import appeng.parts.p2p.PartP2PFEPower;
|
|
||||||
import appeng.parts.p2p.PartP2PFluids;
|
|
||||||
import appeng.parts.p2p.PartP2PIC2Power;
|
|
||||||
import appeng.parts.p2p.PartP2PItems;
|
|
||||||
import appeng.parts.p2p.PartP2PLight;
|
|
||||||
import appeng.parts.p2p.PartP2PRedstone;
|
|
||||||
import appeng.parts.p2p.PartP2PTunnelME;
|
|
||||||
import appeng.util.Platform;
|
import appeng.util.Platform;
|
||||||
|
|
||||||
|
|
||||||
@@ -275,25 +269,32 @@ public enum PartType
|
|||||||
@Override
|
@Override
|
||||||
String getUnlocalizedName()
|
String getUnlocalizedName()
|
||||||
{
|
{
|
||||||
return "p2p_tunnel";
|
return "p2p_tunnel";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
P2P_TUNNEL_FE( 469, "p2p_tunnel_fe", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FE ), EnumSet
|
P2P_TUNNEL_FE( 469, "p2p_tunnel_fe", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_FE ), EnumSet.noneOf( IntegrationType.class ), PartP2PFEPower.class, GuiText.FETunnel )
|
||||||
.noneOf( IntegrationType.class ), PartP2PFEPower.class, GuiText.FETunnel )
|
{
|
||||||
{
|
@Override
|
||||||
@Override
|
String getUnlocalizedName()
|
||||||
String getUnlocalizedName()
|
{
|
||||||
{
|
return "p2p_tunnel";
|
||||||
return "p2p_tunnel";
|
}
|
||||||
}
|
},
|
||||||
},
|
|
||||||
|
P2P_TUNNEL_GTCEU( 470, "p2p_tunnel_gtceu", EnumSet.of( AEFeature.P2P_TUNNEL, AEFeature.P2P_TUNNEL_GTCEU ), EnumSet.of( IntegrationType.GTCE ), PartP2PGTCEPower.class, GuiText.GTCEUTunnel )
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
String getUnlocalizedName()
|
||||||
|
{
|
||||||
|
return "p2p_tunnel";
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of(
|
// P2PTunnelOpenComputers( 468, EnumSet.of( AEFeature.P2PTunnel, AEFeature.P2PTunnelOpenComputers ), EnumSet.of(
|
||||||
// IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel ),
|
// IntegrationType.OpenComputers ), PartP2POpenComputers.class, GuiText.OCTunnel ),
|
||||||
|
|
||||||
INTERFACE_TERMINAL( 480, "interface_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet
|
INTERFACE_TERMINAL( 480, "interface_terminal", EnumSet.of( AEFeature.INTERFACE_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartInterfaceTerminal.class ),
|
||||||
.noneOf( IntegrationType.class ), PartInterfaceTerminal.class ),
|
|
||||||
|
|
||||||
FLUID_TERMINAL( 520, "fluid_terminal", EnumSet.of( AEFeature.FLUID_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartFluidTerminal.class );
|
FLUID_TERMINAL( 520, "fluid_terminal", EnumSet.of( AEFeature.FLUID_TERMINAL ), EnumSet.noneOf( IntegrationType.class ), PartFluidTerminal.class );
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,308 @@
|
|||||||
|
package appeng.parts.p2p;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.Nullable;
|
||||||
|
import appeng.api.parts.IPartModel;
|
||||||
|
import appeng.items.parts.PartModels;
|
||||||
|
import appeng.me.GridAccessException;
|
||||||
|
import gregtech.api.capability.GregtechCapabilities;
|
||||||
|
import gregtech.api.capability.IEnergyContainer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumFacing;
|
||||||
|
import net.minecraftforge.common.capabilities.Capability;
|
||||||
|
import net.minecraftforge.fml.common.Optional;
|
||||||
|
|
||||||
|
import java.util.ArrayDeque;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Queue;
|
||||||
|
|
||||||
|
|
||||||
|
public class PartP2PGTCEPower extends PartP2PTunnel<PartP2PGTCEPower>
|
||||||
|
{
|
||||||
|
private static final P2PModels MODELS = new P2PModels( "part/p2p/p2p_tunnel_gtceu" );
|
||||||
|
private static final IEnergyContainer NULL_ENERGY_STORAGE = new NullEnergyStorage();
|
||||||
|
private final IEnergyContainer inputHandler = new InputEnergyStorage();
|
||||||
|
private final IEnergyContainer outputHandler = new OutputEnergyStorage();
|
||||||
|
private final Queue<PartP2PGTCEPower> outputs = new ArrayDeque<>();
|
||||||
|
|
||||||
|
public PartP2PGTCEPower( ItemStack is )
|
||||||
|
{
|
||||||
|
super( is );
|
||||||
|
}
|
||||||
|
|
||||||
|
@PartModels
|
||||||
|
public static List<IPartModel> getModels()
|
||||||
|
{
|
||||||
|
return MODELS.getModels();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPartModel getStaticModels()
|
||||||
|
{
|
||||||
|
return MODELS.getModel( this.isPowered(), this.isActive() );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTunnelNetworkChange()
|
||||||
|
{
|
||||||
|
this.getHost().notifyNeighbors();
|
||||||
|
}
|
||||||
|
|
||||||
|
private IEnergyContainer getAttachedEnergyStorage()
|
||||||
|
{
|
||||||
|
if( this.isActive() )
|
||||||
|
{
|
||||||
|
final TileEntity self = this.getTile();
|
||||||
|
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() ) )
|
||||||
|
{
|
||||||
|
return te.getCapability( GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER, this.getSide().getOpposite().getFacing() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL_ENERGY_STORAGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasCapability( @Nonnull Capability<?> capability )
|
||||||
|
{
|
||||||
|
if( capability == GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return super.hasCapability( capability );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
@Override
|
||||||
|
public <T> T getCapability( @Nonnull Capability<T> capability )
|
||||||
|
{
|
||||||
|
if( capability == GregtechCapabilities.CAPABILITY_ENERGY_CONTAINER )
|
||||||
|
{
|
||||||
|
if( this.isOutput() )
|
||||||
|
{
|
||||||
|
return (T) this.outputHandler;
|
||||||
|
}
|
||||||
|
return (T) this.inputHandler;
|
||||||
|
}
|
||||||
|
return super.getCapability( capability );
|
||||||
|
}
|
||||||
|
|
||||||
|
class InputEnergyStorage implements IEnergyContainer
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public long getEnergyCanBeInserted()
|
||||||
|
{
|
||||||
|
long canInsert = 0;
|
||||||
|
if( outputs.isEmpty() )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for( PartP2PGTCEPower o : PartP2PGTCEPower.this.getOutputs() )
|
||||||
|
outputs.add( o );
|
||||||
|
}
|
||||||
|
catch( GridAccessException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while ( !outputs.isEmpty() )
|
||||||
|
{
|
||||||
|
PartP2PGTCEPower target = outputs.poll();
|
||||||
|
final IEnergyContainer output = target.getAttachedEnergyStorage();
|
||||||
|
|
||||||
|
if( output == null || output.getEnergyCanBeInserted() <= 0 )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
canInsert += output.getEnergyCanBeInserted();
|
||||||
|
}
|
||||||
|
return canInsert;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long acceptEnergyFromNetwork( EnumFacing facing, long voltage, long amperage )
|
||||||
|
{
|
||||||
|
long amperesUsed = 0L;
|
||||||
|
|
||||||
|
if( outputs.isEmpty() )
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
for( PartP2PGTCEPower o : PartP2PGTCEPower.this.getOutputs() )
|
||||||
|
outputs.add( o );
|
||||||
|
}
|
||||||
|
catch( GridAccessException e )
|
||||||
|
{
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
while ( !outputs.isEmpty() )
|
||||||
|
{
|
||||||
|
PartP2PGTCEPower target = outputs.poll();
|
||||||
|
final IEnergyContainer output = target.getAttachedEnergyStorage();
|
||||||
|
|
||||||
|
if( output == null || !output.inputsEnergy( facing ) || output.getEnergyCanBeInserted() <= 0 )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( voltage > 0 )
|
||||||
|
{
|
||||||
|
amperesUsed += output.acceptEnergyFromNetwork( facing, voltage, amperage - amperesUsed );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( amperage == amperesUsed )
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return amperesUsed;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean inputsEnergy( EnumFacing enumFacing )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long changeEnergy( long l )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEnergyStored()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEnergyCapacity()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getInputAmperage()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getInputVoltage()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class OutputEnergyStorage implements IEnergyContainer
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public long acceptEnergyFromNetwork( EnumFacing facing, long voltage, long amperage )
|
||||||
|
{
|
||||||
|
if( facing == getSide().getFacing() )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
final IEnergyContainer output = getAttachedEnergyStorage();
|
||||||
|
voltage *= 0.95;
|
||||||
|
if( voltage > 0 )
|
||||||
|
{
|
||||||
|
return output.acceptEnergyFromNetwork( facing, voltage, amperage );
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean inputsEnergy( EnumFacing enumFacing )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean outputsEnergy( EnumFacing side )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long changeEnergy( long l )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEnergyStored()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEnergyCapacity()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getInputAmperage()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getInputVoltage()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static class NullEnergyStorage implements IEnergyContainer
|
||||||
|
{
|
||||||
|
@Override
|
||||||
|
public long acceptEnergyFromNetwork( EnumFacing enumFacing, long l, long l1 )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean inputsEnergy( EnumFacing enumFacing )
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long changeEnergy( long l )
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEnergyStored()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getEnergyCapacity()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getInputAmperage()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getInputVoltage()
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -292,6 +292,10 @@ 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:
|
||||||
|
newType = parts.p2PTunnelGTCEU().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||||
|
break;
|
||||||
|
|
||||||
case FLUID:
|
case FLUID:
|
||||||
newType = parts.p2PTunnelFluids().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
newType = parts.p2PTunnelFluids().maybeStack( 1 ).orElse( ItemStack.EMPTY );
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class OreHelper
|
|||||||
return oreIDs;
|
return oreIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ItemStack> getCachedOres( final String oreName )
|
public List<ItemStack> getCachedOres( final String oreName )
|
||||||
{
|
{
|
||||||
return this.oreDictCache.getUnchecked( oreName );
|
return this.oreDictCache.getUnchecked( oreName );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,6 +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.LightTunnel=Light
|
gui.appliedenergistics2.LightTunnel=Light
|
||||||
gui.appliedenergistics2.OCTunnel=OpenComputers
|
gui.appliedenergistics2.OCTunnel=OpenComputers
|
||||||
gui.appliedenergistics2.PressureTunnel=Pressure
|
gui.appliedenergistics2.PressureTunnel=Pressure
|
||||||
@@ -375,6 +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
|
||||||
|
|
||||||
// Colors
|
// Colors
|
||||||
gui.appliedenergistics2.White=White
|
gui.appliedenergistics2.White=White
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "appliedenergistics2:item/part/p2p_tunnel",
|
||||||
|
"textures": {
|
||||||
|
"type": "appliedenergistics2:parts/p2p/power_gtceu"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"parent": "appliedenergistics2:part/p2p/p2p_tunnel_base",
|
||||||
|
"textures": {
|
||||||
|
"type": "appliedenergistics2:parts/p2p/power_gtceu"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 206 B |
@@ -1,17 +1,17 @@
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
"modid":"appliedenergistics2",
|
"modid": "appliedenergistics2",
|
||||||
"name":"Applied Energistics 2 Trousers Edition",
|
"name": "AE2 Unofficial Extended Life",
|
||||||
"description":"A Mod about Matter, Energy and using them to conquer the world..",
|
"description": "A Mod about Matter, Energy and using them to conquer the world..",
|
||||||
"version":"${version}",
|
"version": "${version}",
|
||||||
"mcversion":"${mcversion}",
|
"mcversion": "${mcversion}",
|
||||||
"url":"https://github.com/PrototypeTrousers/Applied-Energistics-2",
|
"url": "https://github.com/PrototypeTrousers/Applied-Energistics-2",
|
||||||
"updateUrl":"",
|
"updateUrl": "",
|
||||||
"authorList":[
|
"authorList": [
|
||||||
"AlgorithmX2"
|
"AlgorithmX2"
|
||||||
],
|
],
|
||||||
"credits":"AlgorithmX2",
|
"credits": "AlgorithmX2",
|
||||||
"logoFile":"assets/appliedenergistics2/meta/logo.png",
|
"logoFile": "assets/appliedenergistics2/meta/logo.png",
|
||||||
"screenshots":[]
|
"screenshots":[]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user