Updated documentation/manual

Register the wires and connectors even if IC2 isn't installed
This commit is contained in:
malte0811 2018-08-25 17:48:17 +02:00
parent 0eb9a03185
commit 8962cd1bcb
5 changed files with 60 additions and 62 deletions

View file

@ -29,7 +29,6 @@ public interface IMixedConnector extends IImmersiveConnectable {
@Override @Override
default float getDamageAmount(Entity e, ImmersiveNetHandler.Connection c) default float getDamageAmount(Entity e, ImmersiveNetHandler.Connection c)
{ {
//TODO different damage for EU anf FE
return (float) Math.ceil(IImmersiveConnectable.super.getDamageAmount(e, c) * ConversionUtil.euPerJoule());//Same as IC2 uses return (float) Math.ceil(IImmersiveConnectable.super.getDamageAmount(e, c) * ConversionUtil.euPerJoule());//Same as IC2 uses
} }
} }

View file

@ -163,27 +163,25 @@ public class IndustrialWires {
double ieThreshold = 12.74275; double ieThreshold = 12.74275;
String ieVer = Loader.instance().getIndexedModList().get(ImmersiveEngineering.MODID).getDisplayVersion(); String ieVer = Loader.instance().getIndexedModList().get(ImmersiveEngineering.MODID).getDisplayVersion();
int firstDash = ieVer.indexOf('-'); int firstDash = ieVer.indexOf('-');
String end = ieVer.substring(firstDash+1); String end = ieVer.substring(firstDash + 1);
String start = ieVer.substring(0, firstDash); String start = ieVer.substring(0, firstDash);
end = end.replaceAll("[^0-9]", ""); end = end.replaceAll("[^0-9]", "");
start = start.replaceAll("[^0-9]", ""); start = start.replaceAll("[^0-9]", "");
double ieVerDouble = Double.parseDouble(start+"."+end); double ieVerDouble = Double.parseDouble(start + "." + end);
isOldIE = ieVerDouble<ieThreshold; isOldIE = ieVerDouble < ieThreshold;
} }
logger = e.getModLog(); logger = e.getModLog();
new IWConfig(); new IWConfig();
if (hasIC2) { GameRegistry.registerTileEntity(TileEntityIC2ConnectorTin.class, new ResourceLocation(MODID, "ic2ConnectorTin"));
GameRegistry.registerTileEntity(TileEntityIC2ConnectorTin.class, new ResourceLocation(MODID, "ic2ConnectorTin")); GameRegistry.registerTileEntity(TileEntityIC2ConnectorCopper.class, new ResourceLocation(MODID, "ic2ConnectorCopper"));
GameRegistry.registerTileEntity(TileEntityIC2ConnectorCopper.class, new ResourceLocation(MODID, "ic2ConnectorCopper")); GameRegistry.registerTileEntity(TileEntityIC2ConnectorGold.class, new ResourceLocation(MODID, "ic2ConnectorGold"));
GameRegistry.registerTileEntity(TileEntityIC2ConnectorGold.class, new ResourceLocation(MODID, "ic2ConnectorGold")); GameRegistry.registerTileEntity(TileEntityIC2ConnectorHV.class, new ResourceLocation(MODID, "ic2ConnectorHV"));
GameRegistry.registerTileEntity(TileEntityIC2ConnectorHV.class, new ResourceLocation(MODID, "ic2ConnectorHV")); GameRegistry.registerTileEntity(TileEntityIC2ConnectorGlass.class, new ResourceLocation(MODID, "ic2ConnectorGlass"));
GameRegistry.registerTileEntity(TileEntityIC2ConnectorGlass.class, new ResourceLocation(MODID, "ic2ConnectorGlass"));
if (IWConfig.enableConversion) { if (hasIC2 && IWConfig.enableConversion) {
GameRegistry.registerTileEntity(TileEntityIEMotor.class, new ResourceLocation(MODID, "ieMotor")); GameRegistry.registerTileEntity(TileEntityIEMotor.class, new ResourceLocation(MODID, "ieMotor"));
GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, new ResourceLocation(MODID, "mechIcToIe")); GameRegistry.registerTileEntity(TileEntityMechICtoIE.class, new ResourceLocation(MODID, "mechIcToIe"));
GameRegistry.registerTileEntity(TileEntityMechIEtoIC.class, new ResourceLocation(MODID, "mechIeToIc")); GameRegistry.registerTileEntity(TileEntityMechIEtoIC.class, new ResourceLocation(MODID, "mechIeToIc"));
}
} }
GameRegistry.registerTileEntity(TileEntityMechMB.class, new ResourceLocation(MODID, "mechMB")); GameRegistry.registerTileEntity(TileEntityMechMB.class, new ResourceLocation(MODID, "mechMB"));
GameRegistry.registerTileEntity(TileEntityJacobsLadder.class, new ResourceLocation(MODID, "jacobsLadder")); GameRegistry.registerTileEntity(TileEntityJacobsLadder.class, new ResourceLocation(MODID, "jacobsLadder"));
@ -215,9 +213,7 @@ public class IndustrialWires {
if (IWConfig.enableConversion&&hasIC2) { if (IWConfig.enableConversion&&hasIC2) {
event.getRegistry().register(new BlockMechanicalConverter()); event.getRegistry().register(new BlockMechanicalConverter());
} }
if (hasIC2) { event.getRegistry().register(new BlockIC2Connector());
event.getRegistry().register(new BlockIC2Connector());
}
event.getRegistry().register(new BlockJacobsLadder()); event.getRegistry().register(new BlockJacobsLadder());
event.getRegistry().register(new BlockPanel()); event.getRegistry().register(new BlockPanel());
event.getRegistry().register(new BlockHVMultiblocks()); event.getRegistry().register(new BlockHVMultiblocks());
@ -231,9 +227,7 @@ public class IndustrialWires {
event.getRegistry().register(b.createItemBlock()); event.getRegistry().register(b.createItemBlock());
} }
if (hasIC2) { event.getRegistry().register(new ItemIC2Coil());
event.getRegistry().register(new ItemIC2Coil());
}
event.getRegistry().register(new ItemPanelComponent()); event.getRegistry().register(new ItemPanelComponent());
event.getRegistry().register(new ItemKey()); event.getRegistry().register(new ItemKey());
} }

