From ccc3c7ab12bfa5b8f31b168ddf42be13e1a7177d Mon Sep 17 00:00:00 2001 From: malte0811 Date: Tue, 22 Aug 2017 18:33:05 +0200 Subject: [PATCH] IC2 is an optional dependency now, probably still buggy Fix the TE names --- build.gradle | 19 +++- gradle/wrapper/gradle-wrapper.properties | 2 +- .../industrialWires/IndustrialWires.java | 48 +++++--- .../blocks/controlpanel/TileEntityPanel.java | 12 +- .../blocks/wire/BlockIC2Connector.java | 4 +- .../industrialWires/blocks/wire/DummyTEs.java | 44 +++++++ .../wire/TileEntityIC2ConnectorGold.java | 4 +- .../blocks/wire/TileEntityIC2ConnectorHV.java | 4 +- .../wire/TileEntityIC2ConnectorTin.java | 93 ++++++++++----- .../industrialWires/client/ClientProxy.java | 13 ++- .../controlpanel/CoveredToggleSwitch.java | 1 + .../controlpanel/IndicatorLight.java | 1 + .../controlpanel/LightedButton.java | 4 +- .../industrialWires/controlpanel/Lock.java | 5 +- .../controlpanel/PanelMeter.java | 1 + .../industrialWires/controlpanel/Slider.java | 1 + .../controlpanel/ToggleSwitch.java | 4 +- .../industrialWires/controlpanel/Variac.java | 1 + .../industrialWires/crafting/IC2TRHelper.java | 107 ++++++++++++++++++ .../crafting/RecipeCoilLength.java | 4 +- .../crafting/RecipeComponentCopy.java | 2 +- .../crafting/RecipeKeyLock.java | 2 +- .../crafting/RecipeKeyRing.java | 2 +- .../crafting/factories/IC2ItemFactory.java | 13 ++- .../recipes/ic2_connector_copper_conn.json | 23 +++- .../recipes/ic2_connector_copper_relay.json | 17 ++- .../recipes/ic2_connector_glass_conn.json | 17 ++- .../recipes/ic2_connector_glass_relay.json | 17 ++- .../recipes/ic2_connector_gold_conn.json | 17 ++- .../recipes/ic2_connector_gold_relay.json | 17 ++- .../recipes/ic2_connector_hv_conn.json | 17 ++- .../recipes/ic2_connector_hv_relay.json | 17 ++- .../recipes/ic2_connector_tin_conn.json | 17 ++- .../recipes/ic2_connector_tin_relay.json | 17 ++- .../recipes/mechanical_converter_kin_rot.json | 27 +++-- .../recipes/mechanical_converter_motor.json | 12 +- .../recipes/mechanical_converter_rot_kin.json | 27 +++-- .../industrialwires/recipes/wire_copper.json | 17 ++- .../industrialwires/recipes/wire_glass.json | 17 ++- .../industrialwires/recipes/wire_gold.json | 17 ++- .../industrialwires/recipes/wire_hv.json | 17 ++- .../industrialwires/recipes/wire_tin.json | 17 ++- 42 files changed, 604 insertions(+), 114 deletions(-) create mode 100644 src/main/java/malte0811/industrialWires/blocks/wire/DummyTEs.java create mode 100644 src/main/java/malte0811/industrialWires/crafting/IC2TRHelper.java diff --git a/build.gradle b/build.gradle index 063cf2c..397a4d7 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 minecraft { - version = "14.21.1.2404" + version = "14.21.1.2443" runDir = "run" replace '${version}', project.version @@ -42,15 +42,30 @@ repositories { name 'ic2' url 'http://maven.ic2.player.to/' } + maven { + name 'tr' + url 'http://maven.modmuss50.me' + } maven { name 'jared maven' url 'http://blamejared.com/maven' } + // dependencies of TR... + maven { + url 'http://maven.epoxide.xyz' + } + maven { + // HWYLA + name "TehNut" + url "http://tehnut.info/maven/" + } } dependencies { - compile "net.industrial-craft:industrialcraft-2:2.8.+" + deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.+' deobfCompile "blusunrize:ImmersiveEngineering:0.12-+:deobf" + compileOnly "TechReborn:TechReborn-1.12:2.6.+:dev" + compileOnly "RebornCore:RebornCore-1.12:3.2.+:dev" } jar { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9397848..7b28f0a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip diff --git a/src/main/java/malte0811/industrialWires/IndustrialWires.java b/src/main/java/malte0811/industrialWires/IndustrialWires.java index f67841d..2fbb795 100644 --- a/src/main/java/malte0811/industrialWires/IndustrialWires.java +++ b/src/main/java/malte0811/industrialWires/IndustrialWires.java @@ -41,6 +41,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.fml.common.FMLCommonHandler; +import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.SidedProxy; @@ -57,7 +59,7 @@ import org.apache.logging.log4j.Logger; import java.util.ArrayList; import java.util.List; -@Mod(modid = IndustrialWires.MODID, version = IndustrialWires.VERSION, dependencies = "required-after:immersiveengineering@[0.10-58,);required-after:ic2") +@Mod(modid = IndustrialWires.MODID, version = IndustrialWires.VERSION, dependencies = "required-after:immersiveengineering@[0.10-58,);after:ic2") @Mod.EventBusSubscriber public class IndustrialWires { public static final String MODID = "industrialwires"; @@ -89,15 +91,21 @@ public class IndustrialWires { }; @SidedProxy(clientSide = "malte0811.industrialWires.client.ClientProxy", serverSide = "malte0811.industrialWires.CommonProxy") public static CommonProxy proxy; + public static boolean hasIC2; + public static boolean hasTechReborn; @EventHandler public void preInit(FMLPreInitializationEvent e) { + hasIC2 = Loader.isModLoaded("ic2"); + hasTechReborn = Loader.isModLoaded("techreborn"); logger = e.getModLog(); new IWConfig(); - if (IWConfig.enableConversion) { + if (IWConfig.enableConversion&&hasIC2) { mechConv = new BlockMechanicalConverter(); } - ic2conn = new BlockIC2Connector(); + if (hasIC2||hasTechReborn) { + ic2conn = new BlockIC2Connector(); + } jacobsLadder = new BlockJacobsLadder(); panel = new BlockPanel(); @@ -105,22 +113,32 @@ public class IndustrialWires { panelComponent = new ItemPanelComponent(); key = new ItemKey(); - GameRegistry.registerTileEntity(TileEntityIC2ConnectorTin.class, MODID + "ic2ConnectorTin"); - GameRegistry.registerTileEntity(TileEntityIC2ConnectorCopper.class, MODID + "ic2ConnectorCopper"); - GameRegistry.registerTileEntity(TileEntityIC2ConnectorGold.class, MODID + "ic2ConnectorGold"); - GameRegistry.registerTileEntity(TileEntityIC2ConnectorHV.class, MODID + "ic2ConnectorHV"); - GameRegistry.registerTileEntity(TileEntityIC2ConnectorGlass.class, MODID + "ic2ConnectorGlass"); + if (hasIC2) { + //TODO + GameRegistry.registerTileEntity(TileEntityIC2ConnectorTin.class, MODID + ":ic2ConnectorTin"); + GameRegistry.registerTileEntity(TileEntityIC2ConnectorCopper.class, MODID + ":ic2ConnectorCopper"); + GameRegistry.registerTileEntity(TileEntityIC2ConnectorGold.class, MODID + ":ic2ConnectorGold"); + GameRegistry.registerTileEntity(TileEntityIC2ConnectorHV.class, MODID + ":ic2ConnectorHV"); + GameRegistry.registerTileEntity(TileEntityIC2ConnectorGlass.class, MODID + ":ic2ConnectorGlass"); + // Dummy TE's with bad names used to update old TE's to the proper names + GameRegistry.registerTileEntity(DummyTEs.TinDummy.class, MODID + "ic2ConnectorTin"); + GameRegistry.registerTileEntity(DummyTEs.CopperDummy.class, MODID + "ic2ConnectorCopper"); + GameRegistry.registerTileEntity(DummyTEs.GoldDummy.class, MODID + "ic2ConnectorGold"); + GameRegistry.registerTileEntity(DummyTEs.HVDummy.class, MODID + "ic2ConnectorHV"); + GameRegistry.registerTileEntity(DummyTEs.GlassDummy.class, MODID + "ic2ConnectorGlass"); + + if (IWConfig.enableConversion) { + GameRegistry.registerTileEntity(TileEntityIEMotor.class, MODID + ":ieMotor"); + GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, MODID + ":mechIcToIe"); + GameRegistry.registerTileEntity(TileEntityMechIEtoIC.class, MODID + ":mechIeToIc"); + } + } GameRegistry.registerTileEntity(TileEntityJacobsLadder.class, MODID + ":jacobsLadder"); GameRegistry.registerTileEntity(TileEntityPanel.class, MODID + ":control_panel"); GameRegistry.registerTileEntity(TileEntityRSPanelConn.class, MODID + ":control_panel_rs"); GameRegistry.registerTileEntity(TileEntityPanelCreator.class, MODID + ":panel_creator"); GameRegistry.registerTileEntity(TileEntityUnfinishedPanel.class, MODID + ":unfinished_panel"); GameRegistry.registerTileEntity(TileEntityComponentPanel.class, MODID + ":single_component_panel"); - if (IWConfig.enableConversion) { - GameRegistry.registerTileEntity(TileEntityIEMotor.class, MODID + ":ieMotor"); - GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, MODID + ":mechIcToIe"); - GameRegistry.registerTileEntity(TileEntityMechIEtoIC.class, MODID + ":mechIeToIc"); - } proxy.preInit(); } @@ -149,7 +167,9 @@ public class IndustrialWires { @EventHandler public void init(FMLInitializationEvent e) { - ExtraIC2Compat.addToolConmpat(); + if (hasIC2) { + ExtraIC2Compat.addToolConmpat(); + } packetHandler.registerMessage(MessageTileSyncIW.HandlerClient.class, MessageTileSyncIW.class, 0, Side.CLIENT); packetHandler.registerMessage(MessagePanelInteract.HandlerServer.class, MessagePanelInteract.class, 1, Side.SERVER); diff --git a/src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java b/src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java index 485b8f1..25b2915 100644 --- a/src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java +++ b/src/main/java/malte0811/industrialWires/blocks/controlpanel/TileEntityPanel.java @@ -57,7 +57,6 @@ public class TileEntityPanel extends TileEntityIWBase implements IDirectionalTil public boolean firstTick = true; // non-rendered properties private Set rsPorts = new HashSet<>(); - private boolean renderUpdate; { int[] colors = { @@ -100,13 +99,6 @@ public class TileEntityPanel extends TileEntityIWBase implements IDirectionalTil } firstTick = false; } - if (renderUpdate) { - IBlockState state = world.getBlockState(pos); - world.notifyBlockUpdate(pos, state, state, 3); - world.addBlockEvent(pos, state.getBlock(), 255, 0); - markDirty(); - renderUpdate = false; - } } } @@ -289,7 +281,9 @@ public class TileEntityPanel extends TileEntityIWBase implements IDirectionalTil } public void triggerRenderUpdate() { - renderUpdate = true; + IBlockState state = world.getBlockState(pos); + world.notifyBlockUpdate(pos, state, state, 3); + world.addBlockEvent(pos, state.getBlock(), 255, 0); } public void registerRS(TileEntityRSPanelConn te) { diff --git a/src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java b/src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java index c3cd877..1e58fa9 100644 --- a/src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java +++ b/src/main/java/malte0811/industrialWires/blocks/wire/BlockIC2Connector.java @@ -30,8 +30,6 @@ import net.minecraft.block.state.IBlockState; import net.minecraft.client.resources.I18n; import net.minecraft.client.util.ITooltipFlag; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockRenderLayer; @@ -63,7 +61,7 @@ public class BlockIC2Connector extends BlockIWBase implements IMetaEnum { TileEntity te = world.getTileEntity(pos); if (te instanceof TileEntityIC2ConnectorTin) { TileEntityIC2ConnectorTin connector = (TileEntityIC2ConnectorTin) te; - if (world.isAirBlock(pos.offset(connector.f))) { + if (world.isAirBlock(pos.offset(connector.facing))) { this.dropBlockAsItem(connector.getWorld(), pos, world.getBlockState(pos), 0); connector.getWorld().setBlockToAir(pos); } diff --git a/src/main/java/malte0811/industrialWires/blocks/wire/DummyTEs.java b/src/main/java/malte0811/industrialWires/blocks/wire/DummyTEs.java new file mode 100644 index 0000000..22622fc --- /dev/null +++ b/src/main/java/malte0811/industrialWires/blocks/wire/DummyTEs.java @@ -0,0 +1,44 @@ +package malte0811.industrialWires.blocks.wire; + +public final class DummyTEs { + public static class TinDummy extends TileEntityIC2ConnectorTin { + @Override + public void update() { + TileEntityIC2ConnectorTin newTe = getRaw(); + newTe.inBuffer = inBuffer; + newTe.outBuffer = outBuffer; + newTe.maxToNet = maxToNet; + newTe.maxToMachine = maxToMachine; + newTe.relay = relay; + newTe.facing = facing; + world.setTileEntity(pos, newTe); + } + protected TileEntityIC2ConnectorTin getRaw() { + return new TileEntityIC2ConnectorTin(); + } + } + public static class CopperDummy extends TinDummy { + @Override + protected TileEntityIC2ConnectorTin getRaw() { + return new TileEntityIC2ConnectorCopper(); + } + } + public static class GoldDummy extends TinDummy { + @Override + protected TileEntityIC2ConnectorTin getRaw() { + return new TileEntityIC2ConnectorGold(); + } + } + public static class HVDummy extends TinDummy { + @Override + protected TileEntityIC2ConnectorTin getRaw() { + return new TileEntityIC2ConnectorHV(); + } + } + public static class GlassDummy extends TinDummy { + @Override + protected TileEntityIC2ConnectorTin getRaw() { + return new TileEntityIC2ConnectorGlass(); + } + } +} diff --git a/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorGold.java b/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorGold.java index 6881fcb..ef378f1 100644 --- a/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorGold.java +++ b/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorGold.java @@ -45,13 +45,13 @@ public class TileEntityIC2ConnectorGold extends TileEntityIC2ConnectorTin { @Override public Vec3d getRaytraceOffset(IImmersiveConnectable link) { - EnumFacing side = f.getOpposite(); + EnumFacing side = facing.getOpposite(); return new Vec3d(.5 + side.getFrontOffsetX() * .125, .5 + side.getFrontOffsetY() * .125, .5 + side.getFrontOffsetZ() * .125); } @Override public Vec3d getConnectionOffset(Connection con) { - EnumFacing side = f.getOpposite(); + EnumFacing side = facing.getOpposite(); double conRadius = con.cableType.getRenderDiameter() / 2; return new Vec3d(.5 + side.getFrontOffsetX() * (.0625 - conRadius), .5 + side.getFrontOffsetY() * (.0625 - conRadius), .5 + side.getFrontOffsetZ() * (.0625 - conRadius)); } diff --git a/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorHV.java b/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorHV.java index 7463bfb..0bc4e23 100644 --- a/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorHV.java +++ b/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorHV.java @@ -45,7 +45,7 @@ public class TileEntityIC2ConnectorHV extends TileEntityIC2ConnectorTin { @Override public Vec3d getRaytraceOffset(IImmersiveConnectable link) { - EnumFacing side = f.getOpposite(); + EnumFacing side = facing.getOpposite(); if (relay) { return new Vec3d(.5 + side.getFrontOffsetX() * .4375, .5 + side.getFrontOffsetY() * .4375, .5 + side.getFrontOffsetZ() * .4375); } else { @@ -55,7 +55,7 @@ public class TileEntityIC2ConnectorHV extends TileEntityIC2ConnectorTin { @Override public Vec3d getConnectionOffset(Connection con) { - EnumFacing side = f.getOpposite(); + EnumFacing side = facing.getOpposite(); double conRadius = con.cableType.getRenderDiameter() / 2; if (relay) { return new Vec3d(.5 + side.getFrontOffsetX() * (.375 - conRadius), .5 + side.getFrontOffsetY() * (.375 - conRadius), .5 + side.getFrontOffsetZ() * (.375 - conRadius)); diff --git a/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java b/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java index efce9de..2741ca1 100644 --- a/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java +++ b/src/main/java/malte0811/industrialWires/blocks/wire/TileEntityIC2ConnectorTin.java @@ -26,6 +26,7 @@ import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler.Conn import blusunrize.immersiveengineering.api.energy.wires.TileEntityImmersiveConnectable; import blusunrize.immersiveengineering.api.energy.wires.WireType; import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile; +import blusunrize.immersiveengineering.common.util.Utils; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; import ic2.api.energy.tile.IEnergyAcceptor; @@ -33,17 +34,22 @@ import ic2.api.energy.tile.IEnergyEmitter; import ic2.api.energy.tile.IEnergySink; import ic2.api.energy.tile.IEnergySource; import malte0811.industrialWires.IIC2Connector; +import malte0811.industrialWires.IndustrialWires; import malte0811.industrialWires.blocks.IBlockBoundsIW; import malte0811.industrialWires.wires.IC2Wiretype; import net.minecraft.entity.EntityLivingBase; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.ITickable; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.Vec3d; import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.Optional; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; +import reborncore.api.power.EnumPowerTier; +import reborncore.api.power.IEnergyInterfaceTile; import javax.annotation.Nonnull; import java.util.HashMap; @@ -51,20 +57,25 @@ import java.util.HashSet; import java.util.Map; import java.util.Set; -public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable implements IEnergySource, IEnergySink, IDirectionalTile, ITickable, IIC2Connector, IBlockBoundsIW { - EnumFacing f = EnumFacing.NORTH; +@Optional.InterfaceList({ + @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySource", modid = "ic2"), + @Optional.Interface(iface = "ic2.api.energy.tile.IEnergySink", modid = "ic2")//TODO tech reborn +}) +public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable implements IEnergySource, IEnergySink, IDirectionalTile, + ITickable, IIC2Connector, IBlockBoundsIW { + EnumFacing facing = EnumFacing.NORTH; boolean relay; private boolean first = true; //IC2 net to IE net buffer - private double inBuffer = 0; - private double maxToNet = 0; + double inBuffer = 0; + double maxToNet = 0; //IE net to IC2 net buffer - private double outBuffer = 0; - private double maxToMachine = 0; - protected double maxStored = IC2Wiretype.IC2_TYPES[0].getTransferRate() / 8; + double outBuffer = 0; + double maxToMachine = 0; + double maxStored = IC2Wiretype.IC2_TYPES[0].getTransferRate() / 8; int tier = 1; - public TileEntityIC2ConnectorTin(boolean rel) { + TileEntityIC2ConnectorTin(boolean rel) { relay = rel; } @@ -74,15 +85,27 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im @Override public void update() { if (first) { - if (!world.isRemote) + if (!world.isRemote&& IndustrialWires.hasIC2) MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this)); first = false; } - if (!world.isRemote && inBuffer > .1) - transferPower(); + if (!world.isRemote) { + if (inBuffer > .1) { + transferPower(); + } + if (outBuffer>.1&&IndustrialWires.hasTechReborn) { + TileEntity output = Utils.getExistingTileEntity(world, pos.offset(facing)); + if (output instanceof IEnergyInterfaceTile) { + IEnergyInterfaceTile out = (IEnergyInterfaceTile) output; + if (out.canAcceptEnergy(facing.getOpposite())) { + outBuffer -= out.addEnergy(Math.min(outBuffer, maxToMachine)); + } + } + } + } } - public void transferPower() { + private void transferPower() { Set conns = new HashSet<>(ImmersiveNetHandler.INSTANCE.getIndirectEnergyConnections(pos, world)); Map> maxOutputs = new HashMap<>(); double outputMax = Math.min(inBuffer, maxToNet); @@ -125,7 +148,7 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im } } - public double getAverageLossRate(AbstractConnection conn) { + private double getAverageLossRate(AbstractConnection conn) { double f = 0; for (Connection c : conn.subConnections) { f += c.length * c.cableType.getLossRatio(); @@ -169,13 +192,13 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im @Override public Vec3d getRaytraceOffset(IImmersiveConnectable link) { - EnumFacing side = f.getOpposite(); + EnumFacing side = facing.getOpposite(); return new Vec3d(.5 + side.getFrontOffsetX() * .0625, .5 + side.getFrontOffsetY() * .0625, .5 + side.getFrontOffsetZ() * .0625); } @Override public Vec3d getConnectionOffset(Connection con) { - EnumFacing side = f.getOpposite(); + EnumFacing side = facing.getOpposite(); double conRadius = con.cableType.getRenderDiameter() / 2; return new Vec3d(.5 - conRadius * side.getFrontOffsetX(), .5 - conRadius * side.getFrontOffsetY(), .5 - conRadius * side.getFrontOffsetZ()); } @@ -205,16 +228,19 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im } @Override + @Optional.Method(modid="ic2") public boolean emitsEnergyTo(IEnergyAcceptor receiver, EnumFacing side) { - return !relay && side == f; + return !relay && side == facing; } @Override + @Optional.Method(modid="ic2") public boolean acceptsEnergyFrom(IEnergyEmitter emitter, EnumFacing side) { - return !relay && side == f; + return !relay && side == facing; } @Override + @Optional.Method(modid="ic2") public double getDemandedEnergy() { double ret = maxStored + .5 - inBuffer; if (ret < .1) @@ -223,20 +249,16 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im } @Override + @Optional.Method(modid="ic2") public int getSinkTier() { return tier; } @Override + @Optional.Method(modid="ic2") public double injectEnergy(EnumFacing directionFrom, double amount, double voltage) { if (inBuffer < maxStored) { - if (inBuffer < maxToNet) { - maxToNet = inBuffer; - } - inBuffer += amount; - if (amount > maxToNet) { - maxToNet = amount; - } + addToIn(amount); markDirty(); return 0; } @@ -244,25 +266,38 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im } @Override + @Optional.Method(modid="ic2") public double getOfferedEnergy() { return Math.min(maxToMachine, outBuffer); } @Override + @Optional.Method(modid="ic2") public void drawEnergy(double amount) { outBuffer -= amount; markDirty(); } @Override + @Optional.Method(modid="ic2") public int getSourceTier() { return tier; } + private void addToIn(double amount) { + if (inBuffer < maxToNet) { + maxToNet = inBuffer; + } + inBuffer += amount; + if (amount > maxToNet) { + maxToNet = amount; + } + } + @Override public void readCustomNBT(NBTTagCompound nbt, boolean descPacket) { super.readCustomNBT(nbt, descPacket); - f = EnumFacing.getFront(nbt.getInteger("facing")); + facing = EnumFacing.getFront(nbt.getInteger("facing")); relay = nbt.getBoolean("relay"); inBuffer = nbt.getDouble("inBuffer"); outBuffer = nbt.getDouble("outBuffer"); @@ -281,7 +316,7 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im @Override public void writeCustomNBT(NBTTagCompound nbt, boolean descPacket) { super.writeCustomNBT(nbt, descPacket); - nbt.setInteger("facing", f.getIndex()); + nbt.setInteger("facing", facing.getIndex()); nbt.setBoolean("relay", relay); nbt.setDouble("inBuffer", inBuffer); nbt.setDouble("outBuffer", outBuffer); @@ -292,12 +327,12 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im @Nonnull @Override public EnumFacing getFacing() { - return f; + return facing; } @Override public void setFacing(@Nonnull EnumFacing facing) { - f = facing; + this.facing = facing; } @Override @@ -320,7 +355,7 @@ public class TileEntityIC2ConnectorTin extends TileEntityImmersiveConnectable im float length = this instanceof TileEntityIC2ConnectorHV ? (relay ? .875f : .75f) : this instanceof TileEntityIC2ConnectorGold ? .5625f : .5f; float wMin = .3125f; float wMax = .6875f; - switch (f.getOpposite()) { + switch (facing.getOpposite()) { case UP: return new AxisAlignedBB(wMin, 0, wMin, wMax, length, wMax); case DOWN: diff --git a/src/main/java/malte0811/industrialWires/client/ClientProxy.java b/src/main/java/malte0811/industrialWires/client/ClientProxy.java index 9d3c0c3..b31ed41 100644 --- a/src/main/java/malte0811/industrialWires/client/ClientProxy.java +++ b/src/main/java/malte0811/industrialWires/client/ClientProxy.java @@ -41,6 +41,7 @@ import malte0811.industrialWires.client.gui.GuiRenameKey; import malte0811.industrialWires.client.panelmodel.PanelModelLoader; import malte0811.industrialWires.client.render.TileRenderJacobsLadder; import malte0811.industrialWires.controlpanel.PanelComponent; +import malte0811.industrialWires.crafting.IC2TRHelper; import malte0811.industrialWires.items.ItemIC2Coil; import malte0811.industrialWires.items.ItemKey; import malte0811.industrialWires.items.ItemPanelComponent; @@ -54,6 +55,7 @@ import net.minecraft.client.renderer.block.model.ModelResourceLocation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.Ingredient; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumHand; import net.minecraft.util.ResourceLocation; @@ -69,9 +71,7 @@ import net.minecraftforge.fml.client.registry.ClientRegistry; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.relauncher.Side; -import java.util.Locale; -import java.util.Random; -import java.util.WeakHashMap; +import java.util.*; public class ClientProxy extends CommonProxy { @Override @@ -122,10 +122,11 @@ public class ClientProxy extends CommonProxy { ManualInstance m = ManualHelper.getManual(); PositionedItemStack[][] wireRecipes = new PositionedItemStack[3][10]; int xBase = 15; - ItemStack tinCable = IC2Items.getItem("cable", "type:tin,insulation:0"); + Ingredient tinCable = IC2TRHelper.getStack("cable", "type:tin,insulation:0"); + List tinCableList = Arrays.asList(tinCable.getMatchingStacks()); for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { - wireRecipes[0][3 * i + j] = new PositionedItemStack(tinCable.copy(), 18 * i + xBase, 18 * j); + wireRecipes[0][3 * i + j] = new PositionedItemStack(tinCableList, 18 * i + xBase, 18 * j); } } ItemStack tmp = new ItemStack(IndustrialWires.coil); @@ -139,7 +140,7 @@ public class ClientProxy extends CommonProxy { if (r.nextBoolean()) { // cable lengthSum++; - wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(tinCable.copy(), 18 * j1 + xBase, 18 * j2); + wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(tinCableList, 18 * j1 + xBase, 18 * j2); } else { // wire coil int length = r.nextInt(99) + 1; diff --git a/src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java b/src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java index 438b4c8..9d9d6d3 100644 --- a/src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java +++ b/src/main/java/malte0811/industrialWires/controlpanel/CoveredToggleSwitch.java @@ -67,6 +67,7 @@ public class CoveredToggleSwitch extends ToggleSwitch { state = state.next(); } setOut(state.active, tile); + tile.markDirty(); tile.triggerRenderUpdate(); } diff --git a/src/main/java/malte0811/industrialWires/controlpanel/IndicatorLight.java b/src/main/java/malte0811/industrialWires/controlpanel/IndicatorLight.java index 0310bbe..4674bfa 100644 --- a/src/main/java/malte0811/industrialWires/controlpanel/IndicatorLight.java +++ b/src/main/java/malte0811/industrialWires/controlpanel/IndicatorLight.java @@ -124,6 +124,7 @@ public class IndicatorLight extends PanelComponent implements IConfigurableCompo private Consumer handler = (input) -> { if (input[rsInputChannel] != rsInput) { rsInput = input[rsInputChannel]; + panel.markDirty(); panel.triggerRenderUpdate(); } }; diff --git a/src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java b/src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java index 0433575..16e04e6 100644 --- a/src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java +++ b/src/main/java/malte0811/industrialWires/controlpanel/LightedButton.java @@ -123,6 +123,7 @@ public class LightedButton extends PanelComponent implements IConfigurableCompon ticksTillOff = 10; } } + tile.markDirty(); tile.triggerRenderUpdate(); } @@ -157,11 +158,12 @@ public class LightedButton extends PanelComponent implements IConfigurableCompon @Override public void invalidate(TileEntityPanel te) { - setOut(rsOutputChannel, 0); + setOut(false, te); } private void setOut(boolean on, TileEntityPanel tile) { active = on; + tile.markDirty(); tile.triggerRenderUpdate(); setOut(rsOutputChannel, active ? 15 : 0); } diff --git a/src/main/java/malte0811/industrialWires/controlpanel/Lock.java b/src/main/java/malte0811/industrialWires/controlpanel/Lock.java index c92641a..f8474f6 100644 --- a/src/main/java/malte0811/industrialWires/controlpanel/Lock.java +++ b/src/main/java/malte0811/industrialWires/controlpanel/Lock.java @@ -197,6 +197,7 @@ public class Lock extends PanelComponent implements IConfigurableComponent { ticksTillOff = 10; } } + tile.markDirty(); tile.triggerRenderUpdate(); } @@ -207,6 +208,7 @@ public class Lock extends PanelComponent implements IConfigurableComponent { tile.markDirty(); if (ticksTillOff == 0) { turned = false; + tile.markDirty(); tile.triggerRenderUpdate(); setOut(tile); } @@ -239,10 +241,11 @@ public class Lock extends PanelComponent implements IConfigurableComponent { @Override public void invalidate(TileEntityPanel te) { - setOut(rsOutputChannel, 0); + setOut(te); } private void setOut(TileEntityPanel tile) { + tile.markDirty(); tile.triggerRenderUpdate(); setOut(rsOutputChannel, turned ? 15 : 0); } diff --git a/src/main/java/malte0811/industrialWires/controlpanel/PanelMeter.java b/src/main/java/malte0811/industrialWires/controlpanel/PanelMeter.java index 5bcf29d..7074bc2 100644 --- a/src/main/java/malte0811/industrialWires/controlpanel/PanelMeter.java +++ b/src/main/java/malte0811/industrialWires/controlpanel/PanelMeter.java @@ -192,6 +192,7 @@ public class PanelMeter extends PanelComponent implements IConfigurableComponent private Consumer handler = (input) -> { if (input[rsInputChannel] != rsInput) { rsInput = input[rsInputChannel]; + panel.markDirty(); panel.triggerRenderUpdate(); } }; diff --git a/src/main/java/malte0811/industrialWires/controlpanel/Slider.java b/src/main/java/malte0811/industrialWires/controlpanel/Slider.java index 1241883..675f4c4 100644 --- a/src/main/java/malte0811/industrialWires/controlpanel/Slider.java +++ b/src/main/java/malte0811/industrialWires/controlpanel/Slider.java @@ -134,6 +134,7 @@ public class Slider extends PanelComponent implements IConfigurableComponent { if (newLevel != out) { setOut(rsChannel, newLevel); out = newLevel; + tile.markDirty(); tile.triggerRenderUpdate(); } } diff --git a/src/main/java/malte0811/industrialWires/controlpanel/ToggleSwitch.java b/src/main/java/malte0811/industrialWires/controlpanel/ToggleSwitch.java index 5688d58..28a1cf0 100644 --- a/src/main/java/malte0811/industrialWires/controlpanel/ToggleSwitch.java +++ b/src/main/java/malte0811/industrialWires/controlpanel/ToggleSwitch.java @@ -119,6 +119,7 @@ public class ToggleSwitch extends PanelComponent implements IConfigurableCompone @Override public void interactWith(Vec3d hitRel, TileEntityPanel tile, EntityPlayerMP player) { setOut(!active, tile); + tile.markDirty(); tile.triggerRenderUpdate(); } @@ -160,11 +161,12 @@ public class ToggleSwitch extends PanelComponent implements IConfigurableCompone @Override public void invalidate(TileEntityPanel te) { - setOut(rsOutputChannel, 0); + setOut(false, te); } protected void setOut(boolean on, TileEntityPanel tile) { active = on; + tile.markDirty(); tile.triggerRenderUpdate(); setOut(rsOutputChannel, active ? 15 : 0); } diff --git a/src/main/java/malte0811/industrialWires/controlpanel/Variac.java b/src/main/java/malte0811/industrialWires/controlpanel/Variac.java index 0f4d0fc..db0b0e6 100644 --- a/src/main/java/malte0811/industrialWires/controlpanel/Variac.java +++ b/src/main/java/malte0811/industrialWires/controlpanel/Variac.java @@ -152,6 +152,7 @@ public class Variac extends PanelComponent implements IConfigurableComponent { if (newLevel != out) { setOut(rsChannel, newLevel); out = newLevel; + tile.markDirty(); tile.triggerRenderUpdate(); } } diff --git a/src/main/java/malte0811/industrialWires/crafting/IC2TRHelper.java b/src/main/java/malte0811/industrialWires/crafting/IC2TRHelper.java new file mode 100644 index 0000000..8242a20 --- /dev/null +++ b/src/main/java/malte0811/industrialWires/crafting/IC2TRHelper.java @@ -0,0 +1,107 @@ +package malte0811.industrialWires.crafting; + +import blusunrize.immersiveengineering.common.IEContent; +import ic2.api.item.IC2Items; +import malte0811.industrialWires.IndustrialWires; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.Ingredient; +import net.minecraftforge.fml.common.Loader; +import net.minecraftforge.oredict.OreIngredient; +import techreborn.api.TechRebornAPI; + +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +public final class IC2TRHelper { + public static Ingredient getStack(String type, String variant) { + Set stacks = new HashSet<>(); + if (IndustrialWires.hasIC2) { + stacks.add(IC2Items.getItem(type, variant)); + } + if (Loader.isModLoaded("techreborn")) { + switch (type) { + case "cable": + stacks.add(getTRCable(variant)); + break; + case "crafting": + switch (variant) { + case "coil": + stacks.add(new ItemStack(IEContent.blockMetalDecoration0)); + break; + case "alloy": + stacks.add(TechRebornAPI.subItemRetriever.getPlateByName("advanced_alloy")); + } + break; + case "te": + if (variant.equals("mv_transformer")) { + stacks.add(new ItemStack(TechRebornAPI.getBlock("MV_TRANSFORMER"))); + } + } + } + stacks.removeIf(ItemStack::isEmpty); + if (stacks.isEmpty()) { + switch (type) { + case "cable": + return getIECable(variant.substring("type:".length(), variant.indexOf(','))); + case "crafting": + switch (variant) { + case "alloy": + return new OreIngredient("plateConstantan"); + case "electric_motor": + stacks.add(new ItemStack(IEContent.itemMaterial, 1, 27)); + } + break; + case "te": + if (variant.equals("mv_transformer")) { + stacks.add(new ItemStack(IEContent.blockConnectors, 1, 7)); + } + } + } + return Ingredient.fromStacks(stacks.toArray(new ItemStack[stacks.size()])); + } + + public static ItemStack getTRCable(String variant) { + String cableType = variant.substring("type:".length(), variant.indexOf(',')); + int meta = -1; + switch (cableType) { + case "copper": + meta = 0; + break; + case "tin": + meta = 1; + break; + case "glass": + meta = 4; + break; + case "gold": + meta = 2; + break; + case "iron": + meta = 3; + break; + } + if (meta>=0&&variant.charAt(variant.length()-1)=='0') { + return new ItemStack(TechRebornAPI.getBlock("CABLE"), 1, meta); + } + return ItemStack.EMPTY; + } + public static Ingredient getIECable(String type) { + switch (type) { + case "gold": + type = "electrum"; + break; + case "iron": + type = "steel"; + break; + case "tin": + type = "aluminum"; + break; + case "glass": + throw new IllegalArgumentException(type+" is not a valid IE wire type"); + } + type = Character.toUpperCase(type.charAt(0))+type.substring(1); + return new OreIngredient("wire"+type); + } +} diff --git a/src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java b/src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java index c8f8378..2a1bc45 100644 --- a/src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java +++ b/src/main/java/malte0811/industrialWires/crafting/RecipeCoilLength.java @@ -48,8 +48,8 @@ public class RecipeCoilLength extends IForgeRegistryEntry.Impl implemen } @Override - public boolean matches(@Nonnull InventoryCrafting inv, @Nonnull World worldIn) { - int l = getLength(inv); + public boolean matches(@Nonnull InventoryCrafting inv, World worldIn) { + int l = 0;//getLength(inv); return l > 0; } diff --git a/src/main/java/malte0811/industrialWires/crafting/RecipeComponentCopy.java b/src/main/java/malte0811/industrialWires/crafting/RecipeComponentCopy.java index 0e4ec46..ba4d2ad 100644 --- a/src/main/java/malte0811/industrialWires/crafting/RecipeComponentCopy.java +++ b/src/main/java/malte0811/industrialWires/crafting/RecipeComponentCopy.java @@ -34,7 +34,7 @@ import javax.annotation.Nullable; public class RecipeComponentCopy extends IForgeRegistryEntry.Impl implements IRecipe { @Override - public boolean matches(@Nonnull InventoryCrafting inv, @Nonnull World worldIn) { + public boolean matches(@Nonnull InventoryCrafting inv, World worldIn) { boolean found = false; int foundX = -1; int foundY = -1; diff --git a/src/main/java/malte0811/industrialWires/crafting/RecipeKeyLock.java b/src/main/java/malte0811/industrialWires/crafting/RecipeKeyLock.java index eba79b0..b0cd0bf 100644 --- a/src/main/java/malte0811/industrialWires/crafting/RecipeKeyLock.java +++ b/src/main/java/malte0811/industrialWires/crafting/RecipeKeyLock.java @@ -36,7 +36,7 @@ import javax.annotation.Nonnull; public class RecipeKeyLock extends IForgeRegistryEntry.Impl implements IRecipe { @Override - public boolean matches(@Nonnull InventoryCrafting inv, @Nonnull World worldIn) { + public boolean matches(@Nonnull InventoryCrafting inv, World worldIn) { return getLockId(inv) != 0; } diff --git a/src/main/java/malte0811/industrialWires/crafting/RecipeKeyRing.java b/src/main/java/malte0811/industrialWires/crafting/RecipeKeyRing.java index a83788d..549ab5e 100644 --- a/src/main/java/malte0811/industrialWires/crafting/RecipeKeyRing.java +++ b/src/main/java/malte0811/industrialWires/crafting/RecipeKeyRing.java @@ -41,7 +41,7 @@ public class RecipeKeyRing extends IForgeRegistryEntry.Impl implements } @Override - public boolean matches(@Nonnull InventoryCrafting inv, @Nonnull World worldIn) { + public boolean matches(@Nonnull InventoryCrafting inv, World worldIn) { return isValid(inv); } diff --git a/src/main/java/malte0811/industrialWires/crafting/factories/IC2ItemFactory.java b/src/main/java/malte0811/industrialWires/crafting/factories/IC2ItemFactory.java index 7e82fb5..2e6afc3 100644 --- a/src/main/java/malte0811/industrialWires/crafting/factories/IC2ItemFactory.java +++ b/src/main/java/malte0811/industrialWires/crafting/factories/IC2ItemFactory.java @@ -1,10 +1,12 @@ package malte0811.industrialWires.crafting.factories; -import blusunrize.immersiveengineering.common.crafting.IngredientFactoryStackableNBT; import com.google.gson.JsonObject; import ic2.api.item.IC2Items; +import malte0811.industrialWires.crafting.IC2TRHelper; +import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.Ingredient; import net.minecraftforge.common.crafting.IIngredientFactory; +import net.minecraftforge.common.crafting.IngredientNBT; import net.minecraftforge.common.crafting.JsonContext; import javax.annotation.Nonnull; @@ -15,6 +17,13 @@ public class IC2ItemFactory implements IIngredientFactory { public Ingredient parse(JsonContext context, JsonObject json) { String name = json.get("name").getAsString(); String variant = json.get("variant").getAsString(); - return new IngredientFactoryStackableNBT.IngredientStackableNBT(IC2Items.getItem(name, variant)); + return IC2TRHelper.getStack(name, variant); + } + //TODO NBT sensitivity? + private class MyNBTIngredient extends IngredientNBT { + + public MyNBTIngredient(ItemStack stack) { + super(stack); + } } } diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_copper_conn.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_copper_conn.json index 43be65c..5761fdc 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_copper_conn.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_copper_conn.json @@ -12,10 +12,27 @@ "type": "forge:ore_shaped", "key": { "r": { - "type": "forge:ore_dict", "ore": "itemRubber" + "type": "forge:ore_dict", + "ore": "itemRubber" }, "c": { - "type": "forge:ore_dict", "ore": "ingotCopper" + "type": "forge:ore_dict", + "ore": "ingotCopper" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_copper_relay.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_copper_relay.json index fcbeac2..c057844 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_copper_relay.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_copper_relay.json @@ -16,5 +16,20 @@ "c": { "type": "forge:ore_dict", "ore": "ingotCopper" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_glass_conn.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_glass_conn.json index 7e09b22..d22d131 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_glass_conn.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_glass_conn.json @@ -19,5 +19,20 @@ "name": "cable", "variant": "type:glass,insulation:0" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_glass_relay.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_glass_relay.json index dc120be..d3eb69c 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_glass_relay.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_glass_relay.json @@ -23,5 +23,20 @@ "item": "immersiveengineering:stone_decoration", "data": 8 } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_gold_conn.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_gold_conn.json index d891c59..7213773 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_gold_conn.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_gold_conn.json @@ -17,5 +17,20 @@ "g": { "type": "forge:ore_dict", "ore": "ingotGold" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_gold_relay.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_gold_relay.json index 37cfd67..917352e 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_gold_relay.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_gold_relay.json @@ -16,5 +16,20 @@ "g": { "type": "forge:ore_dict", "ore": "ingotGold" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_hv_conn.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_hv_conn.json index bf546cd..5c736a8 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_hv_conn.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_hv_conn.json @@ -17,5 +17,20 @@ "i": { "type": "forge:ore_dict", "ore": "ingotIron" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_hv_relay.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_hv_relay.json index 0816c11..409af8e 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_hv_relay.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_hv_relay.json @@ -18,5 +18,20 @@ "i": { "type": "forge:ore_dict", "ore": "ingotIron" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_tin_conn.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_tin_conn.json index d4ce901..896252e 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_tin_conn.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_tin_conn.json @@ -19,5 +19,20 @@ "type": "forge:ore_dict", "ore": "ingotTin" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/ic2_connector_tin_relay.json b/src/main/resources/assets/industrialwires/recipes/ic2_connector_tin_relay.json index c365790..f7a7674 100644 --- a/src/main/resources/assets/industrialwires/recipes/ic2_connector_tin_relay.json +++ b/src/main/resources/assets/industrialwires/recipes/ic2_connector_tin_relay.json @@ -16,5 +16,20 @@ "t": { "type": "forge:ore_dict", "ore": "ingotTin" } - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/mechanical_converter_kin_rot.json b/src/main/resources/assets/industrialwires/recipes/mechanical_converter_kin_rot.json index 8462f59..0c753d9 100644 --- a/src/main/resources/assets/industrialwires/recipes/mechanical_converter_kin_rot.json +++ b/src/main/resources/assets/industrialwires/recipes/mechanical_converter_kin_rot.json @@ -11,19 +11,24 @@ "type": "forge:ore_shaped", "key": { "b": { - "type": "forge:ore_dict", "ore": "ingotBronze" + "type": "forge:ore_dict", + "ore": "ingotBronze" }, "r": { - "type": "forge:ore_dict", "ore": "stickSteel" + "type": "forge:ore_dict", + "ore": "stickSteel" }, "s": { - "type": "forge:ore_dict", "ore": "blockSheetmetalIron" + "type": "forge:ore_dict", + "ore": "blockSheetmetalIron" }, "S": { - "type": "forge:ore_dict", "ore": "blockSheetmetalSteel" + "type": "forge:ore_dict", + "ore": "blockSheetmetalSteel" }, "i": { - "type": "forge:ore_dict", "ore": "plateIron" + "type": "forge:ore_dict", + "ore": "plateIron" }, "I": { "type": "industrialwires:ic2_item", @@ -35,7 +40,13 @@ "data": 9 } }, - "conditions": [{ - "type": "industrialwires:conversion" - }] + "conditions": [ + { + "type": "industrialwires:conversion" + }, + { + "type": "forge:mod_loaded", + "modid": "ic2" + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/mechanical_converter_motor.json b/src/main/resources/assets/industrialwires/recipes/mechanical_converter_motor.json index c1a80f5..8ac39af 100644 --- a/src/main/resources/assets/industrialwires/recipes/mechanical_converter_motor.json +++ b/src/main/resources/assets/industrialwires/recipes/mechanical_converter_motor.json @@ -31,7 +31,13 @@ "data": 8 } }, - "conditions": [{ - "type": "industrialwires:conversion" - }] + "conditions": [ + { + "type": "industrialwires:conversion" + }, + { + "type": "forge:mod_loaded", + "modid": "ic2" + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/mechanical_converter_rot_kin.json b/src/main/resources/assets/industrialwires/recipes/mechanical_converter_rot_kin.json index 04994b0..16b1b8f 100644 --- a/src/main/resources/assets/industrialwires/recipes/mechanical_converter_rot_kin.json +++ b/src/main/resources/assets/industrialwires/recipes/mechanical_converter_rot_kin.json @@ -11,19 +11,24 @@ "type": "forge:ore_shaped", "key": { "b": { - "type": "forge:ore_dict", "ore": "ingotBronze" + "type": "forge:ore_dict", + "ore": "ingotBronze" }, "r": { - "type": "forge:ore_dict", "ore": "stickIron" + "type": "forge:ore_dict", + "ore": "stickIron" }, "s": { - "type": "forge:ore_dict", "ore": "blockSheetmetalIron" + "type": "forge:ore_dict", + "ore": "blockSheetmetalIron" }, "S": { - "type": "forge:ore_dict", "ore": "blockSheetmetalSteel" + "type": "forge:ore_dict", + "ore": "blockSheetmetalSteel" }, "i": { - "type": "forge:ore_dict", "ore": "plateSteel" + "type": "forge:ore_dict", + "ore": "plateSteel" }, "I": { "type": "industrialwires:ic2_item", @@ -35,7 +40,13 @@ "data": 8 } }, - "conditions": [{ - "type": "industrialwires:conversion" - }] + "conditions": [ + { + "type": "industrialwires:conversion" + }, + { + "type": "forge:mod_loaded", + "modid": "ic2" + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/wire_copper.json b/src/main/resources/assets/industrialwires/recipes/wire_copper.json index 5d14f8d..13444ea 100644 --- a/src/main/resources/assets/industrialwires/recipes/wire_copper.json +++ b/src/main/resources/assets/industrialwires/recipes/wire_copper.json @@ -8,5 +8,20 @@ "coil": { "item": "industrialwires:ic2_wire_coil", "data": 1 - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/wire_glass.json b/src/main/resources/assets/industrialwires/recipes/wire_glass.json index 15cf640..7d72f81 100644 --- a/src/main/resources/assets/industrialwires/recipes/wire_glass.json +++ b/src/main/resources/assets/industrialwires/recipes/wire_glass.json @@ -8,5 +8,20 @@ "coil": { "item": "industrialwires:ic2_wire_coil", "data": 4 - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/wire_gold.json b/src/main/resources/assets/industrialwires/recipes/wire_gold.json index 3361712..9137c6e 100644 --- a/src/main/resources/assets/industrialwires/recipes/wire_gold.json +++ b/src/main/resources/assets/industrialwires/recipes/wire_gold.json @@ -8,5 +8,20 @@ "coil": { "item": "industrialwires:ic2_wire_coil", "data": 2 - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/wire_hv.json b/src/main/resources/assets/industrialwires/recipes/wire_hv.json index 1f0d037..e25f086 100644 --- a/src/main/resources/assets/industrialwires/recipes/wire_hv.json +++ b/src/main/resources/assets/industrialwires/recipes/wire_hv.json @@ -8,5 +8,20 @@ "coil": { "item": "industrialwires:ic2_wire_coil", "data": 3 - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file diff --git a/src/main/resources/assets/industrialwires/recipes/wire_tin.json b/src/main/resources/assets/industrialwires/recipes/wire_tin.json index f9f1363..b3b515c 100644 --- a/src/main/resources/assets/industrialwires/recipes/wire_tin.json +++ b/src/main/resources/assets/industrialwires/recipes/wire_tin.json @@ -8,5 +8,20 @@ "coil": { "item": "industrialwires:ic2_wire_coil", "data": 0 - } + }, + "conditions": [ + { + "type": "forge:or", + "values": [ + { + "type": "forge:mod_loaded", + "modid": "ic2" + }, + { + "type": "forge:mod_loaded", + "modid": "techreborn" + } + ] + } + ] } \ No newline at end of file