added textures for the mechanical converters+IF motor, made by C8H8O4

fixed some minor bugs with energy conversion rates
increased the default maximum of kinetic to rotational energy conversion, the old one was equal to about 2 IF
added a manual entry, still need to change the displayed recipes
This commit is contained in:
malte0811 2016-12-15 21:32:28 +01:00
parent ac390872b1
commit d3c571d60c
16 changed files with 200 additions and 35 deletions

View file

@ -6,4 +6,6 @@ An addon for Immersive Engineering and IndustrialCraft2. It adds IE-style wires
Recipes for the relays, connectors and wires can be found in the Engineer's Manual.
All textures are modified versions of the textures Immersive Engineering uses and the models are loaded out of IE, so all art is at least based on art Mr. Damien Hazard made.
All textures for the connectors are modified versions of the textures Immersive Engineering uses and the models are loaded out of IE, so all art for the wires is at least based on art Mr. Damien Hazard made.
The textures for the mechanical converters and the Rotational Motor were made by C8H8O4.

View file

@ -48,7 +48,7 @@ public class IWConfig {
public static double rotToKinEfficiency = .7;
@Comment({"The maximum amount of IC2 kinetic energy that can be converted into IE rotational energy", "by one converter in one tick"})
public static int maxKinToRot = 50;
public static int maxKinToRot = 2400;
@Comment({"The efficiency of the conversion from IC2 kinetic energy to IE rotational energy"})
public static double kinToRotEfficiency = .8;

View file

@ -21,6 +21,7 @@ import java.util.List;
import blusunrize.immersiveengineering.api.IEProperties;
import blusunrize.immersiveengineering.common.blocks.IEBlockInterfaces.IDirectionalTile;
import blusunrize.immersiveengineering.common.util.Utils;
import malte0811.industrialWires.IndustrialWires;
import malte0811.industrialWires.blocks.IMetaEnum;
import malte0811.industrialWires.blocks.ItemBlockIW;
@ -38,6 +39,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
@ -51,20 +53,20 @@ public class BlockMechanicalConverter extends Block implements IMetaEnum, ITileE
super(Material.IRON);
setHardness(3.0F);
setResistance(15.0F);
String name = "mechanicalConverter";
String name = "mechanical_converter";
GameRegistry.register(this, new ResourceLocation(IndustrialWires.MODID, name));
GameRegistry.register(new ItemBlockIW(this), new ResourceLocation(IndustrialWires.MODID, name));
setUnlocalizedName(name);
setCreativeTab(IndustrialWires.creativeTab);
}
@Override
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list) {
for (int i = 0;i<3;i++) {
list.add(new ItemStack(itemIn, 1, i));
}
}
@Override
protected BlockStateContainer createBlockState() {
type = PropertyEnum.create("type", MechanicalBlockType.class);
@ -75,7 +77,7 @@ public class BlockMechanicalConverter extends Block implements IMetaEnum, ITileE
});
return container;
}
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
return getExtendedState(state, worldIn, pos);
@ -140,4 +142,34 @@ public class BlockMechanicalConverter extends Block implements IMetaEnum, ITileE
EntityPlayer player) {
return new ItemStack(this, 1, damageDropped(state));
}
//mostly copied from IE
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player,
EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
TileEntity te = world.getTileEntity(pos);
if(te instanceof IDirectionalTile && Utils.isHammer(heldItem) && !world.isRemote) {
IDirectionalTile directionalTe = (IDirectionalTile) te;
if (directionalTe.canHammerRotate(side, hitX, hitY, hitZ, player)) {
EnumFacing f = directionalTe.getFacing();
final EnumFacing original = f;
int limit = directionalTe.getFacingLimitation();
if(limit==0) {
f = EnumFacing.VALUES[(f.ordinal() + 1) % EnumFacing.VALUES.length];
} else if(limit==1) {
f = player.isSneaking()?f.rotateAround(side.getAxis()).getOpposite():f.rotateAround(side.getAxis());
} else if(limit == 2 || limit == 5) {
f = player.isSneaking()?f.rotateYCCW():f.rotateY();
}
if (f!=original) {
directionalTe.setFacing(f);
te.markDirty();
world.notifyBlockUpdate(pos,state,state,3);
world.addBlockEvent(pos, this, 255, 0);
}
return true;
}
}
return false;
}
}

