diff --git a/README.md b/README.md index f8cfc470..01dd9ff9 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Tinker's Construct - 1.5 -Modify all the things, then do it again! -Melt down any metals you find. -Turn everything into golems! +Modify all the things, then do it again! +Melt down any metals you find. +Turn everything into golems! -Most code is public domain; any that isn't has a note in their folders +Most code is public domain; any alternate licenses are noted where appropriate diff --git a/mods/tinker/armory/client/ArmorStandGui.java b/mods/tinker/armory/client/ArmorStandGui.java index 1fc29205..6078449f 100644 --- a/mods/tinker/armory/client/ArmorStandGui.java +++ b/mods/tinker/armory/client/ArmorStandGui.java @@ -32,7 +32,7 @@ public class ArmorStandGui extends GuiContainer //int var4 = this.mc.renderEngine.getTexture("/infitextures/gui/armorstand.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); //this.mc.renderEngine.bindTexture(var4); - this.mc.renderEngine.func_98187_b("/tinkertextures/gui/armorstand.png"); + this.mc.renderEngine.bindTexture("/tinkertextures/gui/armorstand.png"); int var5 = this.guiLeft; int var6 = this.guiTop; this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); diff --git a/mods/tinker/armory/content/ArmorStandEntity.java b/mods/tinker/armory/content/ArmorStandEntity.java index 64c30999..96c16602 100644 --- a/mods/tinker/armory/content/ArmorStandEntity.java +++ b/mods/tinker/armory/content/ArmorStandEntity.java @@ -156,14 +156,14 @@ public class ArmorStandEntity extends EntityEquipment } @Override - public boolean func_94042_c () + public boolean isInvNameLocalized () { // TODO Auto-generated method stub return false; } @Override - public boolean func_94041_b (int i, ItemStack itemstack) + public boolean isStackValidForSlot (int i, ItemStack itemstack) { // TODO Auto-generated method stub return false; diff --git a/mods/tinker/armory/content/DisplayBlock.java b/mods/tinker/armory/content/DisplayBlock.java index 0edc6a17..ee0bef9a 100644 --- a/mods/tinker/armory/content/DisplayBlock.java +++ b/mods/tinker/armory/content/DisplayBlock.java @@ -60,8 +60,9 @@ public class DisplayBlock extends InventoryBlock return new String[] { "toolstation_top" }; } - public void func_94332_a (IconRegister par1IconRegister) + @Override + public void registerIcons (IconRegister par1IconRegister) { - this.field_94336_cN = par1IconRegister.func_94245_a(Block.blockSteel.getUnlocalizedName()); + this.blockIcon = par1IconRegister.registerIcon(Block.blockSteel.getUnlocalizedName()); } } diff --git a/mods/tinker/armory/content/ToolrackLogic.java b/mods/tinker/armory/content/ToolrackLogic.java index 4f052e73..0ff4aace 100644 --- a/mods/tinker/armory/content/ToolrackLogic.java +++ b/mods/tinker/armory/content/ToolrackLogic.java @@ -200,14 +200,14 @@ public class ToolrackLogic extends TileEntity } @Override - public boolean func_94042_c () + public boolean isInvNameLocalized () { // TODO Auto-generated method stub return false; } @Override - public boolean func_94041_b (int i, ItemStack itemstack) + public boolean isStackValidForSlot (int i, ItemStack itemstack) { // TODO Auto-generated method stub return false; diff --git a/mods/tinker/common/BlockSkinRenderHelper.java b/mods/tinker/common/BlockSkinRenderHelper.java index 2fe58477..cf563a5e 100644 --- a/mods/tinker/common/BlockSkinRenderHelper.java +++ b/mods/tinker/common/BlockSkinRenderHelper.java @@ -38,182 +38,130 @@ public class BlockSkinRenderHelper { render.enableAO = true; boolean flag = false; - float f3 = render.lightValueOwn; - float f4 = render.lightValueOwn; - float f5 = render.lightValueOwn; - float f6 = render.lightValueOwn; + float f3 = 0.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; boolean flag1 = true; - boolean flag2 = true; - boolean flag3 = true; - boolean flag4 = true; - boolean flag5 = true; - boolean flag6 = true; - render.lightValueOwn = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin); - render.aoLightValueXNeg = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueYNeg = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueZNeg = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueXPos = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); - render.aoLightValueYPos = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoLightValueZPos = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); int l = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin); - int i1 = l; - int j1 = l; - int k1 = l; - int l1 = l; - int i2 = l; - int j2 = l; - - if (render.renderMinY <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin - 1, zMin)) - { - j1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - } - - if (render.renderMaxY >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin + 1, zMin)) - { - i2 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); - } - - if (render.renderMinX <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin - 1, yMin, zMin)) - { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - } - - if (render.renderMaxX >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin + 1, yMin, zMin)) - { - l1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); - } - - if (render.renderMinZ <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin - 1)) - { - k1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - } - - if (render.renderMaxZ >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin + 1)) - { - j2 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - } - Tessellator tessellator = Tessellator.instance; tessellator.setBrightness(983055); - render.aoGrassXYZPPC = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin + 1, zMin)]; - render.aoGrassXYZPNC = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin - 1, zMin)]; - render.aoGrassXYZPCP = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin + 1)]; - render.aoGrassXYZPCN = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin - 1)]; - render.aoGrassXYZNPC = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin + 1, zMin)]; - render.aoGrassXYZNNC = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin - 1, zMin)]; - render.aoGrassXYZNCN = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin - 1)]; - render.aoGrassXYZNCP = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin + 1)]; - render.aoGrassXYZCPP = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin + 1)]; - render.aoGrassXYZCPN = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin - 1)]; - render.aoGrassXYZCNP = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin + 1)]; - render.aoGrassXYZCNN = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin - 1)]; - if (render.func_94175_b(block).func_94215_i().equals("grass_top")) + if (render.getBlockIcon(block).getIconName().equals("grass_top")) + { + flag1 = false; + } + else if (render.hasOverrideBlockTexture()) { - flag6 = false; - flag5 = false; - flag4 = false; - flag3 = false; flag1 = false; } - if (render.func_94167_b()) - { - flag6 = false; - flag5 = false; - flag4 = false; - flag3 = false; - flag1 = false; - } + boolean flag2; + boolean flag3; + boolean flag4; + boolean flag5; + float f7; + int i1; if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin - 1, zMin, 0)) { - if (render.aoType > 0) + if (render.renderMinY <= 0.0D) { - if (render.renderMinY <= 0.0D) - { - --yMin; - } + --yMin; + } - render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); - render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); - render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin - 1, zMin)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin - 1, zMin)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin - 1)]; - if (!render.aoGrassXYZCNN && !render.aoGrassXYZNNC) - { - render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXYNN; - render.aoBrightnessXYZNNN = render.aoBrightnessXYNN; - } - else - { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); - } - - if (!render.aoGrassXYZCNP && !render.aoGrassXYZNNC) - { - render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXYNN; - render.aoBrightnessXYZNNP = render.aoBrightnessXYNN; - } - else - { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); - } - - if (!render.aoGrassXYZCNN && !render.aoGrassXYZPNC) - { - render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXYPN; - render.aoBrightnessXYZPNN = render.aoBrightnessXYPN; - } - else - { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); - } - - if (!render.aoGrassXYZCNP && !render.aoGrassXYZPNC) - { - render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXYPN; - render.aoBrightnessXYZPNP = render.aoBrightnessXYPN; - } - else - { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); - } - - if (render.renderMinY <= 0.0D) - { - ++yMin; - } - - f3 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXYNN + render.aoLightValueScratchYZNP + render.aoLightValueYNeg) / 4.0F; - f6 = (render.aoLightValueScratchYZNP + render.aoLightValueYNeg + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXYPN) / 4.0F; - f5 = (render.aoLightValueYNeg + render.aoLightValueScratchYZNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNN) / 4.0F; - f4 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNN + render.aoLightValueYNeg + render.aoLightValueScratchYZNN) / 4.0F; - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXYNN, render.aoBrightnessYZNP, j1); - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXYPN, j1); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYPN, render.aoBrightnessXYZPNN, j1); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNN, render.aoBrightnessYZNN, j1); + if (!flag4 && !flag2) + { + render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXYNN; + render.aoBrightnessXYZNNN = render.aoBrightnessXYNN; } else { - f6 = render.aoLightValueYNeg; - f5 = render.aoLightValueYNeg; - f4 = render.aoLightValueYNeg; - f3 = render.aoLightValueYNeg; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = render.aoBrightnessXYNN; + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); + } + + if (!flag5 && !flag2) + { + render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXYNN; + render.aoBrightnessXYZNNP = render.aoBrightnessXYNN; + } + else + { + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); + } + + if (!flag4 && !flag3) + { + render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXYPN; + render.aoBrightnessXYZPNN = render.aoBrightnessXYPN; + } + else + { + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); + } + + if (!flag5 && !flag3) + { + render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXYPN; + render.aoBrightnessXYZPNP = render.aoBrightnessXYPN; + } + else + { + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); + } + + if (render.renderMinY <= 0.0D) + { + ++yMin; + } + + i1 = l; + + if (render.renderMinY <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin - 1, zMin)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + f3 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXYNN + render.aoLightValueScratchYZNP + f7) / 4.0F; + f6 = (render.aoLightValueScratchYZNP + f7 + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXYPN) / 4.0F; + f5 = (f7 + render.aoLightValueScratchYZNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNN) / 4.0F; + f4 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNN + f7 + render.aoLightValueScratchYZNN) / 4.0F; + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXYNN, render.aoBrightnessYZNP, i1); + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXYPN, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYPN, render.aoBrightnessXYZPNN, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNN, render.aoBrightnessYZNN, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.5F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.5F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.5F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.5F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.5F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.5F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag1 ? xMax : 1.0F) * 0.5F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag1 ? yMax : 1.0F) * 0.5F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag1 ? zMax : 1.0F) * 0.5F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -232,92 +180,92 @@ public class BlockSkinRenderHelper if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin + 1, zMin, 1)) { - if (render.aoType > 0) + if (render.renderMaxY >= 1.0D) { - if (render.renderMaxY >= 1.0D) - { - ++yMin; - } + ++yMin; + } - render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); - render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); - render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin + 1, zMin)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin + 1, zMin)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin - 1)]; - if (!render.aoGrassXYZCPN && !render.aoGrassXYZNPC) - { - render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXYNP; - render.aoBrightnessXYZNPN = render.aoBrightnessXYNP; - } - else - { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); - } - - if (!render.aoGrassXYZCPN && !render.aoGrassXYZPPC) - { - render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXYPP; - render.aoBrightnessXYZPPN = render.aoBrightnessXYPP; - } - else - { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); - } - - if (!render.aoGrassXYZCPP && !render.aoGrassXYZNPC) - { - render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXYNP; - render.aoBrightnessXYZNPP = render.aoBrightnessXYNP; - } - else - { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); - } - - if (!render.aoGrassXYZCPP && !render.aoGrassXYZPPC) - { - render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXYPP; - render.aoBrightnessXYZPPP = render.aoBrightnessXYPP; - } - else - { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); - } - - if (render.renderMaxY >= 1.0D) - { - --yMin; - } - - f6 = (render.aoLightValueScratchXYZNPP + render.aoLightValueScratchXYNP + render.aoLightValueScratchYZPP + render.aoLightValueYPos) / 4.0F; - f3 = (render.aoLightValueScratchYZPP + render.aoLightValueYPos + render.aoLightValueScratchXYZPPP + render.aoLightValueScratchXYPP) / 4.0F; - f4 = (render.aoLightValueYPos + render.aoLightValueScratchYZPN + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPN) / 4.0F; - f5 = (render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPN + render.aoLightValueYPos + render.aoLightValueScratchYZPN) / 4.0F; - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYZNPP, render.aoBrightnessXYNP, render.aoBrightnessYZPP, i2); - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXYZPPP, render.aoBrightnessXYPP, i2); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXYPP, render.aoBrightnessXYZPPN, i2); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXYNP, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, i2); + if (!flag4 && !flag2) + { + render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXYNP; + render.aoBrightnessXYZNPN = render.aoBrightnessXYNP; } else { - f6 = render.aoLightValueYPos; - f5 = render.aoLightValueYPos; - f4 = render.aoLightValueYPos; - f3 = render.aoLightValueYPos; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = i2; + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = flag2 ? xMax : 1.0F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = flag2 ? yMax : 1.0F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = flag2 ? zMax : 1.0F; + if (!flag4 && !flag3) + { + render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXYPP; + render.aoBrightnessXYZPPN = render.aoBrightnessXYPP; + } + else + { + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); + } + + if (!flag5 && !flag2) + { + render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXYNP; + render.aoBrightnessXYZNPP = render.aoBrightnessXYNP; + } + else + { + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); + } + + if (!flag5 && !flag3) + { + render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXYPP; + render.aoBrightnessXYZPPP = render.aoBrightnessXYPP; + } + else + { + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); + } + + if (render.renderMaxY >= 1.0D) + { + --yMin; + } + + i1 = l; + + if (render.renderMaxY >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin + 1, zMin)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + f6 = (render.aoLightValueScratchXYZNPP + render.aoLightValueScratchXYNP + render.aoLightValueScratchYZPP + f7) / 4.0F; + f3 = (render.aoLightValueScratchYZPP + f7 + render.aoLightValueScratchXYZPPP + render.aoLightValueScratchXYPP) / 4.0F; + f4 = (f7 + render.aoLightValueScratchYZPN + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPN) / 4.0F; + f5 = (render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPN + f7 + render.aoLightValueScratchYZPN) / 4.0F; + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYZNPP, render.aoBrightnessXYNP, render.aoBrightnessYZPP, i1); + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXYZPPP, render.aoBrightnessXYPP, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXYPP, render.aoBrightnessXYZPPN, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXYNP, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, i1); + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -334,126 +282,107 @@ public class BlockSkinRenderHelper flag = true; } - float f7; - float f8; - float f9; - int k2; - float f10; - int l2; Icon icon; - int i3; - int j3; if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin - 1, 2)) { - if (render.aoType > 0) + if (render.renderMinZ <= 0.0D) { - if (render.renderMinZ <= 0.0D) - { - --zMin; - } + --zMin; + } - render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); - render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); - render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin - 1)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin - 1)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin - 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin - 1)]; - if (!render.aoGrassXYZNCN && !render.aoGrassXYZCNN) - { - render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXZNN; - render.aoBrightnessXYZNNN = render.aoBrightnessXZNN; - } - else - { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); - } - - if (!render.aoGrassXYZNCN && !render.aoGrassXYZCPN) - { - render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXZNN; - render.aoBrightnessXYZNPN = render.aoBrightnessXZNN; - } - else - { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); - } - - if (!render.aoGrassXYZPCN && !render.aoGrassXYZCNN) - { - render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXZPN; - render.aoBrightnessXYZPNN = render.aoBrightnessXZPN; - } - else - { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); - } - - if (!render.aoGrassXYZPCN && !render.aoGrassXYZCPN) - { - render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXZPN; - render.aoBrightnessXYZPPN = render.aoBrightnessXZPN; - } - else - { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); - } - - if (render.renderMinZ <= 0.0D) - { - ++zMin; - } - - if (render.field_98189_n && render.field_94177_n.gameSettings.ambientOcclusion >= 2) - { - f7 = (render.aoLightValueScratchXZNN + render.aoLightValueScratchXYZNPN + render.aoLightValueZNeg + render.aoLightValueScratchYZPN) / 4.0F; - f9 = (render.aoLightValueZNeg + render.aoLightValueScratchYZPN + render.aoLightValueScratchXZPN + render.aoLightValueScratchXYZPPN) / 4.0F; - f8 = (render.aoLightValueScratchYZNN + render.aoLightValueZNeg + render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXZPN) / 4.0F; - f10 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXZNN + render.aoLightValueScratchYZNN + render.aoLightValueZNeg) / 4.0F; - f3 = (float)((double)f7 * render.renderMaxY * (1.0D - render.renderMinX) + (double)f9 * render.renderMinY * render.renderMinX + (double)f8 * (1.0D - render.renderMaxY) * render.renderMinX + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMinX)); - f4 = (float)((double)f7 * render.renderMaxY * (1.0D - render.renderMaxX) + (double)f9 * render.renderMaxY * render.renderMaxX + (double)f8 * (1.0D - render.renderMaxY) * render.renderMaxX + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMaxX)); - f5 = (float)((double)f7 * render.renderMinY * (1.0D - render.renderMaxX) + (double)f9 * render.renderMinY * render.renderMaxX + (double)f8 * (1.0D - render.renderMinY) * render.renderMaxX + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMaxX)); - f6 = (float)((double)f7 * render.renderMinY * (1.0D - render.renderMinX) + (double)f9 * render.renderMinY * render.renderMinX + (double)f8 * (1.0D - render.renderMinY) * render.renderMinX + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMinX)); - k2 = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, k1); - i3 = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, k1); - j3 = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYZPNN, render.aoBrightnessXZPN, k1); - l2 = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXZNN, render.aoBrightnessYZNN, k1); - render.brightnessTopLeft = render.func_96444_a(k2, i3, j3, l2, render.renderMaxY * (1.0D - render.renderMinX), render.renderMaxY * render.renderMinX, (1.0D - render.renderMaxY) * render.renderMinX, (1.0D - render.renderMaxY) * (1.0D - render.renderMinX)); - render.brightnessBottomLeft = render.func_96444_a(k2, i3, j3, l2, render.renderMaxY * (1.0D - render.renderMaxX), render.renderMaxY * render.renderMaxX, (1.0D - render.renderMaxY) * render.renderMaxX, (1.0D - render.renderMaxY) * (1.0D - render.renderMaxX)); - render.brightnessBottomRight = render.func_96444_a(k2, i3, j3, l2, render.renderMinY * (1.0D - render.renderMaxX), render.renderMinY * render.renderMaxX, (1.0D - render.renderMinY) * render.renderMaxX, (1.0D - render.renderMinY) * (1.0D - render.renderMaxX)); - render.brightnessTopRight = render.func_96444_a(k2, i3, j3, l2, render.renderMinY * (1.0D - render.renderMinX), render.renderMinY * render.renderMinX, (1.0D - render.renderMinY) * render.renderMinX, (1.0D - render.renderMinY) * (1.0D - render.renderMinX)); - } - else - { - f3 = (render.aoLightValueScratchXZNN + render.aoLightValueScratchXYZNPN + render.aoLightValueZNeg + render.aoLightValueScratchYZPN) / 4.0F; - f4 = (render.aoLightValueZNeg + render.aoLightValueScratchYZPN + render.aoLightValueScratchXZPN + render.aoLightValueScratchXYZPPN) / 4.0F; - f5 = (render.aoLightValueScratchYZNN + render.aoLightValueZNeg + render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXZPN) / 4.0F; - f6 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXZNN + render.aoLightValueScratchYZNN + render.aoLightValueZNeg) / 4.0F; - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, k1); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, k1); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYZPNN, render.aoBrightnessXZPN, k1); - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXZNN, render.aoBrightnessYZNN, k1); - } + if (!flag2 && !flag4) + { + render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXZNN; + render.aoBrightnessXYZNNN = render.aoBrightnessXZNN; } else { - f6 = render.aoLightValueZNeg; - f5 = render.aoLightValueZNeg; - f4 = render.aoLightValueZNeg; - f3 = render.aoLightValueZNeg; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = k1; + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); + } + + if (!flag2 && !flag5) + { + render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXZNN; + render.aoBrightnessXYZNPN = render.aoBrightnessXZNN; + } + else + { + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); + } + + if (!flag3 && !flag4) + { + render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXZPN; + render.aoBrightnessXYZPNN = render.aoBrightnessXZPN; + } + else + { + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); + } + + if (!flag3 && !flag5) + { + render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXZPN; + render.aoBrightnessXYZPPN = render.aoBrightnessXZPN; + } + else + { + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); + } + + if (render.renderMinZ <= 0.0D) + { + ++zMin; + } + + i1 = l; + + if (render.renderMinZ <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin - 1)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + f3 = (render.aoLightValueScratchXZNN + render.aoLightValueScratchXYZNPN + f7 + render.aoLightValueScratchYZPN) / 4.0F; + f4 = (f7 + render.aoLightValueScratchYZPN + render.aoLightValueScratchXZPN + render.aoLightValueScratchXYZPPN) / 4.0F; + f5 = (render.aoLightValueScratchYZNN + f7 + render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXZPN) / 4.0F; + f6 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXZNN + render.aoLightValueScratchYZNN + f7) / 4.0F; + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYZPNN, render.aoBrightnessXZPN, i1); + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXZNN, render.aoBrightnessYZNN, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.8F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.8F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag3 ? xMax : 1.0F) * 0.8F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag3 ? yMax : 1.0F) * 0.8F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag3 ? zMax : 1.0F) * 0.8F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -466,121 +395,111 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderEastFace(block, (double)xMin, (double)yMin, (double)zMin, block.getBlockTextureFromSideAndMetadata(2, metadata)); + icon = block.getBlockTextureFromSideAndMetadata(2, metadata); + render.renderEastFace(block, (double)xMin, (double)yMin, (double)zMin, icon); flag = true; } if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin + 1, 3)) { - if (render.aoType > 0) + if (render.renderMaxZ >= 1.0D) { - if (render.renderMaxZ >= 1.0D) - { - ++zMin; - } + ++zMin; + } - render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); - render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); - render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin + 1)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin + 1)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin + 1)]; - if (!render.aoGrassXYZNCP && !render.aoGrassXYZCNP) - { - render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXZNP; - render.aoBrightnessXYZNNP = render.aoBrightnessXZNP; - } - else - { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); - } - - if (!render.aoGrassXYZNCP && !render.aoGrassXYZCPP) - { - render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXZNP; - render.aoBrightnessXYZNPP = render.aoBrightnessXZNP; - } - else - { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); - } - - if (!render.aoGrassXYZPCP && !render.aoGrassXYZCNP) - { - render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXZPP; - render.aoBrightnessXYZPNP = render.aoBrightnessXZPP; - } - else - { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); - } - - if (!render.aoGrassXYZPCP && !render.aoGrassXYZCPP) - { - render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXZPP; - render.aoBrightnessXYZPPP = render.aoBrightnessXZPP; - } - else - { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); - } - - if (render.renderMaxZ >= 1.0D) - { - --zMin; - } - - if (render.field_98189_n && render.field_94177_n.gameSettings.ambientOcclusion >= 2) - { - f7 = (render.aoLightValueScratchXZNP + render.aoLightValueScratchXYZNPP + render.aoLightValueZPos + render.aoLightValueScratchYZPP) / 4.0F; - f9 = (render.aoLightValueZPos + render.aoLightValueScratchYZPP + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYZPPP) / 4.0F; - f8 = (render.aoLightValueScratchYZNP + render.aoLightValueZPos + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXZPP) / 4.0F; - f10 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXZNP + render.aoLightValueScratchYZNP + render.aoLightValueZPos) / 4.0F; - f3 = (float)((double)f7 * render.renderMaxY * (1.0D - render.renderMinX) + (double)f9 * render.renderMaxY * render.renderMinX + (double)f8 * (1.0D - render.renderMaxY) * render.renderMinX + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMinX)); - f4 = (float)((double)f7 * render.renderMinY * (1.0D - render.renderMinX) + (double)f9 * render.renderMinY * render.renderMinX + (double)f8 * (1.0D - render.renderMinY) * render.renderMinX + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMinX)); - f5 = (float)((double)f7 * render.renderMinY * (1.0D - render.renderMaxX) + (double)f9 * render.renderMinY * render.renderMaxX + (double)f8 * (1.0D - render.renderMinY) * render.renderMaxX + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMaxX)); - f6 = (float)((double)f7 * render.renderMaxY * (1.0D - render.renderMaxX) + (double)f9 * render.renderMaxY * render.renderMaxX + (double)f8 * (1.0D - render.renderMaxY) * render.renderMaxX + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMaxX)); - k2 = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYZNPP, render.aoBrightnessYZPP, j2); - i3 = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXZPP, render.aoBrightnessXYZPPP, j2); - j3 = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, j2); - l2 = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, render.aoBrightnessYZNP, j2); - render.brightnessTopLeft = render.func_96444_a(k2, l2, j3, i3, render.renderMaxY * (1.0D - render.renderMinX), (1.0D - render.renderMaxY) * (1.0D - render.renderMinX), (1.0D - render.renderMaxY) * render.renderMinX, render.renderMaxY * render.renderMinX); - render.brightnessBottomLeft = render.func_96444_a(k2, l2, j3, i3, render.renderMinY * (1.0D - render.renderMinX), (1.0D - render.renderMinY) * (1.0D - render.renderMinX), (1.0D - render.renderMinY) * render.renderMinX, render.renderMinY * render.renderMinX); - render.brightnessBottomRight = render.func_96444_a(k2, l2, j3, i3, render.renderMinY * (1.0D - render.renderMaxX), (1.0D - render.renderMinY) * (1.0D - render.renderMaxX), (1.0D - render.renderMinY) * render.renderMaxX, render.renderMinY * render.renderMaxX); - render.brightnessTopRight = render.func_96444_a(k2, l2, j3, i3, render.renderMaxY * (1.0D - render.renderMaxX), (1.0D - render.renderMaxY) * (1.0D - render.renderMaxX), (1.0D - render.renderMaxY) * render.renderMaxX, render.renderMaxY * render.renderMaxX); - } - else - { - f3 = (render.aoLightValueScratchXZNP + render.aoLightValueScratchXYZNPP + render.aoLightValueZPos + render.aoLightValueScratchYZPP) / 4.0F; - f6 = (render.aoLightValueZPos + render.aoLightValueScratchYZPP + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYZPPP) / 4.0F; - f5 = (render.aoLightValueScratchYZNP + render.aoLightValueZPos + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXZPP) / 4.0F; - f4 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXZNP + render.aoLightValueScratchYZNP + render.aoLightValueZPos) / 4.0F; - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYZNPP, render.aoBrightnessYZPP, j2); - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXZPP, render.aoBrightnessXYZPPP, j2); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, j2); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, render.aoBrightnessYZNP, j2); - } + if (!flag2 && !flag4) + { + render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXZNP; + render.aoBrightnessXYZNNP = render.aoBrightnessXZNP; } else { - f6 = render.aoLightValueZPos; - f5 = render.aoLightValueZPos; - f4 = render.aoLightValueZPos; - f3 = render.aoLightValueZPos; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = j2; + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); + } + + if (!flag2 && !flag5) + { + render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXZNP; + render.aoBrightnessXYZNPP = render.aoBrightnessXZNP; + } + else + { + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); + } + + if (!flag3 && !flag4) + { + render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXZPP; + render.aoBrightnessXYZPNP = render.aoBrightnessXZPP; + } + else + { + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); + } + + if (!flag3 && !flag5) + { + render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXZPP; + render.aoBrightnessXYZPPP = render.aoBrightnessXZPP; + } + else + { + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); + } + + if (render.renderMaxZ >= 1.0D) + { + --zMin; + } + + i1 = l; + + if (render.renderMaxZ >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin + 1)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + f3 = (render.aoLightValueScratchXZNP + render.aoLightValueScratchXYZNPP + f7 + render.aoLightValueScratchYZPP) / 4.0F; + f6 = (f7 + render.aoLightValueScratchYZPP + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYZPPP) / 4.0F; + f5 = (render.aoLightValueScratchYZNP + f7 + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXZPP) / 4.0F; + f4 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXZNP + render.aoLightValueScratchYZNP + f7) / 4.0F; + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYZNPP, render.aoBrightnessYZPP, i1); + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXZPP, render.aoBrightnessXYZPPP, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, render.aoBrightnessYZNP, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.8F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.8F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag4 ? xMax : 1.0F) * 0.8F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag4 ? yMax : 1.0F) * 0.8F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag4 ? zMax : 1.0F) * 0.8F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -593,121 +512,111 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderWestFace(block, (double)xMin, (double)yMin, (double)zMin, block.getBlockTextureFromSideAndMetadata(0, metadata)); + icon = block.getBlockTextureFromSideAndMetadata(3, metadata); + render.renderWestFace(block, (double)xMin, (double)yMin, (double)zMin, icon); flag = true; } if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin - 1, yMin, zMin, 4)) { - if (render.aoType > 0) + if (render.renderMinX <= 0.0D) { - if (render.renderMinX <= 0.0D) - { - --xMin; - } + --xMin; + } - render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); - render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin + 1, zMin)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin - 1, zMin)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin - 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin + 1)]; - if (!render.aoGrassXYZNCN && !render.aoGrassXYZNNC) - { - render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXZNN; - render.aoBrightnessXYZNNN = render.aoBrightnessXZNN; - } - else - { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); - } - - if (!render.aoGrassXYZNCP && !render.aoGrassXYZNNC) - { - render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXZNP; - render.aoBrightnessXYZNNP = render.aoBrightnessXZNP; - } - else - { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); - } - - if (!render.aoGrassXYZNCN && !render.aoGrassXYZNPC) - { - render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXZNN; - render.aoBrightnessXYZNPN = render.aoBrightnessXZNN; - } - else - { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); - } - - if (!render.aoGrassXYZNCP && !render.aoGrassXYZNPC) - { - render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXZNP; - render.aoBrightnessXYZNPP = render.aoBrightnessXZNP; - } - else - { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); - } - - if (render.renderMinX <= 0.0D) - { - ++xMin; - } - - if (render.field_98189_n && render.field_94177_n.gameSettings.ambientOcclusion >= 2) - { - f7 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNP + render.aoLightValueXNeg + render.aoLightValueScratchXZNP) / 4.0F; - f9 = (render.aoLightValueXNeg + render.aoLightValueScratchXZNP + render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPP) / 4.0F; - f8 = (render.aoLightValueScratchXZNN + render.aoLightValueXNeg + render.aoLightValueScratchXYZNPN + render.aoLightValueScratchXYNP) / 4.0F; - f10 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXYNN + render.aoLightValueScratchXZNN + render.aoLightValueXNeg) / 4.0F; - f3 = (float)((double)f9 * render.renderMaxY * render.renderMaxZ + (double)f8 * render.renderMaxY * (1.0D - render.renderMaxZ) + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMaxZ) + (double)f7 * (1.0D - render.renderMaxY) * render.renderMaxZ); - f4 = (float)((double)f9 * render.renderMaxY * render.renderMinZ + (double)f8 * render.renderMaxY * (1.0D - render.renderMinZ) + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMinZ) + (double)f7 * (1.0D - render.renderMaxY) * render.renderMinZ); - f5 = (float)((double)f9 * render.renderMinY * render.renderMinZ + (double)f8 * render.renderMinY * (1.0D - render.renderMinZ) + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMinZ) + (double)f7 * (1.0D - render.renderMinY) * render.renderMinZ); - f6 = (float)((double)f9 * render.renderMinY * render.renderMaxZ + (double)f8 * render.renderMinY * (1.0D - render.renderMaxZ) + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMaxZ) + (double)f7 * (1.0D - render.renderMinY) * render.renderMaxZ); - k2 = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, i1); - i3 = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYNP, render.aoBrightnessXYZNPP, i1); - j3 = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessXYNP, i1); - l2 = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXYNN, render.aoBrightnessXZNN, i1); - render.brightnessTopLeft = render.func_96444_a(i3, j3, l2, k2, render.renderMaxY * render.renderMaxZ, render.renderMaxY * (1.0D - render.renderMaxZ), (1.0D - render.renderMaxY) * (1.0D - render.renderMaxZ), (1.0D - render.renderMaxY) * render.renderMaxZ); - render.brightnessBottomLeft = render.func_96444_a(i3, j3, l2, k2, render.renderMaxY * render.renderMinZ, render.renderMaxY * (1.0D - render.renderMinZ), (1.0D - render.renderMaxY) * (1.0D - render.renderMinZ), (1.0D - render.renderMaxY) * render.renderMinZ); - render.brightnessBottomRight = render.func_96444_a(i3, j3, l2, k2, render.renderMinY * render.renderMinZ, render.renderMinY * (1.0D - render.renderMinZ), (1.0D - render.renderMinY) * (1.0D - render.renderMinZ), (1.0D - render.renderMinY) * render.renderMinZ); - render.brightnessTopRight = render.func_96444_a(i3, j3, l2, k2, render.renderMinY * render.renderMaxZ, render.renderMinY * (1.0D - render.renderMaxZ), (1.0D - render.renderMinY) * (1.0D - render.renderMaxZ), (1.0D - render.renderMinY) * render.renderMaxZ); - } - else - { - f6 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNP + render.aoLightValueXNeg + render.aoLightValueScratchXZNP) / 4.0F; - f3 = (render.aoLightValueXNeg + render.aoLightValueScratchXZNP + render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPP) / 4.0F; - f4 = (render.aoLightValueScratchXZNN + render.aoLightValueXNeg + render.aoLightValueScratchXYZNPN + render.aoLightValueScratchXYNP) / 4.0F; - f5 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXYNN + render.aoLightValueScratchXZNN + render.aoLightValueXNeg) / 4.0F; - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, i1); - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYNP, render.aoBrightnessXYZNPP, i1); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessXYNP, i1); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXYNN, render.aoBrightnessXZNN, i1); - } + if (!flag5 && !flag2) + { + render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXZNN; + render.aoBrightnessXYZNNN = render.aoBrightnessXZNN; } else { - f6 = render.aoLightValueXNeg; - f5 = render.aoLightValueXNeg; - f4 = render.aoLightValueXNeg; - f3 = render.aoLightValueXNeg; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = i1; + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); + } + + if (!flag4 && !flag2) + { + render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXZNP; + render.aoBrightnessXYZNNP = render.aoBrightnessXZNP; + } + else + { + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); + } + + if (!flag5 && !flag3) + { + render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXZNN; + render.aoBrightnessXYZNPN = render.aoBrightnessXZNN; + } + else + { + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); + } + + if (!flag4 && !flag3) + { + render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXZNP; + render.aoBrightnessXYZNPP = render.aoBrightnessXZNP; + } + else + { + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); + } + + if (render.renderMinX <= 0.0D) + { + ++xMin; + } + + i1 = l; + + if (render.renderMinX <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin - 1, yMin, zMin)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + f6 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNP + f7 + render.aoLightValueScratchXZNP) / 4.0F; + f3 = (f7 + render.aoLightValueScratchXZNP + render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPP) / 4.0F; + f4 = (render.aoLightValueScratchXZNN + f7 + render.aoLightValueScratchXYZNPN + render.aoLightValueScratchXYNP) / 4.0F; + f5 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXYNN + render.aoLightValueScratchXZNN + f7) / 4.0F; + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, i1); + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYNP, render.aoBrightnessXYZNPP, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessXYNP, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXYNN, render.aoBrightnessXZNN, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.6F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.6F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag5 ? xMax : 1.0F) * 0.6F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag5 ? yMax : 1.0F) * 0.6F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag5 ? zMax : 1.0F) * 0.6F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -720,121 +629,111 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderNorthFace(block, (double)xMin, (double)yMin, (double)zMin, block.getBlockTextureFromSideAndMetadata(4, metadata)); + icon = block.getBlockTextureFromSideAndMetadata(4, metadata); + render.renderNorthFace(block, (double)xMin, (double)yMin, (double)zMin, icon); flag = true; } if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin + 1, yMin, zMin, 5)) { - if (render.aoType > 0) + if (render.renderMaxX >= 1.0D) { - if (render.renderMaxX >= 1.0D) - { - ++xMin; - } + ++xMin; + } - render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); - render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin + 1, zMin)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin - 1, zMin)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin - 1)]; - if (!render.aoGrassXYZPNC && !render.aoGrassXYZPCN) - { - render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXZPN; - render.aoBrightnessXYZPNN = render.aoBrightnessXZPN; - } - else - { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); - } - - if (!render.aoGrassXYZPNC && !render.aoGrassXYZPCP) - { - render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXZPP; - render.aoBrightnessXYZPNP = render.aoBrightnessXZPP; - } - else - { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); - } - - if (!render.aoGrassXYZPPC && !render.aoGrassXYZPCN) - { - render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXZPN; - render.aoBrightnessXYZPPN = render.aoBrightnessXZPN; - } - else - { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); - } - - if (!render.aoGrassXYZPPC && !render.aoGrassXYZPCP) - { - render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXZPP; - render.aoBrightnessXYZPPP = render.aoBrightnessXZPP; - } - else - { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); - } - - if (render.renderMaxX >= 1.0D) - { - --xMin; - } - - if (render.field_98189_n && render.field_94177_n.gameSettings.ambientOcclusion >= 2) - { - f7 = (render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNP + render.aoLightValueXPos + render.aoLightValueScratchXZPP) / 4.0F; - f9 = (render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXZPN + render.aoLightValueXPos) / 4.0F; - f8 = (render.aoLightValueScratchXZPN + render.aoLightValueXPos + render.aoLightValueScratchXYZPPN + render.aoLightValueScratchXYPP) / 4.0F; - f10 = (render.aoLightValueXPos + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPP) / 4.0F; - f3 = (float)((double)f7 * (1.0D - render.renderMinY) * render.renderMaxZ + (double)f9 * (1.0D - render.renderMinY) * (1.0D - render.renderMaxZ) + (double)f8 * render.renderMinY * (1.0D - render.renderMaxZ) + (double)f10 * render.renderMinY * render.renderMaxZ); - f4 = (float)((double)f7 * (1.0D - render.renderMinY) * render.renderMinZ + (double)f9 * (1.0D - render.renderMinY) * (1.0D - render.renderMinZ) + (double)f8 * render.renderMinY * (1.0D - render.renderMinZ) + (double)f10 * render.renderMinY * render.renderMinZ); - f5 = (float)((double)f7 * (1.0D - render.renderMaxY) * render.renderMinZ + (double)f9 * (1.0D - render.renderMaxY) * (1.0D - render.renderMinZ) + (double)f8 * render.renderMaxY * (1.0D - render.renderMinZ) + (double)f10 * render.renderMaxY * render.renderMinZ); - f6 = (float)((double)f7 * (1.0D - render.renderMaxY) * render.renderMaxZ + (double)f9 * (1.0D - render.renderMaxY) * (1.0D - render.renderMaxZ) + (double)f8 * render.renderMaxY * (1.0D - render.renderMaxZ) + (double)f10 * render.renderMaxY * render.renderMaxZ); - k2 = render.getAoBrightness(render.aoBrightnessXYPN, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, l1); - i3 = render.getAoBrightness(render.aoBrightnessXZPP, render.aoBrightnessXYPP, render.aoBrightnessXYZPPP, l1); - j3 = render.getAoBrightness(render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, render.aoBrightnessXYPP, l1); - l2 = render.getAoBrightness(render.aoBrightnessXYZPNN, render.aoBrightnessXYPN, render.aoBrightnessXZPN, l1); - render.brightnessTopLeft = render.func_96444_a(k2, l2, j3, i3, (1.0D - render.renderMinY) * render.renderMaxZ, (1.0D - render.renderMinY) * (1.0D - render.renderMaxZ), render.renderMinY * (1.0D - render.renderMaxZ), render.renderMinY * render.renderMaxZ); - render.brightnessBottomLeft = render.func_96444_a(k2, l2, j3, i3, (1.0D - render.renderMinY) * render.renderMinZ, (1.0D - render.renderMinY) * (1.0D - render.renderMinZ), render.renderMinY * (1.0D - render.renderMinZ), render.renderMinY * render.renderMinZ); - render.brightnessBottomRight = render.func_96444_a(k2, l2, j3, i3, (1.0D - render.renderMaxY) * render.renderMinZ, (1.0D - render.renderMaxY) * (1.0D - render.renderMinZ), render.renderMaxY * (1.0D - render.renderMinZ), render.renderMaxY * render.renderMinZ); - render.brightnessTopRight = render.func_96444_a(k2, l2, j3, i3, (1.0D - render.renderMaxY) * render.renderMaxZ, (1.0D - render.renderMaxY) * (1.0D - render.renderMaxZ), render.renderMaxY * (1.0D - render.renderMaxZ), render.renderMaxY * render.renderMaxZ); - } - else - { - f3 = (render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNP + render.aoLightValueXPos + render.aoLightValueScratchXZPP) / 4.0F; - f4 = (render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXZPN + render.aoLightValueXPos) / 4.0F; - f5 = (render.aoLightValueScratchXZPN + render.aoLightValueXPos + render.aoLightValueScratchXYZPPN + render.aoLightValueScratchXYPP) / 4.0F; - f6 = (render.aoLightValueXPos + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPP) / 4.0F; - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXYPN, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, l1); - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXZPP, render.aoBrightnessXYPP, render.aoBrightnessXYZPPP, l1); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, render.aoBrightnessXYPP, l1); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYZPNN, render.aoBrightnessXYPN, render.aoBrightnessXZPN, l1); - } + if (!flag2 && !flag4) + { + render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXZPN; + render.aoBrightnessXYZPNN = render.aoBrightnessXZPN; } else { - f6 = render.aoLightValueXPos; - f5 = render.aoLightValueXPos; - f4 = render.aoLightValueXPos; - f3 = render.aoLightValueXPos; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = l1; + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); + } + + if (!flag2 && !flag5) + { + render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXZPP; + render.aoBrightnessXYZPNP = render.aoBrightnessXZPP; + } + else + { + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); + } + + if (!flag3 && !flag4) + { + render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXZPN; + render.aoBrightnessXYZPPN = render.aoBrightnessXZPN; + } + else + { + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); + } + + if (!flag3 && !flag5) + { + render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXZPP; + render.aoBrightnessXYZPPP = render.aoBrightnessXZPP; + } + else + { + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); + } + + if (render.renderMaxX >= 1.0D) + { + --xMin; + } + + i1 = l; + + if (render.renderMaxX >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin + 1, yMin, zMin)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + f3 = (render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNP + f7 + render.aoLightValueScratchXZPP) / 4.0F; + f4 = (render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXZPN + f7) / 4.0F; + f5 = (render.aoLightValueScratchXZPN + f7 + render.aoLightValueScratchXYZPPN + render.aoLightValueScratchXYPP) / 4.0F; + f6 = (f7 + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPP) / 4.0F; + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXYPN, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, i1); + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXZPP, render.aoBrightnessXYPP, render.aoBrightnessXYZPPP, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, render.aoBrightnessXYPP, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYZPNN, render.aoBrightnessXYPN, render.aoBrightnessXZPN, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.6F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.6F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag6 ? xMax : 1.0F) * 0.6F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag6 ? yMax : 1.0F) * 0.6F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag6 ? zMax : 1.0F) * 0.6F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -847,7 +746,8 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderSouthFace(block, (double)xMin, (double)yMin, (double)zMin, block.getBlockTextureFromSideAndMetadata(5, metadata)); + icon = block.getBlockTextureFromSideAndMetadata(5, metadata); + render.renderSouthFace(block, (double)xMin, (double)yMin, (double)zMin, icon); flag = true; } @@ -979,182 +879,130 @@ public class BlockSkinRenderHelper Block block = Block.stone; render.enableAO = true; boolean flag = false; - float f3 = render.lightValueOwn; - float f4 = render.lightValueOwn; - float f5 = render.lightValueOwn; - float f6 = render.lightValueOwn; + float f3 = 0.0F; + float f4 = 0.0F; + float f5 = 0.0F; + float f6 = 0.0F; boolean flag1 = true; - boolean flag2 = true; - boolean flag3 = true; - boolean flag4 = true; - boolean flag5 = true; - boolean flag6 = true; - render.lightValueOwn = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin); - render.aoLightValueXNeg = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueYNeg = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueZNeg = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueXPos = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); - render.aoLightValueYPos = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoLightValueZPos = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); int l = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin); - int i1 = l; - int j1 = l; - int k1 = l; - int l1 = l; - int i2 = l; - int j2 = l; - - if (render.renderMinY <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin - 1, zMin)) - { - j1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - } - - if (render.renderMaxY >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin + 1, zMin)) - { - i2 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); - } - - if (render.renderMinX <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin - 1, yMin, zMin)) - { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - } - - if (render.renderMaxX >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin + 1, yMin, zMin)) - { - l1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); - } - - if (render.renderMinZ <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin - 1)) - { - k1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - } - - if (render.renderMaxZ >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin + 1)) - { - j2 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - } - Tessellator tessellator = Tessellator.instance; tessellator.setBrightness(983055); - render.aoGrassXYZPPC = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin + 1, zMin)]; - render.aoGrassXYZPNC = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin - 1, zMin)]; - render.aoGrassXYZPCP = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin + 1)]; - render.aoGrassXYZPCN = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin - 1)]; - render.aoGrassXYZNPC = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin + 1, zMin)]; - render.aoGrassXYZNNC = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin - 1, zMin)]; - render.aoGrassXYZNCN = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin - 1)]; - render.aoGrassXYZNCP = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin + 1)]; - render.aoGrassXYZCPP = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin + 1)]; - render.aoGrassXYZCPN = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin - 1)]; - render.aoGrassXYZCNP = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin + 1)]; - render.aoGrassXYZCNN = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin - 1)]; - if (render.func_94175_b(block).func_94215_i().equals("grass_top")) + if (render.getBlockIcon(block).getIconName().equals("grass_top")) + { + flag1 = false; + } + else if (render.hasOverrideBlockTexture()) { - flag6 = false; - flag5 = false; - flag4 = false; - flag3 = false; flag1 = false; } - if (render.func_94167_b()) - { - flag6 = false; - flag5 = false; - flag4 = false; - flag3 = false; - flag1 = false; - } + boolean flag2; + boolean flag3; + boolean flag4; + boolean flag5; + float f7; + int i1; if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin - 1, zMin, 0)) { - if (render.aoType > 0) + if (render.renderMinY <= 0.0D) { - if (render.renderMinY <= 0.0D) - { - --yMin; - } + --yMin; + } - render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); - render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); - render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin - 1, zMin)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin - 1, zMin)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin - 1)]; - if (!render.aoGrassXYZCNN && !render.aoGrassXYZNNC) - { - render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXYNN; - render.aoBrightnessXYZNNN = render.aoBrightnessXYNN; - } - else - { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); - } - - if (!render.aoGrassXYZCNP && !render.aoGrassXYZNNC) - { - render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXYNN; - render.aoBrightnessXYZNNP = render.aoBrightnessXYNN; - } - else - { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); - } - - if (!render.aoGrassXYZCNN && !render.aoGrassXYZPNC) - { - render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXYPN; - render.aoBrightnessXYZPNN = render.aoBrightnessXYPN; - } - else - { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); - } - - if (!render.aoGrassXYZCNP && !render.aoGrassXYZPNC) - { - render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXYPN; - render.aoBrightnessXYZPNP = render.aoBrightnessXYPN; - } - else - { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); - } - - if (render.renderMinY <= 0.0D) - { - ++yMin; - } - - f3 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXYNN + render.aoLightValueScratchYZNP + render.aoLightValueYNeg) / 4.0F; - f6 = (render.aoLightValueScratchYZNP + render.aoLightValueYNeg + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXYPN) / 4.0F; - f5 = (render.aoLightValueYNeg + render.aoLightValueScratchYZNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNN) / 4.0F; - f4 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNN + render.aoLightValueYNeg + render.aoLightValueScratchYZNN) / 4.0F; - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXYNN, render.aoBrightnessYZNP, j1); - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXYPN, j1); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYPN, render.aoBrightnessXYZPNN, j1); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNN, render.aoBrightnessYZNN, j1); + if (!flag4 && !flag2) + { + render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXYNN; + render.aoBrightnessXYZNNN = render.aoBrightnessXYNN; } else { - f6 = render.aoLightValueYNeg; - f5 = render.aoLightValueYNeg; - f4 = render.aoLightValueYNeg; - f3 = render.aoLightValueYNeg; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = render.aoBrightnessXYNN; + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); + } + + if (!flag5 && !flag2) + { + render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXYNN; + render.aoBrightnessXYZNNP = render.aoBrightnessXYNN; + } + else + { + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); + } + + if (!flag4 && !flag3) + { + render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXYPN; + render.aoBrightnessXYZPNN = render.aoBrightnessXYPN; + } + else + { + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); + } + + if (!flag5 && !flag3) + { + render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXYPN; + render.aoBrightnessXYZPNP = render.aoBrightnessXYPN; + } + else + { + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); + } + + if (render.renderMinY <= 0.0D) + { + ++yMin; + } + + i1 = l; + + if (render.renderMinY <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin - 1, zMin)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + f3 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXYNN + render.aoLightValueScratchYZNP + f7) / 4.0F; + f6 = (render.aoLightValueScratchYZNP + f7 + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXYPN) / 4.0F; + f5 = (f7 + render.aoLightValueScratchYZNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNN) / 4.0F; + f4 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNN + f7 + render.aoLightValueScratchYZNN) / 4.0F; + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXYNN, render.aoBrightnessYZNP, i1); + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXYPN, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYPN, render.aoBrightnessXYZPNN, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNN, render.aoBrightnessYZNN, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.5F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.5F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.5F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.5F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.5F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.5F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag1 ? xMax : 1.0F) * 0.5F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag1 ? yMax : 1.0F) * 0.5F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag1 ? zMax : 1.0F) * 0.5F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -1173,92 +1021,92 @@ public class BlockSkinRenderHelper if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin + 1, zMin, 1)) { - if (render.aoType > 0) + if (render.renderMaxY >= 1.0D) { - if (render.renderMaxY >= 1.0D) - { - ++yMin; - } + ++yMin; + } - render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); - render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); - render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin + 1, zMin)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin + 1, zMin)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin - 1)]; - if (!render.aoGrassXYZCPN && !render.aoGrassXYZNPC) - { - render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXYNP; - render.aoBrightnessXYZNPN = render.aoBrightnessXYNP; - } - else - { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); - } - - if (!render.aoGrassXYZCPN && !render.aoGrassXYZPPC) - { - render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXYPP; - render.aoBrightnessXYZPPN = render.aoBrightnessXYPP; - } - else - { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); - } - - if (!render.aoGrassXYZCPP && !render.aoGrassXYZNPC) - { - render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXYNP; - render.aoBrightnessXYZNPP = render.aoBrightnessXYNP; - } - else - { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); - } - - if (!render.aoGrassXYZCPP && !render.aoGrassXYZPPC) - { - render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXYPP; - render.aoBrightnessXYZPPP = render.aoBrightnessXYPP; - } - else - { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); - } - - if (render.renderMaxY >= 1.0D) - { - --yMin; - } - - f6 = (render.aoLightValueScratchXYZNPP + render.aoLightValueScratchXYNP + render.aoLightValueScratchYZPP + render.aoLightValueYPos) / 4.0F; - f3 = (render.aoLightValueScratchYZPP + render.aoLightValueYPos + render.aoLightValueScratchXYZPPP + render.aoLightValueScratchXYPP) / 4.0F; - f4 = (render.aoLightValueYPos + render.aoLightValueScratchYZPN + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPN) / 4.0F; - f5 = (render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPN + render.aoLightValueYPos + render.aoLightValueScratchYZPN) / 4.0F; - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYZNPP, render.aoBrightnessXYNP, render.aoBrightnessYZPP, i2); - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXYZPPP, render.aoBrightnessXYPP, i2); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXYPP, render.aoBrightnessXYZPPN, i2); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXYNP, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, i2); + if (!flag4 && !flag2) + { + render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXYNP; + render.aoBrightnessXYZNPN = render.aoBrightnessXYNP; } else { - f6 = render.aoLightValueYPos; - f5 = render.aoLightValueYPos; - f4 = render.aoLightValueYPos; - f3 = render.aoLightValueYPos; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = i2; + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = flag2 ? xMax : 1.0F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = flag2 ? yMax : 1.0F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = flag2 ? zMax : 1.0F; + if (!flag4 && !flag3) + { + render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXYPP; + render.aoBrightnessXYZPPN = render.aoBrightnessXYPP; + } + else + { + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); + } + + if (!flag5 && !flag2) + { + render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXYNP; + render.aoBrightnessXYZNPP = render.aoBrightnessXYNP; + } + else + { + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); + } + + if (!flag5 && !flag3) + { + render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXYPP; + render.aoBrightnessXYZPPP = render.aoBrightnessXYPP; + } + else + { + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); + } + + if (render.renderMaxY >= 1.0D) + { + --yMin; + } + + i1 = l; + + if (render.renderMaxY >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin + 1, zMin)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + f6 = (render.aoLightValueScratchXYZNPP + render.aoLightValueScratchXYNP + render.aoLightValueScratchYZPP + f7) / 4.0F; + f3 = (render.aoLightValueScratchYZPP + f7 + render.aoLightValueScratchXYZPPP + render.aoLightValueScratchXYPP) / 4.0F; + f4 = (f7 + render.aoLightValueScratchYZPN + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPN) / 4.0F; + f5 = (render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPN + f7 + render.aoLightValueScratchYZPN) / 4.0F; + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYZNPP, render.aoBrightnessXYNP, render.aoBrightnessYZPP, i1); + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXYZPPP, render.aoBrightnessXYPP, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXYPP, render.aoBrightnessXYZPPN, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXYNP, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, i1); + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -1275,126 +1123,105 @@ public class BlockSkinRenderHelper flag = true; } - float f7; - float f8; - float f9; - int k2; - float f10; - int l2; - Icon icon; - int i3; - int j3; - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin - 1, 2)) { - if (render.aoType > 0) + if (render.renderMinZ <= 0.0D) { - if (render.renderMinZ <= 0.0D) - { - --zMin; - } + --zMin; + } - render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); - render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); - render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin - 1)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin - 1)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin - 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin - 1)]; - if (!render.aoGrassXYZNCN && !render.aoGrassXYZCNN) - { - render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXZNN; - render.aoBrightnessXYZNNN = render.aoBrightnessXZNN; - } - else - { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); - } - - if (!render.aoGrassXYZNCN && !render.aoGrassXYZCPN) - { - render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXZNN; - render.aoBrightnessXYZNPN = render.aoBrightnessXZNN; - } - else - { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); - } - - if (!render.aoGrassXYZPCN && !render.aoGrassXYZCNN) - { - render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXZPN; - render.aoBrightnessXYZPNN = render.aoBrightnessXZPN; - } - else - { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); - } - - if (!render.aoGrassXYZPCN && !render.aoGrassXYZCPN) - { - render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXZPN; - render.aoBrightnessXYZPPN = render.aoBrightnessXZPN; - } - else - { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); - } - - if (render.renderMinZ <= 0.0D) - { - ++zMin; - } - - if (render.field_98189_n && render.field_94177_n.gameSettings.ambientOcclusion >= 2) - { - f7 = (render.aoLightValueScratchXZNN + render.aoLightValueScratchXYZNPN + render.aoLightValueZNeg + render.aoLightValueScratchYZPN) / 4.0F; - f9 = (render.aoLightValueZNeg + render.aoLightValueScratchYZPN + render.aoLightValueScratchXZPN + render.aoLightValueScratchXYZPPN) / 4.0F; - f8 = (render.aoLightValueScratchYZNN + render.aoLightValueZNeg + render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXZPN) / 4.0F; - f10 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXZNN + render.aoLightValueScratchYZNN + render.aoLightValueZNeg) / 4.0F; - f3 = (float)((double)f7 * render.renderMaxY * (1.0D - render.renderMinX) + (double)f9 * render.renderMinY * render.renderMinX + (double)f8 * (1.0D - render.renderMaxY) * render.renderMinX + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMinX)); - f4 = (float)((double)f7 * render.renderMaxY * (1.0D - render.renderMaxX) + (double)f9 * render.renderMaxY * render.renderMaxX + (double)f8 * (1.0D - render.renderMaxY) * render.renderMaxX + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMaxX)); - f5 = (float)((double)f7 * render.renderMinY * (1.0D - render.renderMaxX) + (double)f9 * render.renderMinY * render.renderMaxX + (double)f8 * (1.0D - render.renderMinY) * render.renderMaxX + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMaxX)); - f6 = (float)((double)f7 * render.renderMinY * (1.0D - render.renderMinX) + (double)f9 * render.renderMinY * render.renderMinX + (double)f8 * (1.0D - render.renderMinY) * render.renderMinX + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMinX)); - k2 = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, k1); - i3 = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, k1); - j3 = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYZPNN, render.aoBrightnessXZPN, k1); - l2 = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXZNN, render.aoBrightnessYZNN, k1); - render.brightnessTopLeft = render.func_96444_a(k2, i3, j3, l2, render.renderMaxY * (1.0D - render.renderMinX), render.renderMaxY * render.renderMinX, (1.0D - render.renderMaxY) * render.renderMinX, (1.0D - render.renderMaxY) * (1.0D - render.renderMinX)); - render.brightnessBottomLeft = render.func_96444_a(k2, i3, j3, l2, render.renderMaxY * (1.0D - render.renderMaxX), render.renderMaxY * render.renderMaxX, (1.0D - render.renderMaxY) * render.renderMaxX, (1.0D - render.renderMaxY) * (1.0D - render.renderMaxX)); - render.brightnessBottomRight = render.func_96444_a(k2, i3, j3, l2, render.renderMinY * (1.0D - render.renderMaxX), render.renderMinY * render.renderMaxX, (1.0D - render.renderMinY) * render.renderMaxX, (1.0D - render.renderMinY) * (1.0D - render.renderMaxX)); - render.brightnessTopRight = render.func_96444_a(k2, i3, j3, l2, render.renderMinY * (1.0D - render.renderMinX), render.renderMinY * render.renderMinX, (1.0D - render.renderMinY) * render.renderMinX, (1.0D - render.renderMinY) * (1.0D - render.renderMinX)); - } - else - { - f3 = (render.aoLightValueScratchXZNN + render.aoLightValueScratchXYZNPN + render.aoLightValueZNeg + render.aoLightValueScratchYZPN) / 4.0F; - f4 = (render.aoLightValueZNeg + render.aoLightValueScratchYZPN + render.aoLightValueScratchXZPN + render.aoLightValueScratchXYZPPN) / 4.0F; - f5 = (render.aoLightValueScratchYZNN + render.aoLightValueZNeg + render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXZPN) / 4.0F; - f6 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXZNN + render.aoLightValueScratchYZNN + render.aoLightValueZNeg) / 4.0F; - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, k1); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, k1); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYZPNN, render.aoBrightnessXZPN, k1); - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXZNN, render.aoBrightnessYZNN, k1); - } + if (!flag2 && !flag4) + { + render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXZNN; + render.aoBrightnessXYZNNN = render.aoBrightnessXZNN; } else { - f6 = render.aoLightValueZNeg; - f5 = render.aoLightValueZNeg; - f4 = render.aoLightValueZNeg; - f3 = render.aoLightValueZNeg; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = k1; + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); + } + + if (!flag2 && !flag5) + { + render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXZNN; + render.aoBrightnessXYZNPN = render.aoBrightnessXZNN; + } + else + { + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); + } + + if (!flag3 && !flag4) + { + render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXZPN; + render.aoBrightnessXYZPNN = render.aoBrightnessXZPN; + } + else + { + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); + } + + if (!flag3 && !flag5) + { + render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXZPN; + render.aoBrightnessXYZPPN = render.aoBrightnessXZPN; + } + else + { + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); + } + + if (render.renderMinZ <= 0.0D) + { + ++zMin; + } + + i1 = l; + + if (render.renderMinZ <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin - 1)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + f3 = (render.aoLightValueScratchXZNN + render.aoLightValueScratchXYZNPN + f7 + render.aoLightValueScratchYZPN) / 4.0F; + f4 = (f7 + render.aoLightValueScratchYZPN + render.aoLightValueScratchXZPN + render.aoLightValueScratchXYZPPN) / 4.0F; + f5 = (render.aoLightValueScratchYZNN + f7 + render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXZPN) / 4.0F; + f6 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXZNN + render.aoLightValueScratchYZNN + f7) / 4.0F; + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessYZPN, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessYZPN, render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNN, render.aoBrightnessXYZPNN, render.aoBrightnessXZPN, i1); + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXZNN, render.aoBrightnessYZNN, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.8F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.8F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag3 ? xMax : 1.0F) * 0.8F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag3 ? yMax : 1.0F) * 0.8F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag3 ? zMax : 1.0F) * 0.8F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -1414,114 +1241,103 @@ public class BlockSkinRenderHelper if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin + 1, 3)) { - if (render.aoType > 0) + if (render.renderMaxZ >= 1.0D) { - if (render.renderMaxZ >= 1.0D) - { - ++zMin; - } + ++zMin; + } - render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); - render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); - render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); - render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); - render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin + 1)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin + 1)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin + 1, zMin + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin, yMin - 1, zMin + 1)]; - if (!render.aoGrassXYZNCP && !render.aoGrassXYZCNP) - { - render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXZNP; - render.aoBrightnessXYZNNP = render.aoBrightnessXZNP; - } - else - { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); - } - - if (!render.aoGrassXYZNCP && !render.aoGrassXYZCPP) - { - render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXZNP; - render.aoBrightnessXYZNPP = render.aoBrightnessXZNP; - } - else - { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); - } - - if (!render.aoGrassXYZPCP && !render.aoGrassXYZCNP) - { - render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXZPP; - render.aoBrightnessXYZPNP = render.aoBrightnessXZPP; - } - else - { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); - } - - if (!render.aoGrassXYZPCP && !render.aoGrassXYZCPP) - { - render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXZPP; - render.aoBrightnessXYZPPP = render.aoBrightnessXZPP; - } - else - { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); - } - - if (render.renderMaxZ >= 1.0D) - { - --zMin; - } - - if (render.field_98189_n && render.field_94177_n.gameSettings.ambientOcclusion >= 2) - { - f7 = (render.aoLightValueScratchXZNP + render.aoLightValueScratchXYZNPP + render.aoLightValueZPos + render.aoLightValueScratchYZPP) / 4.0F; - f9 = (render.aoLightValueZPos + render.aoLightValueScratchYZPP + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYZPPP) / 4.0F; - f8 = (render.aoLightValueScratchYZNP + render.aoLightValueZPos + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXZPP) / 4.0F; - f10 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXZNP + render.aoLightValueScratchYZNP + render.aoLightValueZPos) / 4.0F; - f3 = (float)((double)f7 * render.renderMaxY * (1.0D - render.renderMinX) + (double)f9 * render.renderMaxY * render.renderMinX + (double)f8 * (1.0D - render.renderMaxY) * render.renderMinX + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMinX)); - f4 = (float)((double)f7 * render.renderMinY * (1.0D - render.renderMinX) + (double)f9 * render.renderMinY * render.renderMinX + (double)f8 * (1.0D - render.renderMinY) * render.renderMinX + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMinX)); - f5 = (float)((double)f7 * render.renderMinY * (1.0D - render.renderMaxX) + (double)f9 * render.renderMinY * render.renderMaxX + (double)f8 * (1.0D - render.renderMinY) * render.renderMaxX + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMaxX)); - f6 = (float)((double)f7 * render.renderMaxY * (1.0D - render.renderMaxX) + (double)f9 * render.renderMaxY * render.renderMaxX + (double)f8 * (1.0D - render.renderMaxY) * render.renderMaxX + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMaxX)); - k2 = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYZNPP, render.aoBrightnessYZPP, j2); - i3 = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXZPP, render.aoBrightnessXYZPPP, j2); - j3 = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, j2); - l2 = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, render.aoBrightnessYZNP, j2); - render.brightnessTopLeft = render.func_96444_a(k2, l2, j3, i3, render.renderMaxY * (1.0D - render.renderMinX), (1.0D - render.renderMaxY) * (1.0D - render.renderMinX), (1.0D - render.renderMaxY) * render.renderMinX, render.renderMaxY * render.renderMinX); - render.brightnessBottomLeft = render.func_96444_a(k2, l2, j3, i3, render.renderMinY * (1.0D - render.renderMinX), (1.0D - render.renderMinY) * (1.0D - render.renderMinX), (1.0D - render.renderMinY) * render.renderMinX, render.renderMinY * render.renderMinX); - render.brightnessBottomRight = render.func_96444_a(k2, l2, j3, i3, render.renderMinY * (1.0D - render.renderMaxX), (1.0D - render.renderMinY) * (1.0D - render.renderMaxX), (1.0D - render.renderMinY) * render.renderMaxX, render.renderMinY * render.renderMaxX); - render.brightnessTopRight = render.func_96444_a(k2, l2, j3, i3, render.renderMaxY * (1.0D - render.renderMaxX), (1.0D - render.renderMaxY) * (1.0D - render.renderMaxX), (1.0D - render.renderMaxY) * render.renderMaxX, render.renderMaxY * render.renderMaxX); - } - else - { - f3 = (render.aoLightValueScratchXZNP + render.aoLightValueScratchXYZNPP + render.aoLightValueZPos + render.aoLightValueScratchYZPP) / 4.0F; - f6 = (render.aoLightValueZPos + render.aoLightValueScratchYZPP + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYZPPP) / 4.0F; - f5 = (render.aoLightValueScratchYZNP + render.aoLightValueZPos + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXZPP) / 4.0F; - f4 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXZNP + render.aoLightValueScratchYZNP + render.aoLightValueZPos) / 4.0F; - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYZNPP, render.aoBrightnessYZPP, j2); - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXZPP, render.aoBrightnessXYZPPP, j2); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, j2); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, render.aoBrightnessYZNP, j2); - } + if (!flag2 && !flag4) + { + render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXZNP; + render.aoBrightnessXYZNNP = render.aoBrightnessXZNP; } else { - f6 = render.aoLightValueZPos; - f5 = render.aoLightValueZPos; - f4 = render.aoLightValueZPos; - f3 = render.aoLightValueZPos; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = j2; + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); + } + + if (!flag2 && !flag5) + { + render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXZNP; + render.aoBrightnessXYZNPP = render.aoBrightnessXZNP; + } + else + { + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); + } + + if (!flag3 && !flag4) + { + render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXZPP; + render.aoBrightnessXYZPNP = render.aoBrightnessXZPP; + } + else + { + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); + } + + if (!flag3 && !flag5) + { + render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXZPP; + render.aoBrightnessXYZPPP = render.aoBrightnessXZPP; + } + else + { + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); + } + + if (render.renderMaxZ >= 1.0D) + { + --zMin; + } + + i1 = l; + + if (render.renderMaxZ >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin + 1)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + f3 = (render.aoLightValueScratchXZNP + render.aoLightValueScratchXYZNPP + f7 + render.aoLightValueScratchYZPP) / 4.0F; + f6 = (f7 + render.aoLightValueScratchYZPP + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYZPPP) / 4.0F; + f5 = (render.aoLightValueScratchYZNP + f7 + render.aoLightValueScratchXYZPNP + render.aoLightValueScratchXZPP) / 4.0F; + f4 = (render.aoLightValueScratchXYZNNP + render.aoLightValueScratchXZNP + render.aoLightValueScratchYZNP + f7) / 4.0F; + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYZNPP, render.aoBrightnessYZPP, i1); + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessYZPP, render.aoBrightnessXZPP, render.aoBrightnessXYZPPP, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessYZNP, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, render.aoBrightnessYZNP, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.8F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.8F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag4 ? xMax : 1.0F) * 0.8F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag4 ? yMax : 1.0F) * 0.8F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag4 ? zMax : 1.0F) * 0.8F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -1541,114 +1357,103 @@ public class BlockSkinRenderHelper if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin - 1, yMin, zMin, 4)) { - if (render.aoType > 0) + if (render.renderMinX <= 0.0D) { - if (render.renderMinX <= 0.0D) - { - --xMin; - } + --xMin; + } - render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); - render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin + 1, zMin)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin - 1, zMin)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin - 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin - 1, yMin, zMin + 1)]; - if (!render.aoGrassXYZNCN && !render.aoGrassXYZNNC) - { - render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXZNN; - render.aoBrightnessXYZNNN = render.aoBrightnessXZNN; - } - else - { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); - } - - if (!render.aoGrassXYZNCP && !render.aoGrassXYZNNC) - { - render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXZNP; - render.aoBrightnessXYZNNP = render.aoBrightnessXZNP; - } - else - { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); - } - - if (!render.aoGrassXYZNCN && !render.aoGrassXYZNPC) - { - render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXZNN; - render.aoBrightnessXYZNPN = render.aoBrightnessXZNN; - } - else - { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); - } - - if (!render.aoGrassXYZNCP && !render.aoGrassXYZNPC) - { - render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXZNP; - render.aoBrightnessXYZNPP = render.aoBrightnessXZNP; - } - else - { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); - } - - if (render.renderMinX <= 0.0D) - { - ++xMin; - } - - if (render.field_98189_n && render.field_94177_n.gameSettings.ambientOcclusion >= 2) - { - f7 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNP + render.aoLightValueXNeg + render.aoLightValueScratchXZNP) / 4.0F; - f9 = (render.aoLightValueXNeg + render.aoLightValueScratchXZNP + render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPP) / 4.0F; - f8 = (render.aoLightValueScratchXZNN + render.aoLightValueXNeg + render.aoLightValueScratchXYZNPN + render.aoLightValueScratchXYNP) / 4.0F; - f10 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXYNN + render.aoLightValueScratchXZNN + render.aoLightValueXNeg) / 4.0F; - f3 = (float)((double)f9 * render.renderMaxY * render.renderMaxZ + (double)f8 * render.renderMaxY * (1.0D - render.renderMaxZ) + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMaxZ) + (double)f7 * (1.0D - render.renderMaxY) * render.renderMaxZ); - f4 = (float)((double)f9 * render.renderMaxY * render.renderMinZ + (double)f8 * render.renderMaxY * (1.0D - render.renderMinZ) + (double)f10 * (1.0D - render.renderMaxY) * (1.0D - render.renderMinZ) + (double)f7 * (1.0D - render.renderMaxY) * render.renderMinZ); - f5 = (float)((double)f9 * render.renderMinY * render.renderMinZ + (double)f8 * render.renderMinY * (1.0D - render.renderMinZ) + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMinZ) + (double)f7 * (1.0D - render.renderMinY) * render.renderMinZ); - f6 = (float)((double)f9 * render.renderMinY * render.renderMaxZ + (double)f8 * render.renderMinY * (1.0D - render.renderMaxZ) + (double)f10 * (1.0D - render.renderMinY) * (1.0D - render.renderMaxZ) + (double)f7 * (1.0D - render.renderMinY) * render.renderMaxZ); - k2 = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, i1); - i3 = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYNP, render.aoBrightnessXYZNPP, i1); - j3 = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessXYNP, i1); - l2 = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXYNN, render.aoBrightnessXZNN, i1); - render.brightnessTopLeft = render.func_96444_a(i3, j3, l2, k2, render.renderMaxY * render.renderMaxZ, render.renderMaxY * (1.0D - render.renderMaxZ), (1.0D - render.renderMaxY) * (1.0D - render.renderMaxZ), (1.0D - render.renderMaxY) * render.renderMaxZ); - render.brightnessBottomLeft = render.func_96444_a(i3, j3, l2, k2, render.renderMaxY * render.renderMinZ, render.renderMaxY * (1.0D - render.renderMinZ), (1.0D - render.renderMaxY) * (1.0D - render.renderMinZ), (1.0D - render.renderMaxY) * render.renderMinZ); - render.brightnessBottomRight = render.func_96444_a(i3, j3, l2, k2, render.renderMinY * render.renderMinZ, render.renderMinY * (1.0D - render.renderMinZ), (1.0D - render.renderMinY) * (1.0D - render.renderMinZ), (1.0D - render.renderMinY) * render.renderMinZ); - render.brightnessTopRight = render.func_96444_a(i3, j3, l2, k2, render.renderMinY * render.renderMaxZ, render.renderMinY * (1.0D - render.renderMaxZ), (1.0D - render.renderMinY) * (1.0D - render.renderMaxZ), (1.0D - render.renderMinY) * render.renderMaxZ); - } - else - { - f6 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNP + render.aoLightValueXNeg + render.aoLightValueScratchXZNP) / 4.0F; - f3 = (render.aoLightValueXNeg + render.aoLightValueScratchXZNP + render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPP) / 4.0F; - f4 = (render.aoLightValueScratchXZNN + render.aoLightValueXNeg + render.aoLightValueScratchXYZNPN + render.aoLightValueScratchXYNP) / 4.0F; - f5 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXYNN + render.aoLightValueScratchXZNN + render.aoLightValueXNeg) / 4.0F; - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, i1); - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYNP, render.aoBrightnessXYZNPP, i1); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessXYNP, i1); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXYNN, render.aoBrightnessXZNN, i1); - } + if (!flag5 && !flag2) + { + render.aoLightValueScratchXYZNNN = render.aoLightValueScratchXZNN; + render.aoBrightnessXYZNNN = render.aoBrightnessXZNN; } else { - f6 = render.aoLightValueXNeg; - f5 = render.aoLightValueXNeg; - f4 = render.aoLightValueXNeg; - f3 = render.aoLightValueXNeg; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = i1; + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); + } + + if (!flag4 && !flag2) + { + render.aoLightValueScratchXYZNNP = render.aoLightValueScratchXZNP; + render.aoBrightnessXYZNNP = render.aoBrightnessXZNP; + } + else + { + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); + } + + if (!flag5 && !flag3) + { + render.aoLightValueScratchXYZNPN = render.aoLightValueScratchXZNN; + render.aoBrightnessXYZNPN = render.aoBrightnessXZNN; + } + else + { + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); + } + + if (!flag4 && !flag3) + { + render.aoLightValueScratchXYZNPP = render.aoLightValueScratchXZNP; + render.aoBrightnessXYZNPP = render.aoBrightnessXZNP; + } + else + { + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); + } + + if (render.renderMinX <= 0.0D) + { + ++xMin; + } + + i1 = l; + + if (render.renderMinX <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin - 1, yMin, zMin)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + f6 = (render.aoLightValueScratchXYNN + render.aoLightValueScratchXYZNNP + f7 + render.aoLightValueScratchXZNP) / 4.0F; + f3 = (f7 + render.aoLightValueScratchXZNP + render.aoLightValueScratchXYNP + render.aoLightValueScratchXYZNPP) / 4.0F; + f4 = (render.aoLightValueScratchXZNN + f7 + render.aoLightValueScratchXYZNPN + render.aoLightValueScratchXYNP) / 4.0F; + f5 = (render.aoLightValueScratchXYZNNN + render.aoLightValueScratchXYNN + render.aoLightValueScratchXZNN + f7) / 4.0F; + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXYNN, render.aoBrightnessXYZNNP, render.aoBrightnessXZNP, i1); + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXZNP, render.aoBrightnessXYNP, render.aoBrightnessXYZNPP, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXZNN, render.aoBrightnessXYZNPN, render.aoBrightnessXYNP, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXYZNNN, render.aoBrightnessXYNN, render.aoBrightnessXZNN, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.6F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.6F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag5 ? xMax : 1.0F) * 0.6F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag5 ? yMax : 1.0F) * 0.6F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag5 ? zMax : 1.0F) * 0.6F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -1668,114 +1473,103 @@ public class BlockSkinRenderHelper if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin + 1, yMin, zMin, 5)) { - if (render.aoType > 0) + if (render.renderMaxX >= 1.0D) { - if (render.renderMaxX >= 1.0D) - { - ++xMin; - } + ++xMin; + } - render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); - render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); - render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); - render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); - render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); - render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); - render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); - render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin + 1, zMin)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin - 1, zMin)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xMin + 1, yMin, zMin - 1)]; - if (!render.aoGrassXYZPNC && !render.aoGrassXYZPCN) - { - render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXZPN; - render.aoBrightnessXYZPNN = render.aoBrightnessXZPN; - } - else - { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); - } - - if (!render.aoGrassXYZPNC && !render.aoGrassXYZPCP) - { - render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXZPP; - render.aoBrightnessXYZPNP = render.aoBrightnessXZPP; - } - else - { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); - } - - if (!render.aoGrassXYZPPC && !render.aoGrassXYZPCN) - { - render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXZPN; - render.aoBrightnessXYZPPN = render.aoBrightnessXZPN; - } - else - { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); - } - - if (!render.aoGrassXYZPPC && !render.aoGrassXYZPCP) - { - render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXZPP; - render.aoBrightnessXYZPPP = render.aoBrightnessXZPP; - } - else - { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); - } - - if (render.renderMaxX >= 1.0D) - { - --xMin; - } - - if (render.field_98189_n && render.field_94177_n.gameSettings.ambientOcclusion >= 2) - { - f7 = (render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNP + render.aoLightValueXPos + render.aoLightValueScratchXZPP) / 4.0F; - f9 = (render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXZPN + render.aoLightValueXPos) / 4.0F; - f8 = (render.aoLightValueScratchXZPN + render.aoLightValueXPos + render.aoLightValueScratchXYZPPN + render.aoLightValueScratchXYPP) / 4.0F; - f10 = (render.aoLightValueXPos + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPP) / 4.0F; - f3 = (float)((double)f7 * (1.0D - render.renderMinY) * render.renderMaxZ + (double)f9 * (1.0D - render.renderMinY) * (1.0D - render.renderMaxZ) + (double)f8 * render.renderMinY * (1.0D - render.renderMaxZ) + (double)f10 * render.renderMinY * render.renderMaxZ); - f4 = (float)((double)f7 * (1.0D - render.renderMinY) * render.renderMinZ + (double)f9 * (1.0D - render.renderMinY) * (1.0D - render.renderMinZ) + (double)f8 * render.renderMinY * (1.0D - render.renderMinZ) + (double)f10 * render.renderMinY * render.renderMinZ); - f5 = (float)((double)f7 * (1.0D - render.renderMaxY) * render.renderMinZ + (double)f9 * (1.0D - render.renderMaxY) * (1.0D - render.renderMinZ) + (double)f8 * render.renderMaxY * (1.0D - render.renderMinZ) + (double)f10 * render.renderMaxY * render.renderMinZ); - f6 = (float)((double)f7 * (1.0D - render.renderMaxY) * render.renderMaxZ + (double)f9 * (1.0D - render.renderMaxY) * (1.0D - render.renderMaxZ) + (double)f8 * render.renderMaxY * (1.0D - render.renderMaxZ) + (double)f10 * render.renderMaxY * render.renderMaxZ); - k2 = render.getAoBrightness(render.aoBrightnessXYPN, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, l1); - i3 = render.getAoBrightness(render.aoBrightnessXZPP, render.aoBrightnessXYPP, render.aoBrightnessXYZPPP, l1); - j3 = render.getAoBrightness(render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, render.aoBrightnessXYPP, l1); - l2 = render.getAoBrightness(render.aoBrightnessXYZPNN, render.aoBrightnessXYPN, render.aoBrightnessXZPN, l1); - render.brightnessTopLeft = render.func_96444_a(k2, l2, j3, i3, (1.0D - render.renderMinY) * render.renderMaxZ, (1.0D - render.renderMinY) * (1.0D - render.renderMaxZ), render.renderMinY * (1.0D - render.renderMaxZ), render.renderMinY * render.renderMaxZ); - render.brightnessBottomLeft = render.func_96444_a(k2, l2, j3, i3, (1.0D - render.renderMinY) * render.renderMinZ, (1.0D - render.renderMinY) * (1.0D - render.renderMinZ), render.renderMinY * (1.0D - render.renderMinZ), render.renderMinY * render.renderMinZ); - render.brightnessBottomRight = render.func_96444_a(k2, l2, j3, i3, (1.0D - render.renderMaxY) * render.renderMinZ, (1.0D - render.renderMaxY) * (1.0D - render.renderMinZ), render.renderMaxY * (1.0D - render.renderMinZ), render.renderMaxY * render.renderMinZ); - render.brightnessTopRight = render.func_96444_a(k2, l2, j3, i3, (1.0D - render.renderMaxY) * render.renderMaxZ, (1.0D - render.renderMaxY) * (1.0D - render.renderMaxZ), render.renderMaxY * (1.0D - render.renderMaxZ), render.renderMaxY * render.renderMaxZ); - } - else - { - f3 = (render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNP + render.aoLightValueXPos + render.aoLightValueScratchXZPP) / 4.0F; - f4 = (render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXZPN + render.aoLightValueXPos) / 4.0F; - f5 = (render.aoLightValueScratchXZPN + render.aoLightValueXPos + render.aoLightValueScratchXYZPPN + render.aoLightValueScratchXYPP) / 4.0F; - f6 = (render.aoLightValueXPos + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPP) / 4.0F; - render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXYPN, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, l1); - render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXZPP, render.aoBrightnessXYPP, render.aoBrightnessXYZPPP, l1); - render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, render.aoBrightnessXYPP, l1); - render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYZPNN, render.aoBrightnessXYPN, render.aoBrightnessXZPN, l1); - } + if (!flag2 && !flag4) + { + render.aoLightValueScratchXYZPNN = render.aoLightValueScratchXZPN; + render.aoBrightnessXYZPNN = render.aoBrightnessXZPN; } else { - f6 = render.aoLightValueXPos; - f5 = render.aoLightValueXPos; - f4 = render.aoLightValueXPos; - f3 = render.aoLightValueXPos; - render.brightnessTopLeft = render.brightnessBottomLeft = render.brightnessBottomRight = render.brightnessTopRight = l1; + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); + } + + if (!flag2 && !flag5) + { + render.aoLightValueScratchXYZPNP = render.aoLightValueScratchXZPP; + render.aoBrightnessXYZPNP = render.aoBrightnessXZPP; + } + else + { + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); + } + + if (!flag3 && !flag4) + { + render.aoLightValueScratchXYZPPN = render.aoLightValueScratchXZPN; + render.aoBrightnessXYZPPN = render.aoBrightnessXZPN; + } + else + { + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); + } + + if (!flag3 && !flag5) + { + render.aoLightValueScratchXYZPPP = render.aoLightValueScratchXZPP; + render.aoBrightnessXYZPPP = render.aoBrightnessXZPP; + } + else + { + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); + } + + if (render.renderMaxX >= 1.0D) + { + --xMin; + } + + i1 = l; + + if (render.renderMaxX >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin + 1, yMin, zMin)) + { + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + } + + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + f3 = (render.aoLightValueScratchXYPN + render.aoLightValueScratchXYZPNP + f7 + render.aoLightValueScratchXZPP) / 4.0F; + f4 = (render.aoLightValueScratchXYZPNN + render.aoLightValueScratchXYPN + render.aoLightValueScratchXZPN + f7) / 4.0F; + f5 = (render.aoLightValueScratchXZPN + f7 + render.aoLightValueScratchXYZPPN + render.aoLightValueScratchXYPP) / 4.0F; + f6 = (f7 + render.aoLightValueScratchXZPP + render.aoLightValueScratchXYPP + render.aoLightValueScratchXYZPPP) / 4.0F; + render.brightnessTopLeft = render.getAoBrightness(render.aoBrightnessXYPN, render.aoBrightnessXYZPNP, render.aoBrightnessXZPP, i1); + render.brightnessTopRight = render.getAoBrightness(render.aoBrightnessXZPP, render.aoBrightnessXYPP, render.aoBrightnessXYZPPP, i1); + render.brightnessBottomRight = render.getAoBrightness(render.aoBrightnessXZPN, render.aoBrightnessXYZPPN, render.aoBrightnessXYPP, i1); + render.brightnessBottomLeft = render.getAoBrightness(render.aoBrightnessXYZPNN, render.aoBrightnessXYPN, render.aoBrightnessXZPN, i1); + + if (flag1) + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = xMax * 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = yMax * 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = zMax * 0.6F; + } + else + { + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = 0.6F; } - render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = (flag6 ? xMax : 1.0F) * 0.6F; - render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = (flag6 ? yMax : 1.0F) * 0.6F; - render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = (flag6 ? zMax : 1.0F) * 0.6F; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; diff --git a/mods/tinker/common/InventoryBlock.java b/mods/tinker/common/InventoryBlock.java index 2e4a71d3..adb3c64d 100644 --- a/mods/tinker/common/InventoryBlock.java +++ b/mods/tinker/common/InventoryBlock.java @@ -144,7 +144,8 @@ public abstract class InventoryBlock extends BlockContainer public Icon[] icons; public abstract String[] getTextureNames(); - public void func_94332_a(IconRegister iconRegister) + @Override + public void registerIcons(IconRegister iconRegister) { String[] textureNames = getTextureNames(); //System.out.println("TextureNames: :"+this.getClass().getSimpleName()); @@ -152,7 +153,7 @@ public abstract class InventoryBlock extends BlockContainer for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.func_94245_a("tinker:"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]); } } } diff --git a/mods/tinker/common/InventoryLogic.java b/mods/tinker/common/InventoryLogic.java index beadb35d..21636895 100644 --- a/mods/tinker/common/InventoryLogic.java +++ b/mods/tinker/common/InventoryLogic.java @@ -151,16 +151,16 @@ public abstract class InventoryLogic extends TileEntity public String getInvName() { - return this.func_94042_c() ? this.invName : getDefaultName(); + return this.isInvNameLocalized() ? this.invName : getDefaultName(); } - public boolean func_94042_c() + public boolean isInvNameLocalized() { return this.invName != null && this.invName.length() > 0; } @Override - public boolean func_94041_b (int i, ItemStack itemstack) + public boolean isStackValidForSlot (int i, ItemStack itemstack) { // TODO Auto-generated method stub return false; diff --git a/mods/tinker/common/fancyitem/FancyItemRender.java b/mods/tinker/common/fancyitem/FancyItemRender.java index a4e4bbd2..6bbdcd01 100644 --- a/mods/tinker/common/fancyitem/FancyItemRender.java +++ b/mods/tinker/common/fancyitem/FancyItemRender.java @@ -25,20 +25,18 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) -public class FancyItemRender extends Render -{ +public class FancyItemRender extends Render { private RenderBlocks itemRenderBlocks = new RenderBlocks(); /** The RNG used in RenderItem (for bobbing itemstacks on the ground) */ private Random random = new Random(); - public boolean field_77024_a = true; + public boolean renderWithColor = true; /** Defines the zLevel of rendering of item on GUI. */ public float zLevel = 0.0F; - public static boolean field_82407_g = false; + public static boolean renderInFrame = false; - public FancyItemRender() - { + public FancyItemRender() { this.shadowSize = 0.15F; this.shadowOpaque = 0.75F; } @@ -46,16 +44,18 @@ public class FancyItemRender extends Render /** * Renders the item */ - public void doRenderItem (EntityItem par1EntityItem, double par2, double par4, double par6, float par8, float par9) - { + public void doRenderItem(EntityItem par1EntityItem, double par2, + double par4, double par6, float par8, float par9) { this.random.setSeed(187L); ItemStack itemstack = par1EntityItem.getEntityItem(); - if (itemstack.getItem() != null) - { + if (itemstack.getItem() != null) { GL11.glPushMatrix(); - float f2 = shouldBob() ? MathHelper.sin(((float) par1EntityItem.age + par9) / 10.0F + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F; - float f3 = (((float) par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI); + float f2 = shouldBob() ? MathHelper + .sin(((float) par1EntityItem.age + par9) / 10.0F + + par1EntityItem.hoverStart) * 0.1F + 0.1F : 0F; + float f3 = (((float) par1EntityItem.age + par9) / 20.0F + par1EntityItem.hoverStart) + * (180F / (float) Math.PI); byte b0 = getMiniBlockCount(itemstack); GL11.glTranslatef((float) par2, (float) par4 + f2, (float) par6); @@ -66,21 +66,21 @@ public class FancyItemRender extends Render float f6; Block block = null; - if (itemstack.itemID < Block.blocksList.length) - { + if (itemstack.itemID < Block.blocksList.length) { block = Block.blocksList[itemstack.itemID]; } - if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, f2, f3, random, renderManager.renderEngine, renderBlocks)) - { + if (ForgeHooksClient.renderEntityItem(par1EntityItem, itemstack, + f2, f3, random, renderManager.renderEngine, renderBlocks)) { ; - } - else if (itemstack.func_94608_d() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[itemstack.itemID].getRenderType())) - { + } else if (itemstack.getItemSpriteNumber() == 0 + && block != null + && RenderBlocks + .renderItemIn3d(Block.blocksList[itemstack.itemID] + .getRenderType())) { GL11.glRotatef(f3, 0.0F, 1.0F, 0.0F); - if (field_82407_g) - { + if (renderInFrame) { GL11.glScalef(1.25F, 1.25F, 1.25F); GL11.glTranslatef(0.0F, 0.05F, 0.0F); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); @@ -90,104 +90,91 @@ public class FancyItemRender extends Render float f7 = 0.25F; int j = block.getRenderType(); - if (j == 1 || j == 19 || j == 12 || j == 2) - { + if (j == 1 || j == 19 || j == 12 || j == 2) { f7 = 0.5F; } GL11.glScalef(f7, f7, f7); - for (i = 0; i < b0; ++i) - { + for (i = 0; i < b0; ++i) { GL11.glPushMatrix(); - if (i > 0) - { - f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; - f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; - f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F / f7; + if (i > 0) { + f5 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F + / f7; + f4 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F + / f7; + f6 = (this.random.nextFloat() * 2.0F - 1.0F) * 0.2F + / f7; GL11.glTranslatef(f5, f4, f6); } f5 = 1.0F; - this.itemRenderBlocks.renderBlockAsItem(block, itemstack.getItemDamage(), f5); + this.itemRenderBlocks.renderBlockAsItem(block, + itemstack.getItemDamage(), f5); GL11.glPopMatrix(); } - } - else - { + } else { float f8; - if (itemstack.getItem().requiresMultipleRenderPasses()) - { - if (field_82407_g) - { + if (itemstack.getItem().requiresMultipleRenderPasses()) { + if (renderInFrame) { GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); GL11.glTranslatef(0.0F, -0.05F, 0.0F); - } - else - { + } else { GL11.glScalef(0.5F, 0.5F, 0.5F); } this.loadTexture("/gui/items.png"); - for (int k = 0; k <= itemstack.getItem().getRenderPasses(itemstack.getItemDamage()); ++k) - { + for (int k = 0; k < itemstack.getItem().getRenderPasses( + itemstack.getItemDamage()); ++k) { this.random.setSeed(187L); Icon icon = itemstack.getItem().getIcon(itemstack, k); f8 = 1.0F; - if (this.field_77024_a) - { - i = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, k); + if (this.renderWithColor) { + i = Item.itemsList[itemstack.itemID] + .getColorFromItemStack(itemstack, k); f5 = (float) (i >> 16 & 255) / 255.0F; f4 = (float) (i >> 8 & 255) / 255.0F; f6 = (float) (i & 255) / 255.0F; GL11.glColor4f(f5 * f8, f4 * f8, f6 * f8, 1.0F); - this.renderDroppedItem(par1EntityItem, icon, b0, par9, f5 * f8, f4 * f8, f6 * f8); - } - else - { - this.renderDroppedItem(par1EntityItem, icon, b0, par9, 1.0F, 1.0F, 1.0F); + this.renderDroppedItem(par1EntityItem, icon, b0, + par9, f5 * f8, f4 * f8, f6 * f8); + } else { + this.renderDroppedItem(par1EntityItem, icon, b0, + par9, 1.0F, 1.0F, 1.0F); } } - } - else - { - if (field_82407_g) - { + } else { + if (renderInFrame) { GL11.glScalef(0.5128205F, 0.5128205F, 0.5128205F); GL11.glTranslatef(0.0F, -0.05F, 0.0F); - } - else - { + } else { GL11.glScalef(0.5F, 0.5F, 0.5F); } Icon icon1 = itemstack.getIconIndex(); - if (itemstack.func_94608_d() == 0) - { + if (itemstack.getItemSpriteNumber() == 0) { this.loadTexture("/terrain.png"); - } - else - { + } else { this.loadTexture("/gui/items.png"); } - if (this.field_77024_a) - { - int l = Item.itemsList[itemstack.itemID].getColorFromItemStack(itemstack, 0); + if (this.renderWithColor) { + int l = Item.itemsList[itemstack.itemID] + .getColorFromItemStack(itemstack, 0); f8 = (float) (l >> 16 & 255) / 255.0F; float f9 = (float) (l >> 8 & 255) / 255.0F; f5 = (float) (l & 255) / 255.0F; f4 = 1.0F; - this.renderDroppedItem(par1EntityItem, icon1, b0, par9, f8 * f4, f9 * f4, f5 * f4); - } - else - { - this.renderDroppedItem(par1EntityItem, icon1, b0, par9, 1.0F, 1.0F, 1.0F); + this.renderDroppedItem(par1EntityItem, icon1, b0, par9, + f8 * f4, f9 * f4, f5 * f4); + } else { + this.renderDroppedItem(par1EntityItem, icon1, b0, par9, + 1.0F, 1.0F, 1.0F); } } } @@ -200,19 +187,20 @@ public class FancyItemRender extends Render /** * Renders a dropped item */ - private void renderDroppedItem (EntityItem par1EntityItem, Icon par2Icon, int par3, float par4, float par5, float par6, float par7) - { + private void renderDroppedItem(EntityItem par1EntityItem, Icon par2Icon, + int par3, float par4, float par5, float par6, float par7) { Tessellator tessellator = Tessellator.instance; - if (par2Icon == null) - { - par2Icon = this.renderManager.renderEngine.func_96448_c(par1EntityItem.getEntityItem().func_94608_d()); + if (par2Icon == null) { + par2Icon = this.renderManager.renderEngine + .getMissingIcon(par1EntityItem.getEntityItem() + .getItemSpriteNumber()); } - float f4 = par2Icon.func_94209_e(); - float f5 = par2Icon.func_94212_f(); - float f6 = par2Icon.func_94206_g(); - float f7 = par2Icon.func_94210_h(); + float f4 = par2Icon.getMinU(); + float f5 = par2Icon.getMaxU(); + float f6 = par2Icon.getMinV(); + float f7 = par2Icon.getMaxV(); float f8 = 1.0F; float f9 = 0.5F; float f10 = 0.25F; @@ -220,13 +208,12 @@ public class FancyItemRender extends Render GL11.glPushMatrix(); - if (field_82407_g) - { + if (renderInFrame) { GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); - } - else - { - GL11.glRotatef((((float) par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); + } else { + GL11.glRotatef( + (((float) par1EntityItem.age + par4) / 20.0F + par1EntityItem.hoverStart) + * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); } float f12 = 0.0625F; @@ -237,38 +224,34 @@ public class FancyItemRender extends Render GL11.glTranslatef(-f9, -f10, -((f12 + f11) * (float) b0 / 2.0F)); - for (int k = 0; k < b0; ++k) - { - // Makes items offset when in 3D, like when in 2D, looks much better. Considered a vanilla bug... - if (k > 0 && shouldSpreadItems()) - { + for (int k = 0; k < b0; ++k) { + GL11.glTranslatef(0.0F, 0.0F, f12 + f11); + // Makes items offset when in 3D, like when in 2D, looks much + // better. Considered a vanilla bug... + if (k > 0 && shouldSpreadItems()) { float x = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; float y = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; float z = (random.nextFloat() * 2.0F - 1.0F) * 0.3F / 0.5F; GL11.glTranslatef(x, y, f12 + f11); - } - else - { + } else { GL11.glTranslatef(0f, 0f, f12 + f11); } - if (itemstack.func_94608_d() == 0 && itemstack.itemID < Block.blocksList.length && Block.blocksList[itemstack.itemID] != null) - { + if (itemstack.getItemSpriteNumber() == 0) { this.loadTexture("/terrain.png"); - } - else - { + } else { this.loadTexture("/gui/items.png"); } GL11.glColor4f(par5, par6, par7, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, par2Icon.func_94213_j(), par2Icon.func_94208_k(), f12); + ItemRenderer.renderItemIn2D(tessellator, f5, f6, f4, f7, + par2Icon.getSheetWidth(), par2Icon.getSheetHeight(), f12); - if (itemstack != null && itemstack.hasEffect()) - { + if (itemstack != null && itemstack.hasEffect()) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_LIGHTING); - this.renderManager.renderEngine.func_98187_b("%blur%/misc/glint.png"); + this.renderManager.renderEngine + .bindTexture("%blur%/misc/glint.png"); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); float f13 = 0.76F; @@ -280,14 +263,16 @@ public class FancyItemRender extends Render float f15 = (float) (Minecraft.getSystemTime() % 3000L) / 3000.0F * 8.0F; GL11.glTranslatef(f15, 0.0F, 0.0F); GL11.glRotatef(-50.0F, 0.0F, 0.0F, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, + 1.0F, 255, 255, f12); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glScalef(f14, f14, f14); f15 = (float) (Minecraft.getSystemTime() % 4873L) / 4873.0F * 8.0F; GL11.glTranslatef(-f15, 0.0F, 0.0F); GL11.glRotatef(10.0F, 0.0F, 0.0F, 1.0F); - ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, 1.0F, 255, 255, f12); + ItemRenderer.renderItemIn2D(tessellator, 0.0F, 0.0F, 1.0F, + 1.0F, 255, 255, f12); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glDisable(GL11.GL_BLEND); @@ -303,8 +288,9 @@ public class FancyItemRender extends Render /** * Renders the item's icon or block into the UI at the specified position. */ - public void renderItemIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) - { + public void renderItemIntoGUI(FontRenderer par1FontRenderer, + RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, + int par5) { int k = par3ItemStack.itemID; int l = par3ItemStack.getItemDamage(); Icon icon = par3ItemStack.getIconIndex(); @@ -313,12 +299,14 @@ public class FancyItemRender extends Render float f2; Block block = (k < Block.blocksList.length ? Block.blocksList[k] : null); - - if (par3ItemStack.func_94608_d() == 0 && block != null && RenderBlocks.renderItemIn3d(Block.blocksList[k].getRenderType())) - { - par2RenderEngine.func_98187_b("/terrain.png"); + if (par3ItemStack.getItemSpriteNumber() == 0 + && block != null + && RenderBlocks.renderItemIn3d(Block.blocksList[k] + .getRenderType())) { + par2RenderEngine.bindTexture("/terrain.png"); GL11.glPushMatrix(); - GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + this.zLevel); + GL11.glTranslatef((float) (par4 - 2), (float) (par5 + 3), -3.0F + + this.zLevel); GL11.glScalef(10.0F, 10.0F, 10.0F); GL11.glTranslatef(1.0F, 0.5F, 1.0F); GL11.glScalef(1.0F, 1.0F, -1.0F); @@ -329,60 +317,52 @@ public class FancyItemRender extends Render f = (float) (i1 >> 8 & 255) / 255.0F; f1 = (float) (i1 & 255) / 255.0F; - if (this.field_77024_a) - { + if (this.renderWithColor) { GL11.glColor4f(f2, f, f1, 1.0F); } GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); - this.itemRenderBlocks.useInventoryTint = this.field_77024_a; + this.itemRenderBlocks.useInventoryTint = this.renderWithColor; this.itemRenderBlocks.renderBlockAsItem(block, l, 1.0F); this.itemRenderBlocks.useInventoryTint = true; GL11.glPopMatrix(); - } - else - { + } else { int j1; - if (Item.itemsList[k].requiresMultipleRenderPasses()) - { + if (Item.itemsList[k].requiresMultipleRenderPasses()) { GL11.glDisable(GL11.GL_LIGHTING); - par2RenderEngine.func_98187_b("/gui/items.png"); + par2RenderEngine.bindTexture(par3ItemStack + .getItemSpriteNumber() == 0 ? "/terrain.png" + : "/gui/items.png"); - for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) - { + for (j1 = 0; j1 < Item.itemsList[k].getRenderPasses(l); ++j1) { Icon icon1 = Item.itemsList[k].getIcon(par3ItemStack, j1); - int k1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, j1); + int k1 = Item.itemsList[k].getColorFromItemStack( + par3ItemStack, j1); f = (float) (k1 >> 16 & 255) / 255.0F; f1 = (float) (k1 >> 8 & 255) / 255.0F; float f3 = (float) (k1 & 255) / 255.0F; - if (this.field_77024_a) - { + if (this.renderWithColor) { GL11.glColor4f(f, f1, f3, 1.0F); } - this.func_94149_a(par4, par5, icon1, 16, 16); + this.renderIcon(par4, par5, icon1, 16, 16); } GL11.glEnable(GL11.GL_LIGHTING); - } - else - { + } else { GL11.glDisable(GL11.GL_LIGHTING); - if (par3ItemStack.func_94608_d() == 0) - { - par2RenderEngine.func_98187_b("/terrain.png"); - } - else - { - par2RenderEngine.func_98187_b("/gui/items.png"); + if (par3ItemStack.getItemSpriteNumber() == 0) { + par2RenderEngine.bindTexture("/terrain.png"); + } else { + par2RenderEngine.bindTexture("/gui/items.png"); } - if (icon == null) - { - icon = par2RenderEngine.func_96448_c(par3ItemStack.func_94608_d()); + if (icon == null) { + icon = par2RenderEngine.getMissingIcon(par3ItemStack + .getItemSpriteNumber()); } j1 = Item.itemsList[k].getColorFromItemStack(par3ItemStack, 0); @@ -390,12 +370,11 @@ public class FancyItemRender extends Render f2 = (float) (j1 >> 8 & 255) / 255.0F; f = (float) (j1 & 255) / 255.0F; - if (this.field_77024_a) - { + if (this.renderWithColor) { GL11.glColor4f(f4, f2, f, 1.0F); } - this.func_94149_a(par4, par5, icon, 16, 16); + this.renderIcon(par4, par5, icon, 16, 16); GL11.glEnable(GL11.GL_LIGHTING); } } @@ -406,26 +385,28 @@ public class FancyItemRender extends Render /** * Render the item's icon or block into the GUI, including the glint effect. */ - public void renderItemAndEffectIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) - { - if (par3ItemStack != null) - { - if (!ForgeHooksClient.renderInventoryItem(renderBlocks, par2RenderEngine, par3ItemStack, field_77024_a, zLevel, (float) par4, (float) par5)) - { - this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5); + public void renderItemAndEffectIntoGUI(FontRenderer par1FontRenderer, + RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, + int par5) { + if (par3ItemStack != null) { + if (!ForgeHooksClient.renderInventoryItem(renderBlocks, + par2RenderEngine, par3ItemStack, renderWithColor, zLevel, + (float) par4, (float) par5)) { + this.renderItemIntoGUI(par1FontRenderer, par2RenderEngine, + par3ItemStack, par4, par5); } - if (par3ItemStack.hasEffect()) - { + if (par3ItemStack.hasEffect()) { GL11.glDepthFunc(GL11.GL_GREATER); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false); - par2RenderEngine.func_98187_b("%blur%/misc/glint.png"); + par2RenderEngine.bindTexture("%blur%/misc/glint.png"); this.zLevel -= 50.0F; GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_DST_COLOR); GL11.glColor4f(0.5F, 0.25F, 0.8F, 1.0F); - this.func_77018_a(par4 * 431278612 + par5 * 32178161, par4 - 2, par5 - 2, 20, 20); + this.renderGlint(par4 * 431278612 + par5 * 32178161, par4 - 2, + par5 - 2, 20, 20); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); this.zLevel += 50.0F; @@ -435,68 +416,82 @@ public class FancyItemRender extends Render } } - private void func_77018_a (int par1, int par2, int par3, int par4, int par5) - { - for (int j1 = 0; j1 < 2; ++j1) - { - if (j1 == 0) - { + private void renderGlint(int par1, int par2, int par3, int par4, int par5) { + for (int j1 = 0; j1 < 2; ++j1) { + if (j1 == 0) { GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); } - if (j1 == 1) - { + if (j1 == 1) { GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); } float f = 0.00390625F; float f1 = 0.00390625F; - float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F; + float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) + / (3000.0F + (float) (j1 * 1873)) * 256.0F; float f3 = 0.0F; Tessellator tessellator = Tessellator.instance; float f4 = 4.0F; - if (j1 == 1) - { + if (j1 == 1) { f4 = -1.0F; } tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1)); - tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1)); - tessellator.addVertexWithUV((double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1)); - tessellator.addVertexWithUV((double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1)); + tessellator.addVertexWithUV((double) (par2 + 0), + (double) (par3 + par5), (double) this.zLevel, + (double) ((f2 + (float) par5 * f4) * f), + (double) ((f3 + (float) par5) * f1)); + tessellator.addVertexWithUV((double) (par2 + par4), + (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + + (float) par4 + (float) par5 * f4) * f), + (double) ((f3 + (float) par5) * f1)); + tessellator.addVertexWithUV((double) (par2 + par4), + (double) (par3 + 0), (double) this.zLevel, + (double) ((f2 + (float) par4) * f), + (double) ((f3 + 0.0F) * f1)); + tessellator.addVertexWithUV((double) (par2 + 0), + (double) (par3 + 0), (double) this.zLevel, + (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1)); tessellator.draw(); } } /** - * Renders the item's overlay information. Examples being stack count or damage on top of the item's image at the - * specified position. + * Renders the item's overlay information. Examples being stack count or + * damage on top of the item's image at the specified position. */ - public void renderItemOverlayIntoGUI (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5) - { - this.func_94148_a(par1FontRenderer, par2RenderEngine, par3ItemStack, par4, par5, (String) null); + public void renderItemOverlayIntoGUI(FontRenderer par1FontRenderer, + RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, + int par5) { + this.renderItemStack(par1FontRenderer, par2RenderEngine, par3ItemStack, + par4, par5, (String) null); } - public void func_94148_a (FontRenderer par1FontRenderer, RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, int par5, String par6Str) - { - if (par3ItemStack != null) - { - if (par3ItemStack.stackSize > 1 || par6Str != null) - { - String s1 = par6Str == null ? String.valueOf(par3ItemStack.stackSize) : par6Str; + public void renderItemStack(FontRenderer par1FontRenderer, + RenderEngine par2RenderEngine, ItemStack par3ItemStack, int par4, + int par5, String par6Str) { + if (par3ItemStack != null) { + if (par3ItemStack.stackSize > 1 || par6Str != null) { + String s1 = par6Str == null ? String + .valueOf(par3ItemStack.stackSize) : par6Str; GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); - par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, 16777215); + par1FontRenderer.drawStringWithShadow(s1, par4 + 19 - 2 + - par1FontRenderer.getStringWidth(s1), par5 + 6 + 3, + 16777215); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_DEPTH_TEST); } - if (par3ItemStack.isItemDamaged()) - { - int k = (int) Math.round(13.0D - (double) par3ItemStack.getItemDamageForDisplay() * 13.0D / (double) par3ItemStack.getMaxDamage()); - int l = (int) Math.round(255.0D - (double) par3ItemStack.getItemDamageForDisplay() * 255.0D / (double) par3ItemStack.getMaxDamage()); + if (par3ItemStack.isItemDamaged()) { + int k = (int) Math.round(13.0D + - (double) par3ItemStack.getItemDamageForDisplay() + * 13.0D / (double) par3ItemStack.getMaxDamage()); + int l = (int) Math.round(255.0D + - (double) par3ItemStack.getItemDamageForDisplay() + * 255.0D / (double) par3ItemStack.getMaxDamage()); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_TEXTURE_2D); @@ -515,62 +510,74 @@ public class FancyItemRender extends Render } /** - * Adds a quad to the tesselator at the specified position with the set width and height and color. Args: - * tessellator, x, y, width, height, color + * Adds a quad to the tesselator at the specified position with the set + * width and height and color. Args: tessellator, x, y, width, height, color */ - private void renderQuad (Tessellator par1Tessellator, int par2, int par3, int par4, int par5, int par6) - { + private void renderQuad(Tessellator par1Tessellator, int par2, int par3, + int par4, int par5, int par6) { par1Tessellator.startDrawingQuads(); par1Tessellator.setColorOpaque_I(par6); - par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), 0.0D); - par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), 0.0D); - par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + par5), 0.0D); - par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), 0.0D); + par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + 0), + 0.0D); + par1Tessellator.addVertex((double) (par2 + 0), (double) (par3 + par5), + 0.0D); + par1Tessellator.addVertex((double) (par2 + par4), + (double) (par3 + par5), 0.0D); + par1Tessellator.addVertex((double) (par2 + par4), (double) (par3 + 0), + 0.0D); par1Tessellator.draw(); } - public void func_94149_a (int par1, int par2, Icon par3Icon, int par4, int par5) - { + public void renderIcon(int par1, int par2, Icon par3Icon, int par4, int par5) { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.func_94209_e(), (double) par3Icon.func_94210_h()); - tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + par5), (double) this.zLevel, (double) par3Icon.func_94212_f(), (double) par3Icon.func_94210_h()); - tessellator.addVertexWithUV((double) (par1 + par4), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.func_94212_f(), (double) par3Icon.func_94206_g()); - tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), (double) this.zLevel, (double) par3Icon.func_94209_e(), (double) par3Icon.func_94206_g()); + tessellator.addVertexWithUV((double) (par1 + 0), + (double) (par2 + par5), (double) this.zLevel, + (double) par3Icon.getMinU(), (double) par3Icon.getMaxV()); + tessellator.addVertexWithUV((double) (par1 + par4), + (double) (par2 + par5), (double) this.zLevel, + (double) par3Icon.getMaxU(), (double) par3Icon.getMaxV()); + tessellator.addVertexWithUV((double) (par1 + par4), + (double) (par2 + 0), (double) this.zLevel, + (double) par3Icon.getMaxU(), (double) par3Icon.getMinV()); + tessellator.addVertexWithUV((double) (par1 + 0), (double) (par2 + 0), + (double) this.zLevel, (double) par3Icon.getMinU(), + (double) par3Icon.getMinV()); tessellator.draw(); } /** - * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then - * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic - * (Render 1) ret = 2; @@ -586,11 +593,11 @@ public class FancyItemRender extends Render /** * Allows for a subclass to override how many rendered items appear in a * "mini item 3d stack" + * * @param stack * @return */ - public byte getMiniItemCount (ItemStack stack) - { + public byte getMiniItemCount(ItemStack stack) { byte ret = 1; if (stack.stackSize > 1) ret = 2; diff --git a/mods/tinker/resources/lang/en_US.xml b/mods/tinker/resources/lang/en_US.xml index 3c04eb21..37c5582f 100644 --- a/mods/tinker/resources/lang/en_US.xml +++ b/mods/tinker/resources/lang/en_US.xml @@ -68,6 +68,8 @@ Liquid Damascus Steel Bucket Liquid Angmallen Bucket + Gelatinous Slime + Casting Table Seared Faucet diff --git a/mods/tinker/tconstruct/AbilityHelper.java b/mods/tinker/tconstruct/AbilityHelper.java index b65f41e3..1e676b69 100644 --- a/mods/tinker/tconstruct/AbilityHelper.java +++ b/mods/tinker/tconstruct/AbilityHelper.java @@ -474,7 +474,7 @@ public class AbilityHelper } else { - world.func_94575_c(x, y, z, block.blockID); + world.setBlock(x, y, z, block.blockID); onBlockChanged(stack, world, 0, x, y, z, player, random); return true; } diff --git a/mods/tinker/tconstruct/PHConstruct.java b/mods/tinker/tconstruct/PHConstruct.java index 1f4d4aa3..561fc793 100644 --- a/mods/tinker/tconstruct/PHConstruct.java +++ b/mods/tinker/tconstruct/PHConstruct.java @@ -107,6 +107,7 @@ public class PHConstruct { buckets = config.getItem("Patterns and Misc", "Buckets", 14101).getInt(14101); uselessItem = config.getItem("Patterns and Misc", "Title Icon", 14102).getInt(14102); + slimefood = config.getItem("Patterns and Misc", "Strange Food", 14103).getInt(14103); boolean ic2 = true; boolean xycraft = true; @@ -175,6 +176,9 @@ public class PHConstruct { public static int buckets; public static int uselessItem; + //Food + public static int slimefood; + //Tools public static int pickaxe; public static int shovel; diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index f1d2f665..63600f1e 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -23,7 +23,7 @@ import cpw.mods.fml.common.registry.GameRegistry; * @author: mDiyo */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.0_1.1.23", dependencies = "before:*") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.2.1", dependencies = "before:*") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.TPacketHandler.class) public class TConstruct { diff --git a/mods/tinker/tconstruct/TConstructRegistry.java b/mods/tinker/tconstruct/TConstructRegistry.java index 7cffbdf1..0bc82d13 100644 --- a/mods/tinker/tconstruct/TConstructRegistry.java +++ b/mods/tinker/tconstruct/TConstructRegistry.java @@ -34,7 +34,7 @@ public class TConstructRegistry //Rendering - //itemMap.func_94245_a + //itemMap.updateIcons /*public static void addMaterialRenderMapping(int materialID, String textureLocation) diff --git a/mods/tinker/tconstruct/TContent.java b/mods/tinker/tconstruct/TContent.java index 449a710b..282a7240 100644 --- a/mods/tinker/tconstruct/TContent.java +++ b/mods/tinker/tconstruct/TContent.java @@ -21,7 +21,7 @@ import mods.tinker.tconstruct.crafting.Smeltery; import mods.tinker.tconstruct.crafting.ToolBuilder; import mods.tinker.tconstruct.entity.CartEntity; import mods.tinker.tconstruct.entity.Crystal; -import mods.tinker.tconstruct.entity.EdibleSlime; +import mods.tinker.tconstruct.entity.BlueSlime; import mods.tinker.tconstruct.entity.Skyla; import mods.tinker.tconstruct.entity.UnstableCreeper; import mods.tinker.tconstruct.items.CraftedSoilItemBlock; @@ -36,6 +36,7 @@ import mods.tinker.tconstruct.items.Pattern; import mods.tinker.tconstruct.items.PatternManual; import mods.tinker.tconstruct.items.SearedTableItemBlock; import mods.tinker.tconstruct.items.SmelteryItemBlock; +import mods.tinker.tconstruct.items.StrangeFood; import mods.tinker.tconstruct.items.TitleIcon; import mods.tinker.tconstruct.items.ToolPart; import mods.tinker.tconstruct.items.ToolShard; @@ -105,6 +106,8 @@ public class TContent implements IFuelHandler public static Item manualBook; public static Item buckets; public static Item titleIcon; + + public static Item strangeFood; //public static Item stonePattern; //public static Item netherPattern; @@ -183,12 +186,13 @@ public class TContent implements IFuelHandler EntityRegistry.registerModEntity(Skyla.class, "Skyla", 10, TConstruct.instance, 32, 5, true); EntityRegistry.registerModEntity(UnstableCreeper.class, "UnstableCreeper", 11, TConstruct.instance, 64, 5, true); - EntityRegistry.registerModEntity(EdibleSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true); + EntityRegistry.registerModEntity(BlueSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true); BiomeGenBase[] overworldBiomes = new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.beach, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills }; EntityRegistry.addSpawn(UnstableCreeper.class, 8, 4, 6, EnumCreatureType.monster, overworldBiomes); + EntityRegistry.addSpawn(BlueSlime.class, 10, 4, 4, EnumCreatureType.monster, overworldBiomes); } void registerBlocks () @@ -261,11 +265,13 @@ public class TContent implements IFuelHandler titleIcon = new TitleIcon(PHConstruct.uselessItem).setUnlocalizedName("tconstruct.titleicon"); String[] blanks = new String[] { "blank_pattern", "blank_cast" }; blankPattern = new CraftingItem(PHConstruct.blankPattern, blanks, blanks, "materials/").setUnlocalizedName("tconstruct.Pattern"); + String[] craftingMaterials = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot" }; String[] craftingTextures = new String[] { "material_paperstack", "material_slimecrystal", "material_searedbrick", "material_cobaltingot", "material_arditeingot", "material_manyullyningot", "material_mossball", "material_lavacrystal", "material_necroticbone", "material_copperingot", "material_tiningot", "material_aluminumingot", "material_aluminumraw", "material_bronzeingot", "material_alubrassingot", "material_alumiteingot", "material_steelingot" }; + materials = new CraftingItem(PHConstruct.materials, craftingMaterials, craftingTextures, "materials/").setUnlocalizedName("tconstruct.Materials"); toolRod = new ToolPart(PHConstruct.toolRod, "ToolRod", "_rod").setUnlocalizedName("tconstruct.ToolRod"); toolShard = new ToolShard(PHConstruct.toolShard, "ToolShard", "_chunk").setUnlocalizedName("tconstruct.ToolShard"); @@ -302,7 +308,13 @@ public class TContent implements IFuelHandler frypanHead = new ToolPart(PHConstruct.frypanHead, "FrypanHead", "_frypan_head").setUnlocalizedName("tconstruct.FrypanHead"); signHead = new ToolPart(PHConstruct.signHead, "SignHead", "_battlesign_head").setUnlocalizedName("tconstruct.SignHead"); + strangeFood = new StrangeFood(PHConstruct.slimefood).setUnlocalizedName("tconstruct.strangefood"); //lumberHead = new ToolPart(PHConstruct.lumberHead, 0, broadheads).setUnlocalizedName("tconstruct.LumberHead"); + Item.doorWood.setMaxStackSize(16); + Item.doorSteel.setMaxStackSize(16); + Item.snowball.setMaxStackSize(64); + Item.boat.setMaxStackSize(16); + Item.potion.setMaxStackSize(16); } void registerMaterials () @@ -327,6 +339,7 @@ public class TContent implements IFuelHandler //Thaumcraft TConstructRegistry.addToolMaterial(21, "Thaumium", 2, 2, 250, 600, 2, 1.3F, 1, 0f); + //Metallurgy TConstructRegistry.addToolMaterial(22, "Heptazion", 2, 2, 300, 800, 1, 1.0F, 0, 0f); TConstructRegistry.addToolMaterial(23, "Damascus Steel", 2, 3, 500, 600, 2, 1.35F, 1, 0f); @@ -476,19 +489,35 @@ public class TContent implements IFuelHandler lc.addCastingRecipe(new ItemStack(blankPattern, 1, 1), new LiquidStack(liquidMetalStill.blockID, 1, 8), 50); //Ingots - lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, 1, 0), ingotcast, 50); //Iron - lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, 1, 1), ingotcast, 50); //gold - lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, 1, 2), ingotcast, 50); //copper - lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, 1, 3), ingotcast, 50); //tin - lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, 1, 4), ingotcast, 50); //aluminum - lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, 1, 5), ingotcast, 50); //cobalt - lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, 1, 6), ingotcast, 50); //ardite - lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, 1, 7), ingotcast, 50); //bronze - lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, 1, 8), ingotcast, 50); //albrass - lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 9), ingotcast, 50); //manyullyn - lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, 1, 10), ingotcast, 50); //alumite + lc.addCastingRecipe(new ItemStack(Item.ingotIron), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 0), ingotcast, 75); //Iron + lc.addCastingRecipe(new ItemStack(Item.ingotGold), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 1), ingotcast, 75); //gold + lc.addCastingRecipe(new ItemStack(materials, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 2), ingotcast, 75); //copper + lc.addCastingRecipe(new ItemStack(materials, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 3), ingotcast, 75); //tin + lc.addCastingRecipe(new ItemStack(materials, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 4), ingotcast, 75); //aluminum + lc.addCastingRecipe(new ItemStack(materials, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 5), ingotcast, 75); //cobalt + lc.addCastingRecipe(new ItemStack(materials, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 6), ingotcast, 75); //ardite + lc.addCastingRecipe(new ItemStack(materials, 1, 13), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 7), ingotcast, 75); //bronze + lc.addCastingRecipe(new ItemStack(materials, 1, 14), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 8), ingotcast, 75); //albrass + lc.addCastingRecipe(new ItemStack(materials, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 9), ingotcast, 75); //manyullyn + lc.addCastingRecipe(new ItemStack(materials, 1, 15), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 10), ingotcast, 75); //alumite // obsidian - lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, 1, 12), ingotcast, 50); //steel + lc.addCastingRecipe(new ItemStack(materials, 1, 16), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 12), ingotcast, 75); //steel + + //Buckets + ItemStack bucket = new ItemStack(Item.bucketEmpty); + lc.addCastingRecipe(new ItemStack(buckets, 1, 0), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 0), bucket, 10); //Iron + lc.addCastingRecipe(new ItemStack(buckets, 1, 1), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 1), bucket, 10); //gold + lc.addCastingRecipe(new ItemStack(buckets, 1, 2), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 2), bucket, 10); //copper + lc.addCastingRecipe(new ItemStack(buckets, 1, 3), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 3), bucket, 10); //tin + lc.addCastingRecipe(new ItemStack(buckets, 1, 4), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 4), bucket, 10); //aluminum + lc.addCastingRecipe(new ItemStack(buckets, 1, 5), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 5), bucket, 10); //cobalt + lc.addCastingRecipe(new ItemStack(buckets, 1, 6), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 6), bucket, 10); //ardite + lc.addCastingRecipe(new ItemStack(buckets, 1, 7), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 7), bucket, 10); //bronze + lc.addCastingRecipe(new ItemStack(buckets, 1, 8), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 8), bucket, 10); //albrass + lc.addCastingRecipe(new ItemStack(buckets, 1, 9), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 9), bucket, 10); //manyullyn + lc.addCastingRecipe(new ItemStack(buckets, 1, 10), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 10), bucket, 10); //alumite + lc.addCastingRecipe(new ItemStack(buckets, 1, 11), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 11), bucket, 10);// obsidian + lc.addCastingRecipe(new ItemStack(buckets, 1, 12), new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, 12), bucket, 10); //steel liquids = new LiquidStack[] { new LiquidStack(liquidMetalStill.blockID, 1, 0), new LiquidStack(liquidMetalStill.blockID, 1, 2), new LiquidStack(liquidMetalStill.blockID, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 6), new LiquidStack(liquidMetalStill.blockID, 1, 9), new LiquidStack(liquidMetalStill.blockID, 1, 7), @@ -522,10 +551,10 @@ public class TContent implements IFuelHandler Smeltery.addMelting(Block.obsidian, 0, 800, new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue, 11)); //Alloys - Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 4, 7), new LiquidStack(liquidMetalStill.blockID, 3, 2), new LiquidStack(liquidMetalStill.blockID, 1, 3)); //Bronze - Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 4, 8), new LiquidStack(liquidMetalStill.blockID, 3, 4), new LiquidStack(liquidMetalStill.blockID, 1, 2)); //Aluminum Brass + Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 2, 7), new LiquidStack(liquidMetalStill.blockID, 3, 2), new LiquidStack(liquidMetalStill.blockID, 1, 3)); //Bronze + Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 2, 8), new LiquidStack(liquidMetalStill.blockID, 3, 4), new LiquidStack(liquidMetalStill.blockID, 1, 2)); //Aluminum Brass Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 2, 9), new LiquidStack(liquidMetalStill.blockID, 1, 5), new LiquidStack(liquidMetalStill.blockID, 1, 6)); //Manyullyn - Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 9, 10), new LiquidStack(liquidMetalStill.blockID, 5, 4), new LiquidStack(liquidMetalStill.blockID, 2, 0), new LiquidStack( + Smeltery.addAlloyMixing(new LiquidStack(liquidMetalStill.blockID, 3, 10), new LiquidStack(liquidMetalStill.blockID, 5, 4), new LiquidStack(liquidMetalStill.blockID, 2, 0), new LiquidStack( liquidMetalStill.blockID, 2, 11)); //Alumite } @@ -630,7 +659,7 @@ public class TContent implements IFuelHandler String[] liquidNames = new String[] { "Iron", "Gold", "Copper", "Tin", "Aluminum", "Cobalt", "Ardite", "Bronze", "Brass", "Manyullyn", "Alumite", "Obsidian", "Steel" }; for (int iter = 0; iter < liquidNames.length; iter++) { - LiquidStack liquidstack = new LiquidStack(liquidMetalStill.blockID, LiquidContainerRegistry.BUCKET_VOLUME, iter); + LiquidStack liquidstack = new LiquidStack(liquidMetalStill.blockID, TConstruct.ingotLiquidValue*9, iter); LiquidDictionary.getOrCreateLiquid("Molten " + liquidNames[iter], liquidstack); LiquidContainerRegistry.registerLiquid(new LiquidContainerData(liquidstack, new ItemStack(buckets, 1, iter), new ItemStack(Item.bucketEmpty))); } diff --git a/mods/tinker/tconstruct/TEventHandler.java b/mods/tinker/tconstruct/TEventHandler.java index 1fee9c52..c69915eb 100644 --- a/mods/tinker/tconstruct/TEventHandler.java +++ b/mods/tinker/tconstruct/TEventHandler.java @@ -248,7 +248,7 @@ public class TEventHandler if (meta != -1) { - evt.world.func_94571_i(hitX, hitY, hitZ); //Set air block + evt.world.setBlockToAir(hitX, hitY, hitZ); //Set air block evt.result = new ItemStack(TContent.buckets, 1, meta); evt.setResult(Result.ALLOW); } diff --git a/mods/tinker/tconstruct/blocks/EquipBlock.java b/mods/tinker/tconstruct/blocks/EquipBlock.java index 5c62e5f0..1e9aaeff 100644 --- a/mods/tinker/tconstruct/blocks/EquipBlock.java +++ b/mods/tinker/tconstruct/blocks/EquipBlock.java @@ -41,9 +41,9 @@ public class EquipBlock extends InventoryBlock } /*@SideOnly(Side.CLIENT) - public void func_94332_a (IconRegister par1IconRegister) + public void registerIcons (IconRegister par1IconRegister) { - this.field_94336_cN = par1IconRegister.func_94245_a(Block.blockSteel.getUnlocalizedName()); + this.blockIcon = par1iconRegister.registerIcon(Block.blockSteel.getUnlocalizedName()); }*/ @Override diff --git a/mods/tinker/tconstruct/blocks/LavaTankBlock.java b/mods/tinker/tconstruct/blocks/LavaTankBlock.java index 7d78cd79..4463d36a 100644 --- a/mods/tinker/tconstruct/blocks/LavaTankBlock.java +++ b/mods/tinker/tconstruct/blocks/LavaTankBlock.java @@ -4,7 +4,6 @@ import java.util.List; import mods.tinker.common.IServantLogic; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.TContent; import mods.tinker.tconstruct.client.TankRender; import mods.tinker.tconstruct.logic.LavaTankLogic; import net.minecraft.block.Block; @@ -13,17 +12,21 @@ import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import net.minecraftforge.common.ForgeDirection; +import net.minecraftforge.liquids.ILiquidTank; import net.minecraftforge.liquids.LiquidContainerRegistry; import net.minecraftforge.liquids.LiquidStack; public class LavaTankBlock extends BlockContainer { public Icon[] icons; + public LavaTankBlock(int id) { super(id, Material.rock); @@ -32,32 +35,24 @@ public class LavaTankBlock extends BlockContainer setUnlocalizedName("TConstruct.LavaTank"); setStepSound(Block.soundGlassFootstep); } - - public String[] getTextureNames() + + public String[] getTextureNames () { - String[] textureNames = { - "lavatank_side", - "lavatank_top", - "searedgague_top", - "searedgague_side", - "searedgague_bottom", - "searedwindow_top", - "searedwindow_side", - "searedwindow_bottom" }; - - return textureNames; + String[] textureNames = { "lavatank_side", "lavatank_top", "searedgague_top", "searedgague_side", "searedgague_bottom", "searedwindow_top", "searedwindow_side", "searedwindow_bottom" }; + + return textureNames; } - - public void func_94332_a(IconRegister iconRegister) - { + + public void registerIcons (IconRegister iconRegister) + { String[] textureNames = getTextureNames(); this.icons = new Icon[textureNames.length]; - for (int i = 0; i < this.icons.length; ++i) - { - this.icons[i] = iconRegister.func_94245_a("tinker:"+textureNames[i]); - } - } + for (int i = 0; i < this.icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:" + textureNames[i]); + } + } @Override public boolean isOpaqueCube () @@ -75,27 +70,26 @@ public class LavaTankBlock extends BlockContainer public boolean shouldSideBeRendered (IBlockAccess world, int x, int y, int z, int side) { //if (side == 0 && world.getBlockMetadata(x, y, z) == 0) - //return super.shouldSideBeRendered(world, x, y, z, side); - int bID = world.getBlockId(x, y, z); - return bID == this.blockID ? false : super.shouldSideBeRendered(world, x, y, z, side); + //return super.shouldSideBeRendered(world, x, y, z, side); + int bID = world.getBlockId(x, y, z); + return bID == this.blockID ? false : super.shouldSideBeRendered(world, x, y, z, side); //return true; } - + @Override - public int getLightValue(IBlockAccess world, int x, int y, int z) - { + public int getLightValue (IBlockAccess world, int x, int y, int z) + { TileEntity logic = world.getBlockTileEntity(x, y, z); if (logic != null && logic instanceof LavaTankLogic) return ((LavaTankLogic) logic).getBrightness(); return 0; - } - + } + /*@Override public int getRenderBlockPass() - { + { return 1; - }*/ - + }*/ @Override public int getRenderType () @@ -118,10 +112,10 @@ public class LavaTankBlock extends BlockContainer } else { - return icons[meta*3+getTextureIndex(side)-1]; + return icons[meta * 3 + getTextureIndex(side) - 1]; } } - + public int getTextureIndex (int side) { if (side == 0) @@ -141,21 +135,75 @@ public class LavaTankBlock extends BlockContainer @Override public boolean onBlockActivated (World world, int x, int y, int z, EntityPlayer player, int side, float clickX, float clickY, float clickZ) { - LiquidStack liquid = LiquidContainerRegistry.getLiquidForFilledItem(player.getCurrentEquippedItem()); - if (liquid != null) + ItemStack heldItem = player.inventory.getCurrentItem(); + if (heldItem != null) { + LiquidStack liquid = LiquidContainerRegistry.getLiquidForFilledItem(player.getCurrentEquippedItem()); LavaTankLogic logic = (LavaTankLogic) world.getBlockTileEntity(x, y, z); - int amount = logic.fill(0, liquid, true); - if (amount > 0) - return true; + if (liquid != null) + { + int amount = logic.fill(0, liquid, false); + if (amount == liquid.amount) + { + logic.fill(ForgeDirection.UNKNOWN, liquid, true); + if (!player.capabilities.isCreativeMode) + player.inventory.setInventorySlotContents(player.inventory.currentItem, consumeItem(heldItem)); + return true; + } + else + return false; + } + else if (LiquidContainerRegistry.isBucket(heldItem)) + { + ILiquidTank[] tanks = logic.getTanks(ForgeDirection.UNKNOWN); + LiquidStack fillLiquid = tanks[0].getLiquid(); + ItemStack fillStack = LiquidContainerRegistry.fillLiquidContainer(fillLiquid, heldItem); + if (fillStack != null) + { + logic.drain(ForgeDirection.UNKNOWN, LiquidContainerRegistry.getLiquidForFilledItem(fillStack).amount, true); + if (!player.capabilities.isCreativeMode) + { + if (heldItem.stackSize == 1) + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, fillStack); + } + else + { + player.inventory.setInventorySlotContents(player.inventory.currentItem, consumeItem(heldItem)); + + if (!player.inventory.addItemStackToInventory(fillStack)) + { + player.dropPlayerItem(fillStack); + } + } + } + return true; + } + else + { + return false; + } + } + } + + return false; + } + + public static ItemStack consumeItem (ItemStack stack) + { + if (stack.stackSize == 1) + { + if (stack.getItem().hasContainerItem()) + return stack.getItem().getContainerItemStack(stack); else - return false; + return null; } else { + stack.splitStack(1); + return stack; } - return false; } @Override @@ -172,15 +220,15 @@ public class LavaTankBlock extends BlockContainer list.add(new ItemStack(id, 1, iter)); } } - + /* Data */ public int damageDropped (int meta) { return meta; } - + /* Updates */ - public void onNeighborBlockChange(World world, int x, int y, int z, int nBlockID) + public void onNeighborBlockChange (World world, int x, int y, int z, int nBlockID) { TileEntity logic = world.getBlockTileEntity(x, y, z); if (logic instanceof IServantLogic) diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalBase.java b/mods/tinker/tconstruct/blocks/LiquidMetalBase.java index 5c2d8d2d..67d62fca 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalBase.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalBase.java @@ -27,19 +27,19 @@ public abstract class LiquidMetalBase extends Block protected LiquidMetalBase(int par1, Material par2Material) { super(par1, par2Material); - textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "steel" }; + textureNames = new String[] { "iron", "gold", "copper", "tin", "aluminum", "cobalt", "ardite", "bronze", "alubrass", "manyullyn", "alumite", "obsidian", "steel" }; setLightValue(0.625F); } - public void func_94332_a (IconRegister iconRegister) + public void registerIcons (IconRegister iconRegister) { this.stillInoms = new Icon[textureNames.length]; this.flowInoms = new Icon[textureNames.length]; for (int i = 0; i < this.stillInoms.length; ++i) { - this.stillInoms[i] = iconRegister.func_94245_a("tinker:liquid_" + textureNames[i]); - this.flowInoms[i] = iconRegister.func_94245_a("tinker:liquid_" + textureNames[i] + "_flow"); + this.stillInoms[i] = iconRegister.registerIcon("tinker:liquid_" + textureNames[i]); + this.flowInoms[i] = iconRegister.registerIcon("tinker:liquid_" + textureNames[i] + "_flow"); } } @@ -623,11 +623,11 @@ public abstract class LiquidMetalBase extends Block if (var6 == 0) { - par1World.func_94575_c(par2, par3, par4, Block.obsidian.blockID); + par1World.setBlock(par2, par3, par4, Block.obsidian.blockID); } else if (var6 <= 4) { - par1World.func_94575_c(par2, par3, par4, Block.cobblestone.blockID); + par1World.setBlock(par2, par3, par4, Block.cobblestone.blockID); } this.triggerLavaMixEffects(par1World, par2, par3, par4); diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java b/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java index 72d86789..ff50fbdb 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalFlowing.java @@ -33,7 +33,7 @@ public class LiquidMetalFlowing extends LiquidMetalBase //System.out.println("x: "+x+", y: "+y+", z: "+z); int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); int meta = world.getBlockMetadata(x, y, z); - world.setBlockAndMetadataWithNotify(x, y, z, stillLiquidId(), meta, 3); + world.setBlock(x, y, z, stillLiquidId(), meta, 3); world.markBlockRangeForRenderUpdate(x, y, z, x, y, z); world.markBlockForUpdate(x, y, z); ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); @@ -76,7 +76,7 @@ public class LiquidMetalFlowing extends LiquidMetalBase flow = j1; if (flow < 0) { - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); } else { @@ -98,11 +98,11 @@ public class LiquidMetalFlowing extends LiquidMetalBase { if (flow >= 8) { - world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, flow, 3); + world.setBlock(x, y - 1, z, blockID, flow, 3); } else { - world.setBlockAndMetadataWithNotify(x, y - 1, z, blockID, flow + 8, 3); + world.setBlock(x, y - 1, z, blockID, flow + 8, 3); } ((LiquidTextureLogic) world.getBlockTileEntity(x, y - 1, z)).setLiquidType(tex); } @@ -144,7 +144,7 @@ public class LiquidMetalFlowing extends LiquidMetalBase { Block.blocksList[bID].dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0); } - world.setBlockAndMetadataWithNotify(x, y, z, blockID, meta, 3); + world.setBlock(x, y, z, blockID, meta, 3); ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); } diff --git a/mods/tinker/tconstruct/blocks/LiquidMetalStill.java b/mods/tinker/tconstruct/blocks/LiquidMetalStill.java index 78dbea31..4c8c50a6 100644 --- a/mods/tinker/tconstruct/blocks/LiquidMetalStill.java +++ b/mods/tinker/tconstruct/blocks/LiquidMetalStill.java @@ -59,7 +59,7 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid { if (this.isFlammable(par1World, par2 - 1, par3, par4) || this.isFlammable(par1World, par2 + 1, par3, par4) || this.isFlammable(par1World, par2, par3, par4 - 1) || this.isFlammable(par1World, par2, par3, par4 + 1) || this.isFlammable(par1World, par2, par3 - 1, par4) || this.isFlammable(par1World, par2, par3 + 1, par4)) { - par1World.func_94575_c(par2, par3, par4, Block.fire.blockID); + par1World.setBlock(par2, par3, par4, Block.fire.blockID); return; } } @@ -81,7 +81,7 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid if (par1World.isAirBlock(par2, par3 + 1, par4) && this.isFlammable(par1World, par2, par3, par4)) { - par1World.func_94575_c(par2, par3 + 1, par4, Block.fire.blockID); + par1World.setBlock(par2, par3 + 1, par4, Block.fire.blockID); } } } @@ -175,7 +175,7 @@ public class LiquidMetalStill extends LiquidMetalBase implements ILiquid int meta = world.getBlockMetadata(x, y, z); int tex = ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).getLiquidType(); - world.setBlockAndMetadataWithNotify(x, y, z, this.blockID - 1, meta, 2); + world.setBlock(x, y, z, this.blockID - 1, meta, 2); world.scheduleBlockUpdate(x, y, z, this.blockID - 1, this.tickRate(world)); ((LiquidTextureLogic) world.getBlockTileEntity(x, y, z)).setLiquidType(tex); /*int meta = world.getBlockMetadata(x, y, z); diff --git a/mods/tinker/tconstruct/blocks/TConstructBlock.java b/mods/tinker/tconstruct/blocks/TConstructBlock.java index 747b2640..f4287ea4 100644 --- a/mods/tinker/tconstruct/blocks/TConstructBlock.java +++ b/mods/tinker/tconstruct/blocks/TConstructBlock.java @@ -28,13 +28,13 @@ public class TConstructBlock extends Block return meta; } - public void func_94332_a(IconRegister iconRegister) + public void registerIcons(IconRegister iconRegister) { this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.func_94245_a("tinker:"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]); } } diff --git a/mods/tinker/tconstruct/client/BreakingFX.java b/mods/tinker/tconstruct/client/BreakingFX.java new file mode 100644 index 00000000..1ee40bc4 --- /dev/null +++ b/mods/tinker/tconstruct/client/BreakingFX.java @@ -0,0 +1,67 @@ +package mods.tinker.tconstruct.client; + +import net.minecraft.block.Block; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.renderer.RenderEngine; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.item.Item; +import net.minecraft.util.Icon; +import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class BreakingFX extends EntityFX +{ + public BreakingFX(World par1World, double par2, double par4, double par6, Item par8Item, RenderEngine par9RenderEngine) + { + super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D); + this.func_94052_a(par9RenderEngine, par8Item.getIconFromDamage(0)); + this.particleRed = this.particleGreen = this.particleBlue = 1.0F; + this.particleGravity = Block.blockSnow.blockParticleGravity; + this.particleScale /= 2.0F; + } + + public BreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item, RenderEngine par15RenderEngine) + { + this(par1World, par2, par4, par6, par14Item, par15RenderEngine); + this.motionX *= 0.10000000149011612D; + this.motionY *= 0.10000000149011612D; + this.motionZ *= 0.10000000149011612D; + this.motionX += par8; + this.motionY += par10; + this.motionZ += par12; + } + + public int getFXLayer() + { + return 2; + } + + public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7) + { + float f6 = ((float)this.particleTextureIndexX + this.particleTextureJitterX / 4.0F) / 16.0F; + float f7 = f6 + 0.015609375F; + float f8 = ((float)this.particleTextureIndexY + this.particleTextureJitterY / 4.0F) / 16.0F; + float f9 = f8 + 0.015609375F; + float f10 = 0.1F * this.particleScale; + + if (this.particleTextureIndex != null) + { + f6 = this.particleTextureIndex.getInterpolatedU((double)(this.particleTextureJitterX / 4.0F * 16.0F)); + f7 = this.particleTextureIndex.getInterpolatedU((double)((this.particleTextureJitterX + 1.0F) / 4.0F * 16.0F)); + f8 = this.particleTextureIndex.getInterpolatedV((double)(this.particleTextureJitterY / 4.0F * 16.0F)); + f9 = this.particleTextureIndex.getInterpolatedV((double)((this.particleTextureJitterY + 1.0F) / 4.0F * 16.0F)); + } + + float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX); + float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY); + float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ); + float f14 = 1.0F; + par1Tessellator.setColorOpaque_F(f14 * this.particleRed, f14 * this.particleGreen, f14 * this.particleBlue); + par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f6, (double)f9); + par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f6, (double)f8); + par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f7, (double)f8); + par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f7, (double)f9); + } +} diff --git a/mods/tinker/tconstruct/client/CastingTableSpecialRenderer.java b/mods/tinker/tconstruct/client/CastingTableSpecialRenderer.java index c8deee52..7d45bf29 100644 --- a/mods/tinker/tconstruct/client/CastingTableSpecialRenderer.java +++ b/mods/tinker/tconstruct/client/CastingTableSpecialRenderer.java @@ -56,18 +56,18 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer entityitem.getEntityItem().stackSize = 1; entityitem.hoverStart = 0.0F; GL11.glPushMatrix(); - GL11.glTranslatef(1F, 1.478F, 0.55F); + GL11.glTranslatef(1F, 1.565F, 0.55F); GL11.glRotatef(90F, 1, 0F, 0F); GL11.glScalef(2F, 2F, 2F); if (stack.getItem() instanceof ItemBlock) { GL11.glRotatef(90F, -1, 0F, 0F); - GL11.glTranslatef(0F, -0.1F, 0.2275F); + GL11.glTranslatef(0F, -10.1F, 0.2275F); } - RenderItem.field_82407_g = true; + RenderItem.renderInFrame = true; RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F); - RenderItem.field_82407_g = false; + RenderItem.renderInFrame = false; GL11.glPopMatrix(); } diff --git a/mods/tinker/tconstruct/client/FluidRender.java b/mods/tinker/tconstruct/client/FluidRender.java index 7fb70804..22982ecf 100644 --- a/mods/tinker/tconstruct/client/FluidRender.java +++ b/mods/tinker/tconstruct/client/FluidRender.java @@ -98,11 +98,11 @@ public class FluidRender implements ISimpleBlockRenderingHandler if (f8 < -999.0F) { - d8 = (double) icon.func_94214_a(0.0D); - d12 = (double) icon.func_94207_b(0.0D); + d8 = (double) icon.getInterpolatedU(0.0D); + d12 = (double) icon.getInterpolatedV(0.0D); d7 = d8; - d11 = (double) icon.func_94207_b(16.0D); - d10 = (double) icon.func_94214_a(16.0D); + d11 = (double) icon.getInterpolatedV(16.0D); + d10 = (double) icon.getInterpolatedU(16.0D); d14 = d11; d9 = d10; d13 = d12; @@ -111,14 +111,14 @@ public class FluidRender implements ISimpleBlockRenderingHandler { f7 = MathHelper.sin(f8) * 0.25F; float f9 = MathHelper.cos(f8) * 0.25F; - d8 = (double) icon.func_94214_a((double) (8.0F + (-f9 - f7) * 16.0F)); - d12 = (double) icon.func_94207_b((double) (8.0F + (-f9 + f7) * 16.0F)); - d7 = (double) icon.func_94214_a((double) (8.0F + (-f9 + f7) * 16.0F)); - d11 = (double) icon.func_94207_b((double) (8.0F + (f9 + f7) * 16.0F)); - d10 = (double) icon.func_94214_a((double) (8.0F + (f9 + f7) * 16.0F)); - d14 = (double) icon.func_94207_b((double) (8.0F + (f9 - f7) * 16.0F)); - d9 = (double) icon.func_94214_a((double) (8.0F + (f9 - f7) * 16.0F)); - d13 = (double) icon.func_94207_b((double) (8.0F + (-f9 - f7) * 16.0F)); + d8 = (double) icon.getInterpolatedU((double) (8.0F + (-f9 - f7) * 16.0F)); + d12 = (double) icon.getInterpolatedV((double) (8.0F + (-f9 + f7) * 16.0F)); + d7 = (double) icon.getInterpolatedU((double) (8.0F + (-f9 + f7) * 16.0F)); + d11 = (double) icon.getInterpolatedV((double) (8.0F + (f9 + f7) * 16.0F)); + d10 = (double) icon.getInterpolatedU((double) (8.0F + (f9 + f7) * 16.0F)); + d14 = (double) icon.getInterpolatedV((double) (8.0F + (f9 - f7) * 16.0F)); + d9 = (double) icon.getInterpolatedU((double) (8.0F + (f9 - f7) * 16.0F)); + d13 = (double) icon.getInterpolatedV((double) (8.0F + (-f9 - f7) * 16.0F)); } tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z)); @@ -213,12 +213,11 @@ public class FluidRender implements ISimpleBlockRenderingHandler } flag2 = true; - float f11 = icon1.func_94214_a(0.0D); - f7 = icon1.func_94214_a(8.0D); - int i2 = icon1.func_94216_b(); - float f12 = icon1.func_94207_b((1.0D - d15) * 16.0D * 0.5D); - float f13 = icon1.func_94207_b((1.0D - d17) * 16.0D * 0.5D); - float f14 = icon1.func_94207_b(8.0D); + float f11 = icon1.getInterpolatedU(0.0D); + f7 = icon1.getInterpolatedU(8.0D); + float f12 = icon1.getInterpolatedV((1.0D - d15) * 16.0D * 0.5D); + float f13 = icon1.getInterpolatedV((1.0D - d17) * 16.0D * 0.5D); + float f14 = icon1.getInterpolatedV(8.0D); tessellator.setBrightness(block.getMixedBrightnessForBlock(world, xPos, y, zPos)); float f15 = 1.0F; diff --git a/mods/tinker/tconstruct/client/SuperCustomToolRenderer.java b/mods/tinker/tconstruct/client/SuperCustomToolRenderer.java index 9a579fc2..3757051d 100644 --- a/mods/tinker/tconstruct/client/SuperCustomToolRenderer.java +++ b/mods/tinker/tconstruct/client/SuperCustomToolRenderer.java @@ -75,7 +75,7 @@ public class SuperCustomToolRenderer implements IItemRenderer for (int renderPass = 0; renderPass < tool.getRenderPasses(itemDamage); renderPass++) { String texturePath = tool.getIconLocation(stack, renderPass); - renderEngine.func_98187_b(texturePath); + renderEngine.bindTexture(texturePath); GL11.glScalef(0.0625F, 0.0625F, 1F); this.renderTexturedQuad(); @@ -85,7 +85,7 @@ public class SuperCustomToolRenderer implements IItemRenderer for (int renderPass = 0; renderPass < 3; renderPass++) { String texturePath = tool.getEffectLocation(stack, renderPass); - renderEngine.func_98187_b(texturePath); + renderEngine.bindTexture(texturePath); GL11.glScalef(0.0625F, 0.0625F, 1F); this.renderTexturedQuad(); @@ -145,7 +145,7 @@ public class SuperCustomToolRenderer implements IItemRenderer texturePath = ((ToolCore)stack.getItem()).getIconLocation(stack, renderPass); else texturePath = ((ToolCore)stack.getItem()).getEffectLocation(stack, renderPass); - renderEngine.func_98187_b(texturePath); + renderEngine.bindTexture(texturePath); float var7 = 0; float var8 = 1; float var9 = 0; @@ -317,7 +317,7 @@ public class SuperCustomToolRenderer implements IItemRenderer var17 = 1.0F; String texturePath = tool.getIconLocation(var10, renderPass); - renderEngine.func_98187_b(texturePath); + renderEngine.bindTexture(texturePath); int var18 = Item.itemsList[tool.itemID].getColorFromItemStack(var10, renderPass); var19 = (float) (var18 >> 16 & 255) / 255.0F; @@ -333,7 +333,7 @@ public class SuperCustomToolRenderer implements IItemRenderer var17 = 1.0F; String texturePath = tool.getEffectLocation(var10, renderPass); - renderEngine.func_98187_b(texturePath); + renderEngine.bindTexture(texturePath); int var18 = Item.itemsList[tool.itemID].getColorFromItemStack(var10, renderPass); var19 = (float) (var18 >> 16 & 255) / 255.0F; @@ -427,7 +427,7 @@ public class SuperCustomToolRenderer implements IItemRenderer texturePath = ((ToolCore)stack.getItem()).getIconLocation(stack, renderPass); else texturePath = ((ToolCore)stack.getItem()).getEffectLocation(stack, renderPass); - renderEngine.func_98187_b(texturePath); + renderEngine.bindTexture(texturePath); GL11.glColor4f(par5, par6, par7, 1.0F); ItemRenderer.renderItemIn2D(var8, var10, var11, var9, var12, var16); diff --git a/mods/tinker/tconstruct/client/TProxyClient.java b/mods/tinker/tconstruct/client/TProxyClient.java index 56567e69..3e3c799e 100644 --- a/mods/tinker/tconstruct/client/TProxyClient.java +++ b/mods/tinker/tconstruct/client/TProxyClient.java @@ -16,10 +16,11 @@ import mods.tinker.tconstruct.TProxyCommon; import mods.tinker.tconstruct.client.entityrender.CartRender; import mods.tinker.tconstruct.client.entityrender.CrystalRender; import mods.tinker.tconstruct.client.entityrender.SkylaRender; +import mods.tinker.tconstruct.client.entityrender.SlimeRender; import mods.tinker.tconstruct.client.gui.ToolGuiElement; import mods.tinker.tconstruct.entity.CartEntity; import mods.tinker.tconstruct.entity.Crystal; -import mods.tinker.tconstruct.entity.EdibleSlime; +import mods.tinker.tconstruct.entity.BlueSlime; import mods.tinker.tconstruct.entity.Skyla; import mods.tinker.tconstruct.entity.UnstableCreeper; import mods.tinker.tconstruct.logic.CastingTableLogic; @@ -53,7 +54,6 @@ import net.minecraft.client.particle.EntitySpellParticleFX; import net.minecraft.client.particle.EntitySplashFX; import net.minecraft.client.particle.EntitySuspendFX; import net.minecraft.client.renderer.entity.RenderCreeper; -import net.minecraft.client.renderer.entity.RenderSlime; import net.minecraft.client.settings.GameSettings; import net.minecraft.client.settings.KeyBinding; import net.minecraft.item.Item; @@ -74,6 +74,7 @@ public class TProxyClient extends TProxyCommon { public static SmallFontRenderer smallFontRenderer; public static Icon blankSprite; + public static Icon metalBall; public static Minecraft mc; /* Registers any rendering code. */ @@ -105,7 +106,7 @@ public class TProxyClient extends TProxyCommon RenderingRegistry.registerEntityRenderingHandler(FancyEntityItem.class, new FancyItemRender()); RenderingRegistry.registerEntityRenderingHandler(Crystal.class, new CrystalRender()); RenderingRegistry.registerEntityRenderingHandler(UnstableCreeper.class, new RenderCreeper()); - RenderingRegistry.registerEntityRenderingHandler(EdibleSlime.class, new RenderSlime(new ModelSlime(16), new ModelSlime(0), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F)); //RenderingRegistry.registerEntityRenderingHandler(net.minecraft.entity.player.EntityPlayer.class, new PlayerArmorRender()); // <-- Works, woo! addRenderMappings(); @@ -187,21 +188,28 @@ public class TProxyClient extends TProxyCommon addToolButtons(); } - public static final String[] shardNames = new String[] { "Wood", "Stone Shard", "Iron Chunk", "Flint Shard", "Cactus Shard", "Bone", "Obsidian Shard", "Netherrack Shard", "Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk", "Alumite Chunk", "Steel Chunk" }; + public static final String[] shardNames = new String[] { "Wood", "Stone Shard", "Iron Chunk", "Flint Shard", "Cactus Shard", "Bone", "Obsidian Shard", "Netherrack Shard", + "Slime Crystal Fragment", "Paper", "Cobalt Chunk", "Ardite Chunk", "Manyullyn Chunk", "Copper Chunk", "Bronze Chunk", "Alumite Chunk", "Steel Chunk" }; - public static final String[] materialItemInternalNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", "NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot" }; + public static final String[] materialItemInternalNames = new String[] { "PaperStack", "SlimeCrystal", "SearedBrick", "CobaltIngot", "ArditeIngot", "ManyullynIngot", "Mossball", "LavaCrystal", + "NecroticBone", "CopperIngot", "TinIngot", "AluminumIngot", "RawAluminum", "BronzeIngot", "AlBrassIngot", "AlumiteIngot", "SteelIngot" }; - public static final String[] materialItemNames = new String[] { "Paper Stack", "Slime Crystal", "Seared Brick", "Cobalt Ingot", "Ardite Ingot", "Manyullyn Ingot", "Ball of Moss", "Lava Crystal", "Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot" }; + public static final String[] materialItemNames = new String[] { "Paper Stack", "Slime Crystal", "Seared Brick", "Cobalt Ingot", "Ardite Ingot", "Manyullyn Ingot", "Ball of Moss", "Lava Crystal", + "Necrotic Bone", "Copper Ingot", "Tin Ingot", "Aluminum Ingot", "Raw Aluminum", "Bronze Ingot", "Aluminum Brass Ingot", "Alumite Ingot", "Steel Ingot" }; - public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn", "Copper", "Bronze", "Alumite", "Steel" }; + public static final String[] toolMaterialNames = new String[] { "Wood", "Stone", "Iron", "Flint", "Cactus", "Bone", "Obsidian", "Netherrack", "Slime", "Paper", "Cobalt", "Ardite", "Manyullyn", + "Copper", "Bronze", "Alumite", "Steel" }; - public static final String[] materialTypes = new String[] { "ToolRod", "PickaxeHead", "ShovelHead", "AxeHead", "SwordBlade", "LargeGuard", "MediumGuard", "Crossbar", "Binding", "FrypanHead", "SignHead", "LumberHead" }; + public static final String[] materialTypes = new String[] { "ToolRod", "PickaxeHead", "ShovelHead", "AxeHead", "SwordBlade", "LargeGuard", "MediumGuard", "Crossbar", "Binding", "FrypanHead", + "SignHead", "LumberHead" }; - public static final String[] materialNames = new String[] { " Rod", " Pickaxe Head", " Shovel Head", " Axe Head", " Sword Blade", " Wide Guard", " Hand Guard", " Crossbar", " Binding", " Pan", " Board", " Broad Axe Head" }; + public static final String[] materialNames = new String[] { " Rod", " Pickaxe Head", " Shovel Head", " Axe Head", " Sword Blade", " Wide Guard", " Hand Guard", " Crossbar", " Binding", " Pan", + " Board", " Broad Axe Head" }; public static final String[] patterns = new String[] { "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign" }; - public static final String[] patternNames = new String[] { "Ingot", "Tool Rod", "Pickaxe Head", "Shovel Head", "Axe Head", "Sword Blade", "Wide Guard", "Hand Guard", "Crossbar", "Tool Binding", "Pan", "Board", "Broad Axe Head" }; + public static final String[] patternNames = new String[] { "Ingot", "Tool Rod", "Pickaxe Head", "Shovel Head", "Axe Head", "Sword Blade", "Wide Guard", "Hand Guard", "Crossbar", "Tool Binding", + "Pan", "Board", "Broad Axe Head" }; public static Document diary; public static Document volume1; @@ -282,14 +290,17 @@ public class TProxyClient extends TProxyCommon //"Ice Axe", "Mattock", "Broadsword", "Longsword", "Rapier", "Frying Pan", "Battlesign" }; - static String[] toolDescriptions = { "The main way to repair or change your tools. Place a tool and a material on the left to get started.", + static String[] toolDescriptions = { + "The main way to repair or change your tools. Place a tool and a material on the left to get started.", "The Pickaxe is a basic mining tool. It is effective on stone and ores.\n\nRequired parts:\n- Pickaxe Head\n- Tool Binding\n- Handle", "The Shovel is a basic digging tool. It is effective on dirt, sand, and snow.\n\nRequired parts:\n- Shovel Head\n- Handle", "The Axe is a basic chopping tool. It is effective on wood and leaves.\n\nRequired parts:\n- Axe Head\n- Handle", //"The Lumber Axe is a broad chopping tool. It harvests wood in a wide range and can fell entire trees.\n\nRequired parts:\n- Broad Axe Head\n- Handle", //"The Ice Axe is a tool for harvesting ice, mining, and attacking foes.\n\nSpecial Ability:\n- Wall Climb\nNatural Ability:\n- Ice Harvest\nDamage: Moderate\n\nRequired parts:\n- Pickaxe Head\n- Spike\n- Handle", - "The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle", "The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle", - "The Longsword is a balanced weapon. It is useful for knocking enemies away or getting in and out of battle quickly.\n\nNatural Ability:\n- Charge Boost\nDamage: Moderate\nDurability: Moderate\n\nRequired parts:\n- Sword Blade\n- Hand Guard\n- Handle", "The Rapier is an offensive weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nDamage: High\nDurability: Low\n\nRequired parts:\n- Sword Blade\n- Crossbar\n- Handle", + "The Cutter Mattock is a versatile farming tool. It is effective on wood, dirt, and plants.\n\nSpecial Ability: Hoe\n\nRequired parts:\n- Axe Head\n- Shovel Head\n- Handle", + "The Broadsword is a defensive weapon. Blocking cuts damage in half.\n\nSpecial Ability: Block\nDamage: Moderate\nDurability: High\n\nRequired parts:\n- Sword Blade\n- Wide Guard\n- Handle", + "The Longsword is a balanced weapon. It is useful for knocking enemies away or getting in and out of battle quickly.\n\nNatural Ability:\n- Charge Boost\nDamage: Moderate\nDurability: Moderate\n\nRequired parts:\n- Sword Blade\n- Hand Guard\n- Handle", + "The Rapier is an offensive weapon that relies on quick strikes to defeat foes.\n\nNatural Abilities:\n- Armor Pierce\n- Quick Strike\n- Charge Boost\nDamage: High\nDurability: Low\n\nRequired parts:\n- Sword Blade\n- Crossbar\n- Handle", "The Frying is a heavy weapon that uses sheer weight to stun foes.\n\nSpecial Ability: Block\nNatural Ability: Bash\nShift+rClick: Place Frying Pan\nDamage: Low\nDurability: High\n\nRequired parts:\n- Pan\n- Handle", //"The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nShift-rClick: Place sign\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Board\n- Handle" "The Battlesign is an advance in weapon technology worthy of Zombie Pigmen everywhere.\n\nSpecial Ability: Block\nDamage: Low\nDurability: Average\n\nRequired parts:\n- Sign Board\n- Handle" }; @@ -364,18 +375,18 @@ public class TProxyClient extends TProxyCommon settings.keyBindings = allKeys; settings.loadOptions(); } - - public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) + + public void spawnParticle (String particle, double xPos, double yPos, double zPos, double velX, double velY, double velZ) { this.doSpawnParticle(particle, xPos, yPos, zPos, velX, velY, velZ); } - - public EntityFX doSpawnParticle(String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) - { + + public EntityFX doSpawnParticle (String par1Str, double par2, double par4, double par6, double par8, double par10, double par12) + { if (this.mc == null) this.mc = Minecraft.getMinecraft(); - - if ( this.mc.renderViewEntity != null && this.mc.effectRenderer != null) + + if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null) { int i = this.mc.gameSettings.particleSetting; @@ -440,12 +451,6 @@ public class TProxyClient extends TProxyCommon { entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12); } - else if (par1Str.equals("magicCrit")) - { - entityfx = new EntityCritFX(mc.theWorld, par2, par4, par6, par8, par10, par12); - ((EntityFX)entityfx).setRBGColorF(((EntityFX)entityfx).getRedColorF() * 0.3F, ((EntityFX)entityfx).getGreenColorF() * 0.8F, ((EntityFX)entityfx).getBlueColorF()); - ((EntityFX)entityfx).func_94053_h(); - } else if (par1Str.equals("smoke")) { entityfx = new EntitySmokeFX(mc.theWorld, par2, par4, par6, par8, par10, par12); @@ -537,9 +542,9 @@ public class TProxyClient extends TProxyCommon { entityfx = new EntitySnowShovelFX(mc.theWorld, par2, par4, par6, par8, par10, par12); } - else if (par1Str.equals("slime")) + else if (par1Str.equals("blueslime")) { - entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.appleGold, mc.renderEngine); + entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, TContent.strangeFood, mc.renderEngine); } else if (par1Str.equals("heart")) { @@ -583,5 +588,48 @@ public class TProxyClient extends TProxyCommon { return null; } - } + /*if (this.mc.renderViewEntity != null && this.mc.effectRenderer != null) + { + int i = this.mc.gameSettings.particleSetting; + + if (i == 1 && mc.theWorld.rand.nextInt(3) == 0) + { + i = 2; + } + + double d6 = this.mc.renderViewEntity.posX - par2; + double d7 = this.mc.renderViewEntity.posY - par4; + double d8 = this.mc.renderViewEntity.posZ - par6; + EntityFX entityfx = null; + double d9 = 16.0D; + + if (d6 * d6 + d7 * d7 + d8 * d8 > d9 * d9) + { + return null; + } + else if (i > 1) + { + return null; + } + else + { + if (par1Str.equals("blueslime")) + { + entityfx = new EntityBreakingFX(mc.theWorld, par2, par4, par6, Item.appleGold, mc.renderEngine);RenderGlobal + } + + else if (par1Str.equals("metalslime")) + { + entityfx = new BreakingFX(mc.theWorld, par2, par4, par6, metalBall, mc.renderEngine); + } + + return (EntityFX) entityfx; + + } + } + else + { + return null; + }*/ + } } diff --git a/mods/tinker/tconstruct/client/TableRender.java b/mods/tinker/tconstruct/client/TableRender.java index 7a6b953c..2f92e956 100644 --- a/mods/tinker/tconstruct/client/TableRender.java +++ b/mods/tinker/tconstruct/client/TableRender.java @@ -42,6 +42,7 @@ public class TableRender implements ISimpleBlockRenderingHandler @Override public boolean renderWorldBlock (IBlockAccess world, int x, int y, int z, Block block, int modelID, RenderBlocks renderer) { + System.out.println("Rendering Table Block"); if (modelID == tabelModelID) { int metadata = world.getBlockMetadata(x, y, z); diff --git a/mods/tinker/tconstruct/client/entityrender/SlimeModel.java b/mods/tinker/tconstruct/client/entityrender/SlimeModel.java new file mode 100644 index 00000000..920c24af --- /dev/null +++ b/mods/tinker/tconstruct/client/entityrender/SlimeModel.java @@ -0,0 +1,57 @@ +package mods.tinker.tconstruct.client.entityrender; + +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class SlimeModel extends ModelBase +{ + /** The slime's bodies, both the inside box and the outside box */ + ModelRenderer slimeBodies; + + /** The slime's right eye */ + ModelRenderer slimeRightEye; + + /** The slime's left eye */ + ModelRenderer slimeLeftEye; + + /** The slime's mouth */ + ModelRenderer slimeMouth; + + public SlimeModel(int par1) + { + this.slimeBodies = new ModelRenderer(this, 0, par1); + this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); + + if (par1 > 0) + { + this.slimeBodies = new ModelRenderer(this, 0, par1); + this.slimeBodies.addBox(-3.0F, 17.0F, -3.0F, 6, 6, 6); + this.slimeRightEye = new ModelRenderer(this, 32, 0); + this.slimeRightEye.addBox(-3.25F, 18.0F, -3.5F, 2, 2, 2); + this.slimeLeftEye = new ModelRenderer(this, 32, 4); + this.slimeLeftEye.addBox(1.25F, 18.0F, -3.5F, 2, 2, 2); + this.slimeMouth = new ModelRenderer(this, 32, 8); + this.slimeMouth.addBox(0.0F, 21.0F, -3.5F, 1, 1, 1); + } + } + + /** + * Sets the models various rotation angles then renders the model. + */ + public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) + { + this.setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity); + this.slimeBodies.render(par7); + + if (this.slimeRightEye != null) + { + this.slimeRightEye.render(par7); + this.slimeLeftEye.render(par7); + this.slimeMouth.render(par7); + } + } +} diff --git a/mods/tinker/tconstruct/client/entityrender/SlimeRender.java b/mods/tinker/tconstruct/client/entityrender/SlimeRender.java new file mode 100644 index 00000000..ebaf36e0 --- /dev/null +++ b/mods/tinker/tconstruct/client/entityrender/SlimeRender.java @@ -0,0 +1,80 @@ +package mods.tinker.tconstruct.client.entityrender; + +import mods.tinker.tconstruct.entity.BlueSlime; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.renderer.entity.RenderLiving; +import net.minecraft.entity.EntityLiving; + +import org.lwjgl.opengl.GL11; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +@SideOnly(Side.CLIENT) +public class SlimeRender extends RenderLiving +{ + private ModelBase scaleAmount; + + public SlimeRender(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) + { + super(par1ModelBase, par3); + this.scaleAmount = par2ModelBase; + } + + /** + * Determines whether Slime Render should pass or not. + */ + protected int shouldSlimeRenderPass(BlueSlime par1EdibleSlime, int par2, float par3) + { + if (par1EdibleSlime.getHasActivePotion()) + { + return 0; + } + else if (par2 == 0) + { + this.setRenderPassModel(this.scaleAmount); + GL11.glEnable(GL11.GL_NORMALIZE); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + return 1; + } + else + { + if (par2 == 1) + { + GL11.glDisable(GL11.GL_BLEND); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + } + + return -1; + } + } + + /** + * sets the scale for the slime based on getSlimeSize in EdibleSlime + */ + protected void scaleSlime(BlueSlime par1EdibleSlime, float par2) + { + float f1 = (float)par1EdibleSlime.getSlimeSize(); + float f2 = (par1EdibleSlime.field_70812_c + (par1EdibleSlime.field_70811_b - par1EdibleSlime.field_70812_c) * par2) / (f1 * 0.5F + 1.0F); + float f3 = 1.0F / (f2 + 1.0F); + GL11.glScalef(f3 * f1, 1.0F / f3 * f1, f3 * f1); + } + + /** + * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args: + * entityLiving, partialTickTime + */ + protected void preRenderCallback(EntityLiving par1EntityLiving, float par2) + { + this.scaleSlime((BlueSlime)par1EntityLiving, par2); + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) + { + return this.shouldSlimeRenderPass((BlueSlime)par1EntityLiving, par2, par3); + } +} diff --git a/mods/tinker/tconstruct/client/gui/FrypanGui.java b/mods/tinker/tconstruct/client/gui/FrypanGui.java index dd511b2c..babf5a02 100644 --- a/mods/tinker/tconstruct/client/gui/FrypanGui.java +++ b/mods/tinker/tconstruct/client/gui/FrypanGui.java @@ -27,7 +27,7 @@ public class FrypanGui extends GuiContainer protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/frypan.png"); + mc.renderEngine.bindTexture("/mods/tinker/textures/gui/frypan.png"); int cornerX = (width - xSize) / 2; int cornerY = (height - ySize) / 2; drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize); diff --git a/mods/tinker/tconstruct/client/gui/GuiButtonTool.java b/mods/tinker/tconstruct/client/gui/GuiButtonTool.java index a05c3cfc..16589fe6 100644 --- a/mods/tinker/tconstruct/client/gui/GuiButtonTool.java +++ b/mods/tinker/tconstruct/client/gui/GuiButtonTool.java @@ -35,7 +35,7 @@ public class GuiButtonTool extends GuiButton { boolean var4 = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.func_98187_b(texture); + mc.renderEngine.bindTexture(texture); this.field_82253_i = mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height; int var5 = this.getHoverState(this.field_82253_i); diff --git a/mods/tinker/tconstruct/client/gui/GuiManual.java b/mods/tinker/tconstruct/client/gui/GuiManual.java index e64e17f5..41e1f260 100644 --- a/mods/tinker/tconstruct/client/gui/GuiManual.java +++ b/mods/tinker/tconstruct/client/gui/GuiManual.java @@ -130,7 +130,7 @@ public class GuiManual extends GuiScreen //int texID = this.mc.renderEngine.getTexture(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/bookright.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookright.png"); int localWidth = (this.width) / 2; byte localHeight = 8; this.drawTexturedModalRect(localWidth, localHeight, 0, 0, this.bookImageWidth, this.bookImageHeight); @@ -138,7 +138,7 @@ public class GuiManual extends GuiScreen //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/bookleft.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); //this.mc.renderEngine.bindTexture(texID); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/bookleft.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/bookleft.png"); localWidth = localWidth - this.bookImageWidth; this.drawTexturedModalRect(localWidth, localHeight, 256 - this.bookImageWidth, 0, this.bookImageWidth, this.bookImageHeight); diff --git a/mods/tinker/tconstruct/client/gui/PartCrafterGui.java b/mods/tinker/tconstruct/client/gui/PartCrafterGui.java index fc3ed7ca..eef78e48 100644 --- a/mods/tinker/tconstruct/client/gui/PartCrafterGui.java +++ b/mods/tinker/tconstruct/client/gui/PartCrafterGui.java @@ -133,7 +133,7 @@ public class PartCrafterGui extends GuiContainer { // Draw the background GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/toolparts.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/toolparts.png"); int cornerX = (this.width - this.xSize) / 2; int cornerY = (this.height - this.ySize) / 2; this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize); @@ -163,7 +163,7 @@ public class PartCrafterGui extends GuiContainer //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/patternchestmini.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); //his.mc.renderEngine.bindTexture(texID); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/patternchestmini.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternchestmini.png"); this.drawTexturedModalRect(cornerX-116, cornerY+11, 0, 0, this.xSize, this.ySize); } @@ -171,7 +171,7 @@ public class PartCrafterGui extends GuiContainer //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/description.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); //this.mc.renderEngine.bindTexture(texID); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/description.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/description.png"); cornerX = (this.width + this.xSize) / 2; cornerY = (this.height - this.ySize) / 2; this.drawTexturedModalRect(cornerX, cornerY, 126, 0, 126, this.ySize); diff --git a/mods/tinker/tconstruct/client/gui/PatternChestGui.java b/mods/tinker/tconstruct/client/gui/PatternChestGui.java index 4df31bd7..10ae904f 100644 --- a/mods/tinker/tconstruct/client/gui/PatternChestGui.java +++ b/mods/tinker/tconstruct/client/gui/PatternChestGui.java @@ -29,7 +29,7 @@ public class PatternChestGui extends GuiContainer protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/patternchest.png"); + mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternchest.png"); int cornerX = (width - xSize) / 2; int cornerY = (height - ySize) / 2; drawTexturedModalRect(cornerX, cornerY, 0, 0, xSize, ySize); diff --git a/mods/tinker/tconstruct/client/gui/PatternShaperGui.java b/mods/tinker/tconstruct/client/gui/PatternShaperGui.java index 97edcc00..e96ceabc 100644 --- a/mods/tinker/tconstruct/client/gui/PatternShaperGui.java +++ b/mods/tinker/tconstruct/client/gui/PatternShaperGui.java @@ -45,7 +45,7 @@ public class PatternShaperGui extends GuiContainer protected void drawGuiContainerBackgroundLayer (float par1, int par2, int par3) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/patternshaper.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/patternshaper.png"); int cornerX = (this.width - this.xSize) / 2; int cornerY = (this.height - this.ySize) / 2; this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize); diff --git a/mods/tinker/tconstruct/client/gui/SmelteryGui.java b/mods/tinker/tconstruct/client/gui/SmelteryGui.java index 373475e3..7e0c23aa 100644 --- a/mods/tinker/tconstruct/client/gui/SmelteryGui.java +++ b/mods/tinker/tconstruct/client/gui/SmelteryGui.java @@ -122,7 +122,7 @@ public class SmelteryGui extends GuiContainer protected void drawGuiContainerBackgroundLayer (float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/smeltery.png"); + mc.renderEngine.bindTexture("/mods/tinker/textures/gui/smeltery.png"); int cornerX = (width - xSize) / 2; int cornerY = (height - ySize) / 2; drawTexturedModalRect(cornerX + 46, cornerY, 0, 0, xSize, ySize); @@ -132,7 +132,7 @@ public class SmelteryGui extends GuiContainer { //ForgeHooksClient.bindTexture(Block.lavaStill.getTextureFile(), 0); //int renderIndex = Block.lavaStill.getBlockTextureFromSideAndMetadata(0, 0); - this.mc.renderEngine.func_98187_b("/terrain.png"); + this.mc.renderEngine.bindTexture("/terrain.png"); Icon lavaIcon = Block.lavaStill.getBlockTextureFromSideAndMetadata(0, 0); //int xTex = renderIndex % 16 * 16; //int yTex = renderIndex / 16 * 16; @@ -142,7 +142,7 @@ public class SmelteryGui extends GuiContainer { int size = fuel >= 16 ? 16 : fuel; fuel -= size; - func_94065_a(cornerX + 117, (cornerY + 68) - size - 16 * count, lavaIcon, 12, size); + drawTexturedModelRectFromIcon(cornerX + 117, (cornerY + 68) - size - 16 * count, lavaIcon, 12, size); //drawTexturedModalRect(cornerX + 117, (cornerY + 68) - size - 16 * count, 0, 16 - size, 12, size); count++; } @@ -157,7 +157,7 @@ public class SmelteryGui extends GuiContainer { Block liquidBlock = Block.blocksList[liquid.itemID]; //ForgeHooksClient.bindTexture(liquidBlock.getTextureFile(), 0); - this.mc.renderEngine.func_98187_b("/terrain.png"); + this.mc.renderEngine.bindTexture("/terrain.png"); renderIndex = liquidBlock.getBlockTextureFromSideAndMetadata(0, liquid.itemMeta); } else @@ -165,7 +165,7 @@ public class SmelteryGui extends GuiContainer { Item liquidItem = Item.itemsList[liquid.itemID]; //ForgeHooksClient.bindTexture(liquidItem.getTextureFile(), 0); - this.mc.renderEngine.func_98187_b("/gui/items.png"); + this.mc.renderEngine.bindTexture("/gui/items.png"); renderIndex = liquidItem.getIconFromDamage(liquid.itemMeta); } @@ -178,10 +178,10 @@ public class SmelteryGui extends GuiContainer { int size = liquidSize >= 16 ? 16 : liquidSize; int basePos = 54; - func_94065_a(cornerX + basePos, (cornerY + 68) - size - base, renderIndex, 16, size); - func_94065_a(cornerX + basePos + 16, (cornerY + 68) - size - base, renderIndex, 16, size); - func_94065_a(cornerX + basePos + 32, (cornerY + 68) - size - base, renderIndex, 16, size); - func_94065_a(cornerX + basePos + 48, (cornerY + 68) - size - base, renderIndex, 4, size); + drawTexturedModelRectFromIcon(cornerX + basePos, (cornerY + 68) - size - base, renderIndex, 16, size); + drawTexturedModelRectFromIcon(cornerX + basePos + 16, (cornerY + 68) - size - base, renderIndex, 16, size); + drawTexturedModelRectFromIcon(cornerX + basePos + 32, (cornerY + 68) - size - base, renderIndex, 16, size); + drawTexturedModelRectFromIcon(cornerX + basePos + 48, (cornerY + 68) - size - base, renderIndex, 4, size); liquidSize -= size; base += size; } @@ -192,13 +192,13 @@ public class SmelteryGui extends GuiContainer //Liquid gague GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/smeltery.png"); + mc.renderEngine.bindTexture("/mods/tinker/textures/gui/smeltery.png"); drawTexturedModalRect(cornerX + 54, cornerY + 16, xSize, 76, 52, 52); //drawTexturedModalRect(cornerX+111, cornerY+16, xSize, 128, 52, 52); //Side inventory GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/smelteryside.png"); + mc.renderEngine.bindTexture("/mods/tinker/textures/gui/smelteryside.png"); if (logic.layers == 1) { drawTexturedModalRect(cornerX - 46, cornerY, 0, 0, 98, 43); @@ -230,7 +230,7 @@ public class SmelteryGui extends GuiContainer } } - fontRenderer.drawString("Time: "+logic.useTime, 140, 2, 0xFFFFFF); + //fontRenderer.drawString("Time: "+logic.useTime, 140, 2, 0xFFFFFF); /*fontRenderer.drawString("Scrolling: "+isScrolling, 140, 12, 0xFFFFFF); fontRenderer.drawString("Scroll: "+currentScroll, 140, 22, 0xFFFFFF);*/ } diff --git a/mods/tinker/tconstruct/client/gui/ToolStationGui.java b/mods/tinker/tconstruct/client/gui/ToolStationGui.java index d202c8aa..93507eb8 100644 --- a/mods/tinker/tconstruct/client/gui/ToolStationGui.java +++ b/mods/tinker/tconstruct/client/gui/ToolStationGui.java @@ -291,7 +291,7 @@ public class ToolStationGui extends GuiContainer // Draw the background //int texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/toolstation.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/toolstation.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/toolstation.png"); int cornerX = (this.width - this.xSize) / 2; int cornerY = (this.height - this.ySize) / 2; this.drawTexturedModalRect(cornerX, cornerY, 0, 0, this.xSize, this.ySize); @@ -299,7 +299,7 @@ public class ToolStationGui extends GuiContainer //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/icons.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); //this.mc.renderEngine.bindTexture(texID); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/icons.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/icons.png"); // Draw the slots for (int i = 0; i < slotX.length; i++) @@ -315,7 +315,7 @@ public class ToolStationGui extends GuiContainer //texID = this.mc.renderEngine.getTexture("/mods/tinker/textures/gui/description.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); //this.mc.renderEngine.bindTexture(texID); - this.mc.renderEngine.func_98187_b("/mods/tinker/textures/gui/description.png"); + this.mc.renderEngine.bindTexture("/mods/tinker/textures/gui/description.png"); cornerX = (this.width + this.xSize) / 2; cornerY = (this.height - this.ySize) / 2; this.drawTexturedModalRect(cornerX, cornerY, 0, 0, 126, this.ySize + 30); diff --git a/mods/tinker/tconstruct/client/gui/TurnPageButton.java b/mods/tinker/tconstruct/client/gui/TurnPageButton.java index e1ed0df5..772f6ca5 100644 --- a/mods/tinker/tconstruct/client/gui/TurnPageButton.java +++ b/mods/tinker/tconstruct/client/gui/TurnPageButton.java @@ -31,7 +31,7 @@ public class TurnPageButton extends GuiButton { boolean var4 = par2 >= this.xPosition && par3 >= this.yPosition && par2 < this.xPosition + this.width && par3 < this.yPosition + this.height; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - par1Minecraft.renderEngine.func_98187_b("/mods/tinker/textures/gui/bookleft.png"); + par1Minecraft.renderEngine.bindTexture("/mods/tinker/textures/gui/bookleft.png"); int var5 = 0; int var6 = 192; diff --git a/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java b/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java index 75cebb2a..ba5f6b78 100644 --- a/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java +++ b/mods/tinker/tconstruct/client/tmt/ModelRendererTurbo.java @@ -1834,7 +1834,7 @@ public class ModelRendererTurbo extends ModelRenderer curTexGroup.loadTexture(); GL11.glCallList(displayListArray[i]); if(!defaultTexture.equals("")) - renderEngine.func_98187_b(defaultTexture); + renderEngine.bindTexture(defaultTexture); } } } diff --git a/mods/tinker/tconstruct/client/tmt/TextureGroup.java b/mods/tinker/tconstruct/client/tmt/TextureGroup.java index 61a62fec..4a1d5644 100644 --- a/mods/tinker/tconstruct/client/tmt/TextureGroup.java +++ b/mods/tinker/tconstruct/client/tmt/TextureGroup.java @@ -29,11 +29,11 @@ public class TextureGroup if(!texture.equals("")) { RenderEngine renderengine = RenderManager.instance.renderEngine; - renderengine.func_98187_b(texture); + renderengine.bindTexture(texture); } /*else if(defaultTexture > -1) { - RenderManager.instance.renderEngine.func_98187_b(defaultTexture); + RenderManager.instance.renderEngine.bindTexture(defaultTexture); }*/ } diff --git a/mods/tinker/tconstruct/container/SmelteryContainer.java b/mods/tinker/tconstruct/container/SmelteryContainer.java index 88de641b..15f78ab3 100644 --- a/mods/tinker/tconstruct/container/SmelteryContainer.java +++ b/mods/tinker/tconstruct/container/SmelteryContainer.java @@ -17,6 +17,7 @@ public class SmelteryContainer extends Container public SmelteryContainer(InventoryPlayer inventoryplayer, SmelteryLogic smeltery) { logic = smeltery; + System.out.println("getSizeInventory: "+logic.getSizeInventory()); playerInv = inventoryplayer; if (smeltery.layers > 2) { diff --git a/mods/tinker/tconstruct/crafting/LiquidCasting.java b/mods/tinker/tconstruct/crafting/LiquidCasting.java index a1babb9f..c95de3ec 100644 --- a/mods/tinker/tconstruct/crafting/LiquidCasting.java +++ b/mods/tinker/tconstruct/crafting/LiquidCasting.java @@ -13,7 +13,6 @@ public class LiquidCasting { public static LiquidCasting instance = new LiquidCasting(); private ArrayList casts = new ArrayList(); - private HashMap, Float> materialReduction = new HashMap, Float>(); public static void addCastingRecipe(ItemStack replacement, LiquidStack metal, ItemStack cast, boolean consume, int delay) { @@ -35,6 +34,14 @@ public class LiquidCasting return -1; } + public int getCastingAmount(LiquidStack metal, ItemStack cast) + { + CastingRecipe recipe = getCastingRecipe(metal, cast); + if (recipe != null) + return recipe.castingMetal.amount; + return 0; + } + public CastingRecipe getCastingRecipe(LiquidStack metal, ItemStack cast) { for (CastingRecipe recipe : casts) @@ -44,13 +51,4 @@ public class LiquidCasting } return null; } - - public float getMaterialReduction(LiquidStack metal) - { - if (materialReduction.containsKey(Arrays.asList(metal.itemID, metal.itemMeta))) - { - return materialReduction.get(Arrays.asList(metal.itemID, metal.itemMeta)); - } - return 1f; - } } diff --git a/mods/tinker/tconstruct/entity/BlueSlime.java b/mods/tinker/tconstruct/entity/BlueSlime.java new file mode 100644 index 00000000..1c5051cd --- /dev/null +++ b/mods/tinker/tconstruct/entity/BlueSlime.java @@ -0,0 +1,461 @@ +package mods.tinker.tconstruct.entity; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteArrayDataOutput; + +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import mods.tinker.tconstruct.TConstruct; +import mods.tinker.tconstruct.TContent; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.monster.EntitySkeleton; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.world.EnumSkyBlock; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; + +public class BlueSlime extends EntityLiving implements IMob +{ + private static final float[] field_100000_e = new float[] { 1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F }; + public float field_70813_a; + public float field_70811_b; + public float field_70812_c; + + /** the time between each jump of the slime */ + private int slimeJumpDelay = 0; + + public BlueSlime(World world) + { + super(world); + this.texture = "/mods/tinker/textures/mob/slimeedible.png"; + int i = 1 << Math.max(1, this.rand.nextInt(4)); + this.yOffset = 0.0F; + this.slimeJumpDelay = this.rand.nextInt(20) + 10; + this.setSlimeSize(i); + this.jumpMovementFactor = 0.004F * i + 0.01F; + //if (i > 6) + //makeSlimeJocky(world); + //System.out.println("Woo"); + } + + @Override + public void initCreature () + { + //Minecraft.getMinecraft().getLogAgent().logInfo("Initializing a slime with size "+getSlimeSize()); + if (getSlimeSize() == 2 && rand.nextInt(15) == 0) + { + EntitySkeleton entityskeleton = new EntitySkeleton(this.worldObj); + entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F); + entityskeleton.initCreature(); + this.worldObj.spawnEntityInWorld(entityskeleton); + entityskeleton.mountEntity(this); + } + + } + + /*@Override + public void updateRiderPosition() + { + if (this.riddenByEntity != null) + { + if (!(this.riddenByEntity instanceof EntityPlayer) || !((EntityPlayer)this.riddenByEntity).func_71066_bF()) + { + this.riddenByEntity.lastTickPosX = this.lastTickPosX;//+Math.sin(this.rotationYaw/360); + this.riddenByEntity.lastTickPosY = this.lastTickPosY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(); + this.riddenByEntity.lastTickPosZ = this.lastTickPosZ;//+Math.cos(this.rotationYaw/360); + } + + this.riddenByEntity.setPosition(this.posX, this.posY + this.getMountedYOffset() + this.riddenByEntity.getYOffset(), this.posZ); + } + }*/ + + @Override + public double getMountedYOffset() + { + return this.height * 0.3; + } + + /*protected void makeSlimeJocky(World world) + { + //if (!world.isRemote) + //{ + EntitySkeleton skeleton = new EntitySkeleton(world); + skeleton.setPosition(posX, posY, posZ); + skeleton.setAngles(this.rotationYaw, this.rotationYaw); + world.spawnEntityInWorld(skeleton); + skeleton.mountEntity(this); + spawnedJocky = true; + //} + }*/ + + protected void jump () + { + this.motionY = 0.05 * getSlimeSize() + 0.37; + + if (this.isPotionActive(Potion.jump)) + { + this.motionY += (double) ((float) (this.getActivePotionEffect(Potion.jump).getAmplifier() + 1) * 0.1F); + } + + if (this.isSprinting()) + { + float f = this.rotationYaw * 0.017453292F; + this.motionX -= (double) (MathHelper.sin(f) * 0.2F); + this.motionZ += (double) (MathHelper.cos(f) * 0.2F); + } + + this.isAirBorne = true; + ForgeHooks.onLivingJump(this); + } + + protected void fall (float par1) + { + } + + protected String getSlimeParticle () + { + return "blueslime"; + } + + @Override + public boolean getCanSpawnHere () + { + return isValidLightLevel() && this.worldObj.checkIfAABBIsClear(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() + && !this.worldObj.isAnyLiquid(this.boundingBox); + } + + protected boolean isValidLightLevel () + { + int x = MathHelper.floor_double(this.posX); + int y = MathHelper.floor_double(this.boundingBox.minY); + int z = MathHelper.floor_double(this.posZ); + + if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) > this.rand.nextInt(32)) + { + return false; + } + else + { + int light = this.worldObj.getBlockLightValue(x, y, z); + + if (this.worldObj.isThundering()) + { + int i1 = this.worldObj.skylightSubtracted; + this.worldObj.skylightSubtracted = 10; + light = this.worldObj.getBlockLightValue(x, y, z); + this.worldObj.skylightSubtracted = i1; + } + + return light <= this.rand.nextInt(10); + } + } + + protected void entityInit () + { + super.entityInit(); + this.dataWatcher.addObject(16, new Byte((byte) 1)); + } + + protected void setSlimeSize (int size) + { + this.dataWatcher.updateObject(16, new Byte((byte) size)); + this.setSize(0.6F * size, 0.6F * size); + this.setPosition(this.posX, this.posY, this.posZ); + this.setEntityHealth(this.getMaxHealth()); + this.experienceValue = size + 2; + } + + public int getMaxHealth () + { + int i = this.getSlimeSize(); + if (i == 1) + return 4; + return (int) Math.min(i * i + 8, 49); + } + + /** + * Returns the size of the slime. + */ + public int getSlimeSize () + { + return this.dataWatcher.getWatchableObjectByte(16); + } + + /** + * (abstract) Protected helper method to write subclass entity data to NBT. + */ + public void writeEntityToNBT (NBTTagCompound par1NBTTagCompound) + { + super.writeEntityToNBT(par1NBTTagCompound); + par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1); + } + + /** + * (abstract) Protected helper method to read subclass entity data from NBT. + */ + public void readEntityFromNBT (NBTTagCompound par1NBTTagCompound) + { + super.readEntityFromNBT(par1NBTTagCompound); + this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1); + } + + /** + * Returns the name of the sound played when the slime jumps. + */ + protected String getJumpSound () + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /** + * Called to update the entity's position/logic. + */ + public void onUpdate () + { + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) + { + this.isDead = true; + } + + this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F; + this.field_70812_c = this.field_70811_b; + boolean flag = this.onGround; + super.onUpdate(); + int i; + + if (this.onGround && !flag) + { + i = this.getSlimeSize(); + + for (int j = 0; j < i * 8; ++j) + { + float f = this.rand.nextFloat() * (float) Math.PI * 2.0F; + float offset = this.rand.nextFloat() * 0.5F + 0.5F; + float xPos = MathHelper.sin(f) * (float) i * 0.5F * offset; + float zPos = MathHelper.cos(f) * (float) i * 0.5F * offset; + TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double) xPos, this.boundingBox.minY, this.posZ + (double) zPos, 0.0D, 0.0D, 0.0D); + } + + //if (this.makesSoundOnLand()) + //{ + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); + //} + + this.field_70813_a = -0.5F; + } + else if (!this.onGround && flag) + { + this.field_70813_a = 1.0F; + } + + this.func_70808_l(); + + if (this.worldObj.isRemote) + { + i = this.getSlimeSize(); + this.setSize(0.6F * (float) i, 0.6F * (float) i); + } + } + + protected void updateEntityActionState () + { + this.despawnEntity(); + EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); + + if (entityplayer != null) + { + this.faceEntity(entityplayer, 10.0F, 20.0F); + } + else if (this.onGround && this.slimeJumpDelay == 1) + { + //this.rotationPitch = rand.nextFloat()*360; + this.rotationYaw = this.rotationYaw + rand.nextFloat() * 180 - 90; + if (rotationYaw > 360) + rotationYaw -= 360; + if (rotationYaw < 0) + rotationYaw += 360; + } + + if (this.onGround && this.slimeJumpDelay-- <= 0) + { + this.slimeJumpDelay = this.getJumpDelay(); + + if (entityplayer != null) + { + this.slimeJumpDelay /= 3; + } + + this.isJumping = true; + + if (this.makesSoundOnJump()) + { + this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); + } + + this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; + this.moveForward = (float) (1 * this.getSlimeSize()); + } + else + { + this.isJumping = false; + + if (this.onGround) + { + this.moveStrafing = this.moveForward = 0.0F; + } + } + } + + protected void func_70808_l () + { + this.field_70813_a *= 0.6F; + } + + /** + * Gets the amount of time the slime needs to wait between jumps. + */ + protected int getJumpDelay () + { + return this.rand.nextInt(20) + 10; + } + + protected BlueSlime createInstance () + { + return new BlueSlime(this.worldObj); + } + + /** + * Will get destroyed next tick. + */ + public void setDead () + { + int i = this.getSlimeSize(); + + if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0) + { + float f = (-0.5F) * (float) i / 4.0F; + float f1 = (-0.5F) * (float) i / 4.0F; + BlueSlime entityslime = this.createInstance(); + entityslime.setSlimeSize(i / 2); + entityslime.setLocationAndAngles(this.posX + (double) f, this.posY + 0.5D, this.posZ + (double) f1, this.rand.nextFloat() * 360.0F, 0.0F); + this.worldObj.spawnEntityInWorld(entityslime); + } + + super.setDead(); + } + + protected void dropFewItems (boolean par1, int par2) + { + int j = this.getDropItemId(); + + if (j > 0) + { + int k = rand.nextInt(3) + rand.nextInt(this.getSlimeSize()); + + if (par2 > 0) + { + k += this.rand.nextInt(par2 + 1); + } + + for (int l = 0; l < k; ++l) + { + this.dropItem(j, 1); + } + } + } + + /** + * Called by a player entity when they collide with an entity + */ + public void onCollideWithPlayer (EntityPlayer par1EntityPlayer) + { + if (this.canDamagePlayer()) + { + int i = this.getSlimeSize(); + + if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double) i * 0.6D * (double) i + && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackStrength())) + { + this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); + } + } + } + + /** + * Indicates weather the slime is able to damage the player (based upon the slime's size) + */ + protected boolean canDamagePlayer () + { + return this.getSlimeSize() > 1; + } + + /** + * Gets the amount of damage dealt to the player when "attacked" by the slime. + */ + protected int getAttackStrength () + { + return this.getSlimeSize(); + } + + /** + * Returns the sound this mob makes when it is hurt. + */ + protected String getHurtSound () + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /** + * Returns the sound this mob makes on death. + */ + protected String getDeathSound () + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + /** + * Returns the item ID for the item the mob drops on death. + */ + protected int getDropItemId () + { + return TContent.strangeFood.itemID; + } + + /** + * Returns the volume for the sounds this mob makes. + */ + protected float getSoundVolume () + { + return 0.4F * (float) this.getSlimeSize(); + } + + /** + * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently + * use in wolves. + */ + public int getVerticalFaceSpeed () + { + return 0; + } + + /** + * Returns true if the slime makes a sound when it jumps (based upon the slime's size) + */ + protected boolean makesSoundOnJump () + { + return this.getSlimeSize() > 0; + } + + /** + * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) + */ + /*protected boolean makesSoundOnLand () + { + return this.getSlimeSize() > 2; + }*/ +} diff --git a/mods/tinker/tconstruct/entity/CartEntity.java b/mods/tinker/tconstruct/entity/CartEntity.java index 97564602..7b432514 100644 --- a/mods/tinker/tconstruct/entity/CartEntity.java +++ b/mods/tinker/tconstruct/entity/CartEntity.java @@ -1428,14 +1428,14 @@ public class CartEntity extends Entity } @Override - public boolean func_94042_c () + public boolean isInvNameLocalized () { // TODO Auto-generated method stub return false; } @Override - public boolean func_94041_b (int i, ItemStack itemstack) + public boolean isStackValidForSlot (int i, ItemStack itemstack) { // TODO Auto-generated method stub return false; diff --git a/mods/tinker/tconstruct/entity/EdibleSlime.java b/mods/tinker/tconstruct/entity/EdibleSlime.java deleted file mode 100644 index d2a1ec2e..00000000 --- a/mods/tinker/tconstruct/entity/EdibleSlime.java +++ /dev/null @@ -1,349 +0,0 @@ -package mods.tinker.tconstruct.entity; - -import mods.tinker.tconstruct.TConstruct; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.monster.IMob; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.DamageSource; -import net.minecraft.util.MathHelper; -import net.minecraft.world.EnumSkyBlock; -import net.minecraft.world.World; - -public class EdibleSlime extends EntityLiving implements IMob -{ - private static final float[] field_100000_e = new float[] {1.0F, 0.75F, 0.5F, 0.25F, 0.0F, 0.25F, 0.5F, 0.75F}; - public float field_70813_a; - public float field_70811_b; - public float field_70812_c; - - /** the time between each jump of the slime */ - private int slimeJumpDelay = 0; - - public EdibleSlime(World world) - { - super(world); - this.texture = "/mods/tinker/textures/mob/slimeedible.png"; - int i = 1 << this.rand.nextInt(3); - this.yOffset = 0.0F; - this.slimeJumpDelay = this.rand.nextInt(20) + 10; - this.setSlimeSize(i); - } - - protected String getSlimeParticle() - { - return "slime"; - } - - @Override - public boolean getCanSpawnHere () - { - return isValidLightLevel() && this.worldObj.checkIfAABBIsClear(this.boundingBox) && this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox).isEmpty() - && !this.worldObj.isAnyLiquid(this.boundingBox); - } - - protected boolean isValidLightLevel () - { - int x = MathHelper.floor_double(this.posX); - int y = MathHelper.floor_double(this.boundingBox.minY); - int z = MathHelper.floor_double(this.posZ); - - if (this.worldObj.getSavedLightValue(EnumSkyBlock.Sky, x, y, z) > this.rand.nextInt(32)) - { - return false; - } - else - { - int light = this.worldObj.getBlockLightValue(x, y, z); - - if (this.worldObj.isThundering()) - { - int i1 = this.worldObj.skylightSubtracted; - this.worldObj.skylightSubtracted = 10; - light = this.worldObj.getBlockLightValue(x, y, z); - this.worldObj.skylightSubtracted = i1; - } - - return light <= this.rand.nextInt(12); - } - } - - protected void entityInit() - { - super.entityInit(); - this.dataWatcher.addObject(16, new Byte((byte)1)); - } - - protected void setSlimeSize(int par1) - { - this.dataWatcher.updateObject(16, new Byte((byte)par1)); - this.setSize(0.6F * (float)par1, 0.6F * (float)par1); - this.setPosition(this.posX, this.posY, this.posZ); - this.setEntityHealth(this.getMaxHealth()); - this.experienceValue = par1; - } - - public int getMaxHealth() - { - int i = this.getSlimeSize(); - return i * i; - } - - /** - * Returns the size of the slime. - */ - public int getSlimeSize() - { - return this.dataWatcher.getWatchableObjectByte(16); - } - - /** - * (abstract) Protected helper method to write subclass entity data to NBT. - */ - public void writeEntityToNBT(NBTTagCompound par1NBTTagCompound) - { - super.writeEntityToNBT(par1NBTTagCompound); - par1NBTTagCompound.setInteger("Size", this.getSlimeSize() - 1); - } - - /** - * (abstract) Protected helper method to read subclass entity data from NBT. - */ - public void readEntityFromNBT(NBTTagCompound par1NBTTagCompound) - { - super.readEntityFromNBT(par1NBTTagCompound); - this.setSlimeSize(par1NBTTagCompound.getInteger("Size") + 1); - } - - /** - * Returns the name of the sound played when the slime jumps. - */ - protected String getJumpSound() - { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } - - /** - * Called to update the entity's position/logic. - */ - public void onUpdate() - { - if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) - { - this.isDead = true; - } - - this.field_70811_b += (this.field_70813_a - this.field_70811_b) * 0.5F; - this.field_70812_c = this.field_70811_b; - boolean flag = this.onGround; - super.onUpdate(); - int i; - - if (this.onGround && !flag) - { - i = this.getSlimeSize(); - - for (int j = 0; j < i * 8; ++j) - { - float f = this.rand.nextFloat() * (float)Math.PI * 2.0F; - float offset = this.rand.nextFloat() * 0.5F + 0.5F; - float xPos = MathHelper.sin(f) * (float)i * 0.5F * offset; - float zPos = MathHelper.cos(f) * (float)i * 0.5F * offset; - //this.worldObj.spawnParticle(this.getSlimeParticle(), this.posX + (double)f2, this.boundingBox.minY, this.posZ + (double)f3, 0.0D, 0.0D, 0.0D); - TConstruct.proxy.spawnParticle(this.getSlimeParticle(), this.posX + (double)xPos, this.boundingBox.minY, this.posZ + (double)zPos, 0.0D, 0.0D, 0.0D); - } - - if (this.makesSoundOnLand()) - { - this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); - } - - this.field_70813_a = -0.5F; - } - else if (!this.onGround && flag) - { - this.field_70813_a = 1.0F; - } - - this.func_70808_l(); - - if (this.worldObj.isRemote) - { - i = this.getSlimeSize(); - this.setSize(0.6F * (float)i, 0.6F * (float)i); - } - } - - protected void updateEntityActionState() - { - this.despawnEntity(); - EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D); - - if (entityplayer != null) - { - this.faceEntity(entityplayer, 10.0F, 20.0F); - } - - if (this.onGround && this.slimeJumpDelay-- <= 0) - { - this.slimeJumpDelay = this.getJumpDelay(); - - if (entityplayer != null) - { - this.slimeJumpDelay /= 3; - } - - this.isJumping = true; - - if (this.makesSoundOnJump()) - { - this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) * 0.8F); - } - - this.moveStrafing = 1.0F - this.rand.nextFloat() * 2.0F; - this.moveForward = (float)(1 * this.getSlimeSize()); - } - else - { - this.isJumping = false; - - if (this.onGround) - { - this.moveStrafing = this.moveForward = 0.0F; - } - } - } - - protected void func_70808_l() - { - this.field_70813_a *= 0.6F; - } - - /** - * Gets the amount of time the slime needs to wait between jumps. - */ - protected int getJumpDelay() - { - return this.rand.nextInt(20) + 10; - } - - protected EdibleSlime createInstance() - { - return new EdibleSlime(this.worldObj); - } - - /** - * Will get destroyed next tick. - */ - public void setDead() - { - int i = this.getSlimeSize(); - - if (!this.worldObj.isRemote && i > 1 && this.getHealth() <= 0) - { - int j = 2 + this.rand.nextInt(3); - - for (int k = 0; k < j; ++k) - { - float f = ((float)(k % 2) - 0.5F) * (float)i / 4.0F; - float f1 = ((float)(k / 2) - 0.5F) * (float)i / 4.0F; - EdibleSlime entityslime = this.createInstance(); - entityslime.setSlimeSize(i / 2); - entityslime.setLocationAndAngles(this.posX + (double)f, this.posY + 0.5D, this.posZ + (double)f1, this.rand.nextFloat() * 360.0F, 0.0F); - this.worldObj.spawnEntityInWorld(entityslime); - } - } - - super.setDead(); - } - - /** - * Called by a player entity when they collide with an entity - */ - public void onCollideWithPlayer(EntityPlayer par1EntityPlayer) - { - if (this.canDamagePlayer()) - { - int i = this.getSlimeSize(); - - if (this.canEntityBeSeen(par1EntityPlayer) && this.getDistanceSqToEntity(par1EntityPlayer) < 0.6D * (double)i * 0.6D * (double)i && par1EntityPlayer.attackEntityFrom(DamageSource.causeMobDamage(this), this.getAttackStrength())) - { - this.playSound("mob.attack", 1.0F, (this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F); - } - } - } - - /** - * Indicates weather the slime is able to damage the player (based upon the slime's size) - */ - protected boolean canDamagePlayer() - { - return this.getSlimeSize() > 1; - } - - /** - * Gets the amount of damage dealt to the player when "attacked" by the slime. - */ - protected int getAttackStrength() - { - return this.getSlimeSize(); - } - - /** - * Returns the sound this mob makes when it is hurt. - */ - protected String getHurtSound() - { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } - - /** - * Returns the sound this mob makes on death. - */ - protected String getDeathSound() - { - return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); - } - - /** - * Returns the item ID for the item the mob drops on death. - */ - protected int getDropItemId() - { - return this.getSlimeSize() == 1 ? Item.slimeBall.itemID : 0; - } - - /** - * Returns the volume for the sounds this mob makes. - */ - protected float getSoundVolume() - { - return 0.4F * (float)this.getSlimeSize(); - } - - /** - * The speed it takes to move the entityliving's rotationPitch through the faceEntity method. This is only currently - * use in wolves. - */ - public int getVerticalFaceSpeed() - { - return 0; - } - - /** - * Returns true if the slime makes a sound when it jumps (based upon the slime's size) - */ - protected boolean makesSoundOnJump() - { - return this.getSlimeSize() > 0; - } - - /** - * Returns true if the slime makes a sound when it lands after a jump (based upon the slime's size) - */ - protected boolean makesSoundOnLand() - { - return this.getSlimeSize() > 2; - } -} diff --git a/mods/tinker/tconstruct/items/CraftingItem.java b/mods/tinker/tconstruct/items/CraftingItem.java index f16c8d83..c18c6a59 100644 --- a/mods/tinker/tconstruct/items/CraftingItem.java +++ b/mods/tinker/tconstruct/items/CraftingItem.java @@ -36,13 +36,13 @@ public class CraftingItem extends Item } @SideOnly(Side.CLIENT) - public void func_94581_a(IconRegister iconRegister) + public void updateIcons(IconRegister iconRegister) { this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.func_94245_a("tinker:"+folder+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:"+folder+textureNames[i]); } } diff --git a/mods/tinker/tconstruct/items/FilledBucket.java b/mods/tinker/tconstruct/items/FilledBucket.java index a639cafc..1ef16440 100644 --- a/mods/tinker/tconstruct/items/FilledBucket.java +++ b/mods/tinker/tconstruct/items/FilledBucket.java @@ -27,6 +27,7 @@ public class FilledBucket extends ItemBucket //setTextureFile(TContent.craftingTexture); //setIconIndex(224); setUnlocalizedName("tconstruct.bucket"); + setContainerItem(Item.bucketEmpty); } public ItemStack onItemRightClick (ItemStack stack, World world, EntityPlayer player) @@ -134,7 +135,7 @@ public class FilledBucket extends ItemBucket } else { - world.func_94575_c(clickX, clickY, clickZ, TContent.liquidMetalStill.blockID); + world.setBlock(clickX, clickY, clickZ, TContent.liquidMetalStill.blockID); LiquidTextureLogic logic = (LiquidTextureLogic) world.getBlockTileEntity(clickX, clickY, clickZ); logic.setLiquidType(meta); @@ -158,13 +159,13 @@ public class FilledBucket extends ItemBucket } @SideOnly(Side.CLIENT) - public void func_94581_a(IconRegister iconRegister) + public void updateIcons(IconRegister iconRegister) { this.icons = new Icon[materialNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.func_94245_a("tinker:materials/bucket_"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:materials/bucket_"+textureNames[i]); } } diff --git a/mods/tinker/tconstruct/items/Pattern.java b/mods/tinker/tconstruct/items/Pattern.java index 04768586..1edbfa52 100644 --- a/mods/tinker/tconstruct/items/Pattern.java +++ b/mods/tinker/tconstruct/items/Pattern.java @@ -39,13 +39,13 @@ public class Pattern extends CraftingItem "ingot", "rod", "pickaxe", "shovel", "axe", "swordblade", "largeguard", "mediumguard", "crossbar", "binding", "frypan", "sign" }; /*@SideOnly(Side.CLIENT) - public void func_94581_a(IconRegister iconRegister) + public void updateIcons(IconRegister iconRegister) { this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.func_94245_a("tinker:"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:"+textureNames[i]); } }*/ diff --git a/mods/tinker/tconstruct/items/SpecialFood.java b/mods/tinker/tconstruct/items/SpecialFood.java new file mode 100644 index 00000000..1a7537c4 --- /dev/null +++ b/mods/tinker/tconstruct/items/SpecialFood.java @@ -0,0 +1,72 @@ +package mods.tinker.tconstruct.items; + +import java.util.List; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import mods.tinker.tconstruct.TConstruct; +import net.minecraft.client.renderer.texture.IconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; +import net.minecraft.util.Icon; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class SpecialFood extends ItemFood +{ + int[] hunger; + float[] saturation; + String[] unlocalizedNames; + String[] iconNames; + Icon[] icons; + public SpecialFood(int id, int[] hunger, float[] saturation, String[] textureNames, String[] iconNames) + { + super(id, 0, 0, false); + this.hunger = hunger; + this.saturation = saturation; + this.unlocalizedNames = textureNames; + this.iconNames = iconNames; + } + + @Override + public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) + { + stack.stackSize--; + int damage = stack.getItemDamage(); + player.getFoodStats().addStats(hunger[damage], saturation[damage]); + world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F); + this.onFoodEaten(stack, world, player); + return stack; + } + + @SideOnly(Side.CLIENT) + public Icon getIconFromDamage(int meta) + { + return icons[meta]; + } + + @SideOnly(Side.CLIENT) + public void updateIcons(IconRegister iconRegister) + { + this.icons = new Icon[iconNames.length]; + + for (int i = 0; i < this.icons.length; ++i) + { + this.icons[i] = iconRegister.registerIcon("tinker:"+iconNames[i]); + } + } + + public String getUnlocalizedName(ItemStack stack) + { + int arr = MathHelper.clamp_int(stack.getItemDamage(), 0, unlocalizedNames.length); + return getUnlocalizedName() + "." +unlocalizedNames[arr]; + } + + public void getSubItems (int id, CreativeTabs tab, List list) + { + for (int i = 0; i < unlocalizedNames.length; i++) + list.add(new ItemStack(id, 1, i)); + } +} diff --git a/mods/tinker/tconstruct/items/StrangeFood.java b/mods/tinker/tconstruct/items/StrangeFood.java new file mode 100644 index 00000000..24a98be5 --- /dev/null +++ b/mods/tinker/tconstruct/items/StrangeFood.java @@ -0,0 +1,24 @@ +package mods.tinker.tconstruct.items; + +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + +public class StrangeFood extends SpecialFood +{ + public StrangeFood(int id) + { + super(id, new int[] { 1 }, new float[] { 1f }, new String[] { "edibleslime" }, new String[] { "edibleslime" }); + } + + @Override + @SideOnly(Side.CLIENT) + public void addInformation (ItemStack stack, EntityPlayer player, List list, boolean par4) + { + list.add("\u00a7b\u00a7oIt smells terrible, but if you"); + list.add("\u00a7b\u00a7ohave nothing else to eat..."); + } +} diff --git a/mods/tinker/tconstruct/items/TitleIcon.java b/mods/tinker/tconstruct/items/TitleIcon.java index 17204eac..cc30e25e 100644 --- a/mods/tinker/tconstruct/items/TitleIcon.java +++ b/mods/tinker/tconstruct/items/TitleIcon.java @@ -13,9 +13,10 @@ public class TitleIcon extends Item } @Override - public void func_94581_a (IconRegister iconRegister) + public void updateIcons (IconRegister iconRegister) { - TProxyClient.blankSprite = iconRegister.func_94245_a("tinker:blanksprite"); - iconIndex = iconRegister.func_94245_a("tinker:tparts"); + TProxyClient.blankSprite = iconRegister.registerIcon("tinker:blanksprite"); + TProxyClient.metalBall = iconRegister.registerIcon("tinker:metalball"); + iconIndex = iconRegister.registerIcon("tinker:tparts"); } } diff --git a/mods/tinker/tconstruct/items/ToolPart.java b/mods/tinker/tconstruct/items/ToolPart.java index ff11c8f5..caa5c515 100644 --- a/mods/tinker/tconstruct/items/ToolPart.java +++ b/mods/tinker/tconstruct/items/ToolPart.java @@ -32,13 +32,13 @@ public class ToolPart extends CraftingItem } /*@SideOnly(Side.CLIENT) - public void func_94581_a(IconRegister iconRegister) + public void updateIcons(IconRegister iconRegister) { this.icons = new Icon[textureNames.length]; for (int i = 0; i < this.icons.length; ++i) { - this.icons[i] = iconRegister.func_94245_a("tinker:parts/"+textureNames[i]); + this.icons[i] = iconRegister.registerIcon("tinker:parts/"+textureNames[i]); } }*/ diff --git a/mods/tinker/tconstruct/logic/CastingTableLogic.java b/mods/tinker/tconstruct/logic/CastingTableLogic.java index 5db91a3b..d2fee57d 100644 --- a/mods/tinker/tconstruct/logic/CastingTableLogic.java +++ b/mods/tinker/tconstruct/logic/CastingTableLogic.java @@ -1,5 +1,6 @@ package mods.tinker.tconstruct.logic; +import cpw.mods.fml.common.FMLLog; import mods.tinker.common.IPattern; import mods.tinker.common.InventoryLogic; import mods.tinker.tconstruct.TConstruct; @@ -7,6 +8,7 @@ import mods.tinker.tconstruct.crafting.CastingRecipe; import mods.tinker.tconstruct.crafting.LiquidCasting; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; @@ -20,7 +22,6 @@ import net.minecraftforge.liquids.LiquidStack; public class CastingTableLogic extends InventoryLogic implements ILiquidTank, ITankContainer { public LiquidStack liquid; - float materialRedux = 0; int castingDelay = 0; int renderOffset = 0; @@ -58,10 +59,15 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT public int getCapacity () { int ret = TConstruct.ingotLiquidValue; - if (inventory[0] != null && inventory[0].getItem() instanceof IPattern) - ret *= ((IPattern) inventory[0].getItem()).getPatternCost(inventory[0].getItemDamage()) * 0.5; - if (materialRedux > 0) - ret *= materialRedux; + + ItemStack inv = inventory[0]; + + if (inv != null && inv.getItem() instanceof IPattern) + ret *= ((IPattern) inv.getItem()).getPatternCost(inv.getItemDamage()) * 0.5; + + else + ret = LiquidCasting.instance.getCastingAmount(liquid, inv); + return ret; } @@ -76,9 +82,18 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT if (inventory[1] == null && LiquidCasting.instance.getCastingRecipe(resource, inventory[0]) != null) { liquid = resource.copy(); - materialRedux = LiquidCasting.instance.getMaterialReduction(resource); - worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); + int capacity = getCapacity(); + if (liquid.amount > capacity) + { + liquid.amount = capacity; + } + if (liquid.amount == capacity) + { + castingDelay = LiquidCasting.instance.getCastingDelay(liquid, inventory[0]); + } + renderOffset = liquid.amount; + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); return liquid.amount; } else @@ -194,7 +209,6 @@ public class CastingTableLogic extends InventoryLogic implements ILiquidTank, IT CastingRecipe recipe = LiquidCasting.instance.getCastingRecipe(liquid, inventory[0]); if (recipe != null) { - materialRedux = 0; inventory[1] = recipe.getResult(); if (recipe.consumeCast) inventory[0] = null; diff --git a/mods/tinker/tconstruct/logic/MultiServantLogic.java b/mods/tinker/tconstruct/logic/MultiServantLogic.java index 0c6475ff..c547f9bb 100644 --- a/mods/tinker/tconstruct/logic/MultiServantLogic.java +++ b/mods/tinker/tconstruct/logic/MultiServantLogic.java @@ -4,7 +4,12 @@ import mods.tinker.common.CoordTuple; import mods.tinker.common.IMasterLogic; import mods.tinker.common.IServantLogic; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.INetworkManager; +import net.minecraft.network.packet.Packet; +import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.liquids.LiquidStack; public class MultiServantLogic extends TileEntity implements IServantLogic @@ -85,9 +90,8 @@ public class MultiServantLogic extends TileEntity } } - public void readFromNBT (NBTTagCompound tags) + public void readCustomNBT (NBTTagCompound tags) { - super.readFromNBT(tags); hasMaster = tags.getBoolean("HasMaster"); if (hasMaster) { @@ -100,9 +104,8 @@ public class MultiServantLogic extends TileEntity } } - public void writeToNBT (NBTTagCompound tags) + public void writeCustomNBT (NBTTagCompound tags) { - super.writeToNBT(tags); tags.setBoolean("HasMaster", hasMaster); if (hasMaster) { @@ -113,4 +116,34 @@ public class MultiServantLogic extends TileEntity tags.setByte("masterMeat", masterMeat); } } + + @Override + public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + readCustomNBT(tags); + } + + @Override + public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + writeCustomNBT(tags); + } + + /* Packets */ + @Override + public Packet getDescriptionPacket () + { + NBTTagCompound tag = new NBTTagCompound(); + writeCustomNBT(tag); + return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); + } + + @Override + public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) + { + readCustomNBT(packet.customParam1); + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } } diff --git a/mods/tinker/tconstruct/logic/SmelteryDrainLogic.java b/mods/tinker/tconstruct/logic/SmelteryDrainLogic.java index 199e8558..eb7c5e31 100644 --- a/mods/tinker/tconstruct/logic/SmelteryDrainLogic.java +++ b/mods/tinker/tconstruct/logic/SmelteryDrainLogic.java @@ -61,7 +61,7 @@ public class SmelteryDrainLogic extends MultiServantLogic @Override public int fill (int tankIndex, LiquidStack resource, boolean doFill) { - if (hasMaster) //Not sure if it should fill or not + if (hasMaster && resource != null) { if (doFill) { diff --git a/mods/tinker/tconstruct/logic/SmelteryLogic.java b/mods/tinker/tconstruct/logic/SmelteryLogic.java index a7d84e3d..1ae6457a 100644 --- a/mods/tinker/tconstruct/logic/SmelteryLogic.java +++ b/mods/tinker/tconstruct/logic/SmelteryLogic.java @@ -2,6 +2,8 @@ package mods.tinker.tconstruct.logic; import java.util.ArrayList; +import cpw.mods.fml.common.FMLLog; + import mods.tinker.common.CoordTuple; import mods.tinker.common.IActiveLogic; import mods.tinker.common.IFacingLogic; @@ -107,6 +109,7 @@ public class SmelteryLogic extends InventoryLogic @Override public Container getGuiContainer (InventoryPlayer inventoryplayer, World world, int x, int y, int z) { + worldObj.markBlockForUpdate(xCoord, yCoord, zCoord); return new SmelteryContainer(inventoryplayer, this); } @@ -210,7 +213,7 @@ public class SmelteryLogic extends InventoryLogic if (meltingTemps[i] > 20 && this.isStackInSlot(i)) { if (activeTemps[i] < internalTemp && activeTemps[i] < meltingTemps[i]) - activeTemps[i] += 5; + activeTemps[i] += 10; else if (meltingTemps[i] >= activeTemps[i]) { if (!worldObj.isRemote) @@ -311,13 +314,13 @@ public class SmelteryLogic extends InventoryLogic } /* Inventory */ - public int getMaxStackStackSize (ItemStack stack) + /*public int getMaxStackStackSize (ItemStack stack) { LiquidStack liquid = getResultFor(stack); if (liquid == null) return 0; return liquid.amount; - } + }*/ public int getInventoryStackLimit () { @@ -332,6 +335,12 @@ public class SmelteryLogic extends InventoryLogic } /* Multiblock */ + @Override + public void notifyChange (int x, int y, int z) + { + checkValidPlacement(); + } + public void checkValidPlacement () { switch (getRenderDirection()) @@ -576,7 +585,6 @@ public class SmelteryLogic extends InventoryLogic return false; } - /* Not an ILiquidTank, but is still a liquid tank of sorts */ public int getCapacity () { return maxLiquid; @@ -612,9 +620,14 @@ public class SmelteryLogic extends InventoryLogic public int fill (LiquidStack resource, boolean doFill) { - int amount = resource.amount; - addMoltenMetal(resource, false); - return amount; + if (resource != null) + { + int amount = resource.amount; + addMoltenMetal(resource, false); + return amount; + } + else + return 0; } @Override @@ -632,8 +645,16 @@ public class SmelteryLogic extends InventoryLogic } /* NBT */ + @Override public void readFromNBT (NBTTagCompound tags) + { + super.readFromNBT(tags); + readCustomNBT(tags); + //checkValidPlacement(); + } + + public void readCustomNBT (NBTTagCompound tags) { direction = tags.getByte("Direction"); useTime = tags.getInteger("UseTime"); @@ -653,13 +674,17 @@ public class SmelteryLogic extends InventoryLogic int meta = tagList.getInteger("meta"); moltenMetal.add(new LiquidStack(id, amount, meta)); } - adjustLayers(layers, true); - super.readFromNBT(tags); } @Override public void writeToNBT (NBTTagCompound tags) + { + super.writeToNBT(tags); + writeCustomNBT(tags); + } + + public void writeCustomNBT (NBTTagCompound tags) { tags.setByte("Direction", direction); tags.setInteger("UseTime", useTime); @@ -679,7 +704,6 @@ public class SmelteryLogic extends InventoryLogic } tags.setTag("Liquids", taglist); - super.writeToNBT(tags); } /* Packets */ @@ -697,10 +721,4 @@ public class SmelteryLogic extends InventoryLogic readFromNBT(packet.customParam1); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); } - - @Override - public void notifyChange (int x, int y, int z) - { - checkValidPlacement(); - } } diff --git a/mods/tinker/tconstruct/tools/BattleSign.java b/mods/tinker/tconstruct/tools/BattleSign.java index e7b210e5..ee3b9770 100644 --- a/mods/tinker/tconstruct/tools/BattleSign.java +++ b/mods/tinker/tconstruct/tools/BattleSign.java @@ -75,11 +75,11 @@ public class BattleSign extends Weapon if (par7 == 1) { int var11 = MathHelper.floor_double((double)((player.rotationYaw + 180.0F) * 16.0F / 360.0F) + 0.5D) & 15; - par3World.setBlockAndMetadataWithNotify(par4, par5, par6, Block.signPost.blockID, var11); + par3World.setBlock(par4, par5, par6, Block.signPost.blockID, var11); } else { - par3World.setBlockAndMetadataWithNotify(par4, par5, par6, Block.signWall.blockID, par7); + par3World.setBlock(par4, par5, par6, Block.signWall.blockID, par7); } //--par1ItemStack.stackSize; diff --git a/mods/tinker/tconstruct/tools/DualHarvestTool.java b/mods/tinker/tconstruct/tools/DualHarvestTool.java index 51b313f7..d9de6850 100644 --- a/mods/tinker/tconstruct/tools/DualHarvestTool.java +++ b/mods/tinker/tconstruct/tools/DualHarvestTool.java @@ -44,7 +44,7 @@ public abstract class DualHarvestTool extends HarvestTool if (result != null) { //System.out.println("Woo~"); - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); if (!player.capabilities.isCreativeMode) onBlockDestroyed(stack, world, bID, x, y, z, player); if (!world.isRemote) @@ -64,7 +64,7 @@ public abstract class DualHarvestTool extends HarvestTool { if (!player.capabilities.isCreativeMode) onBlockDestroyed(stack, world, bID, x, y, z, player); - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); if (!world.isRemote) world.playAuxSFX(2001, x, y, z, bID + (meta << 12)); return true; diff --git a/mods/tinker/tconstruct/tools/FryingPan.java b/mods/tinker/tconstruct/tools/FryingPan.java index 3294fd8c..820ce305 100644 --- a/mods/tinker/tconstruct/tools/FryingPan.java +++ b/mods/tinker/tconstruct/tools/FryingPan.java @@ -83,7 +83,7 @@ public class FryingPan extends Weapon } else { - world.setBlockAndMetadataWithNotify(x, y, z, TContent.heldItemBlock.blockID, 0, 3); + world.setBlock(x, y, z, TContent.heldItemBlock.blockID, 0, 3); EquipLogic logic = (EquipLogic) world.getBlockTileEntity(x, y, z); logic.setEquipmentItem(stack); diff --git a/mods/tinker/tconstruct/tools/Hammer.java b/mods/tinker/tconstruct/tools/Hammer.java index 7fab4e19..5c72bdd9 100644 --- a/mods/tinker/tconstruct/tools/Hammer.java +++ b/mods/tinker/tconstruct/tools/Hammer.java @@ -54,8 +54,8 @@ public class Hammer extends HarvestTool coords.add(new int[] {0, 0, -1}); } - @Override - public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLiving living) + //@Override + /*public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLiving living) { if (!(itemstack.getTagCompound().getCompoundTag("InfiTool").getBoolean("Broken")) && living instanceof EntityPlayer) { @@ -68,11 +68,11 @@ public class Hammer extends HarvestTool if (block != null) { if (block.blockID == Block.stone.blockID) - world.func_94575_c(xPos, yPos, zPos, Block.cobblestone.blockID); + world.setBlock(xPos, yPos, zPos, Block.cobblestone.blockID); else if (block.blockMaterial == Material.rock) { int meta = world.getBlockMetadata(xPos, yPos, zPos); - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); Block.blocksList[bID].harvestBlock(world, (EntityPlayer)player, xPos, yPos, zPos, meta); if (!player.capabilities.isCreativeMode) onBlockDestroyed(itemstack, world, bID, xPos, yPos, zPos, player); @@ -82,7 +82,7 @@ public class Hammer extends HarvestTool } } return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, living, random); - } + }*/ @Override protected Item getHeadItem () diff --git a/mods/tinker/tconstruct/tools/HarvestTool.java b/mods/tinker/tconstruct/tools/HarvestTool.java index 6fbc710b..afc966f2 100644 --- a/mods/tinker/tconstruct/tools/HarvestTool.java +++ b/mods/tinker/tconstruct/tools/HarvestTool.java @@ -38,7 +38,7 @@ public abstract class HarvestTool extends ToolCore if (result != null) { //System.out.println("Woo~"); - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); if (!player.capabilities.isCreativeMode) onBlockDestroyed(stack, world, bID, x, y, z, player); if (!world.isRemote) @@ -56,7 +56,7 @@ public abstract class HarvestTool extends ToolCore } else { - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); if (!player.capabilities.isCreativeMode) onBlockDestroyed(stack, world, bID, x, y, z, player); if (!world.isRemote) diff --git a/mods/tinker/tconstruct/tools/LumberAxe.java b/mods/tinker/tconstruct/tools/LumberAxe.java index ceb9a4b3..83859060 100644 --- a/mods/tinker/tconstruct/tools/LumberAxe.java +++ b/mods/tinker/tconstruct/tools/LumberAxe.java @@ -129,7 +129,7 @@ public class LumberAxe extends HarvestTool if (!(tags.getBoolean("Broken"))) if (world.getBlockId(xPos, yPos, zPos) == bID && world.getBlockMetadata(xPos, yPos, zPos) % 4 == meta % 4) { - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); Block.blocksList[bID].harvestBlock(world, player, xPos, yPos, zPos, meta); if (!player.capabilities.isCreativeMode) onBlockDestroyed(stack, world, bID, xPos, yPos, zPos, player); @@ -155,7 +155,7 @@ public class LumberAxe extends HarvestTool if (block != null && block.blockMaterial == Material.wood) { int meta = world.getBlockMetadata(xPos, yPos, zPos); - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); Block.blocksList[blockID].harvestBlock(world, player, xPos, yPos, zPos, meta); if (!player.capabilities.isCreativeMode) onBlockDestroyed(stack, world, blockID, xPos, yPos, zPos, player); diff --git a/mods/tinker/tconstruct/tools/ToolCore.java b/mods/tinker/tconstruct/tools/ToolCore.java index 70ffae40..b563ff1c 100644 --- a/mods/tinker/tconstruct/tools/ToolCore.java +++ b/mods/tinker/tconstruct/tools/ToolCore.java @@ -146,7 +146,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox } @Override - public void func_94581_a (IconRegister iconRegister) + public void updateIcons (IconRegister iconRegister) { headIcons.clear(); brokenHeadIcons.clear(); @@ -157,21 +157,21 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox while (iter.hasNext()) { Map.Entry pairs = (Map.Entry) iter.next(); - headIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue())); + headIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); } iter = brokenHeadStrings.entrySet().iterator(); while (iter.hasNext()) { Map.Entry pairs = (Map.Entry) iter.next(); - brokenHeadIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue())); + brokenHeadIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); } iter = handleStrings.entrySet().iterator(); while (iter.hasNext()) { Map.Entry pairs = (Map.Entry) iter.next(); - handleIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue())); + handleIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); } if (getPartAmount() > 2) @@ -180,7 +180,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox while (iter.hasNext()) { Map.Entry pairs = (Map.Entry) iter.next(); - accessoryIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue())); + accessoryIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); } } @@ -188,15 +188,8 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox while (iter.hasNext()) { Map.Entry pairs = (Map.Entry) iter.next(); - effectIcons.put((Integer) pairs.getKey(), iconRegister.func_94245_a((String) pairs.getValue())); + effectIcons.put((Integer) pairs.getKey(), iconRegister.registerIcon((String) pairs.getValue())); } - - /*System.out.println(this.getClass().getSimpleName() + " Test"); - System.out.println("Head size: " + headStrings.size() + " " + headIcons.size()); - System.out.println("Broken head size: " + brokenHeadStrings.size() + " " + brokenHeadIcons.size()); - System.out.println("Handle size: " + handleStrings.size() + " " + handleIcons.size()); - System.out.println("Accessory size: " + accessoryStrings.size() + " " + accessoryIcons.size()); - System.out.println("Effect size: " + effectStrings.size() + " " + effectIcons.size());*/ } @Override @@ -525,8 +518,7 @@ public abstract class ToolCore extends Item implements ICustomElectricItem, IBox ItemStack result = FurnaceRecipes.smelting().getSmeltingResult(new ItemStack(block.idDropped(bID, random, 0), 1, block.damageDropped(meta))); if (result != null) { - //System.out.println("Woo~"); - world.func_94571_i(x, y, z); + world.setBlockToAir(x, y, z); if (!player.capabilities.isCreativeMode) onBlockDestroyed(stack, world, bID, x, y, z, player); if (!world.isRemote) diff --git a/mods/tinker/tconstruct/worldgen/NetherOreGenerator.java b/mods/tinker/tconstruct/worldgen/NetherOreGenerator.java index d2d08ae1..e417aab5 100644 --- a/mods/tinker/tconstruct/worldgen/NetherOreGenerator.java +++ b/mods/tinker/tconstruct/worldgen/NetherOreGenerator.java @@ -72,7 +72,7 @@ public class NetherOreGenerator extends WorldGenerator int genID = par1World.getBlockId(var38, var41, var44); if (var39 * var39 + var42 * var42 + var45 * var45 < 1.0D && genID == Block.netherrack.blockID) { - par1World.setBlockAndMetadataWithNotify(var38, var41, var44, this.minableBlockId, minableBlockMeta, 2); + par1World.setBlock(var38, var41, var44, this.minableBlockId, minableBlockMeta, 2); } } } diff --git a/mods/tinker/textures/blocks/liquid_alubrass.png b/mods/tinker/textures/blocks/liquid_alubrass.png index 82988519..ff287289 100644 Binary files a/mods/tinker/textures/blocks/liquid_alubrass.png and b/mods/tinker/textures/blocks/liquid_alubrass.png differ diff --git a/mods/tinker/textures/blocks/liquid_alubrass_flow.png b/mods/tinker/textures/blocks/liquid_alubrass_flow.png index 8618ae8e..51304f6e 100644 Binary files a/mods/tinker/textures/blocks/liquid_alubrass_flow.png and b/mods/tinker/textures/blocks/liquid_alubrass_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_alubrass_flow.txt b/mods/tinker/textures/blocks/liquid_alubrass_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_alubrass_flow.txt +++ b/mods/tinker/textures/blocks/liquid_alubrass_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_aluminum.png b/mods/tinker/textures/blocks/liquid_aluminum.png index 0b93a736..83d58c8b 100644 Binary files a/mods/tinker/textures/blocks/liquid_aluminum.png and b/mods/tinker/textures/blocks/liquid_aluminum.png differ diff --git a/mods/tinker/textures/blocks/liquid_aluminum_flow.png b/mods/tinker/textures/blocks/liquid_aluminum_flow.png index 2f99f0e2..63b8f5f4 100644 Binary files a/mods/tinker/textures/blocks/liquid_aluminum_flow.png and b/mods/tinker/textures/blocks/liquid_aluminum_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_aluminum_flow.txt b/mods/tinker/textures/blocks/liquid_aluminum_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_aluminum_flow.txt +++ b/mods/tinker/textures/blocks/liquid_aluminum_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_alumite.png b/mods/tinker/textures/blocks/liquid_alumite.png index 10a9949b..294ce53d 100644 Binary files a/mods/tinker/textures/blocks/liquid_alumite.png and b/mods/tinker/textures/blocks/liquid_alumite.png differ diff --git a/mods/tinker/textures/blocks/liquid_alumite_flow.png b/mods/tinker/textures/blocks/liquid_alumite_flow.png index 665553f6..407bb15d 100644 Binary files a/mods/tinker/textures/blocks/liquid_alumite_flow.png and b/mods/tinker/textures/blocks/liquid_alumite_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_alumite_flow.txt b/mods/tinker/textures/blocks/liquid_alumite_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_alumite_flow.txt +++ b/mods/tinker/textures/blocks/liquid_alumite_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_ardite.png b/mods/tinker/textures/blocks/liquid_ardite.png index 662e7fd0..d45a495c 100644 Binary files a/mods/tinker/textures/blocks/liquid_ardite.png and b/mods/tinker/textures/blocks/liquid_ardite.png differ diff --git a/mods/tinker/textures/blocks/liquid_ardite_flow.png b/mods/tinker/textures/blocks/liquid_ardite_flow.png index 26ce25ab..eba66a7b 100644 Binary files a/mods/tinker/textures/blocks/liquid_ardite_flow.png and b/mods/tinker/textures/blocks/liquid_ardite_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_ardite_flow.txt b/mods/tinker/textures/blocks/liquid_ardite_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_ardite_flow.txt +++ b/mods/tinker/textures/blocks/liquid_ardite_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_bronze.png b/mods/tinker/textures/blocks/liquid_bronze.png index 52e48387..b3d91d26 100644 Binary files a/mods/tinker/textures/blocks/liquid_bronze.png and b/mods/tinker/textures/blocks/liquid_bronze.png differ diff --git a/mods/tinker/textures/blocks/liquid_bronze_flow.png b/mods/tinker/textures/blocks/liquid_bronze_flow.png index 735c22ee..b6b0c090 100644 Binary files a/mods/tinker/textures/blocks/liquid_bronze_flow.png and b/mods/tinker/textures/blocks/liquid_bronze_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_bronze_flow.txt b/mods/tinker/textures/blocks/liquid_bronze_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_bronze_flow.txt +++ b/mods/tinker/textures/blocks/liquid_bronze_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_cobalt.png b/mods/tinker/textures/blocks/liquid_cobalt.png index 4b3ae249..d69c2768 100644 Binary files a/mods/tinker/textures/blocks/liquid_cobalt.png and b/mods/tinker/textures/blocks/liquid_cobalt.png differ diff --git a/mods/tinker/textures/blocks/liquid_cobalt_flow.png b/mods/tinker/textures/blocks/liquid_cobalt_flow.png index c75d6574..37a7b257 100644 Binary files a/mods/tinker/textures/blocks/liquid_cobalt_flow.png and b/mods/tinker/textures/blocks/liquid_cobalt_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_cobalt_flow.txt b/mods/tinker/textures/blocks/liquid_cobalt_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_cobalt_flow.txt +++ b/mods/tinker/textures/blocks/liquid_cobalt_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_copper.png b/mods/tinker/textures/blocks/liquid_copper.png index 048b48d3..d2dd55b8 100644 Binary files a/mods/tinker/textures/blocks/liquid_copper.png and b/mods/tinker/textures/blocks/liquid_copper.png differ diff --git a/mods/tinker/textures/blocks/liquid_copper_flow.png b/mods/tinker/textures/blocks/liquid_copper_flow.png index 98c0df93..c9166b08 100644 Binary files a/mods/tinker/textures/blocks/liquid_copper_flow.png and b/mods/tinker/textures/blocks/liquid_copper_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_copper_flow.txt b/mods/tinker/textures/blocks/liquid_copper_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_copper_flow.txt +++ b/mods/tinker/textures/blocks/liquid_copper_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_gold.png b/mods/tinker/textures/blocks/liquid_gold.png index 371016ac..631e7d2f 100644 Binary files a/mods/tinker/textures/blocks/liquid_gold.png and b/mods/tinker/textures/blocks/liquid_gold.png differ diff --git a/mods/tinker/textures/blocks/liquid_gold_flow.png b/mods/tinker/textures/blocks/liquid_gold_flow.png index f83147c9..07551973 100644 Binary files a/mods/tinker/textures/blocks/liquid_gold_flow.png and b/mods/tinker/textures/blocks/liquid_gold_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_gold_flow.txt b/mods/tinker/textures/blocks/liquid_gold_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_gold_flow.txt +++ b/mods/tinker/textures/blocks/liquid_gold_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_iron.png b/mods/tinker/textures/blocks/liquid_iron.png index d6f0773c..b78d481b 100644 Binary files a/mods/tinker/textures/blocks/liquid_iron.png and b/mods/tinker/textures/blocks/liquid_iron.png differ diff --git a/mods/tinker/textures/blocks/liquid_iron_flow.png b/mods/tinker/textures/blocks/liquid_iron_flow.png index 099e93f8..5feef48e 100644 Binary files a/mods/tinker/textures/blocks/liquid_iron_flow.png and b/mods/tinker/textures/blocks/liquid_iron_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_iron_flow.txt b/mods/tinker/textures/blocks/liquid_iron_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_iron_flow.txt +++ b/mods/tinker/textures/blocks/liquid_iron_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_manyullyn.png b/mods/tinker/textures/blocks/liquid_manyullyn.png index 87aacc2f..1fb728ba 100644 Binary files a/mods/tinker/textures/blocks/liquid_manyullyn.png and b/mods/tinker/textures/blocks/liquid_manyullyn.png differ diff --git a/mods/tinker/textures/blocks/liquid_manyullyn_flow.png b/mods/tinker/textures/blocks/liquid_manyullyn_flow.png index 474bdc27..e24fb364 100644 Binary files a/mods/tinker/textures/blocks/liquid_manyullyn_flow.png and b/mods/tinker/textures/blocks/liquid_manyullyn_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_manyullyn_flow.txt b/mods/tinker/textures/blocks/liquid_manyullyn_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_manyullyn_flow.txt +++ b/mods/tinker/textures/blocks/liquid_manyullyn_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_obsidian.png b/mods/tinker/textures/blocks/liquid_obsidian.png new file mode 100644 index 00000000..4a604028 Binary files /dev/null and b/mods/tinker/textures/blocks/liquid_obsidian.png differ diff --git a/mods/tinker/textures/blocks/liquid_obsidian.txt b/mods/tinker/textures/blocks/liquid_obsidian.txt new file mode 100644 index 00000000..b0a7c084 --- /dev/null +++ b/mods/tinker/textures/blocks/liquid_obsidian.txt @@ -0,0 +1,38 @@ +0*2 +1*2 +2*2 +3*2 +4*2 +5*2 +6*2 +7*2 +8*2 +9*2 +10*2 +11*2 +12*2 +13*2 +14*2 +15*2 +16*2 +17*2 +18*2 +19*2 +18*2 +17*2 +16*2 +15*2 +14*2 +13*2 +12*2 +11*2 +10*2 +9*2 +8*2 +7*2 +6*2 +5*2 +4*2 +3*2 +2*2 +1*2 diff --git a/mods/tinker/textures/blocks/liquid_obsidian_flow.png b/mods/tinker/textures/blocks/liquid_obsidian_flow.png new file mode 100644 index 00000000..9108e97d Binary files /dev/null and b/mods/tinker/textures/blocks/liquid_obsidian_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_obsidian_flow.txt b/mods/tinker/textures/blocks/liquid_obsidian_flow.txt new file mode 100644 index 00000000..2e6ca4fc --- /dev/null +++ b/mods/tinker/textures/blocks/liquid_obsidian_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_steel.png b/mods/tinker/textures/blocks/liquid_steel.png index 67286267..bc482e90 100644 Binary files a/mods/tinker/textures/blocks/liquid_steel.png and b/mods/tinker/textures/blocks/liquid_steel.png differ diff --git a/mods/tinker/textures/blocks/liquid_steel_flow.png b/mods/tinker/textures/blocks/liquid_steel_flow.png index f40712d2..a278db34 100644 Binary files a/mods/tinker/textures/blocks/liquid_steel_flow.png and b/mods/tinker/textures/blocks/liquid_steel_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_steel_flow.txt b/mods/tinker/textures/blocks/liquid_steel_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_steel_flow.txt +++ b/mods/tinker/textures/blocks/liquid_steel_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/blocks/liquid_tin.png b/mods/tinker/textures/blocks/liquid_tin.png index de721243..be3e3233 100644 Binary files a/mods/tinker/textures/blocks/liquid_tin.png and b/mods/tinker/textures/blocks/liquid_tin.png differ diff --git a/mods/tinker/textures/blocks/liquid_tin_flow.png b/mods/tinker/textures/blocks/liquid_tin_flow.png index 9a470296..139d6743 100644 Binary files a/mods/tinker/textures/blocks/liquid_tin_flow.png and b/mods/tinker/textures/blocks/liquid_tin_flow.png differ diff --git a/mods/tinker/textures/blocks/liquid_tin_flow.txt b/mods/tinker/textures/blocks/liquid_tin_flow.txt index e69de29b..2e6ca4fc 100644 --- a/mods/tinker/textures/blocks/liquid_tin_flow.txt +++ b/mods/tinker/textures/blocks/liquid_tin_flow.txt @@ -0,0 +1,16 @@ +0*3 +1*3 +2*3 +3*3 +4*3 +5*3 +6*3 +7*3 +8*3 +9*3 +10*3 +11*3 +12*3 +13*3 +14*3 +15*3 diff --git a/mods/tinker/textures/items/edibleslime.png b/mods/tinker/textures/items/edibleslime.png new file mode 100644 index 00000000..26b0ad82 Binary files /dev/null and b/mods/tinker/textures/items/edibleslime.png differ diff --git a/mods/tinker/textures/items/metalball.png b/mods/tinker/textures/items/metalball.png new file mode 100644 index 00000000..b6e7f450 Binary files /dev/null and b/mods/tinker/textures/items/metalball.png differ diff --git a/test/XinStick.java b/test/XinStick.java index ff84aed9..462b2f8e 100644 --- a/test/XinStick.java +++ b/test/XinStick.java @@ -1,6 +1,6 @@ package test; -import mods.tinker.tconstruct.entity.EdibleSlime; +import mods.tinker.tconstruct.entity.BlueSlime; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -28,7 +28,7 @@ public class XinStick extends Item //spawnItem(player.posX, player.posY, player.posZ, tool, world); //CartEntity cart = new CartEntity(world, 1); //cart.cartType = 1; - spawnEntity(player.posX, player.posY+1, player.posZ, new EdibleSlime(world), world, player); + spawnEntity(player.posX, player.posY+1, player.posZ, new BlueSlime(world), world, player); return stack; } @@ -71,7 +71,7 @@ public class XinStick extends Item { for (int y = 0; y < 128; y++) { - world.setBlockAndMetadataWithNotify((int) (x + dx), y, (int) (z + dz), 0, 0, 3); + world.setBlock((int) (x + dx), y, (int) (z + dz), 0, 0, 3); } } }