Skip to content

Commit

Permalink
fix lots of rendering mappings. rename toolmaterial to ttoolmaterial …
Browse files Browse the repository at this point in the history
…to avoid conflicts w/ a SRG name for something in vanilla
  • Loading branch information
progwml6 committed Jan 9, 2014
1 parent f7a86a7 commit ab73baf
Show file tree
Hide file tree
Showing 28 changed files with 140 additions and 139 deletions.
8 changes: 4 additions & 4 deletions src/main/java/tconstruct/blocks/logic/TileEntityLandmine.java
Expand Up @@ -101,7 +101,7 @@ public Packet getDescriptionPacket ()
{
NBTTagCompound nbt = new NBTTagCompound();
writeToNBT(nbt);
return new Packet132TileEntityData(field_145851_c, field_145848_d, field_145849_e, 0, nbt);
return new Packet132TileEntityData(xCoord, field_145848_d, field_145849_e, 0, nbt);
}

@Override
Expand Down Expand Up @@ -211,7 +211,7 @@ public void setGuiDisplayName (String par1Str)
@Override
public boolean isUseableByPlayer (EntityPlayer par1EntityPlayer)
{
return this.field_145850_b.getBlockTileEntity(this.field_145851_c, this.field_145848_d, this.field_145849_e) != this ? false : par1EntityPlayer.getDistanceSq((double) this.field_145851_c + 0.5D, (double) this.field_145848_d + 0.5D,
return this.field_145850_b.getBlockTileEntity(this.xCoord, this.field_145848_d, this.field_145849_e) != this ? false : par1EntityPlayer.getDistanceSq((double) this.xCoord + 0.5D, (double) this.field_145848_d + 0.5D,
(double) this.field_145849_e + 0.5D) <= 64.0D;
}

Expand All @@ -229,7 +229,7 @@ public void closeChest ()
public void onInventoryChanged ()
{
super.onInventoryChanged();
this.field_145850_b.markBlockForUpdate(field_145851_c, field_145848_d, field_145849_e);
this.field_145850_b.markBlockForUpdate(xCoord, field_145848_d, field_145849_e);
}

@Override
Expand Down Expand Up @@ -259,7 +259,7 @@ public void updateEntity ()
{
if (shouldUpdateLogic)
{
field_145850_b.markBlockForRenderUpdate(field_145851_c, field_145848_d, field_145849_e);
field_145850_b.markBlockForRenderUpdate(xCoord, field_145848_d, field_145849_e);
shouldUpdateLogic = false;
}
if (soundcountything > 0)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/tconstruct/client/TClientEvents.java
Expand Up @@ -113,7 +113,7 @@ public void renderHealthbar (RenderGameOverlayEvent.Pre event)
int scaledHeight = scaledresolution.getScaledHeight();
int xBasePos = scaledWidth / 2 - 91;
int yBasePos = scaledHeight - 39;
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(mc.thePlayer.username);
TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(mc.thePlayer.getDisplayName());

boolean highlight = mc.thePlayer.hurtResistantTime / 3 % 2 == 1;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/client/entity/FancyItemRender.java
Expand Up @@ -344,9 +344,9 @@ public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par
}

GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
this.itemRenderBlocks.useInventoryTint = this.renderWithColor;
this.itemRenderBlocks.field_147844_c = this.renderWithColor;
this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F);
this.itemRenderBlocks.useInventoryTint = true;
this.itemRenderBlocks.field_147844_c = true;
GL11.glPopMatrix();
}
else if (Item.itemsList[k].requiresMultipleRenderPasses())
Expand Down
Expand Up @@ -336,9 +336,9 @@ public void renderItemIntoGUI (FontRenderer par1FontRenderer, TextureManager par
}

GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
this.itemRenderBlocks.useInventoryTint = this.renderWithColor;
this.itemRenderBlocks.field_147844_c = this.renderWithColor;
this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F);
this.itemRenderBlocks.useInventoryTint = true;
this.itemRenderBlocks.field_147844_c = true;
GL11.glPopMatrix();
}
else if (Item.itemsList[k].requiresMultipleRenderPasses())
Expand Down Expand Up @@ -427,7 +427,7 @@ public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, TextureMa
{
if (par3ItemStack != null)
{
if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5))
if (!ForgeHooksClient.renderInventoryItem(field_147909_c, par2TextureManager, par3ItemStack, renderWithColor, zLevel, (float) par4, (float) par5))
{
this.renderItemIntoGUI(par1FontRenderer, par2TextureManager, par3ItemStack, par4, par5, true);
}
Expand Down
28 changes: 14 additions & 14 deletions src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java
Expand Up @@ -62,10 +62,10 @@ protected void updateScrollbar (int mouseX, int mouseY, float par3)
int topo = this.guiTop;
int xScroll = lefto + 67;
int yScroll = topo + 8;
int scrollWidth = xScroll + 14;
int scrollHeight = yScroll + 144;
int scrollfield_146294_l = xScroll + 14;
int scrollfield_146295_m = yScroll + 144;

