added a config option for wire length per item and per connection
This commit is contained in:
malte0811 2016-12-08 18:16:58 +01:00
parent 24ea23c2b1
commit 3bd6c14266
5 changed files with 21 additions and 3 deletions

View file

@ -1,5 +1,5 @@
def mainVersion = "1.1"
def buildNumber = "3"
def buildNumber = "4"
// For those who want the bleeding edge
buildscript {

View file

@ -1,3 +1,7 @@
#####Version 1.1-4
- fixed an insane amount of log-spam in an edgecase (probably a Vanilla or Forge bug)
- added config values for wire length per connection and per coil item
#####Version 1.1-3
- fixed incompatibility with IE build 48
- reduced the amount of calls to core IE classes to make such incompatibilities less likely

View file

@ -0,0 +1,12 @@
package malte0811.industrialWires;
import net.minecraftforge.common.config.Config;
import net.minecraftforge.common.config.Config.Comment;
@Config(modid=IndustrialWires.MODID)
public class IWConfig {
@Comment({"The maximum length of a single connection.", "Order: Tin, Copper, Gold, HV, Glass Fiber"})
public static int[] maxLengthPerConn = {16, 16, 16, 32, 32};
@Comment({"The maximum length of wire a coil item.", "Order: Tin, Copper, Gold, HV, Glass Fiber (as above)"})
public static int[] maxLengthOnCoil = {1024, 1024, 1024, 2048, 2048};
}

View file

@ -34,6 +34,7 @@ import blusunrize.immersiveengineering.common.util.IEAchievements;
import blusunrize.immersiveengineering.common.util.ItemNBTHelper;
import blusunrize.immersiveengineering.common.util.Utils;
import ic2.api.item.IC2Items;
import malte0811.industrialWires.IWConfig;
import malte0811.industrialWires.IndustrialWires;
import malte0811.industrialWires.wires.IC2Wiretype;
import net.minecraft.block.state.IBlockState;
@ -207,7 +208,7 @@ public class ItemIC2Coil extends Item implements IWireCoil{
return i.getTagCompound().getInteger(lengthKey);
}
public static int getMaxWireLength(ItemStack i) {
return 64*IC2Wiretype.IC2_TYPES[i.getItemDamage()].getMaxLength();
return IWConfig.maxLengthOnCoil[i.getItemDamage()];
}
public static ItemStack getUninsulatedCable(ItemStack i) {
switch (i.getMetadata()) {

View file

@ -20,6 +20,7 @@ package malte0811.industrialWires.wires;
import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler;
import blusunrize.immersiveengineering.api.energy.wires.ImmersiveNetHandler.Connection;
import blusunrize.immersiveengineering.api.energy.wires.WireType;
import malte0811.industrialWires.IWConfig;
import malte0811.industrialWires.IndustrialWires;
import malte0811.industrialWires.items.ItemIC2Coil;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
@ -65,7 +66,7 @@ public class IC2Wiretype extends WireType{
}
@Override
public int getMaxLength() {
return type>=3?32:16;
return IWConfig.maxLengthPerConn[type];
}
@Override
public ItemStack getWireCoil(ImmersiveNetHandler.Connection con) {