Made battlesigns have editable text

This commit is contained in:
Arthur Uzulin committed 2014-09-12 23:59:13 +10:00
1 parent fc0d73dbf6
commit 3d028e7123
20 files changed
+545 -205

No files matched your search

@@ -6,14 +6,15 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumChatFormatting;
import org.lwjgl.opengl.GL11;
import tconstruct.tools.logic.BattlesignLogic;
public class BattlesignTesr extends TileEntitySpecialRenderer
{
@Override
public void renderTileEntityAt (TileEntity te, double x, double y, double z, float something)
public void renderTileEntityAt (BattlesignLogic te, double x, double y, double z, float something)
{
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_LIGHTING);
float f = 0.016666668F * 0.6666667F;
@@ -27,27 +28,31 @@ public class BattlesignTesr extends TileEntitySpecialRenderer
{
case 0:
GL11.glRotatef(-90F, 0F, 1F, 0F);
GL11.glTranslatef(5F, -97F, -37F);
GL11.glTranslatef(5F, -96F, -37F);
break;
case 1:
GL11.glRotatef(90F, 0F, 1F, 0F);
GL11.glTranslatef(-85F, -97F, 53F);
GL11.glTranslatef(-85F, -96F, 53F);
break;
case 2:
GL11.glTranslatef(5F, -97F, 53F);
GL11.glTranslatef(5F, -96F, 53F);
break;
case 3:
GL11.glRotatef(180F, 0F, 1F, 0F);
GL11.glTranslatef(-85F, -97F, -37F);
GL11.glTranslatef(-85F, -96F, -37F);
break;
}
String strings[] = { "Chicken nuggets", "Curly fries", "fuj1n", "mDiyo", "Frosty_Chicken" };
float lum = calcLuminance(te.getWorldObj().getBlock(te.xCoord, te.yCoord, te.zCoord).colorMultiplier(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord));
String strings[] = te.getText();
for (int i = 0; i < strings.length; i++)
if (strings != null && strings.length > 0)
{
fr.drawString((lum >= 35F ? "" : lum >= 31F ? EnumChatFormatting.DARK_GRAY : EnumChatFormatting.WHITE) + strings[i], -fr.getStringWidth(strings[i]) / 2 + 40, 10 * i, 0);
float lum = calcLuminance(te.getWorldObj().getBlock(te.xCoord, te.yCoord, te.zCoord).colorMultiplier(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord));
for (int i = 0; i < strings.length; i++)
{
fr.drawString((lum >= 35F ? EnumChatFormatting.BLACK : lum >= 31F ? EnumChatFormatting.GRAY : EnumChatFormatting.WHITE) + strings[i], -fr.getStringWidth(strings[i]) / 2 + 40, 10 * i, 0);
}
}
GL11.glPopMatrix();
@@ -61,4 +66,10 @@ public class BattlesignTesr extends TileEntitySpecialRenderer
return (r * 0.299f + g * 0.587f + b * 0.114f) / 3;
}
@Override
public void renderTileEntityAt (TileEntity te, double x, double y, double z, float something)
{
this.renderTileEntityAt((BattlesignLogic) te, x, y, z, something);
}
}