From 5bf2eac6463ded004ca8c2884ca45d0092c07851 Mon Sep 17 00:00:00 2001 From: mDiyo Date: Wed, 15 May 2013 19:13:19 -0700 Subject: [PATCH] BlockSkinRenderHelper represents colors as colors --- mods/tinker/tconstruct/TConstruct.java | 3 +- .../tconstruct/client/TClientEvents.java | 98 +- .../tconstruct/client/TProxyClient.java | 87 +- .../tconstruct/client/armor/WingModel.java | 123 +++ .../client/block/BlockSkinRenderHelper.java | 860 +++++++++--------- .../client/entity/CloneHeadModel.java | 33 + .../client/entity/SlimeCloneRender.java | 91 ++ .../tconstruct/client/entity/SlimeRender.java | 2 +- mods/tinker/tconstruct/common/TContent.java | 44 +- mods/tinker/tconstruct/entity/BlueSlime.java | 16 +- mods/tinker/tconstruct/entity/GolemBase.java | 8 +- mods/tinker/tconstruct/entity/SlimeClone.java | 165 ++++ .../tinker/tconstruct/inventory/SlotTool.java | 2 +- .../tconstruct/items/armor/TArmorBase.java | 6 +- .../tconstruct/items/tools/FryingPan.java | 2 +- .../items/materials/pattern_largeguard.png | Bin 246 -> 482 bytes .../sounds => sounds}/frypan_hit.ogg | Bin .../sounds => sounds}/little_saw.ogg | Bin test/XinStick.java | 8 +- 19 files changed, 1023 insertions(+), 525 deletions(-) create mode 100644 mods/tinker/tconstruct/client/armor/WingModel.java create mode 100644 mods/tinker/tconstruct/client/entity/CloneHeadModel.java create mode 100644 mods/tinker/tconstruct/client/entity/SlimeCloneRender.java create mode 100644 mods/tinker/tconstruct/entity/SlimeClone.java rename {mods/tinker/resources/sounds => sounds}/frypan_hit.ogg (100%) rename {mods/tinker/resources/sounds => sounds}/little_saw.ogg (100%) diff --git a/mods/tinker/tconstruct/TConstruct.java b/mods/tinker/tconstruct/TConstruct.java index 6b5418c..e2dd360 100644 --- a/mods/tinker/tconstruct/TConstruct.java +++ b/mods/tinker/tconstruct/TConstruct.java @@ -37,7 +37,7 @@ import cpw.mods.fml.common.registry.VillagerRegistry; * @dependencies: IC2 API */ -@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.3.12", dependencies = "required-after:Forge@[7.7.1.675,)") +@Mod(modid = "TConstruct", name = "TConstruct", version = "1.5.1_1.3.3.14", dependencies = "required-after:Forge@[7.7.1.675,)") @NetworkMod(serverSideRequired = false, clientSideRequired = true, channels = { "TConstruct" }, packetHandler = mods.tinker.tconstruct.util.network.TPacketHandler.class) public class TConstruct { @@ -105,6 +105,7 @@ public class TConstruct MinecraftForge.EVENT_BUS.register(playerTracker); content.modIntegration(); + content.createEntities(); } public static LiquidCasting getTableCasting() diff --git a/mods/tinker/tconstruct/client/TClientEvents.java b/mods/tinker/tconstruct/client/TClientEvents.java index 40cfa40..f57557b 100644 --- a/mods/tinker/tconstruct/client/TClientEvents.java +++ b/mods/tinker/tconstruct/client/TClientEvents.java @@ -1,44 +1,84 @@ package mods.tinker.tconstruct.client; import mods.tinker.tconstruct.TConstruct; +import mods.tinker.tconstruct.client.armor.WingModel; import mods.tinker.tconstruct.common.TContent; +import net.minecraft.client.model.ModelBiped; +import net.minecraft.client.renderer.entity.RenderPlayer; +import net.minecraft.entity.EntityLiving; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.client.event.RenderPlayerEvent; import net.minecraftforge.client.event.TextureStitchEvent; import net.minecraftforge.client.event.sound.SoundLoadEvent; import net.minecraftforge.event.ForgeSubscribe; import net.minecraftforge.liquids.LiquidStack; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; +@SideOnly(Side.CLIENT) public class TClientEvents { - /* Sounds */ - @ForgeSubscribe - @SideOnly(Side.CLIENT) - public void onSound (SoundLoadEvent event) - { - try - { - event.manager.soundPoolSounds.addSound("mods/tinker/resources/sounds/frypan_hit.ogg", TConstruct.class.getResource("/mods/tinker/resources/sounds/frypan_hit.ogg")); - event.manager.soundPoolSounds.addSound("mods/tinker/resources/sounds/little_saw.ogg", TConstruct.class.getResource("/mods/tinker/resources/sounds/little_saw.ogg")); - System.out.println("[TConstruct] Successfully loaded sounds."); - } - catch (Exception e) - { - System.err.println("[TConstruct] Failed to register one or more sounds"); - } - } + /* Sounds */ + @ForgeSubscribe + public void onSound (SoundLoadEvent event) + { + try + { + event.manager.soundPoolSounds.addSound("sounds/frypan_hit.ogg", TConstruct.class.getResource("/sounds/frypan_hit.ogg")); + event.manager.soundPoolSounds.addSound("sounds/little_saw.ogg", TConstruct.class.getResource("/sounds/little_saw.ogg")); + System.out.println("[TConstruct] Successfully loaded sounds."); + } + catch (Exception e) + { + System.err.println("[TConstruct] Failed to register one or more sounds"); + } + } - /* Liquids */ - @ForgeSubscribe - @SideOnly(Side.CLIENT) - public void postStitch (TextureStitchEvent.Post event) - { - for (int i = 0; i < TContent.liquidIcons.length; i++) - { - TContent.liquidIcons[i].setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); - LiquidStack canon = TContent.liquidIcons[i].canonical(); - if (canon != null) - canon.setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); - } - } + /* Liquids */ + @ForgeSubscribe + public void postStitch (TextureStitchEvent.Post event) + { + for (int i = 0; i < TContent.liquidIcons.length; i++) + { + TContent.liquidIcons[i].setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); + LiquidStack canon = TContent.liquidIcons[i].canonical(); + if (canon != null) + canon.setRenderingIcon(TContent.liquidMetalStill.getIcon(0, i)); + } + } + + /* Armor */ + ModelBiped model = new ModelBiped(5f); + WingModel wings = new WingModel(); + + /*static + { + model.bipedHead.showModel = false; + }*/ + + private float interpolateRotation (float par1, float par2, float par3) + { + float f3; + + for (f3 = par2 - par1; f3 < -180.0F; f3 += 360.0F) + { + ; + } + + while (f3 >= 180.0F) + { + f3 -= 360.0F; + } + + return par1 + par3 * f3; + } + + protected float handleRotationFloat (EntityLiving par1EntityLiving, float par2) + { + return (float) par1EntityLiving.ticksExisted + par2; + } } diff --git a/mods/tinker/tconstruct/client/TProxyClient.java b/mods/tinker/tconstruct/client/TProxyClient.java index dc37933..a41b698 100644 --- a/mods/tinker/tconstruct/client/TProxyClient.java +++ b/mods/tinker/tconstruct/client/TProxyClient.java @@ -10,26 +10,67 @@ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import mods.tinker.tconstruct.TConstruct; -import mods.tinker.tconstruct.blocks.logic.*; -import mods.tinker.tconstruct.client.block.*; -import mods.tinker.tconstruct.client.entity.*; -import mods.tinker.tconstruct.client.entity.projectile.*; -import mods.tinker.tconstruct.client.gui.*; -import mods.tinker.tconstruct.common.*; -import mods.tinker.tconstruct.entity.*; -import mods.tinker.tconstruct.entity.projectile.*; -import mods.tinker.tconstruct.items.tools.*; -import mods.tinker.tconstruct.library.*; -import mods.tinker.tconstruct.library.client.*; -import mods.tinker.tconstruct.library.crafting.*; -import mods.tinker.tconstruct.library.tools.*; -import mods.tinker.tconstruct.util.PHConstruct; -import mods.tinker.tconstruct.util.player.*; -import mods.tinker.tconstruct.worldgen.OverworldProvider; +import mods.tinker.tconstruct.blocks.logic.CastingBasinLogic; +import mods.tinker.tconstruct.blocks.logic.CastingTableLogic; +import mods.tinker.tconstruct.blocks.logic.FrypanLogic; +import mods.tinker.tconstruct.blocks.logic.GolemCoreLogic; +import mods.tinker.tconstruct.blocks.logic.PartCrafterLogic; +import mods.tinker.tconstruct.blocks.logic.PatternChestLogic; +import mods.tinker.tconstruct.blocks.logic.PatternShaperLogic; +import mods.tinker.tconstruct.blocks.logic.SmelteryLogic; +import mods.tinker.tconstruct.blocks.logic.ToolStationLogic; +import mods.tinker.tconstruct.client.block.CastingBasinSpecialRender; +import mods.tinker.tconstruct.client.block.CastingTableSpecialRenderer; +import mods.tinker.tconstruct.client.block.FluidRender; +import mods.tinker.tconstruct.client.block.FrypanRender; +import mods.tinker.tconstruct.client.block.GolemCoreRender; +import mods.tinker.tconstruct.client.block.GolemCoreSpecialRender; +import mods.tinker.tconstruct.client.block.OreberryRender; +import mods.tinker.tconstruct.client.block.SearedRender; +import mods.tinker.tconstruct.client.block.SmallFontRenderer; +import mods.tinker.tconstruct.client.block.SmelteryRender; +import mods.tinker.tconstruct.client.block.TableRender; +import mods.tinker.tconstruct.client.block.TankRender; +import mods.tinker.tconstruct.client.entity.CartRender; +import mods.tinker.tconstruct.client.entity.CloneHeadModel; +import mods.tinker.tconstruct.client.entity.CrystalRender; +import mods.tinker.tconstruct.client.entity.FancyItemRender; +import mods.tinker.tconstruct.client.entity.GolemRender; +import mods.tinker.tconstruct.client.entity.SkylaRender; +import mods.tinker.tconstruct.client.entity.SlimeCloneRender; +import mods.tinker.tconstruct.client.entity.SlimeRender; +import mods.tinker.tconstruct.client.entity.projectile.DaggerRender; +import mods.tinker.tconstruct.client.entity.projectile.LaunchedItemRender; +import mods.tinker.tconstruct.client.gui.ArmorExtendedGui; +import mods.tinker.tconstruct.client.gui.FrypanGui; +import mods.tinker.tconstruct.client.gui.GuiManual; +import mods.tinker.tconstruct.client.gui.PartCrafterGui; +import mods.tinker.tconstruct.client.gui.PatternChestGui; +import mods.tinker.tconstruct.client.gui.PatternShaperGui; +import mods.tinker.tconstruct.client.gui.SmelteryGui; +import mods.tinker.tconstruct.client.gui.ToolStationGui; +import mods.tinker.tconstruct.common.TContent; +import mods.tinker.tconstruct.common.TProxyCommon; +import mods.tinker.tconstruct.entity.BlueSlime; +import mods.tinker.tconstruct.entity.CartEntity; +import mods.tinker.tconstruct.entity.Crystal; +import mods.tinker.tconstruct.entity.FancyEntityItem; +import mods.tinker.tconstruct.entity.GolemBase; +import mods.tinker.tconstruct.entity.NitroCreeper; +import mods.tinker.tconstruct.entity.Skyla; +import mods.tinker.tconstruct.entity.SlimeClone; +import mods.tinker.tconstruct.entity.projectile.DaggerEntity; +import mods.tinker.tconstruct.entity.projectile.LaunchedPotion; +import mods.tinker.tconstruct.items.tools.Dagger; +import mods.tinker.tconstruct.library.TConstructRegistry; +import mods.tinker.tconstruct.library.client.TConstructClientRegistry; +import mods.tinker.tconstruct.library.client.ToolGuiElement; +import mods.tinker.tconstruct.library.crafting.ToolBuilder; +import mods.tinker.tconstruct.library.tools.ToolCore; +import mods.tinker.tconstruct.util.player.ArmorExtended; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.model.ModelSlime; import net.minecraft.client.particle.EntityAuraFX; import net.minecraft.client.particle.EntityBreakingFX; @@ -67,8 +108,6 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import net.minecraft.world.World; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; import org.lwjgl.opengl.GL11; @@ -199,15 +238,6 @@ public class TProxyClient extends TProxyCommon //RenderingRegistry.registerBlockHandler(new BrickRender()); //RenderingRegistry.registerBlockHandler(new BallRepeaterRender()); - //Tools - /*IItemRenderer render = new SuperCustomToolRenderer(); - for (ToolCore tool : TConstructRegistry.tools) - { - MinecraftForgeClient.registerItemRenderer(tool.itemID, render); - }*/ - - //MinecraftForgeClient.registerItemRenderer(TContent.chisel.itemID, new ChiselRotator()); - //Special Renderers ClientRegistry.bindTileEntitySpecialRenderer(CastingTableLogic.class, new CastingTableSpecialRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(GolemCoreLogic.class, new GolemCoreSpecialRender()); @@ -217,6 +247,7 @@ public class TProxyClient extends TProxyCommon RenderingRegistry.registerEntityRenderingHandler(FancyEntityItem.class, new FancyItemRender()); RenderingRegistry.registerEntityRenderingHandler(NitroCreeper.class, new RenderCreeper()); RenderingRegistry.registerEntityRenderingHandler(BlueSlime.class, new SlimeRender(new ModelSlime(16), new ModelSlime(0), 0.25F)); + RenderingRegistry.registerEntityRenderingHandler(SlimeClone.class, new SlimeCloneRender(new CloneHeadModel(0), new CloneHeadModel(1f), 0.25F)); RenderingRegistry.registerEntityRenderingHandler(GolemBase.class, new GolemRender(0)); RenderingRegistry.registerEntityRenderingHandler(CartEntity.class, new CartRender()); diff --git a/mods/tinker/tconstruct/client/armor/WingModel.java b/mods/tinker/tconstruct/client/armor/WingModel.java new file mode 100644 index 0000000..12eeb09 --- /dev/null +++ b/mods/tinker/tconstruct/client/armor/WingModel.java @@ -0,0 +1,123 @@ +package mods.tinker.tconstruct.client.armor; + +import mods.tinker.tconstruct.client.tmt.ModelRendererTurbo; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.entity.Entity; + +public class WingModel extends ModelBase +{ + ModelRenderer WingBaseRight; + ModelRenderer WingEdgeRight; + ModelRenderer WingInsetRight; + ModelRenderer WingCenterRight; + ModelRenderer WingFlangeRight; + ModelRenderer WingAuxRight; + ModelRenderer WingBaseLeft; + ModelRenderer WingEdgeLeft; + ModelRenderer WingInsetLeft; + ModelRenderer WingCenterLeft; + ModelRenderer WingFlangeLeft; + ModelRenderer WingAuxLeft; + + public WingModel() + { + textureWidth = 64; + textureHeight = 64; + + //Right Wing + WingBaseRight = new ModelRenderer(this, 0, 41); + WingBaseRight.addBox(-0.5F, -1F, 0F, 1, 2, 10); + WingBaseRight.setRotationPoint(-1F, 1F, 0F); + setRotation(WingBaseRight, 0.5235988F, -0.5235988F, 0F); + + WingEdgeRight = new ModelRenderer(this, 0, 53); //Texture position + WingEdgeRight.addBox(0F, 0F, -2F, 1, 9, 2); //Offset, Size + WingEdgeRight.setRotationPoint(-0.502F, -1F, 10F); //Negative x, y - 1, Position + setRotation(WingEdgeRight, 0.5235988F, 0F, 0F); //Angle in radians + + WingInsetRight = new ModelRenderer(this, 6, 53); + WingInsetRight.addBox(0F, 0F, -1F, 1, 9, 2); + WingInsetRight.setRotationPoint(-0.504F, 0F, 7.8F); + setRotation(WingInsetRight, 0.3490659F, 0F, 0F); + + WingCenterRight = new ModelRenderer(this, 12, 53); + WingCenterRight.addBox(0F, 0F, -1F, 1, 9, 2); + WingCenterRight.setRotationPoint(-0.506F, 0.3F, 6.3F); + setRotation(WingCenterRight, 0.1745329F, 0F, 0F); + + WingFlangeRight = new ModelRenderer(this, 18, 53); + WingFlangeRight.addBox(0F, 0F, -1F, 1, 8, 2); + WingFlangeRight.setRotationPoint(-0.508F, 0.3F, 5.1F); + setRotation(WingFlangeRight, 0F, 0F, 0F); + + WingAuxRight = new ModelRenderer(this, 24, 53); + WingAuxRight.addBox(0F, 0F, -1F, 1, 7, 2); + WingAuxRight.setRotationPoint(-0.51F, 0.1F, 4F); + setRotation(WingAuxRight, -0.1745329F, 0F, 0F); + + WingBaseRight.addChild(WingEdgeRight); + WingBaseRight.addChild(WingInsetRight); + WingBaseRight.addChild(WingCenterRight); + WingBaseRight.addChild(WingFlangeRight); + WingBaseRight.addChild(WingAuxRight); + + //Left Wing + WingBaseLeft = new ModelRenderer(this, 42, 41); + WingBaseLeft.addBox(-0.5F, -1F, 0F, 1, 2, 10); + WingBaseLeft.setRotationPoint(1F, 1F, 0F); + setRotation(WingBaseLeft, 0.5235988F, 0.5235988F, 0F); + + WingEdgeLeft = new ModelRenderer(this, 58, 53); + WingEdgeLeft.addBox(0F, 0F, -2F, 1, 9, 2); + WingEdgeLeft.setRotationPoint(-0.502F, -1F, 10F); + setRotation(WingEdgeLeft, 0.5235988F, 0F, 0F); + + WingInsetLeft = new ModelRenderer(this, 52, 53); + WingInsetLeft.addBox(0F, 0F, -1F, 1, 9, 2); + WingInsetLeft.setRotationPoint(-0.504F, 0F, 7.8F); + setRotation(WingInsetLeft, 0.3490659F, 0F, 0F); + + WingCenterLeft = new ModelRenderer(this, 46, 53); + WingCenterLeft.addBox(0F, 0F, -1F, 1, 9, 2); + WingCenterLeft.setRotationPoint(-0.506F, 0.3F, 6.3F); + setRotation(WingCenterLeft, 0.1745329F, 0F, 0F); + + WingFlangeLeft = new ModelRenderer(this, 40, 53); + WingFlangeLeft.addBox(0F, 0F, -1F, 1, 8, 2); + WingFlangeLeft.setRotationPoint(-0.508F, 0.3F, 5.1F); + setRotation(WingFlangeLeft, 0F, 0F, 0F); + + WingAuxLeft = new ModelRenderer(this, 34, 53); + WingAuxLeft.addBox(0F, 0F, -1F, 1, 7, 2); + WingAuxLeft.setRotationPoint(-0.51F, 0.1F, 4F); + setRotation(WingAuxLeft, -0.1745329F, 0F, 0F); + + WingBaseLeft.addChild(WingEdgeLeft); + WingBaseLeft.addChild(WingInsetLeft); + WingBaseLeft.addChild(WingCenterLeft); + WingBaseLeft.addChild(WingFlangeLeft); + WingBaseLeft.addChild(WingAuxLeft); + } + + public void render (Entity entity, float f, float f1, float f2, float f3, float f4, float f5) + { + super.render(entity, f, f1, f2, f3, f4, f5); + setRotationAngles(f, f1, f2, f3, f4, f5, entity); + WingBaseRight.render(f5); + WingBaseLeft.render(f5); + } + + private void setRotation (ModelRenderer model, float x, float y, float z) + { + model.rotateAngleX = x; + model.rotateAngleY = y; + model.rotateAngleZ = z; + } + + public void setRotationAngles (float f, float f1, float f2, float f3, float f4, float f5, Entity entity) + { + super.setRotationAngles(f, f1, f2, f3, f4, f5, entity); + } + +} diff --git a/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java b/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java index a515952..9718c6f 100644 --- a/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java +++ b/mods/tinker/tconstruct/client/block/BlockSkinRenderHelper.java @@ -33,8 +33,8 @@ public class BlockSkinRenderHelper : renderMetadataBlockWithColorMultiplier(block, metadata, x, y, z, var6, var7, var8, renderer, world); } - static boolean renderMetadataBlockWithAmbientOcclusion(Block block, int metadata, int xMin, int yMin, int zMin, - float xMax, float yMax, float zMax, RenderBlocks render, IBlockAccess world) + static boolean renderMetadataBlockWithAmbientOcclusion(Block block, int metadata, int xPos, int yPos, int zPos, + float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) { render.enableAO = true; boolean flag = false; @@ -43,7 +43,7 @@ public class BlockSkinRenderHelper float f5 = 0.0F; float f6 = 0.0F; boolean flag1 = true; - int l = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin); + int l = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos); Tessellator tessellator = Tessellator.instance; tessellator.setBrightness(983055); @@ -63,25 +63,25 @@ public class BlockSkinRenderHelper float f7; int i1; - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin - 1, zMin, 0)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) { if (render.renderMinY <= 0.0D) { - --yMin; + --yPos; } - 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)]; + render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); + render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); + render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); + render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); + render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); + render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); + render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); + render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos - 1, zPos)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos - 1)]; if (!flag4 && !flag2) { @@ -90,8 +90,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos - 1); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos - 1); } if (!flag5 && !flag2) @@ -101,8 +101,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos + 1); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos + 1); } if (!flag4 && !flag3) @@ -112,8 +112,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos - 1); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos - 1); } if (!flag5 && !flag3) @@ -123,23 +123,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos + 1); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos + 1); } if (render.renderMinY <= 0.0D) { - ++yMin; + ++yPos; } i1 = l; - if (render.renderMinY <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin - 1, zMin)) + if (render.renderMinY <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xPos, yPos - 1, zPos)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); 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; @@ -151,9 +151,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.5F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.5F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.5F; } else { @@ -174,29 +174,29 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceYNeg(block, (double)xMin, (double)yMin, (double)zMin, block.getIcon(0, metadata)); + render.renderFaceYNeg(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(0, metadata)); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin + 1, zMin, 1)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) { if (render.renderMaxY >= 1.0D) { - ++yMin; + ++yPos; } - 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)]; + render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); + render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); + render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); + render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); + render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); + render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); + render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); + render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos - 1)]; if (!flag4 && !flag2) { @@ -205,8 +205,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos - 1); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos - 1); } if (!flag4 && !flag3) @@ -216,8 +216,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos - 1); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos - 1); } if (!flag5 && !flag2) @@ -227,8 +227,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos + 1); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos + 1); } if (!flag5 && !flag3) @@ -238,23 +238,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos + 1); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos + 1); } if (render.renderMaxY >= 1.0D) { - --yMin; + --yPos; } i1 = l; - if (render.renderMaxY >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin + 1, zMin)) + if (render.renderMaxY >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xPos, yPos + 1, zPos)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); 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; @@ -263,9 +263,9 @@ public class BlockSkinRenderHelper 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 = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -278,31 +278,31 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceYPos(block, (double)xMin, (double)yMin, (double)zMin, block.getIcon(1, metadata)); + render.renderFaceYPos(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(1, metadata)); flag = true; } Icon icon; - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin - 1, 2)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) { if (render.renderMinZ <= 0.0D) { - --zMin; + --zPos; } - 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)]; + render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); + render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); + render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); + render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); + render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); + render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); + render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); + render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos - 1)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos - 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos - 1)]; if (!flag2 && !flag4) { @@ -311,8 +311,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos - 1, zPos); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos - 1, zPos); } if (!flag2 && !flag5) @@ -322,8 +322,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos + 1, zPos); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos + 1, zPos); } if (!flag3 && !flag4) @@ -333,8 +333,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos - 1, zPos); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos - 1, zPos); } if (!flag3 && !flag5) @@ -344,23 +344,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos + 1, zPos); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos + 1, zPos); } if (render.renderMinZ <= 0.0D) { - ++zMin; + ++zPos; } i1 = l; - if (render.renderMinZ <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin - 1)) + if (render.renderMinZ <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xPos, yPos, zPos - 1)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 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; @@ -372,9 +372,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.8F; } else { @@ -396,30 +396,30 @@ public class BlockSkinRenderHelper render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; icon = block.getIcon(2, metadata); - render.renderFaceZNeg(block, (double)xMin, (double)yMin, (double)zMin, icon); + render.renderFaceZNeg(block, (double)xPos, (double)yPos, (double)zPos, icon); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin + 1, 3)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) { if (render.renderMaxZ >= 1.0D) { - ++zMin; + ++zPos; } - 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)]; + render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); + render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); + render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); + render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); + render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); + render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); + render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); + render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos + 1)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos + 1)]; if (!flag2 && !flag4) { @@ -428,8 +428,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos - 1, zPos); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos - 1, zPos); } if (!flag2 && !flag5) @@ -439,8 +439,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos + 1, zPos); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos + 1, zPos); } if (!flag3 && !flag4) @@ -450,8 +450,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos - 1, zPos); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos - 1, zPos); } if (!flag3 && !flag5) @@ -461,23 +461,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos + 1, zPos); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos + 1, zPos); } if (render.renderMaxZ >= 1.0D) { - --zMin; + --zPos; } i1 = l; - if (render.renderMaxZ >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin + 1)) + if (render.renderMaxZ >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xPos, yPos, zPos + 1)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 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; @@ -489,9 +489,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.8F; } else { @@ -513,30 +513,30 @@ public class BlockSkinRenderHelper render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; icon = block.getIcon(3, metadata); - render.renderFaceZPos(block, (double)xMin, (double)yMin, (double)zMin, icon); + render.renderFaceZPos(block, (double)xPos, (double)yPos, (double)zPos, icon); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin - 1, yMin, zMin, 4)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) { if (render.renderMinX <= 0.0D) { - --xMin; + --xPos; } - 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)]; + render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); + render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); + render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); + render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); + render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); + render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); + render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); + render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos - 1, zPos)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos - 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos + 1)]; if (!flag5 && !flag2) { @@ -545,8 +545,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos - 1); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos - 1); } if (!flag4 && !flag2) @@ -556,8 +556,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos + 1); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos + 1); } if (!flag5 && !flag3) @@ -567,8 +567,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos - 1); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos - 1); } if (!flag4 && !flag3) @@ -578,23 +578,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos + 1); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos + 1); } if (render.renderMinX <= 0.0D) { - ++xMin; + ++xPos; } i1 = l; - if (render.renderMinX <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin - 1, yMin, zMin)) + if (render.renderMinX <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xPos - 1, yPos, zPos)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); 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; @@ -606,9 +606,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.6F; } else { @@ -630,30 +630,30 @@ public class BlockSkinRenderHelper render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; icon = block.getIcon(4, metadata); - render.renderFaceXNeg(block, (double)xMin, (double)yMin, (double)zMin, icon); + render.renderFaceXNeg(block, (double)xPos, (double)yPos, (double)zPos, icon); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin + 1, yMin, zMin, 5)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) { if (render.renderMaxX >= 1.0D) { - ++xMin; + ++xPos; } - 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)]; + render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); + render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); + render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); + render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); + render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); + render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); + render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); + render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)]; if (!flag2 && !flag4) { @@ -662,8 +662,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos - 1); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos - 1); } if (!flag2 && !flag5) @@ -673,8 +673,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos + 1); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos + 1); } if (!flag3 && !flag4) @@ -684,8 +684,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos - 1); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos - 1); } if (!flag3 && !flag5) @@ -695,23 +695,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos + 1); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos + 1); } if (render.renderMaxX >= 1.0D) { - --xMin; + --xPos; } i1 = l; - if (render.renderMaxX >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin + 1, yMin, zMin)) + if (render.renderMaxX >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xPos + 1, yPos, zPos)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); 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; @@ -723,9 +723,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.6F; } else { @@ -747,7 +747,7 @@ public class BlockSkinRenderHelper render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; icon = block.getIcon(5, metadata); - render.renderFaceXPos(block, (double)xMin, (double)yMin, (double)zMin, icon); + render.renderFaceXPos(block, (double)xPos, (double)yPos, (double)zPos, icon); flag = true; } @@ -756,7 +756,7 @@ public class BlockSkinRenderHelper return flag; } - static boolean renderMetadataBlockWithColorMultiplier(Block block, int metadata, int xMin, int yMin, int zMin, float xMax, float yMax, float zMax, RenderBlocks render, IBlockAccess world) + static boolean renderMetadataBlockWithColorMultiplier(Block block, int metadata, int xPos, int yPos, int zPos, float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) { render.enableAO = false; Tessellator tessellator = Tessellator.instance; @@ -765,9 +765,9 @@ public class BlockSkinRenderHelper float f4 = 1.0F; float f5 = 0.8F; float f6 = 0.6F; - float f7 = f4 * xMax; - float f8 = f4 * yMax; - float f9 = f4 * zMax; + float f7 = f4 * colorRed; + float f8 = f4 * colorGreen; + float f9 = f4 * colorBlue; float f10 = f3; float f11 = f5; float f12 = f6; @@ -780,69 +780,69 @@ public class BlockSkinRenderHelper if (block != Block.grass) { - f10 = f3 * xMax; - f11 = f5 * xMax; - f12 = f6 * xMax; - f13 = f3 * yMax; - f14 = f5 * yMax; - f15 = f6 * yMax; - f16 = f3 * zMax; - f17 = f5 * zMax; - f18 = f6 * zMax; + f10 = f3 * colorRed; + f11 = f5 * colorRed; + f12 = f6 * colorRed; + f13 = f3 * colorGreen; + f14 = f5 * colorGreen; + f15 = f6 * colorGreen; + f16 = f3 * colorBlue; + f17 = f5 * colorBlue; + f18 = f6 * colorBlue; } - int l = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin); + int l = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos); - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin - 1, zMin, 0)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) { - tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin)); + tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos)); tessellator.setColorOpaque_F(f10, f13, f16); - render.renderFaceYNeg(block, (double)xMin, (double)yMin, (double)zMin, block.getIcon(0, metadata)); + render.renderFaceYNeg(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(0, metadata)); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin + 1, zMin, 1)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) { - tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin)); + tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos)); tessellator.setColorOpaque_F(f7, f8, f9); - render.renderFaceYPos(block, (double)xMin, (double)yMin, (double)zMin, block.getIcon(1, metadata)); + render.renderFaceYPos(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(1, metadata)); flag = true; } Icon icon; - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin - 1, 2)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) { - tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1)); + tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1)); tessellator.setColorOpaque_F(f11, f14, f17); - render.renderFaceZNeg(block, (double)xMin, (double)yMin, (double)zMin, block.getIcon(2, metadata)); + render.renderFaceZNeg(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(2, metadata)); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin + 1, 3)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) { - tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1)); + tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1)); tessellator.setColorOpaque_F(f11, f14, f17); - render.renderFaceZPos(block, (double)xMin, (double)yMin, (double)zMin, block.getIcon(3, metadata)); + render.renderFaceZPos(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(3, metadata)); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin - 1, yMin, zMin, 4)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) { - tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin)); + tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); - render.renderFaceXNeg(block, (double)xMin, (double)yMin, (double)zMin, block.getIcon(4, metadata)); + render.renderFaceXNeg(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(4, metadata)); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin + 1, yMin, zMin, 5)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) { - tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin)); + tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); - render.renderFaceXPos(block, (double)xMin, (double)yMin, (double)zMin, block.getIcon(5, metadata)); + render.renderFaceXPos(block, (double)xPos, (double)yPos, (double)zPos, block.getIcon(5, metadata)); flag = true; } @@ -873,8 +873,8 @@ public class BlockSkinRenderHelper : renderFakeBlockWithColorMultiplier(texture, x, y, z, var6, var7, var8, renderer, world); } - static boolean renderFakeBlockWithAmbientOcclusion(Icon texture, int xMin, int yMin, int zMin, - float xMax, float yMax, float zMax, RenderBlocks render, IBlockAccess world) + static boolean renderFakeBlockWithAmbientOcclusion(Icon texture, int xPos, int yPos, int zPos, + float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) { Block block = Block.stone; render.enableAO = true; @@ -884,7 +884,7 @@ public class BlockSkinRenderHelper float f5 = 0.0F; float f6 = 0.0F; boolean flag1 = true; - int l = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin); + int l = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos); Tessellator tessellator = Tessellator.instance; tessellator.setBrightness(983055); @@ -904,25 +904,25 @@ public class BlockSkinRenderHelper float f7; int i1; - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin - 1, zMin, 0)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) { if (render.renderMinY <= 0.0D) { - --yMin; + --yPos; } - 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)]; + render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); + render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); + render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); + render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); + render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); + render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); + render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); + render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos - 1, zPos)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos - 1)]; if (!flag4 && !flag2) { @@ -931,8 +931,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos - 1); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos - 1); } if (!flag5 && !flag2) @@ -942,8 +942,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos + 1); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos + 1); } if (!flag4 && !flag3) @@ -953,8 +953,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos - 1); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos - 1); } if (!flag5 && !flag3) @@ -964,23 +964,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos + 1); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos + 1); } if (render.renderMinY <= 0.0D) { - ++yMin; + ++yPos; } i1 = l; - if (render.renderMinY <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin - 1, zMin)) + if (render.renderMinY <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xPos, yPos - 1, zPos)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); 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; @@ -992,9 +992,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.5F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.5F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.5F; } else { @@ -1015,29 +1015,29 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceYNeg(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceYNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin + 1, zMin, 1)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) { if (render.renderMaxY >= 1.0D) { - ++yMin; + ++yPos; } - 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)]; + render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); + render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); + render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); + render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); + render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); + render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); + render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); + render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos - 1)]; if (!flag4 && !flag2) { @@ -1046,8 +1046,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin - 1); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin - 1); + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos - 1); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos - 1); } if (!flag4 && !flag3) @@ -1057,8 +1057,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin - 1); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin - 1); + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos - 1); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos - 1); } if (!flag5 && !flag2) @@ -1068,8 +1068,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin + 1); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin + 1); + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos + 1); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos + 1); } if (!flag5 && !flag3) @@ -1079,23 +1079,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin + 1); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin + 1); + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos + 1); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos + 1); } if (render.renderMaxY >= 1.0D) { - --yMin; + --yPos; } i1 = l; - if (render.renderMaxY >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin + 1, zMin)) + if (render.renderMaxY >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xPos, yPos + 1, zPos)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); 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; @@ -1104,9 +1104,9 @@ public class BlockSkinRenderHelper 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 = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue; render.colorRedTopLeft *= f3; render.colorGreenTopLeft *= f3; render.colorBlueTopLeft *= f3; @@ -1119,29 +1119,29 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceYPos(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceYPos(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin - 1, 2)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) { if (render.renderMinZ <= 0.0D) { - --zMin; + --zPos; } - 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)]; + render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); + render.aoLightValueScratchYZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); + render.aoLightValueScratchYZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); + render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); + render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); + render.aoBrightnessYZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); + render.aoBrightnessYZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); + render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos - 1)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos - 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos - 1)]; if (!flag2 && !flag4) { @@ -1150,8 +1150,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos - 1, zPos); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos - 1, zPos); } if (!flag2 && !flag5) @@ -1161,8 +1161,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos + 1, zPos); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos + 1, zPos); } if (!flag3 && !flag4) @@ -1172,8 +1172,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos - 1, zPos); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos - 1, zPos); } if (!flag3 && !flag5) @@ -1183,23 +1183,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos + 1, zPos); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos + 1, zPos); } if (render.renderMinZ <= 0.0D) { - ++zMin; + ++zPos; } i1 = l; - if (render.renderMinZ <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin - 1)) + if (render.renderMinZ <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xPos, yPos, zPos - 1)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin - 1); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 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; @@ -1211,9 +1211,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.8F; } else { @@ -1234,30 +1234,30 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceZNeg(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceZNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin + 1, 3)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) { if (render.renderMaxZ >= 1.0D) { - ++zMin; + ++zPos; } - 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)]; + render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); + render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); + render.aoLightValueScratchYZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); + render.aoLightValueScratchYZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); + render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); + render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); + render.aoBrightnessYZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); + render.aoBrightnessYZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos + 1)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos + 1, zPos + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos, yPos - 1, zPos + 1)]; if (!flag2 && !flag4) { @@ -1266,8 +1266,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin - 1, zMin); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin - 1, zMin); + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos - 1, zPos); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos - 1, zPos); } if (!flag2 && !flag5) @@ -1277,8 +1277,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin + 1, zMin); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin + 1, zMin); + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos + 1, zPos); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos + 1, zPos); } if (!flag3 && !flag4) @@ -1288,8 +1288,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin - 1, zMin); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin - 1, zMin); + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos - 1, zPos); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos - 1, zPos); } if (!flag3 && !flag5) @@ -1299,23 +1299,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin + 1, zMin); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin + 1, zMin); + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos + 1, zPos); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos + 1, zPos); } if (render.renderMaxZ >= 1.0D) { - --zMin; + --zPos; } i1 = l; - if (render.renderMaxZ >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin, yMin, zMin + 1)) + if (render.renderMaxZ >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xPos, yPos, zPos + 1)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin, zMin + 1); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 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; @@ -1327,9 +1327,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.8F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.8F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.8F; } else { @@ -1350,30 +1350,30 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceZPos(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceZPos(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin - 1, yMin, zMin, 4)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) { if (render.renderMinX <= 0.0D) { - --xMin; + --xPos; } - 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)]; + render.aoLightValueScratchXYNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); + render.aoLightValueScratchXZNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); + render.aoLightValueScratchXZNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); + render.aoLightValueScratchXYNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); + render.aoBrightnessXYNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); + render.aoBrightnessXZNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); + render.aoBrightnessXZNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); + render.aoBrightnessXYNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos + 1, zPos)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos - 1, zPos)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos - 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos - 1, yPos, zPos + 1)]; if (!flag5 && !flag2) { @@ -1382,8 +1382,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); - render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); + render.aoLightValueScratchXYZNNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos - 1); + render.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos - 1); } if (!flag4 && !flag2) @@ -1393,8 +1393,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); - render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); + render.aoLightValueScratchXYZNNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos + 1); + render.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos + 1); } if (!flag5 && !flag3) @@ -1404,8 +1404,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); - render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); + render.aoLightValueScratchXYZNPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos - 1); + render.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos - 1); } if (!flag4 && !flag3) @@ -1415,23 +1415,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); - render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); + render.aoLightValueScratchXYZNPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos + 1); + render.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos + 1); } if (render.renderMinX <= 0.0D) { - ++xMin; + ++xPos; } i1 = l; - if (render.renderMinX <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xMin - 1, yMin, zMin)) + if (render.renderMinX <= 0.0D || !render.blockAccess.isBlockOpaqueCube(xPos - 1, yPos, zPos)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin - 1, yMin, zMin); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos - 1, yPos, zPos); 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; @@ -1443,9 +1443,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.6F; } else { @@ -1466,30 +1466,30 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceXNeg(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceXNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin + 1, yMin, zMin, 5)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) { if (render.renderMaxX >= 1.0D) { - ++xMin; + ++xPos; } - 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)]; + render.aoLightValueScratchXYPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos); + render.aoLightValueScratchXZPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos - 1); + render.aoLightValueScratchXZPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos, zPos + 1); + render.aoLightValueScratchXYPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos); + render.aoBrightnessXYPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos); + render.aoBrightnessXZPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1); + render.aoBrightnessXZPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1); + render.aoBrightnessXYPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos); + flag3 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos + 1, zPos)]; + flag2 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos - 1, zPos)]; + flag5 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos + 1)]; + flag4 = Block.canBlockGrass[render.blockAccess.getBlockId(xPos + 1, yPos, zPos - 1)]; if (!flag2 && !flag4) { @@ -1498,8 +1498,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin - 1); - render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin - 1); + render.aoLightValueScratchXYZPNN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos - 1); + render.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos - 1); } if (!flag2 && !flag5) @@ -1509,8 +1509,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin - 1, zMin + 1); - render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin + 1); + render.aoLightValueScratchXYZPNP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos - 1, zPos + 1); + render.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos + 1); } if (!flag3 && !flag4) @@ -1520,8 +1520,8 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin - 1); - render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin - 1); + render.aoLightValueScratchXYZPPN = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos - 1); + render.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos - 1); } if (!flag3 && !flag5) @@ -1531,23 +1531,23 @@ public class BlockSkinRenderHelper } else { - render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xMin, yMin + 1, zMin + 1); - render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin + 1); + render.aoLightValueScratchXYZPPP = block.getAmbientOcclusionLightValue(render.blockAccess, xPos, yPos + 1, zPos + 1); + render.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos + 1); } if (render.renderMaxX >= 1.0D) { - --xMin; + --xPos; } i1 = l; - if (render.renderMaxX >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xMin + 1, yMin, zMin)) + if (render.renderMaxX >= 1.0D || !render.blockAccess.isBlockOpaqueCube(xPos + 1, yPos, zPos)) { - i1 = block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin); + i1 = block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos); } - f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xMin + 1, yMin, zMin); + f7 = block.getAmbientOcclusionLightValue(render.blockAccess, xPos + 1, yPos, zPos); 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; @@ -1559,9 +1559,9 @@ public class BlockSkinRenderHelper 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; + render.colorRedTopLeft = render.colorRedBottomLeft = render.colorRedBottomRight = render.colorRedTopRight = colorRed * 0.6F; + render.colorGreenTopLeft = render.colorGreenBottomLeft = render.colorGreenBottomRight = render.colorGreenTopRight = colorGreen * 0.6F; + render.colorBlueTopLeft = render.colorBlueBottomLeft = render.colorBlueBottomRight = render.colorBlueTopRight = colorBlue * 0.6F; } else { @@ -1582,7 +1582,7 @@ public class BlockSkinRenderHelper render.colorRedTopRight *= f6; render.colorGreenTopRight *= f6; render.colorBlueTopRight *= f6; - render.renderFaceXPos(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceXPos(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } @@ -1591,7 +1591,7 @@ public class BlockSkinRenderHelper return flag; } - static boolean renderFakeBlockWithColorMultiplier(Icon texture, int xMin, int yMin, int zMin, float xMax, float yMax, float zMax, RenderBlocks render, IBlockAccess world) + static boolean renderFakeBlockWithColorMultiplier(Icon texture, int xPos, int yPos, int zPos, float colorRed, float colorGreen, float colorBlue, RenderBlocks render, IBlockAccess world) { Block block = Block.stone; render.enableAO = false; @@ -1601,9 +1601,9 @@ public class BlockSkinRenderHelper float f4 = 1.0F; float f5 = 0.8F; float f6 = 0.6F; - float f7 = f4 * xMax; - float f8 = f4 * yMax; - float f9 = f4 * zMax; + float f7 = f4 * colorRed; + float f8 = f4 * colorGreen; + float f9 = f4 * colorBlue; float f10 = f3; float f11 = f5; float f12 = f6; @@ -1616,69 +1616,69 @@ public class BlockSkinRenderHelper if (block != Block.grass) { - f10 = f3 * xMax; - f11 = f5 * xMax; - f12 = f6 * xMax; - f13 = f3 * yMax; - f14 = f5 * yMax; - f15 = f6 * yMax; - f16 = f3 * zMax; - f17 = f5 * zMax; - f18 = f6 * zMax; + f10 = f3 * colorRed; + f11 = f5 * colorRed; + f12 = f6 * colorRed; + f13 = f3 * colorGreen; + f14 = f5 * colorGreen; + f15 = f6 * colorGreen; + f16 = f3 * colorBlue; + f17 = f5 * colorBlue; + f18 = f6 * colorBlue; } - int l = block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin); + int l = block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos); - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin - 1, zMin, 0)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos - 1, zPos, 0)) { - tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin - 1, zMin)); + tessellator.setBrightness(render.renderMinY > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos - 1, zPos)); tessellator.setColorOpaque_F(f10, f13, f16); - render.renderFaceYNeg(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceYNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin + 1, zMin, 1)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos + 1, zPos, 1)) { - tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin + 1, zMin)); + tessellator.setBrightness(render.renderMaxY < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos + 1, zPos)); tessellator.setColorOpaque_F(f7, f8, f9); - render.renderFaceYPos(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceYPos(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } Icon icon; - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin - 1, 2)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos - 1, 2)) { - tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin - 1)); + tessellator.setBrightness(render.renderMinZ > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos - 1)); tessellator.setColorOpaque_F(f11, f14, f17); - render.renderFaceZNeg(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceZNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin, yMin, zMin + 1, 3)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos, yPos, zPos + 1, 3)) { - tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin, yMin, zMin + 1)); + tessellator.setBrightness(render.renderMaxZ < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos, yPos, zPos + 1)); tessellator.setColorOpaque_F(f11, f14, f17); - render.renderFaceZPos(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceZPos(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin - 1, yMin, zMin, 4)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos - 1, yPos, zPos, 4)) { - tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin - 1, yMin, zMin)); + tessellator.setBrightness(render.renderMinX > 0.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos - 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); - render.renderFaceXNeg(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceXNeg(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } - if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xMin + 1, yMin, zMin, 5)) + if (render.renderAllFaces || block.shouldSideBeRendered(render.blockAccess, xPos + 1, yPos, zPos, 5)) { - tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xMin + 1, yMin, zMin)); + tessellator.setBrightness(render.renderMaxX < 1.0D ? l : block.getMixedBrightnessForBlock(render.blockAccess, xPos + 1, yPos, zPos)); tessellator.setColorOpaque_F(f12, f15, f18); - render.renderFaceXPos(block, (double)xMin, (double)yMin, (double)zMin, texture); + render.renderFaceXPos(block, (double)xPos, (double)yPos, (double)zPos, texture); flag = true; } diff --git a/mods/tinker/tconstruct/client/entity/CloneHeadModel.java b/mods/tinker/tconstruct/client/entity/CloneHeadModel.java new file mode 100644 index 0000000..93996a2 --- /dev/null +++ b/mods/tinker/tconstruct/client/entity/CloneHeadModel.java @@ -0,0 +1,33 @@ +package mods.tinker.tconstruct.client.entity; + +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 CloneHeadModel extends ModelBase +{ + /** The slime's bodies, both the inside box and the outside box */ + ModelRenderer slimeBodies; + ModelRenderer slimeHeadwear; + + public CloneHeadModel(float scale) + { + this.slimeBodies = new ModelRenderer(this, 0, 0); + this.slimeBodies.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8); + this.slimeHeadwear = new ModelRenderer(this, 32, 0); + this.slimeHeadwear.addBox(-4.0F, 16.0F, -4.0F, 8, 8, 8, scale); + } + + /** + * 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); + this.slimeHeadwear.render(par7); + } +} diff --git a/mods/tinker/tconstruct/client/entity/SlimeCloneRender.java b/mods/tinker/tconstruct/client/entity/SlimeCloneRender.java new file mode 100644 index 0000000..01827fd --- /dev/null +++ b/mods/tinker/tconstruct/client/entity/SlimeCloneRender.java @@ -0,0 +1,91 @@ +package mods.tinker.tconstruct.client.entity; + +import mods.tinker.tconstruct.entity.SlimeClone; +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 SlimeCloneRender extends RenderLiving +{ + private ModelBase scaleAmount; + + public SlimeCloneRender(ModelBase par1ModelBase, ModelBase par2ModelBase, float par3) + { + super(par1ModelBase, par3); + this.scaleAmount = par2ModelBase; + } + + /** + * Determines whether Slime Render should pass or not. + */ + protected int shouldSlimeRenderPass(SlimeClone blueSlime, int par2, float par3) + { + if (blueSlime.isInvisible()) + { + 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(SlimeClone slimeClone, float par2) + { + float f1 = 2; + float f2 = (slimeClone.sizeHeight + (slimeClone.sizeFactor - slimeClone.sizeHeight) * 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((SlimeClone)par1EntityLiving, par2); + } + + /** + * Queries whether should render the specified pass or not. + */ + protected int shouldRenderPass(EntityLiving par1EntityLiving, int par2, float par3) + { + return this.shouldSlimeRenderPass((SlimeClone)par1EntityLiving, par2, par3); + } + + protected void func_98191_a(SlimeClone slime) + { + this.loadDownloadableImageTexture(slime.skinUrl, slime.getTexture()); + } + + @Override + protected void func_98190_a(EntityLiving par1EntityLiving) + { + this.func_98191_a((SlimeClone)par1EntityLiving); + } +} diff --git a/mods/tinker/tconstruct/client/entity/SlimeRender.java b/mods/tinker/tconstruct/client/entity/SlimeRender.java index bae8d31..3b8c3fb 100644 --- a/mods/tinker/tconstruct/client/entity/SlimeRender.java +++ b/mods/tinker/tconstruct/client/entity/SlimeRender.java @@ -56,7 +56,7 @@ public class SlimeRender extends RenderLiving 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 f2 = (par1EdibleSlime.sizeHeight + (par1EdibleSlime.sizeFactor - par1EdibleSlime.sizeHeight) * par2) / (f1 * 0.5F + 1.0F); float f3 = 1.0F / (f2 + 1.0F); GL11.glScalef(f3 * f1, 1.0F / f3 * f1, f3 * f1); } diff --git a/mods/tinker/tconstruct/common/TContent.java b/mods/tinker/tconstruct/common/TContent.java index 45a4647..44dd9a6 100644 --- a/mods/tinker/tconstruct/common/TContent.java +++ b/mods/tinker/tconstruct/common/TContent.java @@ -27,6 +27,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.liquids.LiquidContainerData; import net.minecraftforge.liquids.LiquidContainerRegistry; @@ -159,7 +160,6 @@ public class TContent implements IFuelHandler public TContent() { - createEntities(); registerBlocks(); registerItems(); registerMaterials(); @@ -167,12 +167,12 @@ public class TContent implements IFuelHandler setupToolTabs(); } - void createEntities () + public void createEntities () { EntityRegistry.registerModEntity(FancyEntityItem.class, "Fancy Item", 0, TConstruct.instance, 32, 5, true); EntityRegistry.registerModEntity(DaggerEntity.class, "Dagger", 1, TConstruct.instance, 32, 5, true); + EntityRegistry.registerModEntity(SlimeClone.class, "SlimeClone", 2, TConstruct.instance, 32, 5, true); //EntityRegistry.registerModEntity(LaunchedPotion.class, "Launched Potion", 1, TConstruct.instance, 32, 3, true); - //EntityRegistry.registerModEntity(GolemBase.class, "Golembase", 2, TConstruct.instance, 32, 5, true); //EntityRegistry.registerModEntity(CartEntity.class, "Small Wagon", 1, TConstruct.instance, 32, 5, true); //EntityRegistry.registerModEntity(Crystal.class, "Crystal", 2, TConstruct.instance, 32, 5, true); @@ -181,18 +181,32 @@ public class TContent implements IFuelHandler EntityRegistry.registerModEntity(BlueSlime.class, "EdibleSlime", 12, TConstruct.instance, 64, 5, true); //EntityRegistry.registerModEntity(MetalSlime.class, "MetalSlime", 13, TConstruct.instance, 64, 5, true); - /*EntityList.IDtoClassMapping.put(7789011, NitroCreeper.class); - EntityList.entityEggs.put(Integer.valueOf(7789011), new EntityEggInfo(7789011, 0xff7050, 0x555555)); - EntityList.IDtoClassMapping.put(7789012, BlueSlime.class); - EntityList.entityEggs.put(Integer.valueOf(7789012), new EntityEggInfo(7789012, 0x3399ff, 0x004499));*/ - - 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 }; + BiomeGenBase[] plains = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.PLAINS); + BiomeGenBase[] mountain = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.MOUNTAIN); + BiomeGenBase[] hills = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.HILLS); + BiomeGenBase[] swamp = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.SWAMP); + BiomeGenBase[] desert = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.DESERT); + BiomeGenBase[] frozen = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.FROZEN); + BiomeGenBase[] jungle = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.JUNGLE); + BiomeGenBase[] wasteland = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.WASTELAND); + + BiomeGenBase[] nether = BiomeDictionary.getBiomesForType(BiomeDictionary.Type.NETHER); + if (PHConstruct.redCreeper) - EntityRegistry.addSpawn(NitroCreeper.class, PHConstruct.redCreeperWeight, 4, 6, EnumCreatureType.monster, BiomeGenBase.hell); + { + EntityRegistry.addSpawn(NitroCreeper.class, PHConstruct.redCreeperWeight, 4, 6, EnumCreatureType.monster, nether); + } if (PHConstruct.blueSlime) - EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, overworldBiomes); + { + EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, plains); + EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, mountain); + EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, hills); + EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, swamp); + EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, desert); + EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, frozen); + EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, jungle); + EntityRegistry.addSpawn(BlueSlime.class, PHConstruct.blueSlimeWeight, 4, 4, EnumCreatureType.monster, wasteland); + } //EntityRegistry.addSpawn(MetalSlime.class, 1, 4, 4, EnumCreatureType.monster, overworldBiomes); } @@ -358,8 +372,8 @@ public class TContent implements IFuelHandler //lumberHead = new ToolPart(PHConstruct.lumberHead, 0, broadheads).setUnlocalizedName("tconstruct.LumberHead"); //Wearables - heavyHelmet = new TArmorBase(PHConstruct.heavyHelmet, 0).setUnlocalizedName("tconstruct.HeavyHelmet"); - heartContainer = new HeartContainer(PHConstruct.heartContainer).setUnlocalizedName("tconstruct.canister"); + //heavyHelmet = new TArmorBase(PHConstruct.heavyHelmet, 0).setUnlocalizedName("tconstruct.HeavyHelmet"); + //heartContainer = new HeartContainer(PHConstruct.heartContainer).setUnlocalizedName("tconstruct.canister"); //Vanilla stack sizes Item.doorWood.setMaxStackSize(16); diff --git a/mods/tinker/tconstruct/entity/BlueSlime.java b/mods/tinker/tconstruct/entity/BlueSlime.java index 7ffee59..a0c0900 100644 --- a/mods/tinker/tconstruct/entity/BlueSlime.java +++ b/mods/tinker/tconstruct/entity/BlueSlime.java @@ -17,9 +17,9 @@ 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; + public float sizeOffset; + public float sizeFactor; + public float sizeHeight; /** the time between each jump of the slime */ protected int slimeJumpDelay = 0; @@ -220,8 +220,8 @@ public class BlueSlime extends EntityLiving implements IMob 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; + this.sizeFactor += (this.sizeOffset - this.sizeFactor) * 0.5F; + this.sizeHeight = this.sizeFactor; boolean flag = this.onGround; super.onUpdate(); int i; @@ -244,11 +244,11 @@ public class BlueSlime extends EntityLiving implements IMob this.playSound(this.getJumpSound(), this.getSoundVolume(), ((this.rand.nextFloat() - this.rand.nextFloat()) * 0.2F + 1.0F) / 0.8F); } - this.field_70813_a = -0.5F; + this.sizeOffset = -0.5F; } else if (!this.onGround && flag) { - this.field_70813_a = 1.0F; + this.sizeOffset = 1.0F; } this.func_70808_l(); @@ -311,7 +311,7 @@ public class BlueSlime extends EntityLiving implements IMob protected void func_70808_l () { - this.field_70813_a *= 0.6F; + this.sizeOffset *= 0.6F; } /** diff --git a/mods/tinker/tconstruct/entity/GolemBase.java b/mods/tinker/tconstruct/entity/GolemBase.java index 6b81080..e40a0c3 100644 --- a/mods/tinker/tconstruct/entity/GolemBase.java +++ b/mods/tinker/tconstruct/entity/GolemBase.java @@ -62,22 +62,22 @@ public class GolemBase extends EntityCreature super.updateWanderPath(); } - protected void coreRoutine () + protected void coreIdle () { } - protected void guardRoutine () + protected void coreGuard () { } - protected void followRoutine () + protected void coreFollow () { } - protected void protectRoutine () + protected void coreProtect () { } diff --git a/mods/tinker/tconstruct/entity/SlimeClone.java b/mods/tinker/tconstruct/entity/SlimeClone.java new file mode 100644 index 0000000..ced533f --- /dev/null +++ b/mods/tinker/tconstruct/entity/SlimeClone.java @@ -0,0 +1,165 @@ +package mods.tinker.tconstruct.entity; + +import mods.tinker.tconstruct.TConstruct; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.potion.Potion; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.ForgeHooks; + +import com.google.common.io.ByteArrayDataInput; +import com.google.common.io.ByteArrayDataOutput; + +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; + +public class SlimeClone extends GolemBase + implements IEntityAdditionalSpawnData +{ + public float sizeOffset; + public float sizeFactor; + public float sizeHeight; + public String username = ""; + public SlimeClone(World world) + { + super(world); + //this.texture = "/mob/char.png"; + } + + public SlimeClone(World world, String username) + { + this(world); + this.username = username; + } + + @Override + public void initCreature () + { + maxHealth = 100; + health = 100; + baseAttack = 3; + paused = false; + inventory = new ItemStack[2]; + } + + public void onUpdate () + { + if (!this.worldObj.isRemote && this.worldObj.difficultySetting == 0 && this.getSlimeSize() > 0) + { + this.isDead = true; + } + + this.sizeFactor += (this.sizeOffset - this.sizeFactor) * 0.5F; + this.sizeHeight = this.sizeFactor; + 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.sizeOffset = -0.5F; + } + else if (!this.onGround && flag) + { + this.sizeOffset = 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 func_70808_l () + { + this.sizeOffset *= 0.6F; + } + + protected String getJumpSound () + { + return "mob.slime." + (this.getSlimeSize() > 1 ? "big" : "small"); + } + + + 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"; + } + + public int getSlimeSize () + { + return 2; + } + + /** + * 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; + } + + @Override + public void writeSpawnData (ByteArrayDataOutput data) + { + data.writeUTF(username); + } + + @Override + public void readSpawnData (ByteArrayDataInput data) + { + username = data.readUTF(); + skinUrl = "http://skins.minecraft.net/MinecraftSkins/"+username+".png"; + } +} diff --git a/mods/tinker/tconstruct/inventory/SlotTool.java b/mods/tinker/tconstruct/inventory/SlotTool.java index 8fbee47..93015bd 100644 --- a/mods/tinker/tconstruct/inventory/SlotTool.java +++ b/mods/tinker/tconstruct/inventory/SlotTool.java @@ -60,7 +60,7 @@ public class SlotTool extends Slot for (int i = 1; i <= 3; i++) inventory.decrStackSize(i, 1); if (!player.worldObj.isRemote && full ) - player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "mods.tinker.resources.sounds.little_saw", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F); + player.worldObj.playSoundEffect(player.posX, player.posY, player.posZ, "sounds.little_saw", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F); //player.worldObj.playAuxSFX(1021, (int)player.posX, (int)player.posY, (int)player.posZ, 0); } } diff --git a/mods/tinker/tconstruct/items/armor/TArmorBase.java b/mods/tinker/tconstruct/items/armor/TArmorBase.java index e00987f..9362bc0 100644 --- a/mods/tinker/tconstruct/items/armor/TArmorBase.java +++ b/mods/tinker/tconstruct/items/armor/TArmorBase.java @@ -23,8 +23,8 @@ public class TArmorBase extends ItemArmor { Icon[] icons; String[] iconNames = { "wood_helmet" }; - static Minecraft mc = Minecraft.getMinecraft(); - private ModelBiped modelArmor; + //static Minecraft mc = Minecraft.getMinecraft(); + //private ModelBiped modelArmor; public TArmorBase(int id, int armorSlot) { @@ -34,7 +34,7 @@ public class TArmorBase extends ItemArmor setNoRepair(); canRepair = false; this.setCreativeTab(CreativeTabs.tabMisc); - this.modelArmor = new ModelBiped(0.75F); + //this.modelArmor = new ModelBiped(0.75F); //this.setCreativeTab(TConstructRegistry.toolTab); } diff --git a/mods/tinker/tconstruct/items/tools/FryingPan.java b/mods/tinker/tconstruct/items/tools/FryingPan.java index ac2bf55..956640b 100644 --- a/mods/tinker/tconstruct/items/tools/FryingPan.java +++ b/mods/tinker/tconstruct/items/tools/FryingPan.java @@ -41,7 +41,7 @@ public class FryingPan extends Weapon public void onEntityDamaged(World world, EntityPlayer player, Entity entity) { - world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "mods.tinker.resources.sounds.frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F); + world.playSoundEffect(entity.posX, entity.posY, entity.posZ, "sounds.frypan_hit", 1.0F, (random.nextFloat() - random.nextFloat()) * 0.2F + 1.0F); } public String getToolName () diff --git a/mods/tinker/textures/items/materials/pattern_largeguard.png b/mods/tinker/textures/items/materials/pattern_largeguard.png index 0944a7f3884706768831033ffb2fe92ecbeba080..7b4107295aaf61752f30582913f5ccc4f977b6ad 100644 GIT binary patch delta 456 zcmV;(0XP2k0pbIYB!32COGiWi{{a60|De66lK=n!32;bRa{vGf6951U69E94oEQKA z00(qQO+^RY1rGrL8V*;fIsgCxZ%IT!R5;6}lQB!fKpe$?hAL-FT+AT|8C;Y?hti>- zbm>_94t@zgj9)@WaS^hJL%>j>Aa%)52*}07#By}e=^v6t1%L4m2Y0#uy}bAC9sIL4 z04~l?K9|cCuDkVP<8rxbeY?DR+~~++*gvQ?!a%p07r8-uK1wM7uJ4`zr~tI*6D29* z!6DXKOj&%(M1Z6^LeG>1y`zAe`#At-qhkP~BxQ2i1;AR{V(0v%`R0C(DGMg2T^6}v zksG2U#afHCwto#Ud&$wBU;P;%o@Q8U(Vma?e8z)AOj$JKIRLJ^RnZiaq~t)9q$s5b z15Fs{>c$!p>pstq9LJ5V(%!ZHbK_IqLgYyIVNiY%wBS~JDa?{ ye-M+gx4XmJ`v)^OuRW-Y#cM&h@BjMn{#0MU(x!&p6r#ld0000Hb1*2;r9OpZ{$nDEJO-lFGS1sMoVj{##!158fTP U@*G2LxBvhE07*qoM6N<$g0h=oX8-^I diff --git a/mods/tinker/resources/sounds/frypan_hit.ogg b/sounds/frypan_hit.ogg similarity index 100% rename from mods/tinker/resources/sounds/frypan_hit.ogg rename to sounds/frypan_hit.ogg diff --git a/mods/tinker/resources/sounds/little_saw.ogg b/sounds/little_saw.ogg similarity index 100% rename from mods/tinker/resources/sounds/little_saw.ogg rename to sounds/little_saw.ogg diff --git a/test/XinStick.java b/test/XinStick.java index f6268b2..1a7cd92 100644 --- a/test/XinStick.java +++ b/test/XinStick.java @@ -1,11 +1,10 @@ package test; +import mods.tinker.tconstruct.entity.SlimeClone; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.monster.EntityCreeper; -import net.minecraft.entity.passive.EntityPig; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -33,11 +32,12 @@ public class XinStick extends Item @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - EntityCreeper creeper = new EntityCreeper(world); + /*EntityCreeper creeper = new EntityCreeper(world); EntityPig pig = new EntityPig(world); spawnEntity(player.posX, player.posY+1, player.posZ, creeper, world, player); spawnEntity(player.posX, player.posY+1, player.posZ, pig, world, player); - creeper.mountEntity(pig); + creeper.mountEntity(pig);*/ + spawnEntity(player.posX, player.posY+1, player.posZ, new SlimeClone(world, player.username), world, player); //System.out.println("Health! "+player.getHealth()); //healPlayer(player); //removeChunk(world, player.posX, player.posZ);