Added various material wires
This commit is contained in:
parent
e5c071a8aa
commit
3c5d00eb1e
9 changed files with 95 additions and 0 deletions
|
@ -8,6 +8,13 @@ tile.resonantinduction\:multimeter.name=Multimeter
|
|||
tile.resonantinduction\:contractor.name=Electromagnetic Contractor
|
||||
tile.resonantinduction\:battery.name=Modular Battery
|
||||
|
||||
tile.resonantinduction\:wire.copper.name=Copper Wire
|
||||
tile.resonantinduction\:wire.tin.name=Tin Wire
|
||||
tile.resonantinduction\:wire.iron.name=Iron Wire
|
||||
tile.resonantinduction\:wire.aluminum.name=Aluminum Wire
|
||||
tile.resonantinduction\:wire.silver.name=Silver Wire
|
||||
tile.resonantinduction\:wire.superconductor.name=Superconductor Wire
|
||||
|
||||
## Items
|
||||
item.resonantinduction\:quantumEntangler.name=Quantum Entangler
|
||||
item.resonantinduction\:capacitor.name=Capacitor Cell
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 269 B |
Binary file not shown.
After Width: | Height: | Size: 224 B |
BIN
resources/assets/resonantinduction/textures/items/wire.iron.png
Normal file
BIN
resources/assets/resonantinduction/textures/items/wire.iron.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 269 B |
Binary file not shown.
After Width: | Height: | Size: 269 B |
Binary file not shown.
After Width: | Height: | Size: 225 B |
BIN
resources/assets/resonantinduction/textures/items/wire.tin.png
Normal file
BIN
resources/assets/resonantinduction/textures/items/wire.tin.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 224 B |
25
src/resonantinduction/wire/EnumWire.java
Normal file
25
src/resonantinduction/wire/EnumWire.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package resonantinduction.wire;
|
||||
|
||||
/**
|
||||
* An enumerator for different wire materials.
|
||||
*
|
||||
* @author Calclavia
|
||||
*
|
||||
*/
|
||||
|
||||
public enum EnumWire
|
||||
{
|
||||
COPPER(0.0125f, 3, 200), TIN(0.01f, 2, 30), IRON(0.005f, 1, 300), ALUMINUM(0.025f, 8, 15),
|
||||
SILVER(0.005f, 1, 300), SUPERCONDUCTOR(0, 5, Integer.MAX_VALUE);
|
||||
|
||||
public final float resistance;
|
||||
public final int damage;
|
||||
public final int maxAmps;
|
||||
|
||||
EnumWire(float resistance, int electrocutionDamage, int maxAmps)
|
||||
{
|
||||
this.resistance = resistance;
|
||||
this.damage = electrocutionDamage;
|
||||
this.maxAmps = maxAmps;
|
||||
}
|
||||
}
|
63
src/resonantinduction/wire/ItemBlockWire.java
Normal file
63
src/resonantinduction/wire/ItemBlockWire.java
Normal file
|
@ -0,0 +1,63 @@
|
|||
package resonantinduction.wire;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Icon;
|
||||
import resonantinduction.ResonantInduction;
|
||||
import universalelectricity.core.electricity.ElectricityDisplay;
|
||||
import universalelectricity.core.electricity.ElectricityDisplay.ElectricUnit;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public abstract class ItemBlockWire extends ItemBlock
|
||||
{
|
||||
protected HashMap<String, Icon> icons = new HashMap<String, Icon>();
|
||||
|
||||
public ItemBlockWire(int id)
|
||||
{
|
||||
super(id);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int damage)
|
||||
{
|
||||
return damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack itemStack)
|
||||
{
|
||||
return this.getUnlocalizedName() + "." + EnumWire.values()[itemStack.getItemDamage()].name().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List par3List, boolean par4)
|
||||
{
|
||||
par3List.add("Resistance: " + ElectricityDisplay.getDisplay(EnumWire.values()[itemstack.getItemDamage()].resistance, ElectricUnit.RESISTANCE));
|
||||
par3List.add("Max Amperage: " + ElectricityDisplay.getDisplay(EnumWire.values()[itemstack.getItemDamage()].maxAmps, ElectricUnit.AMPERE));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IconRegister par1IconRegister)
|
||||
{
|
||||
for (int i = 0; i < EnumWire.values().length - 1; i++)
|
||||
{
|
||||
this.icons.put(this.getUnlocalizedName(new ItemStack(this.itemID, 1, i)), par1IconRegister.registerIcon(this.getUnlocalizedName(new ItemStack(this.itemID, 1, i)).replaceAll("tile.", ResonantInduction.PREFIX)));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Icon getIconFromDamage(int meta)
|
||||
{
|
||||
return this.icons.get(this.getUnlocalizedName(new ItemStack(this.itemID, 1, meta)));
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue