Added mechanic to increase energy transfer rate with higher voltage

This commit is contained in:
Calclavia 2013-12-24 14:59:31 +08:00
parent 6ba873d572
commit 2f497bad58
7 changed files with 34 additions and 16 deletions

@ -1 +1 @@
Subproject commit 784354589b4b3ad36e2c095ae829388b3e639e32
Subproject commit 5579379bc616b74e7b82c64c12d8fadf8df85e94

View file

@ -59,7 +59,7 @@ import cpw.mods.fml.common.registry.GameRegistry;
* @author Calclavia
*
*/
@Mod(modid = ResonantInduction.ID, name = ResonantInduction.NAME, version = ResonantInduction.VERSION)
@Mod(modid = ResonantInduction.ID, name = ResonantInduction.NAME, version = ResonantInduction.VERSION, dependencies = "before:ThermalExpansion;before:IC2")
@NetworkMod(channels = ResonantInduction.CHANNEL, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class)
@ModstatInfo(prefix = "resonantin")
public class ResonantInduction

View file

@ -14,6 +14,7 @@ import codechicken.lib.vec.BlockCoord;
import codechicken.lib.vec.Vector3;
import codechicken.multipart.MultiPartRegistry;
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;
public class ItemMultimeter extends ItemMultipartBase
{
@ -27,7 +28,11 @@ public class ItemMultimeter extends ItemMultipartBase
@Override
public TMultiPart newPart(ItemStack itemStack, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 hit)
{
pos.offset(side ^ 1, -1);
if (world.getBlockTileEntity(pos.x, pos.y, pos.z) instanceof TileMultipart)
{
pos.offset(side ^ 1, -1);
}
PartMultimeter part = (PartMultimeter) MultiPartRegistry.createPart("resonant_induction_multimeter", false);
if (part != null)

View file

@ -17,17 +17,17 @@ import codechicken.lib.colour.ColourRGBA;
public enum EnumWireMaterial
{
/** Copper: General. */
COPPER("Copper", 1.68f, 5, 150, 184, 115, 51),
COPPER("Copper", 1.68f, 5, 15000, 184, 115, 51),
/** Tin: Low shock, cheap */
TIN("Tin", 11f, 1, 100, 132, 132, 130),
TIN("Tin", 11f, 1, 10000, 132, 132, 130),
/** Iron: High Capacity */
IRON("Iron", 10f, 3, 400, 97, 102, 105),
IRON("Iron", 10f, 3, 40000, 97, 102, 105),
/** Aluminum: High Shock */
ALUMINUM("Aluminum", 2.82f, 10, 320, 215, 205, 181),
ALUMINUM("Aluminum", 2.82f, 10, 32000, 215, 205, 181),
/** Aluminum: Low Resistance */
SILVER("Silver", 1.59f, 5, 200, 192, 192, 192),
SILVER("Silver", 1.59f, 5, 20000, 192, 192, 192),
/** Superconductor: Over-powered */
SUPERCONDUCTOR("Superconductor", 0, 10, 1000, 255, 255, 1);
SUPERCONDUCTOR("Superconductor", 0, 10, 100000, 255, 255, 1);
public final float resistance;
public final int damage;

View file

@ -10,12 +10,17 @@ import net.minecraft.util.Icon;
import net.minecraft.world.World;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.ForgeDirection;
import org.lwjgl.input.Keyboard;
import resonantinduction.ResonantInduction;
import resonantinduction.TabRI;
import resonantinduction.Utility;
import resonantinduction.wire.part.PartFlatWire;
import universalelectricity.api.energy.UnitDisplay;
import universalelectricity.api.energy.UnitDisplay.Unit;
import calclavia.lib.Calclavia;
import calclavia.lib.render.EnumColor;
import codechicken.lib.vec.BlockCoord;
import codechicken.lib.vec.Vector3;
import codechicken.multipart.JItemMultiPart;
@ -72,9 +77,17 @@ public class ItemWire extends JItemMultiPart
@Override
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean par4)
{
list.add("Resistance: " + UnitDisplay.getDisplay(EnumWireMaterial.values()[itemstack.getItemDamage()].resistance, Unit.RESISTANCE));
list.add("Max Amperage: " + UnitDisplay.getDisplay(EnumWireMaterial.values()[itemstack.getItemDamage()].maxAmps, Unit.AMPERE));
list.add("Shock Damage: " + EnumWireMaterial.values()[itemstack.getItemDamage()].damage);
if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT))
{
list.add("Hold " + EnumColor.AQUA + "shift" + EnumColor.GREY + " for more information");
}
else
{
list.add("Resistance: " + UnitDisplay.getDisplay(EnumWireMaterial.values()[itemstack.getItemDamage()].resistance, Unit.RESISTANCE));
list.add("Max Amperage: " + UnitDisplay.getDisplay(EnumWireMaterial.values()[itemstack.getItemDamage()].maxAmps, Unit.AMPERE));
list.add("Shock Damage: " + EnumWireMaterial.values()[itemstack.getItemDamage()].damage);
list.addAll(Calclavia.splitStringPerWord("The maximum transfer capacity can be increased and the energy loss may be reduced by using higher voltage.", 5));
}
}
@SideOnly(Side.CLIENT)

View file

@ -78,9 +78,9 @@ public abstract class PartAdvancedWire extends PartConductor
}
@Override
public long getTransferCapacity()
public long getCurrentCapacity()
{
return this.getMaterial().maxAmps * UniversalElectricity.DEFAULT_VOLTAGE;
return this.getMaterial().maxAmps;
}
/**

View file

@ -149,7 +149,7 @@ public class TraitConductor extends TileMultipart implements IConductor
}
@Override
public long getTransferCapacity()
public long getCurrentCapacity()
{
long capacitance = 0;
@ -157,7 +157,7 @@ public class TraitConductor extends TileMultipart implements IConductor
{
for (IConductor conductor : this.ueInterfaces)
{
capacitance += conductor.getTransferCapacity();
capacitance += conductor.getCurrentCapacity();
}
capacitance /= this.ueInterfaces.size();