aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/client
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2024-05-24 19:50:35 +0100
committerRaven Szewczyk <git@eigenraven.me>2024-05-24 19:50:35 +0100
commit6d1b2216464d4dad449ac6fcfec476832224a55e (patch)
tree526a0c15f7056313c80e6c0386e025e9b3f61781 /src/main/java/gtPlusPlus/core/client
parentb5d35f40afa606ed1b07061dad82e0521a59c186 (diff)
downloadGT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.gz
GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.tar.bz2
GT5-Unofficial-6d1b2216464d4dad449ac6fcfec476832224a55e.zip
Merge addon sources
Diffstat (limited to 'src/main/java/gtPlusPlus/core/client')
-rw-r--r--src/main/java/gtPlusPlus/core/client/CustomTextureSet.java30
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java45
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java87
-rw-r--r--src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java117
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java84
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java2469
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java92
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java111
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java96
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java163
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java89
-rw-r--r--src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java105
12 files changed, 3488 insertions, 0 deletions
diff --git a/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java b/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java
new file mode 100644
index 0000000000..ce4d9a0320
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.core.client;
+
+import gregtech.api.enums.TextureSet;
+
+public class CustomTextureSet extends TextureSet {
+
+ public static enum TextureSets {
+
+ REFINED(),
+ GEM_A(),
+ ENRICHED(),
+ NUCLEAR;
+
+ private final CustomTextureSet A;
+
+ private TextureSets() {
+ A = new CustomTextureSet(
+ this.name()
+ .toUpperCase());
+ }
+
+ public CustomTextureSet get() {
+ return A;
+ }
+ }
+
+ public CustomTextureSet(String aSetName) {
+ super(aSetName);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java b/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java
new file mode 100644
index 0000000000..ef0943684c
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java
@@ -0,0 +1,45 @@
+package gtPlusPlus.core.client.model;
+
+import net.minecraft.client.model.ModelBase;
+import net.minecraft.client.model.ModelRenderer;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class ModelDecayChest extends ModelBase {
+
+ /** The chest lid in the chest's model. */
+ public ModelRenderer chestLid = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64);
+ /** The model of the bottom of the chest. */
+ public ModelRenderer chestBelow;
+ /** The chest's knob in the chest model. */
+ public ModelRenderer chestKnob;
+
+ public ModelDecayChest() {
+ this.chestLid.addBox(0.0F, -5.0F, -14.0F, 14, 5, 14, 0.0F);
+ this.chestLid.rotationPointX = 1.0F;
+ this.chestLid.rotationPointY = 7.0F;
+ this.chestLid.rotationPointZ = 15.0F;
+ this.chestKnob = (new ModelRenderer(this, 0, 0)).setTextureSize(64, 64);
+ this.chestKnob.addBox(-1.0F, -2.0F, -15.0F, 2, 4, 1, 0.0F);
+ this.chestKnob.rotationPointX = 8.0F;
+ this.chestKnob.rotationPointY = 7.0F;
+ this.chestKnob.rotationPointZ = 15.0F;
+ this.chestBelow = (new ModelRenderer(this, 0, 19)).setTextureSize(64, 64);
+ this.chestBelow.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F);
+ this.chestBelow.rotationPointX = 1.0F;
+ this.chestBelow.rotationPointY = 6.0F;
+ this.chestBelow.rotationPointZ = 1.0F;
+ }
+
+ /**
+ * This method renders out all parts of the chest model.
+ */
+ public void renderAll() {
+ this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX;
+ this.chestLid.render(0.0625F);
+ this.chestKnob.render(0.0625F);
+ this.chestBelow.render(0.0625F);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java b/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java
new file mode 100644
index 0000000000..3b5922444d
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java
@@ -0,0 +1,87 @@
+package gtPlusPlus.core.client.model;
+
+import net.minecraft.client.model.ModelBlaze;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.util.MathHelper;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class ModelSickBlaze extends ModelBlaze {
+
+ /** The sticks that fly around the Blaze. */
+ private ModelRenderer[] blazeSticks = new ModelRenderer[24];
+
+ private ModelRenderer blazeHead;
+
+ public ModelSickBlaze() {
+ for (int i = 0; i < this.blazeSticks.length; ++i) {
+ this.blazeSticks[i] = new ModelRenderer(this, 0, 16);
+ this.blazeSticks[i].addBox(0.0F, 0.0F, 0.0F, 2, 8, 2);
+ }
+
+ this.blazeHead = new ModelRenderer(this, 0, 0);
+ this.blazeHead.addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
+ }
+
+ @Override
+ public int func_78104_a() {
+ return 8;
+ }
+
+ /**
+ * Sets the models various rotation angles then renders the model.
+ */
+ @Override
+ public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
+ float p_78088_6_, float p_78088_7_) {
+ this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
+ this.blazeHead.render(p_78088_7_);
+
+ for (ModelRenderer blazeStick : this.blazeSticks) {
+ blazeStick.render(p_78088_7_);
+ }
+ }
+
+ /**
+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
+ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
+ * "far" arms and legs can swing at most.
+ */
+ @Override
+ public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
+ float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
+ float f6 = p_78087_3_ * (float) Math.PI * -0.1F;
+ int i;
+
+ for (i = 0; i < 4; ++i) {
+ this.blazeSticks[i].rotationPointY = -2.0F + MathHelper.cos((i * 2 + p_78087_3_) * 0.25F);
+ this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 9.0F;
+ this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 9.0F;
+ ++f6;
+ }
+
+ f6 = ((float) Math.PI / 4F) + p_78087_3_ * (float) Math.PI * 0.03F;
+
+ for (i = 4; i < 8; ++i) {
+ this.blazeSticks[i].rotationPointY = 2.0F + MathHelper.cos((i * 2 + p_78087_3_) * 0.25F);
+ this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 7.0F;
+ this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 7.0F;
+ ++f6;
+ }
+
+ f6 = 0.47123894F + p_78087_3_ * (float) Math.PI * -0.05F;
+
+ for (i = 8; i < 12; ++i) {
+ this.blazeSticks[i].rotationPointY = 11.0F + MathHelper.cos((i * 1.5F + p_78087_3_) * 0.5F);
+ this.blazeSticks[i].rotationPointX = MathHelper.cos(f6) * 5.0F;
+ this.blazeSticks[i].rotationPointZ = MathHelper.sin(f6) * 5.0F;
+ ++f6;
+ }
+
+ this.blazeHead.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
+ this.blazeHead.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java b/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java
new file mode 100644
index 0000000000..457bc7a377
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java
@@ -0,0 +1,117 @@
+package gtPlusPlus.core.client.model;
+
+import net.minecraft.client.model.ModelIronGolem;
+import net.minecraft.client.model.ModelRenderer;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.monster.EntityIronGolem;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class ModelStaballoyConstruct extends ModelIronGolem {
+
+ public ModelStaballoyConstruct() {
+ this(0.0F);
+ }
+
+ public ModelStaballoyConstruct(float p_i1161_1_) {
+ this(p_i1161_1_, -7.0F);
+ }
+
+ public ModelStaballoyConstruct(float p_i1162_1_, float p_i1162_2_) {
+ short short1 = 128;
+ short short2 = 128;
+ this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(short1, short2);
+ this.ironGolemHead.setRotationPoint(0.0F, 0.0F + p_i1162_2_, -2.0F);
+ this.ironGolemHead.setTextureOffset(0, 0)
+ .addBox(-4.0F, -12.0F, -5.5F, 8, 10, 8, p_i1162_1_);
+ this.ironGolemHead.setTextureOffset(24, 0)
+ .addBox(-1.0F, -5.0F, -7.5F, 2, 4, 2, p_i1162_1_);
+ this.ironGolemBody = (new ModelRenderer(this)).setTextureSize(short1, short2);
+ this.ironGolemBody.setRotationPoint(0.0F, 0.0F + p_i1162_2_, 0.0F);
+ this.ironGolemBody.setTextureOffset(0, 40)
+ .addBox(-9.0F, -2.0F, -6.0F, 18, 12, 11, p_i1162_1_);
+ this.ironGolemBody.setTextureOffset(0, 70)
+ .addBox(-4.5F, 10.0F, -3.0F, 9, 5, 6, p_i1162_1_ + 0.5F);
+ this.ironGolemRightArm = (new ModelRenderer(this)).setTextureSize(short1, short2);
+ this.ironGolemRightArm.setRotationPoint(0.0F, -7.0F, 0.0F);
+ this.ironGolemRightArm.setTextureOffset(60, 21)
+ .addBox(-13.0F, -2.5F, -3.0F, 4, 30, 6, p_i1162_1_);
+ this.ironGolemLeftArm = (new ModelRenderer(this)).setTextureSize(short1, short2);
+ this.ironGolemLeftArm.setRotationPoint(0.0F, -7.0F, 0.0F);
+ this.ironGolemLeftArm.setTextureOffset(60, 58)
+ .addBox(9.0F, -2.5F, -3.0F, 4, 30, 6, p_i1162_1_);
+ this.ironGolemLeftLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(short1, short2);
+ this.ironGolemLeftLeg.setRotationPoint(-4.0F, 18.0F + p_i1162_2_, 0.0F);
+ this.ironGolemLeftLeg.setTextureOffset(37, 0)
+ .addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i1162_1_);
+ this.ironGolemRightLeg = (new ModelRenderer(this, 0, 22)).setTextureSize(short1, short2);
+ this.ironGolemRightLeg.mirror = true;
+ this.ironGolemRightLeg.setTextureOffset(60, 0)
+ .setRotationPoint(5.0F, 18.0F + p_i1162_2_, 0.0F);
+ this.ironGolemRightLeg.addBox(-3.5F, -3.0F, -3.0F, 6, 16, 5, p_i1162_1_);
+ }
+
+ /**
+ * Sets the models various rotation angles then renders the model.
+ */
+ @Override
+ public void render(Entity p_78088_1_, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_,
+ float p_78088_6_, float p_78088_7_) {
+ this.setRotationAngles(p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_, p_78088_1_);
+ this.ironGolemHead.render(p_78088_7_);
+ this.ironGolemBody.render(p_78088_7_);
+ this.ironGolemLeftLeg.render(p_78088_7_);
+ this.ironGolemRightLeg.render(p_78088_7_);
+ this.ironGolemRightArm.render(p_78088_7_);
+ this.ironGolemLeftArm.render(p_78088_7_);
+ }
+
+ /**
+ * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
+ * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
+ * "far" arms and legs can swing at most.
+ */
+ @Override
+ public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_,
+ float p_78087_5_, float p_78087_6_, Entity p_78087_7_) {
+ this.ironGolemHead.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
+ this.ironGolemHead.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
+ this.ironGolemLeftLeg.rotateAngleX = -1.5F * this.func_78172_a(p_78087_1_, 13.0F) * p_78087_2_;
+ this.ironGolemRightLeg.rotateAngleX = 1.5F * this.func_78172_a(p_78087_1_, 13.0F) * p_78087_2_;
+ this.ironGolemLeftLeg.rotateAngleY = 0.0F;
+ this.ironGolemRightLeg.rotateAngleY = 0.0F;
+ }
+
+ /**
+ * Used for easily adding entity-dependent animations. The second and third float params here are the same second
+ * and third as in the setRotationAngles method.
+ */
+ @Override
+ public void setLivingAnimations(EntityLivingBase p_78086_1_, float p_78086_2_, float p_78086_3_, float p_78086_4_) {
+ EntityIronGolem entityirongolem = (EntityIronGolem) p_78086_1_;
+ int i = entityirongolem.getAttackTimer();
+
+ if (i > 0) {
+ this.ironGolemRightArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a(i - p_78086_4_, 10.0F);
+ this.ironGolemLeftArm.rotateAngleX = -2.0F + 1.5F * this.func_78172_a(i - p_78086_4_, 10.0F);
+ } else {
+ int j = entityirongolem.getHoldRoseTick();
+
+ if (j > 0) {
+ this.ironGolemRightArm.rotateAngleX = -0.8F + 0.025F * this.func_78172_a(j, 70.0F);
+ this.ironGolemLeftArm.rotateAngleX = 0.0F;
+ } else {
+ this.ironGolemRightArm.rotateAngleX = (-0.2F + 1.5F * this.func_78172_a(p_78086_2_, 13.0F))
+ * p_78086_3_;
+ this.ironGolemLeftArm.rotateAngleX = (-0.2F - 1.5F * this.func_78172_a(p_78086_2_, 13.0F)) * p_78086_3_;
+ }
+ }
+ }
+
+ private float func_78172_a(float p_78172_1_, float p_78172_2_) {
+ return (Math.abs(p_78172_1_ % p_78172_2_ - p_78172_2_ * 0.5F) - p_78172_2_ * 0.25F) / (p_78172_2_ * 0.25F);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java b/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java
new file mode 100644
index 0000000000..f83844f3e3
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java
@@ -0,0 +1,84 @@
+package gtPlusPlus.core.client.renderer;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.IIcon;
+import net.minecraftforge.client.IItemRenderer;
+
+import org.lwjgl.opengl.GL11;
+
+/**
+ * Easy way of rendering an item which should look like a block. Borrowed.
+ *
+ * @author King Lemming
+ *
+ */
+public class CustomItemBlockRenderer implements IItemRenderer {
+
+ public static CustomItemBlockRenderer instance = new CustomItemBlockRenderer();
+
+ @Override
+ public boolean handleRenderType(ItemStack item, ItemRenderType type) {
+ return true;
+ }
+
+ @Override
+ public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
+ return true;
+ }
+
+ @Override
+ public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
+
+ double offset = -0.5;
+ if (type == ItemRenderType.EQUIPPED || type == ItemRenderType.EQUIPPED_FIRST_PERSON) {
+ offset = 0;
+ } else if (type == ItemRenderType.ENTITY) {
+ GL11.glScalef(0.5F, 0.5F, 0.5F);
+ }
+ renderItemAsBlock((RenderBlocks) data[0], item, offset, offset, offset);
+ }
+
+ public static void renderItemAsBlock(RenderBlocks renderer, ItemStack item, double translateX, double translateY,
+ double translateZ) {
+
+ renderTextureAsBlock(renderer, item.getIconIndex(), translateX, translateY, translateZ);
+ }
+
+ public static void renderTextureAsBlock(RenderBlocks renderer, IIcon texture, double translateX, double translateY,
+ double translateZ) {
+
+ Tessellator tessellator = Tessellator.instance;
+ Block block = Blocks.stone;
+
+ if (texture == null) {
+ return;
+ }
+ renderer.setRenderBoundsFromBlock(block);
+ GL11.glTranslated(translateX, translateY, translateZ);
+ tessellator.startDrawingQuads();
+
+ tessellator.setNormal(0.0F, -1.0F, 0.0F);
+ renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, texture);
+
+ tessellator.setNormal(0.0F, 1.0F, 0.0F);
+ renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, texture);
+
+ tessellator.setNormal(0.0F, 0.0F, -1.0F);
+ renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, texture);
+
+ tessellator.setNormal(0.0F, 0.0F, 1.0F);
+ renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, texture);
+
+ tessellator.setNormal(-1.0F, 0.0F, 0.0F);
+ renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, texture);
+
+ tessellator.setNormal(1.0F, 0.0F, 0.0F);
+ renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, texture);
+
+ tessellator.draw();
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java b/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java
new file mode 100644
index 0000000000..689f075703
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java
@@ -0,0 +1,2469 @@
+package gtPlusPlus.core.client.renderer;
+
+import net.minecraft.block.Block;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.util.IIcon;
+import net.minecraft.world.IBlockAccess;
+import net.minecraftforge.common.util.ForgeDirection;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
+import cpw.mods.fml.client.registry.RenderingRegistry;
+import gregtech.api.interfaces.ITexture;
+import gtPlusPlus.api.interfaces.ITexturedBlock;
+import gtPlusPlus.api.objects.Logger;
+
+public class CustomOreBlockRenderer implements ISimpleBlockRenderingHandler {
+
+ public static CustomOreBlockRenderer INSTANCE;
+ public final int mRenderID;
+
+ public CustomOreBlockRenderer() {
+ INSTANCE = this;
+ this.mRenderID = RenderingRegistry.getNextAvailableRenderId();
+ RenderingRegistry.registerBlockHandler(this);
+ Logger.INFO("Registered Custom Ore Block Renderer.");
+ }
+
+ public boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
+ RenderBlocks aRenderer) {
+ Block tTileEntity = aBlock;
+ if ((tTileEntity instanceof ITexturedBlock)) {
+ return renderStandardBlock(
+ aWorld,
+ aX,
+ aY,
+ aZ,
+ aBlock,
+ aRenderer,
+ new ITexture[][] { ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.DOWN),
+ ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.UP),
+ ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.NORTH),
+ ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.SOUTH),
+ ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.WEST),
+ ((ITexturedBlock) tTileEntity).getTexture(ForgeDirection.EAST) });
+ }
+ return false;
+ }
+
+ public boolean renderStandardBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock,
+ RenderBlocks aRenderer, ITexture[][] aTextures) {
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ int l = aBlock.colorMultiplier(aWorld, aX, aY, aZ);
+ float RED = (float) (l >> 16 & 255) / 255.0F;
+ float GREEN = (float) (l >> 8 & 255) / 255.0F;
+ float BLUE = (float) (l & 255) / 255.0F;
+
+ if (Minecraft.isAmbientOcclusionEnabled() && aBlock.getLightValue() == 0) {
+ if (RenderBlocks.getInstance().partialRenderBounds) {
+ return INSTANCE.renderStandardBlockWithAmbientOcclusionPartial(
+ aWorld,
+ aRenderer,
+ aTextures,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ RED,
+ GREEN,
+ BLUE);
+ } else {
+ return INSTANCE.renderStandardBlockWithAmbientOcclusion(
+ aWorld,
+ aRenderer,
+ aTextures,
+ aBlock,
+ aX,
+ aY,
+ aZ,
+ RED,
+ GREEN,
+ BLUE);
+ }
+ } else {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[0], true);
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[1], true);
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[2], true);
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[3], true);
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[4], true);
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aTextures[5], true);
+ }
+ return true;
+ }
+
+ public static void renderFaceYNeg(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ,
+ ITexture[][] aIcon) {
+ renderNegativeYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[0], true);
+ }
+
+ public static void renderFaceYPos(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ,
+ ITexture[][] aIcon) {
+ renderPositiveYFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[1], true);
+ }
+
+ public static void renderFaceZNeg(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ,
+ ITexture[][] aIcon) {
+ renderNegativeZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[2], true);
+ }
+
+ public static void renderFaceZPos(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ,
+ ITexture[][] aIcon) {
+ renderPositiveZFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[3], true);
+ }
+
+ public static void renderFaceXNeg(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ,
+ ITexture[][] aIcon) {
+ renderNegativeXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[4], true);
+ }
+
+ public static void renderFaceXPos(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY, int aZ,
+ ITexture[][] aIcon) {
+ renderPositiveXFacing(aWorld, aRenderer, aBlock, aX, aY, aZ, aIcon[5], true);
+ }
+
+ public static void renderNegativeYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
+ int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY - 1, aZ, 0))) {
+ return;
+ }
+ Tessellator.instance
+ .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY - 1 : aY, aZ));
+ }
+ if (aIcon != null) {
+ for (ITexture iTexture : aIcon) {
+ if (iTexture != null) {
+ iTexture.renderYNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveYFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
+ int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY + 1, aZ, 1))) {
+ return;
+ }
+ Tessellator.instance
+ .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aFullBlock ? aY + 1 : aY, aZ));
+ }
+ if (aIcon != null) {
+ for (ITexture iTexture : aIcon) {
+ if (iTexture != null) {
+ iTexture.renderYPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderNegativeZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
+ int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ - 1, 2))) {
+ return;
+ }
+ Tessellator.instance
+ .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ - 1 : aZ));
+ }
+ aRenderer.flipTexture = (!aFullBlock);
+ if (aIcon != null) {
+ for (ITexture iTexture : aIcon) {
+ if (iTexture != null) {
+ iTexture.renderZNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveZFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
+ int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX, aY, aZ + 1, 3))) {
+ return;
+ }
+ Tessellator.instance
+ .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aX, aY, aFullBlock ? aZ + 1 : aZ));
+ }
+ if (aIcon != null) {
+ for (ITexture iTexture : aIcon) {
+ if (iTexture != null) {
+ iTexture.renderZPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderNegativeXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
+ int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX - 1, aY, aZ, 4))) {
+ return;
+ }
+ Tessellator.instance
+ .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX - 1 : aX, aY, aZ));
+ }
+ if (aIcon != null) {
+ for (ITexture iTexture : aIcon) {
+ if (iTexture != null) {
+ iTexture.renderXNeg(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ public static void renderPositiveXFacing(IBlockAccess aWorld, RenderBlocks aRenderer, Block aBlock, int aX, int aY,
+ int aZ, ITexture[] aIcon, boolean aFullBlock) {
+ if (aWorld != null) {
+ if ((aFullBlock) && (!aBlock.shouldSideBeRendered(aWorld, aX + 1, aY, aZ, 5))) {
+ return;
+ }
+ Tessellator.instance
+ .setBrightness(aBlock.getMixedBrightnessForBlock(aWorld, aFullBlock ? aX + 1 : aX, aY, aZ));
+ }
+ aRenderer.flipTexture = (!aFullBlock);
+ if (aIcon != null) {
+ for (ITexture iTexture : aIcon) {
+ if (iTexture != null) {
+ iTexture.renderXPos(aRenderer, aBlock, aX, aY, aZ);
+ }
+ }
+ }
+ aRenderer.flipTexture = false;
+ }
+
+ @Override
+ public void renderInventoryBlock(Block aBlock, int aMeta, int aModelID, RenderBlocks aRenderer) {
+ aBlock.setBlockBoundsForItemRender();
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, -1.0F, 0.0F);
+ renderNegativeYFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.DOWN),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 1.0F, 0.0F);
+ renderPositiveYFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.UP),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 0.0F, -1.0F);
+ renderNegativeZFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.NORTH),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(0.0F, 0.0F, 1.0F);
+ renderPositiveZFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.SOUTH),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(-1.0F, 0.0F, 0.0F);
+ renderNegativeXFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.WEST),
+ true);
+ Tessellator.instance.draw();
+ Tessellator.instance.startDrawingQuads();
+ Tessellator.instance.setNormal(1.0F, 0.0F, 0.0F);
+ renderPositiveXFacing(
+ null,
+ aRenderer,
+ aBlock,
+ 0,
+ 0,
+ 0,
+ ((ITexturedBlock) aBlock).getTexture(ForgeDirection.EAST),
+ true);
+ Tessellator.instance.draw();
+ aBlock.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
+ aRenderer.setRenderBoundsFromBlock(aBlock);
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ }
+
+ @Override
+ public boolean renderWorldBlock(IBlockAccess aWorld, int aX, int aY, int aZ, Block aBlock, int aModelID,
+ RenderBlocks aRenderer) {
+ blockAccess = aWorld;
+ return renderStandardBlock(aWorld, aX, aY, aZ, aBlock, aRenderer);
+ }
+
+ @Override
+ public boolean shouldRender3DInInventory(int aModel) {
+ return true;
+ }
+
+ @Override
+ public int getRenderId() {
+ return this.mRenderID;
+ }
+
+ public void setRenderBounds(double p_147782_1_, double p_147782_3_, double p_147782_5_, double p_147782_7_,
+ double p_147782_9_, double p_147782_11_) {
+ if (!this.lockBlockBounds) {
+ this.renderMinX = p_147782_1_;
+ this.renderMaxX = p_147782_7_;
+ this.renderMinY = p_147782_3_;
+ this.renderMaxY = p_147782_9_;
+ this.renderMinZ = p_147782_5_;
+ this.renderMaxZ = p_147782_11_;
+ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2
+ && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D
+ || this.renderMinY > 0.0D
+ || this.renderMaxY < 1.0D
+ || this.renderMinZ > 0.0D
+ || this.renderMaxZ < 1.0D);
+ }
+ }
+
+ /**
+ * Like setRenderBounds, but automatically pulling the bounds from the given Block.
+ */
+ public void setRenderBoundsFromBlock(Block block) {
+ if (!this.lockBlockBounds) {
+ this.renderMinX = block.getBlockBoundsMinX();
+ this.renderMaxX = block.getBlockBoundsMaxX();
+ this.renderMinY = block.getBlockBoundsMinY();
+ this.renderMaxY = block.getBlockBoundsMaxY();
+ this.renderMinZ = block.getBlockBoundsMinZ();
+ this.renderMaxZ = block.getBlockBoundsMaxZ();
+ this.partialRenderBounds = this.minecraftRB.gameSettings.ambientOcclusion >= 2
+ && (this.renderMinX > 0.0D || this.renderMaxX < 1.0D
+ || this.renderMinY > 0.0D
+ || this.renderMaxY < 1.0D
+ || this.renderMinZ > 0.0D
+ || this.renderMaxZ < 1.0D);
+ }
+ }
+
+ /**
+ * Vanilla Variables
+ */
+
+ /** The minimum X value for rendering (default 0.0). */
+ public double renderMinX;
+ /** The maximum X value for rendering (default 1.0). */
+ public double renderMaxX;
+ /** The minimum Y value for rendering (default 0.0). */
+ public double renderMinY;
+ /** The maximum Y value for rendering (default 1.0). */
+ public double renderMaxY;
+ /** The minimum Z value for rendering (default 0.0). */
+ public double renderMinZ;
+ /** The maximum Z value for rendering (default 1.0). */
+ public double renderMaxZ;
+
+ public boolean lockBlockBounds;
+ public boolean partialRenderBounds;
+ public final Minecraft minecraftRB = RenderBlocks.getInstance().minecraftRB;
+ public int uvRotateEast;
+ public int uvRotateWest;
+ public int uvRotateSouth;
+ public int uvRotateNorth;
+ public int uvRotateTop;
+ public int uvRotateBottom;
+ /** Whether ambient occlusion is enabled or not */
+ public boolean enableAO;
+ /** Used as a scratch variable for ambient occlusion on the north/bottom/east corner. */
+ public float aoLightValueScratchXYZNNN;
+ /** Used as a scratch variable for ambient occlusion between the bottom face and the north face. */
+ public float aoLightValueScratchXYNN;
+ /** Used as a scratch variable for ambient occlusion on the north/bottom/west corner. */
+ public float aoLightValueScratchXYZNNP;
+ /** Used as a scratch variable for ambient occlusion between the bottom face and the east face. */
+ public float aoLightValueScratchYZNN;
+ /** Used as a scratch variable for ambient occlusion between the bottom face and the west face. */
+ public float aoLightValueScratchYZNP;
+ /** Used as a scratch variable for ambient occlusion on the south/bottom/east corner. */
+ public float aoLightValueScratchXYZPNN;
+ /** Used as a scratch variable for ambient occlusion between the bottom face and the south face. */
+ public float aoLightValueScratchXYPN;
+ /** Used as a scratch variable for ambient occlusion on the south/bottom/west corner. */
+ public float aoLightValueScratchXYZPNP;
+ /** Used as a scratch variable for ambient occlusion on the north/top/east corner. */
+ public float aoLightValueScratchXYZNPN;
+ /** Used as a scratch variable for ambient occlusion between the top face and the north face. */
+ public float aoLightValueScratchXYNP;
+ /** Used as a scratch variable for ambient occlusion on the north/top/west corner. */
+ public float aoLightValueScratchXYZNPP;
+ /** Used as a scratch variable for ambient occlusion between the top face and the east face. */
+ public float aoLightValueScratchYZPN;
+ /** Used as a scratch variable for ambient occlusion on the south/top/east corner. */
+ public float aoLightValueScratchXYZPPN;
+ /** Used as a scratch variable for ambient occlusion between the top face and the south face. */
+ public float aoLightValueScratchXYPP;
+ /** Used as a scratch variable for ambient occlusion between the top face and the west face. */
+ public float aoLightValueScratchYZPP;
+ /** Used as a scratch variable for ambient occlusion on the south/top/west corner. */
+ public float aoLightValueScratchXYZPPP;
+ /** Used as a scratch variable for ambient occlusion between the north face and the east face. */
+ public float aoLightValueScratchXZNN;
+ /** Used as a scratch variable for ambient occlusion between the south face and the east face. */
+ public float aoLightValueScratchXZPN;
+ /** Used as a scratch variable for ambient occlusion between the north face and the west face. */
+ public float aoLightValueScratchXZNP;
+ /** Used as a scratch variable for ambient occlusion between the south face and the west face. */
+ public float aoLightValueScratchXZPP;
+ /** Ambient occlusion brightness XYZNNN */
+ public int aoBrightnessXYZNNN;
+ /** Ambient occlusion brightness XYNN */
+ public int aoBrightnessXYNN;
+ /** Ambient occlusion brightness XYZNNP */
+ public int aoBrightnessXYZNNP;
+ /** Ambient occlusion brightness YZNN */
+ public int aoBrightnessYZNN;
+ /** Ambient occlusion brightness YZNP */
+ public int aoBrightnessYZNP;
+ /** Ambient occlusion brightness XYZPNN */
+ public int aoBrightnessXYZPNN;
+ /** Ambient occlusion brightness XYPN */
+ public int aoBrightnessXYPN;
+ /** Ambient occlusion brightness XYZPNP */
+ public int aoBrightnessXYZPNP;
+ /** Ambient occlusion brightness XYZNPN */
+ public int aoBrightnessXYZNPN;
+ /** Ambient occlusion brightness XYNP */
+ public int aoBrightnessXYNP;
+ /** Ambient occlusion brightness XYZNPP */
+ public int aoBrightnessXYZNPP;
+ /** Ambient occlusion brightness YZPN */
+ public int aoBrightnessYZPN;
+ /** Ambient occlusion brightness XYZPPN */
+ public int aoBrightnessXYZPPN;
+ /** Ambient occlusion brightness XYPP */
+ public int aoBrightnessXYPP;
+ /** Ambient occlusion brightness YZPP */
+ public int aoBrightnessYZPP;
+ /** Ambient occlusion brightness XYZPPP */
+ public int aoBrightnessXYZPPP;
+ /** Ambient occlusion brightness XZNN */
+ public int aoBrightnessXZNN;
+ /** Ambient occlusion brightness XZPN */
+ public int aoBrightnessXZPN;
+ /** Ambient occlusion brightness XZNP */
+ public int aoBrightnessXZNP;
+ /** Ambient occlusion brightness XZPP */
+ public int aoBrightnessXZPP;
+ /** Brightness top left */
+ public int brightnessTopLeft;
+ /** Brightness bottom left */
+ public int brightnessBottomLeft;
+ /** Brightness bottom right */
+ public int brightnessBottomRight;
+ /** Brightness top right */
+ public int brightnessTopRight;
+ /** Red color value for the top left corner */
+ public float colorRedTopLeft;
+ /** Red color value for the bottom left corner */
+ public float colorRedBottomLeft;
+ /** Red color value for the bottom right corner */
+ public float colorRedBottomRight;
+ /** Red color value for the top right corner */
+ public float colorRedTopRight;
+ /** Green color value for the top left corner */
+ public float colorGreenTopLeft;
+ /** Green color value for the bottom left corner */
+ public float colorGreenBottomLeft;
+ /** Green color value for the bottom right corner */
+ public float colorGreenBottomRight;
+ /** Green color value for the top right corner */
+ public float colorGreenTopRight;
+ /** Blue color value for the top left corner */
+ public float colorBlueTopLeft;
+ /** Blue color value for the bottom left corner */
+ public float colorBlueBottomLeft;
+ /** Blue color value for the bottom right corner */
+ public float colorBlueBottomRight;
+ /** Blue color value for the top right corner */
+ public float colorBlueTopRight;
+ /** If set to >=0, all block faces will be rendered using this texture index */
+ public IIcon overrideBlockTexture;
+
+ /**
+ * Clear override block texture
+ */
+ public void clearOverrideBlockTexture() {
+ this.overrideBlockTexture = null;
+ }
+
+ public boolean hasOverrideBlockTexture() {
+ return this.overrideBlockTexture != null;
+ }
+
+ public IIcon getBlockIcon(Block block, IBlockAccess access, int x, int y, int z, int side) {
+ return this.getIconSafe(block.getIcon(access, x, y, z, side));
+ }
+
+ public IIcon getBlockIconFromSideAndMetadata(Block block, int side, int meta) {
+ return this.getIconSafe(block.getIcon(side, meta));
+ }
+
+ public IIcon getBlockIconFromSide(Block block, int side) {
+ return this.getIconSafe(block.getBlockTextureFromSide(side));
+ }
+
+ public IIcon getBlockIcon(Block block) {
+ return this.getIconSafe(block.getBlockTextureFromSide(1));
+ }
+
+ public IIcon getIconSafe(IIcon iicon) {
+ if (iicon == null) {
+ iicon = ((TextureMap) Minecraft.getMinecraft()
+ .getTextureManager()
+ .getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno");
+ }
+
+ return (IIcon) iicon;
+ }
+
+ IBlockAccess blockAccess = RenderBlocks.getInstance().blockAccess;
+
+ public boolean renderStandardBlockWithAmbientOcclusion(IBlockAccess aWorld, RenderBlocks aRenderer,
+ ITexture[][] aTextures, Block block, int xPos, int yPos, int zPos, float R, float G, float B) {
+ this.enableAO = true;
+ boolean flag = false;
+ float f3 = 0.0F;
+ float f4 = 0.0F;
+ float f5 = 0.0F;
+ float f6 = 0.0F;
+ boolean flag1 = true;
+ int l = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos);
+ Tessellator tessellator = Tessellator.instance;
+ tessellator.setBrightness(983055);
+
+ if (this.getBlockIcon(block)
+ .getIconName()
+ .equals("grass_top")) {
+ flag1 = false;
+ } else if (this.hasOverrideBlockTexture()) {
+ flag1 = false;
+ }
+
+ boolean flag2;
+ boolean flag3;
+ boolean flag4;
+ boolean flag5;
+ int i1;
+ float f7;
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos - 1, zPos, 0)) {
+ if (this.renderMinY <= 0.0D) {
+ --yPos;
+ }
+
+ this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoLightValueScratchXYNN = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNN = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNP = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPN = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ flag2 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1)
+ .getCanBlockGrass();
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXYNN;
+ } else {
+ this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos - 1, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXYNN;
+ } else {
+ this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos - 1, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXYPN;
+ } else {
+ this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos + 1, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXYPN;
+ } else {
+ this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos + 1, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
+ }
+
+ if (this.renderMinY <= 0.0D) {
+ ++yPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinY <= 0.0D || !blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ f3 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + f7)
+ / 4.0F;
+ f6 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN)
+ / 4.0F;
+ f5 = (f7 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + f7 + this.aoLightValueScratchYZNN)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.5F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.5F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.5F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ CustomOreBlockRenderer.renderFaceYNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos + 1, zPos, 1)) {
+ if (this.renderMaxY >= 1.0D) {
+ ++yPos;
+ }
+
+ this.aoBrightnessXYNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoLightValueScratchXYNP = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPP = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPN = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPP = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1)
+ .getCanBlockGrass();
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXYNP;
+ } else {
+ this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos - 1, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXYPP;
+ } else {
+ this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos + 1, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXYNP;
+ } else {
+ this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos - 1, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXYPP;
+ } else {
+ this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos + 1, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
+ }
+
+ if (this.renderMaxY >= 1.0D) {
+ --yPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxY >= 1.0D || !blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ f6 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + f7)
+ / 4.0F;
+ f3 = (this.aoLightValueScratchYZPP + f7 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP)
+ / 4.0F;
+ f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN)
+ / 4.0F;
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B;
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ CustomOreBlockRenderer.renderFaceYPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ flag = true;
+ }
+
+ IIcon iicon;
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos - 1, 2)) {
+ if (this.renderMinZ <= 0.0D) {
+ --zPos;
+ }
+
+ this.aoLightValueScratchXZNN = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNN = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPN = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPN = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1)
+ .getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos - 1, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos - 1, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos + 1, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos + 1, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
+ }
+
+ if (this.renderMinZ <= 0.0D) {
+ ++zPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinZ <= 0.0D || !blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ f3 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN)
+ / 4.0F;
+ f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchYZNN + f7 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN)
+ / 4.0F;
+ f6 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + f7)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.8F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.8F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.8F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 2);
+ CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass && iicon.getIconName()
+ .equals("grass_side") && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos + 1, 3)) {
+ if (this.renderMaxZ >= 1.0D) {
+ ++zPos;
+ }
+
+ this.aoLightValueScratchXZNP = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPP = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNP = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPP = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1)
+ .getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos - 1, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos - 1, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos + 1, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos + 1, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
+ }
+
+ if (this.renderMaxZ >= 1.0D) {
+ --zPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxZ >= 1.0D || !blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ f3 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + f7 + this.aoLightValueScratchYZPP)
+ / 4.0F;
+ f6 = (f7 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + f7)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.8F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.8F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.8F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 3);
+ CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass && iicon.getIconName()
+ .equals("grass_side") && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos - 1, yPos, zPos, 4)) {
+ if (this.renderMinX <= 0.0D) {
+ --xPos;
+ }
+
+ this.aoLightValueScratchXYNN = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNN = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNP = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYNP = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1)
+ .getCanBlockGrass();
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos, yPos - 1, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
+ }
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos, yPos - 1, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos, yPos + 1, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos, yPos + 1, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
+ }
+
+ if (this.renderMinX <= 0.0D) {
+ ++xPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinX <= 0.0D || !blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ f6 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + f7 + this.aoLightValueScratchXZNP)
+ / 4.0F;
+ f3 = (f7 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXZNN + f7 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + f7)
+ / 4.0F;
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.6F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.6F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.6F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 4);
+ CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass && iicon.getIconName()
+ .equals("grass_side") && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos + 1, yPos, zPos, 5)) {
+ if (this.renderMaxX >= 1.0D) {
+ ++xPos;
+ }
+
+ this.aoLightValueScratchXYPN = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPN = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPP = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPP = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1)
+ .getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos, yPos - 1, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos, yPos - 1, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos, yPos + 1, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos, yPos + 1, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
+ }
+
+ if (this.renderMaxX >= 1.0D) {
+ --xPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxX >= 1.0D || !blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ f3 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + f7 + this.aoLightValueScratchXZPP)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + f7)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchXZPN + f7 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP)
+ / 4.0F;
+ f6 = (f7 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.6F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.6F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.6F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 5);
+ CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass && iicon.getIconName()
+ .equals("grass_side") && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ this.enableAO = false;
+ return flag;
+ }
+
+ /**
+ * Renders non-full-cube block with ambient occusion. Args: block, x, y, z, red, green, blue (lighting)
+ */
+ public boolean renderStandardBlockWithAmbientOcclusionPartial(IBlockAccess aWorld, RenderBlocks aRenderer,
+ ITexture[][] aTextures, Block block, int xPos, int yPos, int zPos, float R, float G, float B) {
+ this.enableAO = true;
+ boolean flag = false;
+ float f3 = 0.0F;
+ float f4 = 0.0F;
+ float f5 = 0.0F;
+ float f6 = 0.0F;
+ boolean flag1 = true;
+ int l = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos);
+ Tessellator tessellator = Tessellator.instance;
+ tessellator.setBrightness(983055);
+
+ if (this.getBlockIcon(block)
+ .getIconName()
+ .equals("grass_top")) {
+ flag1 = false;
+ } else if (this.hasOverrideBlockTexture()) {
+ flag1 = false;
+ }
+
+ boolean flag2;
+ boolean flag3;
+ boolean flag4;
+ boolean flag5;
+ int i1;
+ float f7;
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos - 1, zPos, 0)) {
+ if (this.renderMinY <= 0.0D) {
+ --yPos;
+ }
+
+ this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoLightValueScratchXYNN = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNN = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNP = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPN = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ flag2 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1)
+ .getCanBlockGrass();
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXYNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXYNN;
+ } else {
+ this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos - 1, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXYNN;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXYNN;
+ } else {
+ this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos - 1, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXYPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXYPN;
+ } else {
+ this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos + 1, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXYPN;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXYPN;
+ } else {
+ this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos + 1, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
+ }
+
+ if (this.renderMinY <= 0.0D) {
+ ++yPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinY <= 0.0D || !blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ f3 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXYNN + this.aoLightValueScratchYZNP + f7)
+ / 4.0F;
+ f6 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXYPN)
+ / 4.0F;
+ f5 = (f7 + this.aoLightValueScratchYZNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNN)
+ / 4.0F;
+ f4 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNN + f7 + this.aoLightValueScratchYZNN)
+ / 4.0F;
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXYNN, this.aoBrightnessYZNP, i1);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXYPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYPN, this.aoBrightnessXYZPNN, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNN, this.aoBrightnessYZNN, i1);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.5F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.5F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.5F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.5F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.5F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.5F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ CustomOreBlockRenderer.renderFaceYNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos + 1, zPos, 1)) {
+ if (this.renderMaxY >= 1.0D) {
+ ++yPos;
+ }
+
+ this.aoBrightnessXYNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoLightValueScratchXYNP = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPP = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPN = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPP = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1)
+ .getCanBlockGrass();
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXYNP;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXYNP;
+ } else {
+ this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos - 1, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos - 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXYPP;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXYPP;
+ } else {
+ this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos + 1, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos - 1);
+ }
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXYNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXYNP;
+ } else {
+ this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos - 1, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos + 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXYPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXYPP;
+ } else {
+ this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos + 1, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos + 1);
+ }
+
+ if (this.renderMaxY >= 1.0D) {
+ --yPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxY >= 1.0D || !blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ f6 = (this.aoLightValueScratchXYZNPP + this.aoLightValueScratchXYNP + this.aoLightValueScratchYZPP + f7)
+ / 4.0F;
+ f3 = (this.aoLightValueScratchYZPP + f7 + this.aoLightValueScratchXYZPPP + this.aoLightValueScratchXYPP)
+ / 4.0F;
+ f4 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPN)
+ / 4.0F;
+ f5 = (this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN)
+ / 4.0F;
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNPP, this.aoBrightnessXYNP, this.aoBrightnessYZPP, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXYZPPP, this.aoBrightnessXYPP, i1);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXYPP, this.aoBrightnessXYZPPN, i1);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNP, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B;
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ CustomOreBlockRenderer.renderFaceYPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ flag = true;
+ }
+
+ float f8;
+ float f9;
+ float f10;
+ float f11;
+ int j1;
+ int k1;
+ int l1;
+ int i2;
+ IIcon iicon;
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos - 1, 2)) {
+ if (this.renderMinZ <= 0.0D) {
+ --zPos;
+ }
+
+ this.aoLightValueScratchXZNN = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNN = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPN = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPN = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessYZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessYZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos - 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos - 1)
+ .getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos - 1, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos - 1, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos + 1, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos + 1, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
+ }
+
+ if (this.renderMinZ <= 0.0D) {
+ ++zPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinZ <= 0.0D || !blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ f8 = (this.aoLightValueScratchXZNN + this.aoLightValueScratchXYZNPN + f7 + this.aoLightValueScratchYZPN)
+ / 4.0F;
+ f9 = (f7 + this.aoLightValueScratchYZPN + this.aoLightValueScratchXZPN + this.aoLightValueScratchXYZPPN)
+ / 4.0F;
+ f10 = (this.aoLightValueScratchYZNN + f7 + this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXZPN)
+ / 4.0F;
+ f11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXZNN + this.aoLightValueScratchYZNN + f7)
+ / 4.0F;
+ f3 = (float) ((double) f8 * this.renderMaxY * (1.0D - this.renderMinX)
+ + (double) f9 * this.renderMaxY * this.renderMinX
+ + (double) f10 * (1.0D - this.renderMaxY) * this.renderMinX
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
+ f4 = (float) ((double) f8 * this.renderMaxY * (1.0D - this.renderMaxX)
+ + (double) f9 * this.renderMaxY * this.renderMaxX
+ + (double) f10 * (1.0D - this.renderMaxY) * this.renderMaxX
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
+ f5 = (float) ((double) f8 * this.renderMinY * (1.0D - this.renderMaxX)
+ + (double) f9 * this.renderMinY * this.renderMaxX
+ + (double) f10 * (1.0D - this.renderMinY) * this.renderMaxX
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
+ f6 = (float) ((double) f8 * this.renderMinY * (1.0D - this.renderMinX)
+ + (double) f9 * this.renderMinY * this.renderMinX
+ + (double) f10 * (1.0D - this.renderMinY) * this.renderMinX
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
+ j1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessYZPN, i1);
+ k1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPN, this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, i1);
+ l1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNN, this.aoBrightnessXYZPNN, this.aoBrightnessXZPN, i1);
+ i2 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXZNN, this.aoBrightnessYZNN, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ k1,
+ l1,
+ i2,
+ this.renderMaxY * (1.0D - this.renderMinX),
+ this.renderMaxY * this.renderMinX,
+ (1.0D - this.renderMaxY) * this.renderMinX,
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ k1,
+ l1,
+ i2,
+ this.renderMaxY * (1.0D - this.renderMaxX),
+ this.renderMaxY * this.renderMaxX,
+ (1.0D - this.renderMaxY) * this.renderMaxX,
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ k1,
+ l1,
+ i2,
+ this.renderMinY * (1.0D - this.renderMaxX),
+ this.renderMinY * this.renderMaxX,
+ (1.0D - this.renderMinY) * this.renderMaxX,
+ (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ k1,
+ l1,
+ i2,
+ this.renderMinY * (1.0D - this.renderMinX),
+ this.renderMinY * this.renderMinX,
+ (1.0D - this.renderMinY) * this.renderMinX,
+ (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.8F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.8F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.8F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 2);
+ CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass && iicon.getIconName()
+ .equals("grass_side") && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceZNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos, yPos, zPos + 1, 3)) {
+ if (this.renderMaxZ >= 1.0D) {
+ ++zPos;
+ }
+
+ this.aoLightValueScratchXZNP = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPP = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZNP = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchYZPP = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ this.aoBrightnessYZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessYZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos, yPos + 1, zPos + 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos, yPos - 1, zPos + 1)
+ .getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos - 1, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos - 1, zPos);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos - 1, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos + 1, zPos);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos + 1, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos - 1, zPos);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos + 1, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos + 1, zPos);
+ }
+
+ if (this.renderMaxZ >= 1.0D) {
+ --zPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxZ >= 1.0D || !blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ }
+
+ f7 = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ f8 = (this.aoLightValueScratchXZNP + this.aoLightValueScratchXYZNPP + f7 + this.aoLightValueScratchYZPP)
+ / 4.0F;
+ f9 = (f7 + this.aoLightValueScratchYZPP + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYZPPP)
+ / 4.0F;
+ f10 = (this.aoLightValueScratchYZNP + f7 + this.aoLightValueScratchXYZPNP + this.aoLightValueScratchXZPP)
+ / 4.0F;
+ f11 = (this.aoLightValueScratchXYZNNP + this.aoLightValueScratchXZNP + this.aoLightValueScratchYZNP + f7)
+ / 4.0F;
+ f3 = (float) ((double) f8 * this.renderMaxY * (1.0D - this.renderMinX)
+ + (double) f9 * this.renderMaxY * this.renderMinX
+ + (double) f10 * (1.0D - this.renderMaxY) * this.renderMinX
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinX));
+ f4 = (float) ((double) f8 * this.renderMinY * (1.0D - this.renderMinX)
+ + (double) f9 * this.renderMinY * this.renderMinX
+ + (double) f10 * (1.0D - this.renderMinY) * this.renderMinX
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinX));
+ f5 = (float) ((double) f8 * this.renderMinY * (1.0D - this.renderMaxX)
+ + (double) f9 * this.renderMinY * this.renderMaxX
+ + (double) f10 * (1.0D - this.renderMinY) * this.renderMaxX
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxX));
+ f6 = (float) ((double) f8 * this.renderMaxY * (1.0D - this.renderMaxX)
+ + (double) f9 * this.renderMaxY * this.renderMaxX
+ + (double) f10 * (1.0D - this.renderMaxY) * this.renderMaxX
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX));
+ j1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYZNPP, this.aoBrightnessYZPP, i1);
+ k1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZPP, this.aoBrightnessXZPP, this.aoBrightnessXYZPPP, i1);
+ l1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessYZNP, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
+ i2 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, this.aoBrightnessYZNP, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ this.renderMaxY * (1.0D - this.renderMinX),
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMinX),
+ (1.0D - this.renderMaxY) * this.renderMinX,
+ this.renderMaxY * this.renderMinX);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ this.renderMinY * (1.0D - this.renderMinX),
+ (1.0D - this.renderMinY) * (1.0D - this.renderMinX),
+ (1.0D - this.renderMinY) * this.renderMinX,
+ this.renderMinY * this.renderMinX);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ this.renderMinY * (1.0D - this.renderMaxX),
+ (1.0D - this.renderMinY) * (1.0D - this.renderMaxX),
+ (1.0D - this.renderMinY) * this.renderMaxX,
+ this.renderMinY * this.renderMaxX);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ this.renderMaxY * (1.0D - this.renderMaxX),
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMaxX),
+ (1.0D - this.renderMaxY) * this.renderMaxX,
+ this.renderMaxY * this.renderMaxX);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.8F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.8F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.8F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.8F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.8F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.8F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 3);
+ CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass && iicon.getIconName()
+ .equals("grass_side") && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceZPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos - 1, yPos, zPos, 4)) {
+ if (this.renderMinX <= 0.0D) {
+ --xPos;
+ }
+
+ this.aoLightValueScratchXYNN = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNN = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZNP = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYNP = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessXZNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessXZNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos - 1, yPos + 1, zPos)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos - 1, yPos - 1, zPos)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos - 1, yPos, zPos - 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos - 1, yPos, zPos + 1)
+ .getCanBlockGrass();
+
+ if (!flag4 && !flag3) {
+ this.aoLightValueScratchXYZNNN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNNN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNNN = blockAccess.getBlock(xPos, yPos - 1, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
+ }
+
+ if (!flag5 && !flag3) {
+ this.aoLightValueScratchXYZNNP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNNP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNNP = blockAccess.getBlock(xPos, yPos - 1, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
+ }
+
+ if (!flag4 && !flag2) {
+ this.aoLightValueScratchXYZNPN = this.aoLightValueScratchXZNN;
+ this.aoBrightnessXYZNPN = this.aoBrightnessXZNN;
+ } else {
+ this.aoLightValueScratchXYZNPN = blockAccess.getBlock(xPos, yPos + 1, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
+ }
+
+ if (!flag5 && !flag2) {
+ this.aoLightValueScratchXYZNPP = this.aoLightValueScratchXZNP;
+ this.aoBrightnessXYZNPP = this.aoBrightnessXZNP;
+ } else {
+ this.aoLightValueScratchXYZNPP = blockAccess.getBlock(xPos, yPos + 1, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZNPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
+ }
+
+ if (this.renderMinX <= 0.0D) {
+ ++xPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMinX <= 0.0D || !blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos - 1, yPos, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos - 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ f8 = (this.aoLightValueScratchXYNN + this.aoLightValueScratchXYZNNP + f7 + this.aoLightValueScratchXZNP)
+ / 4.0F;
+ f9 = (f7 + this.aoLightValueScratchXZNP + this.aoLightValueScratchXYNP + this.aoLightValueScratchXYZNPP)
+ / 4.0F;
+ f10 = (this.aoLightValueScratchXZNN + f7 + this.aoLightValueScratchXYZNPN + this.aoLightValueScratchXYNP)
+ / 4.0F;
+ f11 = (this.aoLightValueScratchXYZNNN + this.aoLightValueScratchXYNN + this.aoLightValueScratchXZNN + f7)
+ / 4.0F;
+ f3 = (float) ((double) f9 * this.renderMaxY * this.renderMaxZ
+ + (double) f10 * this.renderMaxY * (1.0D - this.renderMaxZ)
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ)
+ + (double) f8 * (1.0D - this.renderMaxY) * this.renderMaxZ);
+ f4 = (float) ((double) f9 * this.renderMaxY * this.renderMinZ
+ + (double) f10 * this.renderMaxY * (1.0D - this.renderMinZ)
+ + (double) f11 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ)
+ + (double) f8 * (1.0D - this.renderMaxY) * this.renderMinZ);
+ f5 = (float) ((double) f9 * this.renderMinY * this.renderMinZ
+ + (double) f10 * this.renderMinY * (1.0D - this.renderMinZ)
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ)
+ + (double) f8 * (1.0D - this.renderMinY) * this.renderMinZ);
+ f6 = (float) ((double) f9 * this.renderMinY * this.renderMaxZ
+ + (double) f10 * this.renderMinY * (1.0D - this.renderMaxZ)
+ + (double) f11 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ)
+ + (double) f8 * (1.0D - this.renderMinY) * this.renderMaxZ);
+ j1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYNN, this.aoBrightnessXYZNNP, this.aoBrightnessXZNP, i1);
+ k1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNP, this.aoBrightnessXYNP, this.aoBrightnessXYZNPP, i1);
+ l1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZNN, this.aoBrightnessXYZNPN, this.aoBrightnessXYNP, i1);
+ i2 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZNNN, this.aoBrightnessXYNN, this.aoBrightnessXZNN, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ k1,
+ l1,
+ i2,
+ j1,
+ this.renderMaxY * this.renderMaxZ,
+ this.renderMaxY * (1.0D - this.renderMaxZ),
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ),
+ (1.0D - this.renderMaxY) * this.renderMaxZ);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ k1,
+ l1,
+ i2,
+ j1,
+ this.renderMaxY * this.renderMinZ,
+ this.renderMaxY * (1.0D - this.renderMinZ),
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ),
+ (1.0D - this.renderMaxY) * this.renderMinZ);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ k1,
+ l1,
+ i2,
+ j1,
+ this.renderMinY * this.renderMinZ,
+ this.renderMinY * (1.0D - this.renderMinZ),
+ (1.0D - this.renderMinY) * (1.0D - this.renderMinZ),
+ (1.0D - this.renderMinY) * this.renderMinZ);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ k1,
+ l1,
+ i2,
+ j1,
+ this.renderMinY * this.renderMaxZ,
+ this.renderMinY * (1.0D - this.renderMaxZ),
+ (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ),
+ (1.0D - this.renderMinY) * this.renderMaxZ);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.6F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.6F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.6F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 4);
+ CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass && iicon.getIconName()
+ .equals("grass_side") && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceXNeg(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ if (RenderBlocks.getInstance().renderAllFaces
+ || block.shouldSideBeRendered(blockAccess, xPos + 1, yPos, zPos, 5)) {
+ if (this.renderMaxX >= 1.0D) {
+ ++xPos;
+ }
+
+ this.aoLightValueScratchXYPN = blockAccess.getBlock(xPos, yPos - 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPN = blockAccess.getBlock(xPos, yPos, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXZPP = blockAccess.getBlock(xPos, yPos, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoLightValueScratchXYPP = blockAccess.getBlock(xPos, yPos + 1, zPos)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos);
+ this.aoBrightnessXZPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos - 1);
+ this.aoBrightnessXZPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos, zPos + 1);
+ this.aoBrightnessXYPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos);
+ flag2 = blockAccess.getBlock(xPos + 1, yPos + 1, zPos)
+ .getCanBlockGrass();
+ flag3 = blockAccess.getBlock(xPos + 1, yPos - 1, zPos)
+ .getCanBlockGrass();
+ flag4 = blockAccess.getBlock(xPos + 1, yPos, zPos + 1)
+ .getCanBlockGrass();
+ flag5 = blockAccess.getBlock(xPos + 1, yPos, zPos - 1)
+ .getCanBlockGrass();
+
+ if (!flag3 && !flag5) {
+ this.aoLightValueScratchXYZPNN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPNN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPNN = blockAccess.getBlock(xPos, yPos - 1, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos - 1);
+ }
+
+ if (!flag3 && !flag4) {
+ this.aoLightValueScratchXYZPNP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPNP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPNP = blockAccess.getBlock(xPos, yPos - 1, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPNP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos - 1, zPos + 1);
+ }
+
+ if (!flag2 && !flag5) {
+ this.aoLightValueScratchXYZPPN = this.aoLightValueScratchXZPN;
+ this.aoBrightnessXYZPPN = this.aoBrightnessXZPN;
+ } else {
+ this.aoLightValueScratchXYZPPN = blockAccess.getBlock(xPos, yPos + 1, zPos - 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPN = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos - 1);
+ }
+
+ if (!flag2 && !flag4) {
+ this.aoLightValueScratchXYZPPP = this.aoLightValueScratchXZPP;
+ this.aoBrightnessXYZPPP = this.aoBrightnessXZPP;
+ } else {
+ this.aoLightValueScratchXYZPPP = blockAccess.getBlock(xPos, yPos + 1, zPos + 1)
+ .getAmbientOcclusionLightValue();
+ this.aoBrightnessXYZPPP = block.getMixedBrightnessForBlock(blockAccess, xPos, yPos + 1, zPos + 1);
+ }
+
+ if (this.renderMaxX >= 1.0D) {
+ --xPos;
+ }
+
+ i1 = l;
+
+ if (this.renderMaxX >= 1.0D || !blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .isOpaqueCube()) {
+ i1 = block.getMixedBrightnessForBlock(blockAccess, xPos + 1, yPos, zPos);
+ }
+
+ f7 = blockAccess.getBlock(xPos + 1, yPos, zPos)
+ .getAmbientOcclusionLightValue();
+ f8 = (this.aoLightValueScratchXYPN + this.aoLightValueScratchXYZPNP + f7 + this.aoLightValueScratchXZPP)
+ / 4.0F;
+ f9 = (this.aoLightValueScratchXYZPNN + this.aoLightValueScratchXYPN + this.aoLightValueScratchXZPN + f7)
+ / 4.0F;
+ f10 = (this.aoLightValueScratchXZPN + f7 + this.aoLightValueScratchXYZPPN + this.aoLightValueScratchXYPP)
+ / 4.0F;
+ f11 = (f7 + this.aoLightValueScratchXZPP + this.aoLightValueScratchXYPP + this.aoLightValueScratchXYZPPP)
+ / 4.0F;
+ f3 = (float) ((double) f8 * (1.0D - this.renderMinY) * this.renderMaxZ
+ + (double) f9 * (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ)
+ + (double) f10 * this.renderMinY * (1.0D - this.renderMaxZ)
+ + (double) f11 * this.renderMinY * this.renderMaxZ);
+ f4 = (float) ((double) f8 * (1.0D - this.renderMinY) * this.renderMinZ
+ + (double) f9 * (1.0D - this.renderMinY) * (1.0D - this.renderMinZ)
+ + (double) f10 * this.renderMinY * (1.0D - this.renderMinZ)
+ + (double) f11 * this.renderMinY * this.renderMinZ);
+ f5 = (float) ((double) f8 * (1.0D - this.renderMaxY) * this.renderMinZ
+ + (double) f9 * (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ)
+ + (double) f10 * this.renderMaxY * (1.0D - this.renderMinZ)
+ + (double) f11 * this.renderMaxY * this.renderMinZ);
+ f6 = (float) ((double) f8 * (1.0D - this.renderMaxY) * this.renderMaxZ
+ + (double) f9 * (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ)
+ + (double) f10 * this.renderMaxY * (1.0D - this.renderMaxZ)
+ + (double) f11 * this.renderMaxY * this.renderMaxZ);
+ j1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYPN, this.aoBrightnessXYZPNP, this.aoBrightnessXZPP, i1);
+ k1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZPP, this.aoBrightnessXYPP, this.aoBrightnessXYZPPP, i1);
+ l1 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXZPN, this.aoBrightnessXYZPPN, this.aoBrightnessXYPP, i1);
+ i2 = RenderBlocks.getInstance()
+ .getAoBrightness(this.aoBrightnessXYZPNN, this.aoBrightnessXYPN, this.aoBrightnessXZPN, i1);
+ this.brightnessTopLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ (1.0D - this.renderMinY) * this.renderMaxZ,
+ (1.0D - this.renderMinY) * (1.0D - this.renderMaxZ),
+ this.renderMinY * (1.0D - this.renderMaxZ),
+ this.renderMinY * this.renderMaxZ);
+ this.brightnessBottomLeft = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ (1.0D - this.renderMinY) * this.renderMinZ,
+ (1.0D - this.renderMinY) * (1.0D - this.renderMinZ),
+ this.renderMinY * (1.0D - this.renderMinZ),
+ this.renderMinY * this.renderMinZ);
+ this.brightnessBottomRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ (1.0D - this.renderMaxY) * this.renderMinZ,
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMinZ),
+ this.renderMaxY * (1.0D - this.renderMinZ),
+ this.renderMaxY * this.renderMinZ);
+ this.brightnessTopRight = RenderBlocks.getInstance()
+ .mixAoBrightness(
+ j1,
+ i2,
+ l1,
+ k1,
+ (1.0D - this.renderMaxY) * this.renderMaxZ,
+ (1.0D - this.renderMaxY) * (1.0D - this.renderMaxZ),
+ this.renderMaxY * (1.0D - this.renderMaxZ),
+ this.renderMaxY * this.renderMaxZ);
+
+ if (flag1) {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = R
+ * 0.6F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = G
+ * 0.6F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = B
+ * 0.6F;
+ } else {
+ this.colorRedTopLeft = this.colorRedBottomLeft = this.colorRedBottomRight = this.colorRedTopRight = 0.6F;
+ this.colorGreenTopLeft = this.colorGreenBottomLeft = this.colorGreenBottomRight = this.colorGreenTopRight = 0.6F;
+ this.colorBlueTopLeft = this.colorBlueBottomLeft = this.colorBlueBottomRight = this.colorBlueTopRight = 0.6F;
+ }
+
+ this.colorRedTopLeft *= f3;
+ this.colorGreenTopLeft *= f3;
+ this.colorBlueTopLeft *= f3;
+ this.colorRedBottomLeft *= f4;
+ this.colorGreenBottomLeft *= f4;
+ this.colorBlueBottomLeft *= f4;
+ this.colorRedBottomRight *= f5;
+ this.colorGreenBottomRight *= f5;
+ this.colorBlueBottomRight *= f5;
+ this.colorRedTopRight *= f6;
+ this.colorGreenTopRight *= f6;
+ this.colorBlueTopRight *= f6;
+ iicon = this.getBlockIcon(block, blockAccess, xPos, yPos, zPos, 5);
+ CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+
+ RenderBlocks.getInstance();
+ if (RenderBlocks.fancyGrass && iicon.getIconName()
+ .equals("grass_side") && !this.hasOverrideBlockTexture()) {
+ this.colorRedTopLeft *= R;
+ this.colorRedBottomLeft *= R;
+ this.colorRedBottomRight *= R;
+ this.colorRedTopRight *= R;
+ this.colorGreenTopLeft *= G;
+ this.colorGreenBottomLeft *= G;
+ this.colorGreenBottomRight *= G;
+ this.colorGreenTopRight *= G;
+ this.colorBlueTopLeft *= B;
+ this.colorBlueBottomLeft *= B;
+ this.colorBlueBottomRight *= B;
+ this.colorBlueTopRight *= B;
+ CustomOreBlockRenderer.renderFaceXPos(aWorld, aRenderer, block, xPos, yPos, zPos, aTextures);
+ }
+
+ flag = true;
+ }
+
+ this.enableAO = false;
+ return flag;
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
new file mode 100644
index 0000000000..c691bac144
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderDecayChest.java
@@ -0,0 +1,92 @@
+package gtPlusPlus.core.client.renderer;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import cpw.mods.fml.client.registry.RenderingRegistry;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.client.model.ModelDecayChest;
+import gtPlusPlus.core.lib.CORE;
+import gtPlusPlus.core.tileentities.general.TileEntityDecayablesChest;
+
+@SideOnly(Side.CLIENT)
+public class RenderDecayChest extends TileEntitySpecialRenderer {
+
+ private static final ResourceLocation mChestTexture = new ResourceLocation(
+ GTPlusPlus.ID,
+ "textures/blocks/TileEntities/DecayablesChest_full.png");
+ private ModelDecayChest mChestModel = new ModelDecayChest();
+
+ public static RenderDecayChest INSTANCE;
+ public final int mRenderID;
+
+ public RenderDecayChest() {
+ INSTANCE = this;
+ this.mRenderID = RenderingRegistry.getNextAvailableRenderId();
+ Logger.INFO("Registered Lead Lined Chest Renderer.");
+ }
+
+ public void renderTileEntityAt(TileEntityDecayablesChest p_147500_1_, double p_147500_2_, double p_147500_4_,
+ double p_147500_6_, float p_147500_8_) {
+
+ int i = 0;
+
+ if (true) {
+ this.bindTexture(mChestTexture);
+ GL11.glPushMatrix();
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glTranslatef((float) p_147500_2_, (float) p_147500_4_ + 1.0F, (float) p_147500_6_ + 1.0F);
+ GL11.glScalef(1.0F, -1.0F, -1.0F);
+ GL11.glTranslatef(0.5F, 0.5F, 0.5F);
+ short short1 = 0;
+
+ if (i == 2) {
+ short1 = 180;
+ }
+
+ if (i == 3) {
+ short1 = 0;
+ }
+
+ if (i == 4) {
+ short1 = 90;
+ }
+
+ if (i == 5) {
+ short1 = -90;
+ }
+
+ GL11.glRotatef((float) short1, 0.0F, 1.0F, 0.0F);
+ GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
+ float f1 = p_147500_1_.prevLidAngle + (p_147500_1_.lidAngle - p_147500_1_.prevLidAngle) * p_147500_8_;
+
+ f1 = 1.0F - f1;
+ f1 = 1.0F - f1 * f1 * f1;
+ mChestModel.chestLid.rotateAngleX = -(f1 * CORE.PI / 2.0F);
+ mChestModel.renderAll();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ }
+ }
+
+ @Override
+ public void renderTileEntityAt(TileEntity p_147500_1_, double p_147500_2_, double p_147500_4_, double p_147500_6_,
+ float p_147500_8_) {
+ this.renderTileEntityAt(
+ (TileEntityDecayablesChest) p_147500_1_,
+ p_147500_2_,
+ p_147500_4_,
+ p_147500_6_,
+ p_147500_8_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java
new file mode 100644
index 0000000000..259352367d
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderMiningExplosivesPrimed.java
@@ -0,0 +1,111 @@
+package gtPlusPlus.core.client.renderer;
+
+import net.minecraft.client.renderer.RenderBlocks;
+import net.minecraft.client.renderer.entity.RenderTNTPrimed;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.entity.Entity;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.block.ModBlocks;
+import gtPlusPlus.core.entity.EntityPrimedMiningExplosive;
+
+@SideOnly(Side.CLIENT)
+public class RenderMiningExplosivesPrimed extends RenderTNTPrimed {
+
+ private final RenderBlocks blockRenderer = new RenderBlocks();
+
+ public RenderMiningExplosivesPrimed() {
+ this.shadowSize = 0.5F;
+ Logger.WARNING("Rendering Mining Explosion. 1");
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(final EntityPrimedMiningExplosive entity, final double p_76986_2_, final double p_76986_4_,
+ final double p_76986_6_, final float p_76986_8_, final float p_76986_9_) {
+ Logger.WARNING("Rendering Mining Explosion. 2");
+ GL11.glPushMatrix();
+ GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
+ float f2;
+
+ if (((entity.fuse - p_76986_9_) + 1.0F) < 10.0F) {
+ f2 = 1.0F - (((entity.fuse - p_76986_9_) + 1.0F) / 10.0F);
+
+ if (f2 < 0.0F) {
+ f2 = 0.0F;
+ }
+
+ if (f2 > 1.0F) {
+ f2 = 1.0F;
+ }
+
+ f2 *= f2;
+ f2 *= f2;
+ final float f3 = 1.0F + (f2 * 0.3F);
+ GL11.glScalef(f3, f3, f3);
+ }
+
+ f2 = (1.0F - (((entity.fuse - p_76986_9_) + 1.0F) / 100.0F)) * 0.8F;
+ this.bindEntityTexture(entity);
+ this.blockRenderer.renderBlockAsItem(ModBlocks.blockMiningExplosive, 0, entity.getBrightness(p_76986_9_));
+
+ if (((entity.fuse / 5) % 2) == 0) {
+ GL11.glDisable(GL11.GL_TEXTURE_2D);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, f2);
+ this.blockRenderer.renderBlockAsItem(ModBlocks.blockMiningExplosive, 0, 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL11.GL_TEXTURE_2D);
+ }
+
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(final EntityPrimedMiningExplosive p_110775_1_) {
+ return TextureMap.locationBlocksTexture;
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ @Override
+ protected ResourceLocation getEntityTexture(final Entity p_110775_1_) {
+ Logger.WARNING("Rendering Mining Explosion. 4");
+ return this.getEntityTexture((EntityPrimedMiningExplosive) p_110775_1_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(final Entity p_76986_1_, final double p_76986_2_, final double p_76986_4_,
+ final double p_76986_6_, final float p_76986_8_, final float p_76986_9_) {
+ Logger.WARNING("Rendering Mining Explosion. 3");
+ this.doRender(
+ (EntityPrimedMiningExplosive) p_76986_1_,
+ p_76986_2_,
+ p_76986_4_,
+ p_76986_6_,
+ p_76986_8_,
+ p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java
new file mode 100644
index 0000000000..c1d3927416
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderSickBlaze.java
@@ -0,0 +1,96 @@
+package gtPlusPlus.core.client.renderer;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import net.minecraft.client.renderer.entity.RenderLiving;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.util.ResourceLocation;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.client.model.ModelSickBlaze;
+import gtPlusPlus.core.entity.monster.EntitySickBlaze;
+
+@SideOnly(Side.CLIENT)
+public class RenderSickBlaze extends RenderLiving {
+
+ private static final ResourceLocation blazeTextures = new ResourceLocation(
+ GTPlusPlus.ID + ":" + "textures/entity/sickBlaze.png");
+ private int field_77068_a;
+
+ public RenderSickBlaze() {
+ super(new ModelSickBlaze(), 0.5F);
+ this.field_77068_a = ((ModelSickBlaze) this.mainModel).func_78104_a();
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(EntitySickBlaze p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
+ float p_76986_8_, float p_76986_9_) {
+ int i = ((ModelSickBlaze) this.mainModel).func_78104_a();
+
+ if (i != this.field_77068_a) {
+ this.field_77068_a = i;
+ this.mainModel = new ModelSickBlaze();
+ }
+
+ super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntitySickBlaze p_110775_1_) {
+ return blazeTextures;
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
+ float p_76986_8_, float p_76986_9_) {
+ this.doRender((EntitySickBlaze) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
+ float p_76986_8_, float p_76986_9_) {
+ this.doRender((EntitySickBlaze) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ @Override
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntitySickBlaze) p_110775_1_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntitySickBlaze) p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java
new file mode 100644
index 0000000000..f2ebe84d4d
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderStaballoyConstruct.java
@@ -0,0 +1,163 @@
+package gtPlusPlus.core.client.renderer;
+
+import static gregtech.api.enums.Mods.GTPlusPlus;
+
+import net.minecraft.client.renderer.OpenGlHelper;
+import net.minecraft.client.renderer.entity.RenderLiving;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.entity.Entity;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.init.Blocks;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.client.model.ModelStaballoyConstruct;
+import gtPlusPlus.core.entity.monster.EntityStaballoyConstruct;
+
+@SideOnly(Side.CLIENT)
+public class RenderStaballoyConstruct extends RenderLiving {
+
+ private static final ResourceLocation staballoyGolemTextures = new ResourceLocation(
+ GTPlusPlus.ID + ":" + "textures/entity/golemStaballoy.png");
+ /** Staballoy Golem's Model. */
+ private final ModelStaballoyConstruct staballoyGolemModel;
+
+ public RenderStaballoyConstruct() {
+ super(new ModelStaballoyConstruct(), 0.8F);
+ this.staballoyGolemModel = (ModelStaballoyConstruct) this.mainModel;
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(EntityStaballoyConstruct p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
+ float p_76986_8_, float p_76986_9_) {
+ super.doRender(p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntityStaballoyConstruct p_110775_1_) {
+ return staballoyGolemTextures;
+ }
+
+ protected void rotateCorpse(EntityStaballoyConstruct p_77043_1_, float p_77043_2_, float p_77043_3_,
+ float p_77043_4_) {
+ super.rotateCorpse(p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
+
+ if (p_77043_1_.limbSwingAmount >= 0.01D) {
+ float f3 = 13.0F;
+ float f4 = p_77043_1_.limbSwing - p_77043_1_.limbSwingAmount * (1.0F - p_77043_4_) + 6.0F;
+ float f5 = (Math.abs(f4 % f3 - f3 * 0.5F) - f3 * 0.25F) / (f3 * 0.25F);
+ GL11.glRotatef(6.5F * f5, 0.0F, 0.0F, 1.0F);
+ }
+ }
+
+ protected void renderEquippedItems(EntityStaballoyConstruct p_77029_1_, float p_77029_2_) {
+ super.renderEquippedItems(p_77029_1_, p_77029_2_);
+
+ if (p_77029_1_.getHoldRoseTick() != 0) {
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPushMatrix();
+ GL11.glRotatef(
+ 5.0F + 180.0F * this.staballoyGolemModel.ironGolemRightArm.rotateAngleX / (float) Math.PI,
+ 1.0F,
+ 0.0F,
+ 0.0F);
+ GL11.glTranslatef(-0.6875F, 1.25F, -0.9375F);
+ GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
+ float f1 = 0.8F;
+ GL11.glScalef(f1, -f1, f1);
+ int i = p_77029_1_.getBrightnessForRender(p_77029_2_);
+ int j = i % 65536;
+ int k = i / 65536;
+ OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ this.bindTexture(TextureMap.locationBlocksTexture);
+ this.field_147909_c.renderBlockAsItem(Blocks.red_flower, 0, 1.0F);
+ GL11.glPopMatrix();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ }
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(EntityLiving p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
+ float p_76986_8_, float p_76986_9_) {
+ this.doRender(
+ (EntityStaballoyConstruct) p_76986_1_,
+ p_76986_2_,
+ p_76986_4_,
+ p_76986_6_,
+ p_76986_8_,
+ p_76986_9_);
+ }
+
+ @Override
+ protected void renderEquippedItems(EntityLivingBase p_77029_1_, float p_77029_2_) {
+ this.renderEquippedItems((EntityStaballoyConstruct) p_77029_1_, p_77029_2_);
+ }
+
+ @Override
+ protected void rotateCorpse(EntityLivingBase p_77043_1_, float p_77043_2_, float p_77043_3_, float p_77043_4_) {
+ this.rotateCorpse((EntityStaballoyConstruct) p_77043_1_, p_77043_2_, p_77043_3_, p_77043_4_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(EntityLivingBase p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_,
+ float p_76986_8_, float p_76986_9_) {
+ this.doRender(
+ (EntityStaballoyConstruct) p_76986_1_,
+ p_76986_2_,
+ p_76986_4_,
+ p_76986_6_,
+ p_76986_8_,
+ p_76986_9_);
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ @Override
+ protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
+ return this.getEntityTexture((EntityStaballoyConstruct) p_110775_1_);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender(
+ (EntityStaballoyConstruct) p_76986_1_,
+ p_76986_2_,
+ p_76986_4_,
+ p_76986_6_,
+ p_76986_8_,
+ p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java b/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java
new file mode 100644
index 0000000000..2c0ed7f562
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/renderer/RenderToxinball.java
@@ -0,0 +1,89 @@
+package gtPlusPlus.core.client.renderer;
+
+import net.minecraft.client.renderer.Tessellator;
+import net.minecraft.client.renderer.entity.Render;
+import net.minecraft.client.renderer.texture.TextureMap;
+import net.minecraft.entity.Entity;
+import net.minecraft.init.Items;
+import net.minecraft.util.IIcon;
+import net.minecraft.util.ResourceLocation;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import gtPlusPlus.core.entity.projectile.EntityToxinball;
+
+@SideOnly(Side.CLIENT)
+public class RenderToxinball extends Render {
+
+ private float mSize;
+
+ public RenderToxinball(float scale) {
+ this.mSize = scale;
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ public void doRender(EntityToxinball entity, double p_76986_2_, double p_76986_4_, double p_76986_6_,
+ float p_76986_8_, float p_76986_9_) {
+ GL11.glPushMatrix();
+ this.bindEntityTexture(entity);
+ GL11.glTranslatef((float) p_76986_2_, (float) p_76986_4_, (float) p_76986_6_);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ float f2 = this.mSize;
+ GL11.glScalef(f2 / 1.0F, f2 / 1.0F, f2 / 1.0F);
+ IIcon iicon = Items.slime_ball.getIconFromDamage(0);
+ Tessellator tessellator = Tessellator.instance;
+ float f3 = iicon.getMinU();
+ float f4 = iicon.getMaxU();
+ float f5 = iicon.getMinV();
+ float f6 = iicon.getMaxV();
+ float f7 = 1.0F;
+ float f8 = 0.5F;
+ float f9 = 0.25F;
+ GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
+ GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
+ tessellator.startDrawingQuads();
+ tessellator.setNormal(0.0F, 1.0F, 0.0F);
+ tessellator.addVertexWithUV(0.0F - f8, 0.0F - f9, 0.0D, f3, f6);
+ tessellator.addVertexWithUV(f7 - f8, 0.0F - f9, 0.0D, f4, f6);
+ tessellator.addVertexWithUV(f7 - f8, 1.0F - f9, 0.0D, f4, f5);
+ tessellator.addVertexWithUV(0.0F - f8, 1.0F - f9, 0.0D, f3, f5);
+ tessellator.draw();
+ GL11.glDisable(GL12.GL_RESCALE_NORMAL);
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ protected ResourceLocation getEntityTexture(EntityToxinball entity) {
+ return TextureMap.locationItemsTexture;
+ }
+
+ /**
+ * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture.
+ */
+ @Override
+ protected ResourceLocation getEntityTexture(Entity entity) {
+ return this.getEntityTexture((EntityToxinball) entity);
+ }
+
+ /**
+ * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then
+ * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic
+ * (Render<T extends Entity) and this method has signature public void func_76986_a(T entity, double d, double d1,
+ * double d2, float f, float f1). But JAD is pre 1.5 so doesn't do that.
+ */
+ @Override
+ public void doRender(Entity entity, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_,
+ float p_76986_9_) {
+ this.doRender((EntityToxinball) entity, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_);
+ }
+}
diff --git a/src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java b/src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java
new file mode 100644
index 0000000000..58b135f3fb
--- /dev/null
+++ b/src/main/java/gtPlusPlus/core/client/renderer/particle/EntityDropParticleFX.java
@@ -0,0 +1,105 @@
+package gtPlusPlus.core.client.renderer.particle;
+
+import net.minecraft.block.BlockLiquid;
+import net.minecraft.block.material.Material;
+import net.minecraft.client.particle.EntityFX;
+import net.minecraft.world.World;
+
+import cofh.lib.util.helpers.MathHelper;
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+
+@SideOnly(Side.CLIENT)
+public class EntityDropParticleFX extends EntityFX {
+
+ private int bobTimer;
+
+ public EntityDropParticleFX(World world, double x, double y, double z, float particleRed, float particleGreen,
+ float particleBlue) {
+
+ this(world, x, y, z, particleRed, particleGreen, particleBlue, -1);
+ }
+
+ public EntityDropParticleFX(World world, double x, double y, double z, float particleRed, float particleGreen,
+ float particleBlue, int gravityMod) {
+
+ super(world, x, y, z, 0.0D, 0.0D, 0.0D);
+ this.motionX = this.motionY = this.motionZ = 0.0D;
+
+ this.particleRed = particleRed;
+ this.particleGreen = particleGreen;
+ this.particleBlue = particleBlue;
+
+ this.setParticleTextureIndex(113);
+ this.setSize(0.01F, 0.01F);
+ this.particleGravity = -0.06F * gravityMod;
+ this.bobTimer = 40;
+ this.particleMaxAge = (int) (48.0D / (Math.random() * 0.8D + 0.2D));
+ this.motionX = this.motionY = this.motionZ = 0.0D;
+ }
+
+ @Override
+ public void onUpdate() {
+
+ this.prevPosX = this.posX;
+ this.prevPosY = this.posY;
+ this.prevPosZ = this.posZ;
+
+ this.motionY -= this.particleGravity;
+
+ if (this.bobTimer-- > 0) {
+ this.motionX *= 0.02D;
+ this.motionY *= 0.02D;
+ this.motionZ *= 0.02D;
+ this.setParticleTextureIndex(113);
+ } else {
+ this.setParticleTextureIndex(112);
+ }
+ this.moveEntity(this.motionX, this.motionY, this.motionZ);
+ this.motionX *= 0.9800000190734863D;
+ this.motionY *= 0.9800000190734863D;
+ this.motionZ *= 0.9800000190734863D;
+
+ if (this.particleMaxAge-- <= 0) {
+ this.setDead();
+ }
+ if (this.onGround) {
+ this.setParticleTextureIndex(114);
+ this.motionX *= 0.699999988079071D;
+ this.motionZ *= 0.699999988079071D;
+ }
+ if (this.particleGravity > 0) {
+ Material material = this.worldObj
+ .getBlock(MathHelper.floor(this.posX), MathHelper.floor(this.posY), MathHelper.floor(this.posZ))
+ .getMaterial();
+
+ if (material.isLiquid() || material.isSolid()) {
+ double d0 = MathHelper.floor(this.posY) + 1
+ - BlockLiquid.getLiquidHeightPercent(
+ this.worldObj.getBlockMetadata(
+ MathHelper.floor(this.posX),
+ MathHelper.floor(this.posY),
+ MathHelper.floor(this.posZ)));
+ if (this.posY < d0) {
+ this.setDead();
+ }
+ }
+ } else {
+ Material material = this.worldObj
+ .getBlock(MathHelper.ceil(this.posX), MathHelper.ceil(this.posY), MathHelper.ceil(this.posZ))
+ .getMaterial();
+
+ if (material.isLiquid() || material.isSolid()) {
+ double d0 = MathHelper.ceil(this.posY) + 1
+ - BlockLiquid.getLiquidHeightPercent(
+ this.worldObj.getBlockMetadata(
+ MathHelper.ceil(this.posX),
+ MathHelper.ceil(this.posY),
+ MathHelper.ceil(this.posZ)));
+ if (this.posY > d0) {
+ this.setDead();
+ }
+ }
+ }
+ }
+}