if (!this.wasClicking && mouseDown && mouseX >= xScroll && mouseY >= yScroll && mouseX < scrollWidth && mouseY < scrollHeight)
if (!this.wasClicking && mouseDown && mouseX >= xScroll && mouseY >= yScroll && mouseX < scrollfield_146294_l && mouseY < scrollfield_146295_m)
{
this.isScrolling = true;
}
Expand All @@ -84,7 +84,7 @@ protected void updateScrollbar (int mouseX, int mouseY, float par3)

if (this.isScrolling)
{
this.currentScroll = (mouseY - yScroll - 7.5F) / (scrollHeight - yScroll - 15.0F);
this.currentScroll = (mouseY - yScroll - 7.5F) / (scrollfield_146295_m - yScroll - 15.0F);

if (this.currentScroll < 0.0F)
{
Expand All @@ -110,8 +110,8 @@ protected void drawGuiContainerForegroundLayer (int mouseX, int mouseY)
field_146289_q.drawString(StatCollector.translateToLocal("container.inventory"), 90, (ySize - 96) + 2, 0x404040);

int base = 0;
int cornerX = (width - xSize) / 2 + 36;
int cornerY = (height - ySize) / 2;
int cornerX = (field_146294_l - xSize) / 2 + 36;
int cornerY = (field_146295_m - ySize) / 2;
FluidTankInfo[] info = logic.getTankInfo(ForgeDirection.UNKNOWN);

int capacity = 0;
Expand Down Expand Up @@ -170,8 +170,8 @@ protected void drawGuiContainerBackgroundLayer (float f, int mouseX, int mouseY)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(background);
int cornerX = (width - xSize) / 2 + 36;
int cornerY = (height - ySize) / 2;
int cornerX = (field_146294_l - xSize) / 2 + 36;
int cornerY = (field_146295_m - ySize) / 2;
drawTexturedModalRect(cornerX + 46, cornerY, 0, 0, 176, ySize);

//Fuel - Lava
Expand Down Expand Up @@ -359,7 +359,7 @@ protected void drawToolTip (List par1List, int par2, int par3)
while (iterator.hasNext())
{
String s = (String) iterator.next();
int l = this.field_146289_q.getStringWidth(s);
int l = this.field_146289_q.getStringfield_146294_l(s);

if (l > k)
{
Expand All @@ -376,14 +376,14 @@ protected void drawToolTip (List par1List, int par2, int par3)
k1 += 2 + (par1List.size() - 1) * 10;
}

if (i1 + k > this.width)
if (i1 + k > this.field_146294_l)
{
i1 -= 28 + k;
}

if (j1 + k1 + 6 > this.height)
if (j1 + k1 + 6 > this.field_146295_m)
{
j1 = this.height - k1 - 6;
j1 = this.field_146295_m - k1 - 6;
}

this.zLevel = 300.0F;
Expand Down Expand Up @@ -436,8 +436,8 @@ public void mouseClicked(int mouseX, int mouseY, int mouseButton)
super.mouseClicked(mouseX, mouseY, mouseButton);
int base = 0;
int cornerX = (width - xSize) / 2 + 36;
int cornerY = (height - ySize) / 2;
int cornerX = (field_146294_l - xSize) / 2 + 36;
int cornerY = (field_146295_m - ySize) / 2;
int fluidToBeBroughtUp = -1;
for (FluidStack liquid : multitank.getAllFluids())
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/tconstruct/client/gui/CraftingStationGui.java
Expand Up @@ -339,8 +339,8 @@ protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
// Draw the background
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(background);
int cornerX = (this.width - this.xSize) / 2;
int cornerY = (this.height - this.ySize) / 2;
int cornerX = (this.field_146294_l - this.xSize) / 2;
int cornerY = (this.field_146295_m - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize);

if (active)
Expand Down Expand Up @@ -373,8 +373,8 @@ protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(description);
cornerX = (this.width + this.xSize) / 2;
cornerY = (this.height - this.ySize) / 2;
cornerX = (this.field_146294_l + this.xSize) / 2;
cornerY = (this.field_146295_m - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 0, 0, 126, this.ySize + 30);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/client/gui/FrypanGui.java
Expand Up @@ -32,8 +32,8 @@ protected void drawGuiContainerBackgroundLayer (float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(background);
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
int cornerX = (field_146294_l - xSize) / 2;
int cornerY = (field_146295_m - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
if (logic.fuel > 0)
{
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/tconstruct/client/gui/FurnaceGui.java
Expand Up @@ -30,7 +30,7 @@ public FurnaceGui(InventoryPlayer inventory, FurnaceLogic furnace)
protected void drawGuiContainerForegroundLayer (int par1, int par2)
{
String s = this.logic.isInvNameLocalized() ? this.logic.getInvName() : I18n.getStringParams(this.logic.getInvName());
this.field_146289_q.drawString(s, this.xSize / 2 - this.field_146289_q.getStringWidth(s) / 2, 6, 4210752);
this.field_146289_q.drawString(s, this.xSize / 2 - this.field_146289_q.getStringfield_146294_l(s) / 2, 6, 4210752);
this.field_146289_q.drawString(I18n.getStringParams("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
}

Expand All @@ -41,8 +41,8 @@ protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(furnaceGuiTextures);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
int k = (this.field_146294_l - this.xSize) / 2;
int l = (this.field_146295_m - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
int i1;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/client/gui/GuiLandmine.java
Expand Up @@ -78,8 +78,8 @@ protected void drawGuiContainerBackgroundLayer (float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
field_146297_k.renderEngine.bindTexture(background);
int x = (width - xSize) / 2;
int y = (height - ySize) / 2;
int x = (field_146294_l - xSize) / 2;
int y = (field_146295_m - ySize) / 2;
this.drawTexturedModalRect(x, y, 0, 0, xSize, ySize);
}

Expand Down
14 changes: 7 additions & 7 deletions src/main/java/tconstruct/client/gui/NewContainerGui.java
Expand Up @@ -90,8 +90,8 @@ public void initGui ()
{
super.initGui();
this.field_146297_k.thePlayer.openContainer = this.container;
this.guiLeft = (this.width - this.xSize) / 2;
this.guiTop = (this.height - this.ySize) / 2;
this.guiLeft = (this.field_146294_l - this.xSize) / 2;
this.guiTop = (this.field_146295_m - this.ySize) / 2;
}

/**
Expand Down Expand Up @@ -279,7 +279,7 @@ protected void func_102021_a (List par1List, int par2, int par3)
while (iterator.hasNext())
{
String s = (String) iterator.next();
int l = this.field_146289_q.getStringWidth(s);
int l = this.field_146289_q.getStringfield_146294_l(s);

if (l > k)
{
Expand All @@ -296,14 +296,14 @@ protected void func_102021_a (List par1List, int par2, int par3)
k1 += 2 + (par1List.size() - 1) * 10;
}

if (i1 + k > this.width)
if (i1 + k > this.field_146294_l)
{
i1 -= 28 + k;
}

if (j1 + k1 + 6 > this.height)
if (j1 + k1 + 6 > this.field_146295_m)
{
j1 = this.height - k1 - 6;
j1 = this.field_146295_m - k1 - 6;
}

this.zLevel = 300.0F;
Expand Down Expand Up @@ -803,7 +803,7 @@ protected boolean isMouseOverSlot (Slot slot, int mouseX, int mouseY)
}

/**
* Args: left, top, width, height, pointX, pointY. Note: left, top are local to Gui, pointX, pointY are local to
* Args: left, top, field_146294_l, field_146295_m, pointX, pointY. Note: left, top are local to Gui, pointX, pointY are local to
* screen
*/
protected boolean isPointInRegion (int par1, int par2, int par3, int par4, int par5, int par6)
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/tconstruct/client/gui/PartCrafterGui.java
Expand Up @@ -17,7 +17,7 @@
import tconstruct.inventory.PartCrafterChestContainer;
import tconstruct.library.TConstructRegistry;
import tconstruct.library.crafting.PatternBuilder;
import tconstruct.library.tools.ToolMaterial;
import tconstruct.library.tools.TToolMaterial;

public class PartCrafterGui extends NewContainerGui
{
Expand All @@ -26,7 +26,7 @@ public class PartCrafterGui extends NewContainerGui
boolean drawChestPart;
boolean hasTop, hasBottom;
ItemStack topMaterial, bottomMaterial;
ToolMaterial topEnum, bottomEnum;
TToolMaterial topEnum, bottomEnum;

public PartCrafterGui(InventoryPlayer inventoryplayer, PartBuilderLogic partlogic, World world, int x, int y, int z)
{
Expand Down Expand Up @@ -157,8 +157,8 @@ protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
// Draw the background
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(background);
int cornerX = (this.width - this.xSize) / 2;
int cornerY = (this.height - this.ySize) / 2;
int cornerX = (this.field_146294_l - this.xSize) / 2;
int cornerY = (this.field_146295_m - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize);

// Draw Slots
Expand Down Expand Up @@ -191,8 +191,8 @@ protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3)
// Draw description
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(description);
cornerX = (this.width + this.xSize) / 2;
cornerY = (this.height - this.ySize) / 2;
cornerX = (this.field_146294_l + this.xSize) / 2;
cornerY = (this.field_146295_m - this.ySize) / 2;
this.drawTexturedModalRect(cornerX, cornerY, 126, 0, 126, this.ySize);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/tconstruct/client/gui/PatternChestGui.java
Expand Up @@ -34,8 +34,8 @@ protected void drawGuiContainerBackgroundLayer (float f, int i, int j)
{
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146297_k.getTextureManager().bindTexture(background);
int cornerX = (width - xSize) / 2;
int cornerY = (height - ySize) / 2;
int cornerX = (field_146294_l - xSize) / 2;
int cornerY = (field_146295_m - ySize) / 2;
drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize);
}
}

0 comments on commit ab73baf

Please sign in to comment.