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
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
}
}

View File

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

View File

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

View File

@ -21,7 +21,7 @@ public enum EnergyType {
FE_AC() {
@Override
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() {

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.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.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.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.mechConv.name=Mechanical Converters
ie.manual.entry.industrialwires.mechConv.subtext=I made rotational energy for this!