View file

@ -27,10 +27,9 @@ import blusunrize.lib.manual.ManualPages.PositionedItemStack;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import malte0811.industrialWires.CommonProxy; import it.unimi.dsi.fastutil.objects.Object2IntLinkedOpenHashMap;
import malte0811.industrialWires.IWConfig; import it.unimi.dsi.fastutil.objects.Object2IntMap;
import malte0811.industrialWires.IWPotions; import malte0811.industrialWires.*;
import malte0811.industrialWires.IndustrialWires;
import malte0811.industrialWires.blocks.controlpanel.BlockTypes_Panel; import malte0811.industrialWires.blocks.controlpanel.BlockTypes_Panel;
import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator; import malte0811.industrialWires.blocks.controlpanel.TileEntityPanelCreator;
import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanel; import malte0811.industrialWires.blocks.controlpanel.TileEntityRSPanel;
@ -151,56 +150,64 @@ public class ClientProxy extends CommonProxy {
boolean uni = m.fontRenderer.getUnicodeFlag(); boolean uni = m.fontRenderer.getUnicodeFlag();
m.fontRenderer.setUnicodeFlag(true); m.fontRenderer.setUnicodeFlag(true);
m.entryRenderPre(); m.entryRenderPre();
if (IndustrialWires.hasIC2) { TextSplitter splitter;
{
PositionedItemStack[][] wireRecipes = new PositionedItemStack[3][10]; PositionedItemStack[][] wireRecipes = new PositionedItemStack[3][10];
int xBase = 15; int xBase = 15;
Ingredient tinCable = IC2TRHelper.getStack("cable", "type:tin,insulation:0"); Ingredient copperCable = IC2TRHelper.getStack("cable", "type:copper,insulation:0");
List<ItemStack> tinCableList = Arrays.asList(tinCable.getMatchingStacks()); Object2IntMap<ItemStack> copperCables = new Object2IntLinkedOpenHashMap<>();
for (ItemStack itemStack : copperCable.getMatchingStacks()) {
copperCables.put(itemStack, 1);
}
copperCables.put(new ItemStack(IEObjects.itemWireCoil, 1, 0), 8);
List<ItemStack> copperCableList = new ArrayList<>(copperCables.keySet());
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) { for (int j = 0; j < 3; j++) {
wireRecipes[0][3 * i + j] = new PositionedItemStack(tinCableList, 18 * i + xBase, 18 * j); wireRecipes[0][3 * i + j] = new PositionedItemStack(copperCableList, 18 * i + xBase, 18 * j);
} }
} }
ItemStack tmp = new ItemStack(IndustrialWires.coil); ItemStack copperCoil = new ItemStack(IndustrialWires.coil, 1, 1);
ItemIC2Coil.setLength(tmp, 9); ItemIC2Coil.setLength(copperCoil, 9);
wireRecipes[0][9] = new PositionedItemStack(tmp, 18 * 4 + xBase, 18); wireRecipes[0][9] = new PositionedItemStack(copperCoil, 18 * 4 + xBase, 18);
Random r = new Random(); Random r = new Random();
for (int i = 1; i < 3; i++) { for (int i = 1; i < 3; i++) {
int lengthSum = 0; int lengthSum = 0;
for (int j1 = 0; j1 < 3; j1++) { for (int j1 = 0; j1 < 3; j1++) {
for (int j2 = 0; j2 < 3; j2++) { for (int j2 = 0; j2 < 3; j2++) {
if (r.nextBoolean()) { if (r.nextDouble() > 1 / (1. + copperCables.size())) {
// cable // cable
lengthSum++; ItemStack chosen = copperCableList.get(r.nextInt(copperCables.size()));
wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(tinCableList, 18 * j1 + xBase, 18 * j2); lengthSum += copperCables.getInt(chosen);
wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(chosen, 18 * j1 + xBase, 18 * j2);
} else { } else {
// wire coil // wire coil
int length = r.nextInt(99) + 1; int length = r.nextInt(99) + 1;
tmp = new ItemStack(IndustrialWires.coil); copperCoil = new ItemStack(IndustrialWires.coil, 1, 1);
ItemIC2Coil.setLength(tmp, length); ItemIC2Coil.setLength(copperCoil, length);
wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(tmp, 18 * j1 + xBase, 18 * j2); wireRecipes[i][3 * j1 + j2] = new PositionedItemStack(copperCoil, 18 * j1 + xBase, 18 * j2);
lengthSum += length; lengthSum += length;
} }
} }
} }
tmp = new ItemStack(IndustrialWires.coil); copperCoil = new ItemStack(IndustrialWires.coil);
ItemIC2Coil.setLength(tmp, lengthSum); ItemIC2Coil.setLength(copperCoil, lengthSum);
wireRecipes[i][9] = new PositionedItemStack(tmp, 18 * 4 + xBase, 18); wireRecipes[i][9] = new PositionedItemStack(copperCoil, 18 * 4 + xBase, 18);
} }
m.addEntry("industrialwires.wires", "industrialwires", splitter = new TextSplitter(m);
new ManualPages.CraftingMulti(m, "industrialwires.wires0", new ItemStack(IndustrialWires.ic2conn, 1, 0), new ItemStack(IndustrialWires.ic2conn, 1, 1), new ItemStack(IndustrialWires.ic2conn, 1, 2), new ItemStack(IndustrialWires.ic2conn, 1, 3), splitter.addSpecialPage(0, 0, 10,
new ItemStack(IndustrialWires.ic2conn, 1, 4), new ItemStack(IndustrialWires.ic2conn, 1, 5), new ItemStack(IndustrialWires.ic2conn, 1, 6), new ItemStack(IndustrialWires.ic2conn, 1, 7)), s->new ManualPages.CraftingMulti(m, s, (Object[]) wireRecipes));
new ManualPages.Text(m, "industrialwires.wires1"), String text = I18n.format("ie.manual.entry.industrialwires.wires");
new ManualPages.CraftingMulti(m, "industrialwires.wires2", (Object[]) wireRecipes) splitter.split(text);
List<IManualPage> entry = splitter.toManualEntry();
m.addEntry("industrialwires.wires", IndustrialWires.MODID, entry.toArray(new IManualPage[0]));
}
if (hasIC2 && IndustrialWires.mechConv != null) {
m.addEntry("industrialwires.mechConv", "industrialwires",
new ManualPages.Crafting(m, "industrialwires.mechConv0", new ItemStack(IndustrialWires.mechConv, 1, 1)),
new ManualPages.Crafting(m, "industrialwires.mechConv1", new ItemStack(IndustrialWires.mechConv, 1, 2)),
new ManualPages.Crafting(m, "industrialwires.mechConv2", new ItemStack(IndustrialWires.mechConv, 1, 0))
); );
if (IndustrialWires.mechConv != null) {
m.addEntry("industrialwires.mechConv", "industrialwires",
new ManualPages.Crafting(m, "industrialwires.mechConv0", new ItemStack(IndustrialWires.mechConv, 1, 1)),
new ManualPages.Crafting(m, "industrialwires.mechConv1", new ItemStack(IndustrialWires.mechConv, 1, 2)),
new ManualPages.Crafting(m, "industrialwires.mechConv2", new ItemStack(IndustrialWires.mechConv, 1, 0))
);
}
} }
addUnblockableSounds(TINNITUS, TURN_FAST, TURN_SLOW); addUnblockableSounds(TINNITUS, TURN_FAST, TURN_SLOW);
@ -236,8 +243,8 @@ public class ClientProxy extends CommonProxy {
new ManualPages.Text(m, "industrialwires.panel_creator2") new ManualPages.Text(m, "industrialwires.panel_creator2")
); );
String text = I18n.format("ie.manual.entry.industrialwires.redstone"); String text = I18n.format("ie.manual.entry.industrialwires.redstone");
TextSplitter splitter = new TextSplitter(m); splitter = new TextSplitter(m);
splitter.addSpecialPage(-1, 0, 10, s->new ManualPages.CraftingMulti(m, s, splitter.addSpecialPage(-1, 0, 10, s -> new ManualPages.CraftingMulti(m, s,
new ResourceLocation(IndustrialWires.MODID, "control_panel_rs_other"), new ResourceLocation(IndustrialWires.MODID, "control_panel_rs_other"),
new ResourceLocation(IndustrialWires.MODID, "control_panel_rs_wire"))); new ResourceLocation(IndustrialWires.MODID, "control_panel_rs_wire")));
splitter.split(text); splitter.split(text);
@ -289,9 +296,9 @@ public class ClientProxy extends CommonProxy {
String[][] flywheelTable; String[][] flywheelTable;
{ {
List<String[]> flywheelTableList = new ArrayList<>(1+Material.values().length); List<String[]> flywheelTableList = new ArrayList<>(1 + Material.values().length);
flywheelTableList.add(new String[]{"industrialwires.desc.material", "industrialwires.desc.inertia", "industrialwires.desc.max_speed"}); flywheelTableList.add(new String[]{"industrialwires.desc.material", "industrialwires.desc.inertia", "industrialwires.desc.max_speed"});
for (Material mat:Material.values()) { for (Material mat : Material.values()) {
MechPartFlywheel f = new MechPartFlywheel(mat); MechPartFlywheel f = new MechPartFlywheel(mat);
flywheelTableList.add(new String[]{mat.oreName(), Utils.formatDouble(f.getInertia(), "0.#"), flywheelTableList.add(new String[]{mat.oreName(), Utils.formatDouble(f.getInertia(), "0.#"),
Utils.formatDouble(f.getMaxSpeed(), "0.#")}); Utils.formatDouble(f.getMaxSpeed(), "0.#")});
@ -302,7 +309,7 @@ public class ClientProxy extends CommonProxy {
splitter = new TextSplitter(m); splitter = new TextSplitter(m);
splitter.addSpecialPage(0, 0, 10, (s) -> new ManualPageMultiblock(m, s, splitter.addSpecialPage(0, 0, 10, (s) -> new ManualPageMultiblock(m, s,
MechMBPart.getManualMBForPart(MechPartFlywheel.class))); MechMBPart.getManualMBForPart(MechPartFlywheel.class)));
splitter.addSpecialPage(1, 0, 1, s->new ManualPages.Table(m, "", flywheelTable, true)); splitter.addSpecialPage(1, 0, 1, s -> new ManualPages.Table(m, "", flywheelTable, true));
splitter.addSpecialPage(2, 0, 10, (s) -> new ManualPageMultiblock(m, s, splitter.addSpecialPage(2, 0, 10, (s) -> new ManualPageMultiblock(m, s,
MechMBPart.getManualMBForPart(MechPartSingleCoil.class))); MechMBPart.getManualMBForPart(MechPartSingleCoil.class)));
splitter.addSpecialPage(3, 0, 10, (s) -> new ManualPageMultiblock(m, s, splitter.addSpecialPage(3, 0, 10, (s) -> new ManualPageMultiblock(m, s,

View file

@ -21,7 +21,7 @@ public enum EnergyType {
FE_AC() { FE_AC() {
@Override @Override
public double getLoss(double averageLossRate, double available, double outMax) { public double getLoss(double averageLossRate, double available, double outMax) {
return Math.min(averageLossRate, 1)*outMax;//TODO fix this return Math.min(averageLossRate, 1)*outMax;
} }
}, },
EU_DC() { EU_DC() {

View file

@ -137,9 +137,7 @@ ie.manual.category.control_panels.name=Control Panels
ie.manual.entry.industrialwires.wires.name=Industrial Wires ie.manual.entry.industrialwires.wires.name=Industrial Wires
ie.manual.entry.industrialwires.wires.subtext=No complex impedance! ie.manual.entry.industrialwires.wires.subtext=No complex impedance!
ie.manual.entry.industrialwires.wires0=Wires from the IndustrialWires company allow you to transfer energy like you can with cables from the IndustrialCraft2 company.<br>You use them exactly as you would use wires from Immersive Engineering. Each wire transfers as much EU as the corresponding cable would, so ie.manual.entry.industrialwires.wires=Wires from the IndustrialWires company behave nearly like wires provided by Immersive Engineering with two important differences:<br>1. They can transfer both DC (EU) and AC (IF). However they can not transfer both at the same time, sources of DC and sources of AC should never be connected to one another.<br>2. The amount of wire consumed for a connection depends on the length of the connection. The maximum stack size for the wire coils is 1, however this single coil can contain up to 1024 or 2048 meters/blocks of wire.<br><&0>The wire coils can be created by placing any combination of existing wire coils of this type, wire coils from Immersive Engineering of the corresponding type and IndustrialCraft cables of the corresponding type. Wire coils will combine automatically when picked up.
ie.manual.entry.industrialwires.wires1=attaching a connector to a power source that would destroy the cable will destroy the connector.<br>The wire coils for the IC2 cable are different from the Immersive Engineering wire coils in that longer connections use up more wire: The coils are crafted by placing any combination of uninsulated IC2 cables and the corresponding wire coils in a crafting grid. The next page shows some examples of valid recipes and their outputs. The uninsulated
ie.manual.entry.industrialwires.wires2=tin cables can be replaced by uninsulated copper, gold or HV cables or by glass fiber cable to craft the other coils.
ie.manual.entry.industrialwires.mechConv.name=Mechanical Converters ie.manual.entry.industrialwires.mechConv.name=Mechanical Converters
ie.manual.entry.industrialwires.mechConv.subtext=I made rotational energy for this! ie.manual.entry.industrialwires.mechConv.subtext=I made rotational energy for this!