View file

@ -32,7 +32,7 @@ import net.minecraft.util.ITickable;
import net.minecraft.util.math.BlockPos;
public class TileEntityIEMotor extends TileEntityIWBase implements ITickable, IFluxReceiver, IDirectionalTile {
public static final double bufferMax = 2*MechConversion.maxIfToMech*ConversionUtil.rotPerIf();
public final double bufferMax = 2*MechConversion.maxIfToMech*ConversionUtil.rotPerIf();
private double rotBuffer = 0;
private FluxStorage energy = new FluxStorage(20*MechConversion.maxIfToMech, 2*MechConversion.maxIfToMech);
@ -53,7 +53,6 @@ public class TileEntityIEMotor extends TileEntityIWBase implements ITickable, IF
}
TileEntity te = worldObj.getTileEntity(receiver);
if (te instanceof IRotationAcceptor) {
//TODO maybe get inputRotation changed to return a double? Would make this more user-friendly
((IRotationAcceptor)te).inputRotation(rotBuffer, dir);
rotBuffer = 0;
dirty = true;
@ -116,7 +115,7 @@ public class TileEntityIEMotor extends TileEntityIWBase implements ITickable, IF
}
@Override
public int getFacingLimitation() {
return 0;
return 1;
}
@Override
public boolean mirrorFacingOnPlacement(EntityLivingBase placer) {

View file

@ -33,8 +33,8 @@ import net.minecraft.util.math.BlockPos;
public class TileEntityMechICtoIE extends TileEntityIWBase implements IDirectionalTile, ITickable {
EnumFacing dir = EnumFacing.DOWN;
int kinBuffer = 0;
private static final int kinBufMax = 2*MechConversion.maxKinToRot;
private static final double maxInsert = ConversionUtil.rotPerKin()*MechConversion.maxKinToRot;
private final int kinBufMax = 2*MechConversion.maxKinToRot;
private final double maxInsert = ConversionUtil.rotPerKin()*MechConversion.maxKinToRot;
BlockPos to;
BlockPos from;
@Override
@ -90,7 +90,7 @@ public class TileEntityMechICtoIE extends TileEntityIWBase implements IDirection
}
@Override
public int getFacingLimitation() {
return 0;
return 1;
}
@Override
public boolean mirrorFacingOnPlacement(EntityLivingBase placer) {

View file

@ -30,8 +30,8 @@ import net.minecraft.util.EnumFacing;
public class TileEntityMechIEtoIC extends TileEntityIWBase implements IDirectionalTile, IRotationAcceptor, IKineticSource {
EnumFacing dir = EnumFacing.DOWN;
double rotBuffer = 0;
private static final double rotBufMax = 2*MechConversion.maxRotToKin;
private static final int maxOutput = (int)(ConversionUtil.kinPerRot()*MechConversion.maxRotToKin);
private final double rotBufMax = 2*MechConversion.maxRotToKin;
private final int maxOutput = (int)(ConversionUtil.kinPerRot()*MechConversion.maxRotToKin);
@Override
public void writeNBT(NBTTagCompound out, boolean updatePacket) {
@ -56,7 +56,7 @@ public class TileEntityMechIEtoIC extends TileEntityIWBase implements IDirection
}
@Override
public int getFacingLimitation() {
return 0;
return 1;
}
@Override
public boolean mirrorFacingOnPlacement(EntityLivingBase placer) {

View file

@ -36,6 +36,7 @@ import net.minecraft.block.Block;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@ -84,16 +85,16 @@ public class ClientProxy extends CommonProxy {
ModelBakery.registerItemVariants(IndustrialWires.coil, loc);
ModelLoader.setCustomModelResourceLocation(IndustrialWires.coil, meta, new ModelResourceLocation(loc, "inventory"));
}
Item blockItem = Item.getItemFromBlock(IndustrialWires.ic2conn);
final ResourceLocation loc = IndustrialWires.ic2conn.getRegistryName();
ModelLoader.setCustomMeshDefinition(blockItem, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation(loc, "inventory");
}
});
Block[] blocks = {IndustrialWires.ic2conn};
Block[] blocks = {IndustrialWires.ic2conn, IndustrialWires.mechConv};
for (Block b:blocks) {
Item blockItem = Item.getItemFromBlock(b);
final ResourceLocation loc = b.getRegistryName();
ModelLoader.setCustomMeshDefinition(blockItem, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return new ModelResourceLocation(loc, "inventory");
}
});
Object[] v = ((IMetaEnum)b).getValues();
for(int meta = 0; meta < v.length; meta++) {
String location = loc.toString();
@ -146,11 +147,17 @@ public class ClientProxy extends CommonProxy {
ItemIC2Coil.setLength(tmp, lengthSum);
wireRecipes[i][9] = new PositionedItemStack(tmp, 18*4+xBase, 18);
}
m.addEntry("industrialWires.all", "industrialWires",
new ManualPages.CraftingMulti(m, "industrialWires.all0", new ItemStack(IndustrialWires.ic2conn, 1, 0), new ItemStack(IndustrialWires.ic2conn, 1, 1), new ItemStack(IndustrialWires.ic2conn, 1, 2), new ItemStack(IndustrialWires.ic2conn, 1, 3),
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.all1"),
new ManualPages.CraftingMulti(m, "industrialWires.all2", (Object[])wireRecipes)
new ManualPages.Text(m, "industrialWires.wires1"),
new ManualPages.CraftingMulti(m, "industrialWires.wires2", (Object[])wireRecipes)
);
m.addEntry("industrialWires.mechConv", "industrialWires",
new ManualPages.Crafting(m, "industrialWires.mechConv0", new ItemStack(Items.DIAMOND_PICKAXE)),
new ManualPages.Crafting(m, "industrialWires.mechConv1", new ItemStack(Items.DIAMOND_PICKAXE)),
new ManualPages.Crafting(m, "industrialWires.mechConv2", new ItemStack(Items.DIAMOND_PICKAXE))
);
}
}

View file

@ -35,10 +35,10 @@ public class ConversionUtil {
return 1/MechConversion.euPerIf;
}
public static double euPerKin() {
return MechConversion.kinPerEu;
return 1/euPerKin();
}
public static double kinPerEu() {
return 1/euPerKin();
return MechConversion.kinPerEu;
}
public static double kinPerRot() {
return kinPerEu()*euPerIfIdeal()*ifPerRot();

View file

@ -0,0 +1,111 @@
{
"forge_marker": 1,
"defaults": {
"transform": "forge:default-block",
"model": "immersiveengineering:ieSixSides",
"textures": {
},
"custom": {
"flip-v": true
}
},
"variants": {
"inventory,type=ie_motor": [{
"textures": {
"bottom": "industrialwires:blocks/converter/con_ie",
"top": "industrialwires:blocks/converter/power_ie",
"north": "industrialwires:blocks/converter/motor",
"south": "industrialwires:blocks/converter/motor",
"west": "industrialwires:blocks/converter/motor",
"east": "industrialwires:blocks/converter/motor"
}
}],
"inventory,type=ie_to_ic2": [{
"textures": {
"bottom": "industrialwires:blocks/converter/con_ic",
"top": "industrialwires:blocks/converter/con_ie",
"north": "industrialwires:blocks/converter/ie_to_ic_side",
"south": "industrialwires:blocks/converter/ie_to_ic_side",
"west": "industrialwires:blocks/converter/ie_to_ic_side",
"east": "industrialwires:blocks/converter/ie_to_ic_side"
}
}],
"inventory,type=ic2_to_ie": [{
"textures": {
"bottom": "industrialwires:blocks/converter/con_ie",
"top": "industrialwires:blocks/converter/con_ic",
"north": "industrialwires:blocks/converter/ic_to_ie_side",
"south": "industrialwires:blocks/converter/ic_to_ie_side",
"west": "industrialwires:blocks/converter/ic_to_ie_side",
"east": "industrialwires:blocks/converter/ic_to_ie_side"
}
}],
"type": {
"ie_motor": {"textures": {
"bottom": "industrialwires:blocks/converter/con_ie",
"top": "industrialwires:blocks/converter/power_ie",
"north": "industrialwires:blocks/converter/motor",
"south": "industrialwires:blocks/converter/motor",
"west": "industrialwires:blocks/converter/motor",
"east": "industrialwires:blocks/converter/motor"
}},
"ie_to_ic2": {"textures": {
"bottom": "industrialwires:blocks/converter/con_ic",
"top": "industrialwires:blocks/converter/con_ie",
"north": "industrialwires:blocks/converter/ie_to_ic_side",
"south": "industrialwires:blocks/converter/ie_to_ic_side",
"west": "industrialwires:blocks/converter/ie_to_ic_side",
"east": "industrialwires:blocks/converter/ie_to_ic_side"
}},
"ic2_to_ie": {"textures": {
"bottom": "industrialwires:blocks/converter/con_ie",
"top": "industrialwires:blocks/converter/con_ic",
"north": "industrialwires:blocks/converter/ic_to_ie_side",
"south": "industrialwires:blocks/converter/ic_to_ie_side",
"west": "industrialwires:blocks/converter/ic_to_ie_side",
"east": "industrialwires:blocks/converter/ic_to_ie_side"
}}
},
"facing": {
"down": {
},
"up": {
"transform": {
"rotation": {
"z": 180
}
}
},
"north": {
"transform": {
"rotation": {
"x": 90
}
}
},
"south": {
"transform": {
"rotation": {
"x": -90
}
}
},
"west": {
"transform": {
"rotation": {
"z": -90
}
}
},
"east": {
"transform": {
"rotation": {
"z": 90
}
}
}
}
}
}

View file

@ -9,23 +9,37 @@ tile.industrialwires.ic2Connector.hv_relay.name=IC2 HV Wire Relay
tile.industrialwires.ic2Connector.glass_conn.name=Glass Fiber Wire Connector
tile.industrialwires.ic2Connector.glass_relay.name=Glass Fiber Wire Relay
tile.mechanical_converter.ie_motor.name=Rotational Motor
tile.mechanical_converter.ie_to_ic2.name=Converter: Rotational To Kinetic
tile.mechanical_converter.ic2_to_ie.name=Converter: Kinetic To Rotational
item.industrialwires.ic2wireCoil.tin.name=Tin Wire Coil
item.industrialwires.ic2wireCoil.copper.name=Copper Wire Coil
item.industrialwires.ic2wireCoil.gold.name=Gold Wire Coil
item.industrialwires.ic2wireCoil.hv.name=IC2 HV Wire Coil
item.industrialwires.ic2wireCoil.glass.name=Glass Fiber Wire Coil
industrialwires.desc.wireLength=Wire length: %1s block(s)
industrialwires.desc.recipe=Please check the Engineer's manual for recipe details
industrialwires.chat.tooLong=This coil does not contain enough wire for this connection
industrialwires.chat.stackSize=Linking is only possible with a stack of size 1
itemGroup.industrialwires=Industrial Wires
ie.manual.category.industrialWires.name=Industrial Wires
ie.manual.entry.industrialWires.all.name=Industrial Wires
ie.manual.entry.industrialWires.all.subtext=Everything you need to know
ie.manual.entry.industrialWires.all0=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.all1=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.all2=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.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.mechConv.name=Mechanical Converters
ie.manual.entry.industrialWires.mechConv.subtext=
ie.manual.entry.industrialWires.mechConv0=Both the IC2 and IE company produce products that run on kinetic energy of some sort. The new converters from IndustrialWires allow you to convert between these two forms of energy!<br>To use the "Converter: Rotational To Kinetic" attach a source of IE rotational energy
ie.manual.entry.industrialWires.mechConv1=like a waterwheel or a motor (see page 3) to the side marked with a gear and a consumer of IC2 kinetic energy to the opposite side. The "Converter: Kinetic To Rotational" is used in a similar way (Rotational and kinetic energy have to be swapped).<br>Unfortunately some energy is
ie.manual.entry.industrialWires.mechConv2=lost with each conversion.<br>As a little extra the "Mechanical converter" product series also contains a Rotational Motor: It consumes IF to produce IE rotational energy. As with the converters this is not a lossless process.

Binary file not shown.

After

Width:  |  Height:  |  Size: 838 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 717 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 642 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B