Glow panels render, but are really screwed up
This commit is contained in:
parent
f3894f220c
commit
be3883195c
|
@ -3,6 +3,7 @@ package mekanism.client.render;
|
|||
import java.util.Map;
|
||||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.Mekanism;
|
||||
import mekanism.common.multipart.PartGlowPanel;
|
||||
import mekanism.common.util.MekanismUtils;
|
||||
import mekanism.common.util.MekanismUtils.ResourceType;
|
||||
|
@ -72,9 +73,8 @@ public class RenderGlowPanel implements IIconSelfRegister
|
|||
|
||||
Colour colour = new ColourRGBA(panel.colour.getColor(0), panel.colour.getColor(1), panel.colour.getColor(2), 1);
|
||||
int side = panel.side.ordinal();
|
||||
|
||||
frameModels[side].render(0, frameModels[side].verts.length, new Translation(panel.x(), panel.y(), panel.z()), new IconTransformation(icon), null);
|
||||
|
||||
|
||||
frameModels[side].render(0, frameModels[side].verts.length, new Translation(panel.x(), panel.y(), panel.z()), new IconTransformation(icon));
|
||||
lightModels[side].render(0, lightModels[side].verts.length, new Translation(panel.x(), panel.y(), panel.z()), new IconTransformation(icon), new ColourMultiplier(colour.rgba()));
|
||||
}
|
||||
|
||||
|
@ -87,11 +87,13 @@ public class RenderGlowPanel implements IIconSelfRegister
|
|||
|
||||
Colour colour = new ColourRGBA(c.getColor(0), c.getColor(1), c.getColor(2), 1);
|
||||
Colour white = new ColourRGBA(1.0, 1.0, 1.0, 1.0);
|
||||
for(int i=4;i<5;i++){
|
||||
|
||||
frameModels[i].render(0, frameModels[i].verts.length, new Translation(0, 0, 0), new IconTransformation(icon), new ColourMultiplier(white.rgba()));
|
||||
lightModels[i].render(0, lightModels[i].verts.length, new Translation(0, 0, 0), new IconTransformation(icon), new ColourMultiplier(colour.rgba()));
|
||||
|
||||
for(int i = 4; i < 5; i++)
|
||||
{
|
||||
frameModels[i].render(0, frameModels[i].verts.length, new Translation(0, 0, 0), new IconTransformation(icon), new ColourMultiplier(white.rgba()));
|
||||
lightModels[i].render(0, lightModels[i].verts.length, new Translation(0, 0, 0), new IconTransformation(icon), new ColourMultiplier(colour.rgba()));
|
||||
}
|
||||
|
||||
CCRenderState.draw();
|
||||
}
|
||||
|
||||
|
|
|
@ -974,6 +974,7 @@ public class Mekanism
|
|||
GameRegistry.registerItem(Substrate, "Substrate");
|
||||
GameRegistry.registerItem(Polyethene, "Polyethene");
|
||||
GameRegistry.registerItem(BioFuel, "BioFuel");
|
||||
GameRegistry.registerItem(GlowPanel, "GlowPanel");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.common.Mekanism;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -14,6 +15,8 @@ import codechicken.lib.vec.BlockCoord;
|
|||
import codechicken.lib.vec.Vector3;
|
||||
import codechicken.multipart.JItemMultiPart;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemGlowPanel extends JItemMultiPart
|
||||
{
|
||||
|
@ -23,12 +26,17 @@ public class ItemGlowPanel extends JItemMultiPart
|
|||
setHasSubtypes(true);
|
||||
setCreativeTab(Mekanism.tabMekanism);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {}
|
||||
|
||||
@Override
|
||||
public TMultiPart newPart(ItemStack item, EntityPlayer player, World world, BlockCoord pos, int side, Vector3 vHit)
|
||||
{
|
||||
EnumColor col = EnumColor.DYES[item.getItemDamage()];
|
||||
ForgeDirection orientation = getSideFromVector3(vHit.subtract(Vector3.center));
|
||||
|
||||
return new PartGlowPanel(col, orientation);
|
||||
}
|
||||
|
||||
|
@ -36,28 +44,32 @@ public class ItemGlowPanel extends JItemMultiPart
|
|||
{
|
||||
if(Math.abs(vector.x) > Math.abs(vector.y) && Math.abs(vector.x) > Math.abs(vector.z))
|
||||
{
|
||||
if((vector.x < 0.5 &&vector.x > 0) || vector.x == -0.5)
|
||||
if((vector.x < 0.5 && vector.x > 0) || vector.x == -0.5)
|
||||
{
|
||||
return ForgeDirection.EAST;
|
||||
}
|
||||
|
||||
return ForgeDirection.WEST;
|
||||
}
|
||||
else if(Math.abs(vector.y) > Math.abs(vector.x) && Math.abs(vector.y) > Math.abs(vector.z))
|
||||
{
|
||||
if((vector.y < 0.5 &&vector.y > 0) || vector.y == -0.5)
|
||||
if((vector.y < 0.5 && vector.y > 0) || vector.y == -0.5)
|
||||
{
|
||||
return ForgeDirection.UP;
|
||||
}
|
||||
|
||||
return ForgeDirection.DOWN;
|
||||
}
|
||||
else if(Math.abs(vector.z) > Math.abs(vector.x) && Math.abs(vector.z) > Math.abs(vector.y))
|
||||
{
|
||||
if((vector.z < 0.5 &&vector.z > 0) || vector.z == -0.5)
|
||||
if((vector.z < 0.5 && vector.z > 0) || vector.z == -0.5)
|
||||
{
|
||||
return ForgeDirection.SOUTH;
|
||||
}
|
||||
|
||||
return ForgeDirection.NORTH;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -75,6 +87,7 @@ public class ItemGlowPanel extends JItemMultiPart
|
|||
{
|
||||
EnumColor colour = EnumColor.DYES[stack.getItemDamage()];
|
||||
String colourName;
|
||||
|
||||
if(colour == EnumColor.BLACK)
|
||||
{
|
||||
colourName = EnumColor.DARK_GREY + colour.getDyeName();
|
||||
|
|
|
@ -34,7 +34,6 @@ public class MultipartMekanism implements IPartFactory
|
|||
MultipartGenerator.registerPassThroughInterface("mekanism.common.ITileNetwork");
|
||||
MultipartGenerator.registerPassThroughInterface("ic2.api.tile.IWrenchable");
|
||||
MultipartGenerator.registerPassThroughInterface("mekanism.api.transmitters.IBlockableConnection");
|
||||
MultipartGenerator.registerPassThroughInterface("net.minecraftforge.fluids.IFluidHandler");
|
||||
MultipartGenerator.registerPassThroughInterface("mekanism.api.gas.IGasHandler");
|
||||
}
|
||||
|
||||
|
|
|
@ -37,8 +37,9 @@ public class PartGlowPanel extends JCuboidPart implements JNormalOcclusion, JIco
|
|||
{
|
||||
Cuboid6 cuboid = new Cuboid6(0.25, 0, 0.25, 0.75, 0.125, 0.75);
|
||||
Translation fromOrigin = new Translation(Vector3.center);
|
||||
Translation toOrigin = (Translation) fromOrigin.inverse();
|
||||
for(int i=0; i < 6; i++)
|
||||
Translation toOrigin = (Translation)fromOrigin.inverse();
|
||||
|
||||
for(int i = 0; i < 6; i++)
|
||||
{
|
||||
bounds[i] = cuboid.copy().apply(toOrigin).apply(Rotation.sideRotations[i]).apply(fromOrigin);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue