diff options
Diffstat (limited to 'src/main/java/gregtech')
3 files changed, 30 insertions, 36 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java index 3b08a1e81f..8584e849bb 100644 --- a/src/main/java/gregtech/api/util/GT_Utility.java +++ b/src/main/java/gregtech/api/util/GT_Utility.java @@ -783,10 +783,9 @@ public class GT_Utility { } catch (Exception e) { System.err.println(e); } - //ItemStack rStack = ItemList.Display_Fluid.getWithDamage(aUseStackSize ? aFluid.amount / 1000 : 1, tmp); ItemStack rStack = ItemList.Display_Fluid.getWithDamage(1, tmp); NBTTagCompound tNBT = new NBTTagCompound(); - tNBT.setLong("mFluidDisplayAmount", aFluid.amount); + tNBT.setLong("mFluidDisplayAmount", aUseStackSize ? aFluid.amount : 0); tNBT.setLong("mFluidDisplayHeat", aFluid.getFluid().getTemperature(aFluid)); tNBT.setBoolean("mFluidState", aFluid.getFluid().isGaseous(aFluid)); rStack.setTagCompound(tNBT); diff --git a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java index 4085a24190..06c186d127 100644 --- a/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java +++ b/src/main/java/gregtech/common/render/GT_FluidDisplayStackRenderer.java @@ -15,7 +15,6 @@ import org.lwjgl.opengl.GL11; @SideOnly(cpw.mods.fml.relauncher.Side.CLIENT) public class GT_FluidDisplayStackRenderer implements IItemRenderer { - private static final float smallTextScale = 0.5f; public GT_FluidDisplayStackRenderer() { MinecraftForgeClient.registerItemRenderer(ItemList.Display_Fluid.getItem(), this); @@ -41,25 +40,14 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer { if (item == null || item.getItem() == null || !(item.getItem() instanceof GT_FluidDisplayItem)) return; - Tessellator tess = Tessellator.instance; - GL11.glPushMatrix(); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); - - int l = item.getItem().getColorFromItemStack(item, 0); - float f3 = (float)(l >> 16 & 255) / 255.0F; - float f4 = (float)(l >> 8 & 255) / 255.0F; - float f = (float)(l & 255) / 255.0F; - GL11.glColor4f(f3, f4, f, 1.0F); - - GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); IIcon icon = item.getItem().getIconFromDamage(item.getItemDamage()); - tess.startDrawingQuads(); + Tessellator tess = Tessellator.instance; + tess.startDrawingQuads(); // draw a simple rectangle for the inventory icon final float x_min = icon.getMinU(); final float x_max = icon.getMaxU(); @@ -71,12 +59,6 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer { tess.addVertexWithUV( 0, 0, 0, x_min, y_min); tess.draw(); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_ALPHA_TEST); - GL11.glDisable(GL11.GL_BLEND); - - GL11.glPopMatrix(); - if(item.getTagCompound() == null) return; @@ -91,22 +73,20 @@ public class GT_FluidDisplayStackRenderer implements IItemRenderer { int exp = (int) (Math.log(fluidAmount) / Math.log(1000)); double shortAmount = fluidAmount / Math.pow(1000, exp); if ( shortAmount >= 100) { - amountString = String.format("%.0f%cL", shortAmount, "kMGT".charAt(exp - 1)); + amountString = String.format("%.0f%cL", shortAmount, "kMGTPE".charAt(exp - 1)); //heard it here first, PetaLiters } else if ( shortAmount >= 10) { - amountString = String.format("%.1f%cL", shortAmount, "kMGT".charAt(exp - 1)); + amountString = String.format("%.1f%cL", shortAmount, "kMGTPE".charAt(exp - 1)); } else { - amountString = String.format("%.2f%cL", shortAmount, "kMGT".charAt(exp - 1)); + amountString = String.format("%.2f%cL", shortAmount, "kMGTPE".charAt(exp - 1)); } } FontRenderer fontRender = Minecraft.getMinecraft().fontRenderer; - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_DEPTH_TEST); + float smallTextScale = fontRender.getUnicodeFlag() ? 3F/4F : 1F/2F; GL11.glDisable(GL11.GL_BLEND); - GL11.glScalef(smallTextScale, smallTextScale, smallTextScale); //TODO: how to make this pretty at all scales? - fontRender.drawString( amountString, 0, 16*2 - fontRender.FONT_HEIGHT + 1, 0xFFFFFF, true); - GL11.glEnable(GL11.GL_LIGHTING); - GL11.glEnable(GL11.GL_DEPTH_TEST); + GL11.glScalef(smallTextScale, smallTextScale, 1.0f); + + fontRender.drawString( amountString, 0, (int) (16/smallTextScale) - fontRender.FONT_HEIGHT + 1, 0xFFFFFF, true); } } } diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index d6e31418f5..b57f0396a8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -71,7 +71,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas int mGlassCount = 0; boolean doorState = false; this.mUpdate = 100; - + if (debugCleanroom) { GT_Log.out.println( "Cleanroom: Checking machine" @@ -83,13 +83,25 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { x = i; + break; + } else { + if (debugCleanroom) { + GT_Log.out.println("Cleanroom: Unable to detect room X edge?"); + } + return false; + } + } + } + for (int i = 1; i < 8; i++) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(0, 0, i); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 0, i); + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { z = i; break; } else { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Unable to detect room edge?" - ); + GT_Log.out.println("Cleanroom: Unable to detect room Z edge?"); } return false; } @@ -147,7 +159,10 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas if ((!this.addMaintenanceToMachineList(tTileEntity, 82)) && (!this.addEnergyInputToMachineList(tTileEntity, 82))) { if (tBlock instanceof ic2.core.block.BlockIC2Door) { if ((tMeta & 8) == 0) { - doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0); + if (Math.abs(dY) < y) //x - side + doorState = (tMeta & 0x5) == 0x4 || (tMeta & 0x5) == 0x1; + else if (Math.abs(dX) < x) //y-side, corners ignored. + doorState = (tMeta & 0x5) == 0x5 || (tMeta & 0x5) == 0x0; } mDoorCount++; } else { |