Fixed flat wire glitchy texture

This commit is contained in:
Calclavia 2013-12-22 13:45:21 +08:00
parent 3bdcceddf1
commit b478e67025
13 changed files with 16 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View file

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View file

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 269 B

View file

Before

Width:  |  Height:  |  Size: 224 B

After

Width:  |  Height:  |  Size: 224 B

View file

@ -34,7 +34,7 @@ import resonantinduction.multimeter.TileEntityMultimeter;
import resonantinduction.tesla.BlockTesla;
import resonantinduction.tesla.TileEntityTesla;
import resonantinduction.wire.EnumWireMaterial;
import resonantinduction.wire.ItemPartWire;
import resonantinduction.wire.ItemWire;
import universalelectricity.api.item.IElectricalItem;
import universalelectricity.api.vector.Vector3;
import basiccomponents.api.BasicRegistry;
@ -180,7 +180,7 @@ public class ResonantInduction
// Items
itemQuantumEntangler = new ItemQuantumEntangler(getNextItemID());
itemLinker = new ItemLinker(getNextItemID());
itemPartWire = new ItemPartWire(getNextItemID());
itemPartWire = new ItemWire(getNextItemID());
// Blocks
blockTesla = new BlockTesla(getNextBlockID());

View file

@ -14,6 +14,7 @@ import resonantinduction.ResonantInduction;
import resonantinduction.TabRI;
import resonantinduction.Utility;
import resonantinduction.wire.part.FlatWire;
import resonantinduction.wire.render.RenderFlatWire;
import universalelectricity.api.energy.UnitDisplay;
import universalelectricity.api.energy.UnitDisplay.Unit;
import codechicken.lib.vec.BlockCoord;
@ -24,12 +25,11 @@ import codechicken.multipart.TMultiPart;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemPartWire extends JItemMultiPart
public class ItemWire extends JItemMultiPart
{
public static Icon flatWireTexture;
private Icon[] icons = new Icon[EnumWireMaterial.values().length];
public ItemPartWire(int id)
public ItemWire(int id)
{
super(ResonantInduction.CONFIGURATION.get(Configuration.CATEGORY_ITEM, "wire", id).getInt(id));
this.setUnlocalizedName(ResonantInduction.PREFIX + "wire");
@ -77,6 +77,12 @@ public class ItemPartWire extends JItemMultiPart
list.add("Max Amperage: " + UnitDisplay.getDisplay(EnumWireMaterial.values()[itemstack.getItemDamage()].maxAmps, Unit.AMPERE));
}
@SideOnly(Side.CLIENT)
public int getSpriteNumber()
{
return 0;
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IconRegister register)
@ -86,7 +92,7 @@ public class ItemPartWire extends JItemMultiPart
icons[material.ordinal()] = register.registerIcon(ResonantInduction.PREFIX + "wire." + EnumWireMaterial.values()[material.ordinal()].getName().toLowerCase());
}
flatWireTexture = register.registerIcon(ResonantInduction.PREFIX + "models/flatWire");
RenderFlatWire.flatWireTexture = register.registerIcon(ResonantInduction.PREFIX + "models/flatWire");
}
@Override

View file

@ -14,7 +14,6 @@ import org.lwjgl.opengl.GL11;
import resonantinduction.Utility;
import resonantinduction.wire.EnumWireMaterial;
import resonantinduction.wire.IAdvancedConductor;
import resonantinduction.wire.ItemPartWire;
import resonantinduction.wire.render.RenderFlatWire;
import codechicken.lib.colour.Colour;
import codechicken.lib.data.MCDataInput;
@ -623,7 +622,7 @@ public class FlatWire extends PartWireBase implements TFacePart, JNormalOcclusio
@SideOnly(Side.CLIENT)
public Icon getIcon()
{
return ItemPartWire.flatWireTexture;
return RenderFlatWire.flatWireTexture;
}
public Colour getColour()

View file

@ -3,6 +3,7 @@ package resonantinduction.wire.render;
import java.util.Arrays;
import java.util.LinkedList;
import net.minecraft.block.Block;
import net.minecraft.util.Icon;
import resonantinduction.wire.part.FlatWire;
import codechicken.lib.lighting.LightModel;
@ -26,6 +27,8 @@ import codechicken.lib.vec.Vector3;
public class RenderFlatWire
{
public static Icon flatWireTexture;
public static class UVT implements IUVTransformation
{
public Transformation t;