From 7d1f51a8937e0a86486267437d444696e81e8aa0 Mon Sep 17 00:00:00 2001 From: Jakub <53441451+kuba6000@users.noreply.github.com> Date: Mon, 29 Aug 2022 16:04:28 +0200 Subject: Buildscript + Spotless (#318) * Convert AES.java to readable class * Buildscript * Spotless --- .../gtPlusPlus/core/client/CustomTextureSet.java | 37 +- .../gtPlusPlus/core/client/model/ModelBatKing.java | 59 +- .../core/client/model/ModelDecayChest.java | 11 +- .../gtPlusPlus/core/client/model/ModelEggBox.java | 50 +- .../core/client/model/ModelGiantChicken.java | 61 +- .../core/client/model/ModelSickBlaze.java | 58 +- .../core/client/model/ModelStaballoyConstruct.java | 66 +- .../core/client/model/tabula/ModelTabulaBase.java | 16 +- .../client/renderer/CustomItemBlockRenderer.java | 99 +- .../client/renderer/CustomOreBlockRenderer.java | 3572 +++++++++++--------- .../core/client/renderer/RenderBatKing.java | 292 +- .../core/client/renderer/RenderDecayChest.java | 118 +- .../core/client/renderer/RenderGiantChicken.java | 5 +- .../renderer/RenderMiningExplosivesPrimed.java | 196 +- .../core/client/renderer/RenderPlasmaBolt.java | 317 +- .../core/client/renderer/RenderPotionthrow.java | 42 +- .../core/client/renderer/RenderSickBlaze.java | 76 +- .../client/renderer/RenderStaballoyConstruct.java | 293 +- .../core/client/renderer/RenderToxinball.java | 47 +- .../renderer/particle/EntityDropParticleFX.java | 175 +- .../client/renderer/tabula/RenderTabulaBase.java | 59 +- 21 files changed, 3042 insertions(+), 2607 deletions(-) (limited to 'src/main/java/gtPlusPlus/core/client') diff --git a/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java b/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java index 400503b2fa..687dc65fb1 100644 --- a/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java +++ b/src/main/java/gtPlusPlus/core/client/CustomTextureSet.java @@ -4,25 +4,24 @@ import gregtech.api.enums.TextureSet; public class CustomTextureSet extends TextureSet { - public static enum TextureSets { - - REFINED(), - GEM_A(), - ENRICHED(), - NUCLEAR; + 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); - } + 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/ModelBatKing.java b/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java index ac64dee26a..590345e8e6 100644 --- a/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java +++ b/src/main/java/gtPlusPlus/core/client/model/ModelBatKing.java @@ -1,19 +1,16 @@ package gtPlusPlus.core.client.model; -import org.lwjgl.opengl.GL11; - import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import gtPlusPlus.core.entity.monster.EntityBatKing; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; -import net.minecraft.entity.passive.EntityBat; import net.minecraft.util.MathHelper; +import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -public class ModelBatKing extends ModelBase -{ +public class ModelBatKing extends ModelBase { private ModelRenderer batHead; /** The body box of the bat model. */ private ModelRenderer batBody; @@ -26,11 +23,10 @@ public class ModelBatKing extends ModelBase /** The outer left wing box of the bat model. */ private ModelRenderer batOuterLeftWing; - public ModelBatKing() - { + public ModelBatKing() { this.textureWidth = 64; this.textureHeight = 64; - + this.batHead = new ModelRenderer(this, 0, 0); this.batHead.addBox(-3.0F, -3.0F, -3.0F, 6, 6, 6); ModelRenderer modelrenderer = new ModelRenderer(this, 24, 0); @@ -65,56 +61,57 @@ public class ModelBatKing extends ModelBase * not actually sure this is size, is not used as of now, but the model would be recreated if the value changed and * it seems a good match for a bats size */ - public int getBatSize() - { + public int getBatSize() { return 72; } /** * Sets the models various rotation angles then renders the model. */ - 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_) - { - EntityBatKing entitybat = (EntityBatKing)p_78088_1_; + 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_) { + EntityBatKing entitybat = (EntityBatKing) p_78088_1_; float f6; - if (entitybat.getIsBatHanging()) - { - f6 = (180F / (float)Math.PI); - this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI); - this.batHead.rotateAngleY = (float)Math.PI - p_78088_5_ / (180F / (float)Math.PI); - this.batHead.rotateAngleZ = (float)Math.PI; + if (entitybat.getIsBatHanging()) { + f6 = (180F / (float) Math.PI); + this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI); + this.batHead.rotateAngleY = (float) Math.PI - p_78088_5_ / (180F / (float) Math.PI); + this.batHead.rotateAngleZ = (float) Math.PI; this.batHead.setRotationPoint(0.0F, -2.0F, 0.0F); this.batRightWing.setRotationPoint(-3.0F, 0.0F, 3.0F); this.batLeftWing.setRotationPoint(3.0F, 0.0F, 3.0F); - this.batBody.rotateAngleX = (float)Math.PI; + this.batBody.rotateAngleX = (float) Math.PI; this.batRightWing.rotateAngleX = -0.15707964F; - this.batRightWing.rotateAngleY = -((float)Math.PI * 2F / 5F); + this.batRightWing.rotateAngleY = -((float) Math.PI * 2F / 5F); this.batOuterRightWing.rotateAngleY = -1.7278761F; this.batLeftWing.rotateAngleX = this.batRightWing.rotateAngleX; this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; this.batOuterLeftWing.rotateAngleY = -this.batOuterRightWing.rotateAngleY; - } - else - { - f6 = (180F / (float)Math.PI); - this.batHead.rotateAngleX = p_78088_6_ / (180F / (float)Math.PI); - this.batHead.rotateAngleY = p_78088_5_ / (180F / (float)Math.PI); + } else { + f6 = (180F / (float) Math.PI); + this.batHead.rotateAngleX = p_78088_6_ / (180F / (float) Math.PI); + this.batHead.rotateAngleY = p_78088_5_ / (180F / (float) Math.PI); this.batHead.rotateAngleZ = 0.0F; this.batHead.setRotationPoint(0.0F, 0.0F, 0.0F); this.batRightWing.setRotationPoint(0.0F, 0.0F, 0.0F); this.batLeftWing.setRotationPoint(0.0F, 0.0F, 0.0F); - this.batBody.rotateAngleX = ((float)Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F; + this.batBody.rotateAngleX = ((float) Math.PI / 4F) + MathHelper.cos(p_78088_4_ * 0.1F) * 0.15F; this.batBody.rotateAngleY = 0.0F; - this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float)Math.PI * 0.25F; + this.batRightWing.rotateAngleY = MathHelper.cos(p_78088_4_ * 1.3F) * (float) Math.PI * 0.25F; this.batLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY; this.batOuterRightWing.rotateAngleY = this.batRightWing.rotateAngleY * 0.5F; this.batOuterLeftWing.rotateAngleY = -this.batRightWing.rotateAngleY * 0.5F; } - GL11.glScalef(4, 4, 4); this.batHead.render(p_78088_7_); this.batBody.render(p_78088_7_); } -} \ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java b/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java index c116dcf115..98c474a160 100644 --- a/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java +++ b/src/main/java/gtPlusPlus/core/client/model/ModelDecayChest.java @@ -6,8 +6,7 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; @SideOnly(Side.CLIENT) -public class ModelDecayChest extends ModelBase -{ +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. */ @@ -15,8 +14,7 @@ public class ModelDecayChest extends ModelBase /** The chest's knob in the chest model. */ public ModelRenderer chestKnob; - public ModelDecayChest() - { + 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; @@ -36,11 +34,10 @@ public class ModelDecayChest extends ModelBase /** * This method renders out all parts of the chest model. */ - public void renderAll() - { + public void renderAll() { this.chestKnob.rotateAngleX = this.chestLid.rotateAngleX; this.chestLid.render(0.0625F); this.chestKnob.render(0.0625F); this.chestBelow.render(0.0625F); } -} \ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java b/src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java index 0aef4eb7b0..a12b48c7d2 100644 --- a/src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java +++ b/src/main/java/gtPlusPlus/core/client/model/ModelEggBox.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.client.model; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import gtPlusPlus.core.client.model.tabula.ModelTabulaBase; @@ -14,19 +13,19 @@ import net.minecraft.entity.Entity; * Created using Tabula 4.1.1 */ public class ModelEggBox extends ModelTabulaBase { - - private final AutoMap> mParts = new AutoMap>(); - - private static RenderTabulaBase mRendererInstance; - + + private final AutoMap> mParts = new AutoMap>(); + + private static RenderTabulaBase mRendererInstance; + public ModelRenderer bottom; - //EggBox_full.png + // EggBox_full.png public ModelEggBox() { - super(64, 64); + super(64, 64); this.textureWidth = 64; this.textureHeight = 64; - + this.bottom = new ModelRenderer(this, 0, 19); this.bottom.setRotationPoint(1.0F, 6.0F, 1.0F); this.bottom.addBox(0.0F, 0.0F, 0.0F, 14, 10, 14, 0.0F); @@ -34,8 +33,8 @@ public class ModelEggBox extends ModelTabulaBase { } @Override - public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { - //Logger.INFO("Rendering EggBox"); + public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { + // Logger.INFO("Rendering EggBox"); this.bottom.render(f5); } @@ -48,18 +47,19 @@ public class ModelEggBox extends ModelTabulaBase { modelRenderer.rotateAngleZ = z; } - @Override - protected AutoMap> getModelParts() { - AutoMap> aParts = new AutoMap>(); - aParts.add(new Pair(bottom, 0.0625F)); - return aParts; - //return mParts; - } - - public static RenderTabulaBase getRenderer() { - if (mRendererInstance == null) { - mRendererInstance = new RenderTabulaBase(new ModelEggBox(), "textures/blocks/TileEntities/EggBox_full.png", TileEntityEggBox.class); - } - return mRendererInstance; - } + @Override + protected AutoMap> getModelParts() { + AutoMap> aParts = new AutoMap>(); + aParts.add(new Pair(bottom, 0.0625F)); + return aParts; + // return mParts; + } + + public static RenderTabulaBase getRenderer() { + if (mRendererInstance == null) { + mRendererInstance = new RenderTabulaBase( + new ModelEggBox(), "textures/blocks/TileEntities/EggBox_full.png", TileEntityEggBox.class); + } + return mRendererInstance; + } } diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java b/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java index f7fb92f550..586dfec2db 100644 --- a/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java +++ b/src/main/java/gtPlusPlus/core/client/model/ModelGiantChicken.java @@ -2,7 +2,6 @@ package gtPlusPlus.core.client.model; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - import net.minecraft.client.model.ModelChicken; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; @@ -10,46 +9,50 @@ import net.minecraft.util.MathHelper; import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) -public class ModelGiantChicken extends ModelChicken{ +public class ModelGiantChicken extends ModelChicken { - public ModelGiantChicken() - { + public ModelGiantChicken() { byte b0 = 16; this.head = new ModelRenderer(this, 0, 0); this.head.addBox(-2.0F, -6.0F, -2.0F, 4, 6, 3, 0.0F); - this.head.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.head.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F); this.bill = new ModelRenderer(this, 14, 0); this.bill.addBox(-2.0F, -4.0F, -4.0F, 4, 2, 2, 0.0F); - this.bill.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.bill.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F); this.chin = new ModelRenderer(this, 14, 4); this.chin.addBox(-1.0F, -2.0F, -3.0F, 2, 2, 2, 0.0F); - this.chin.setRotationPoint(0.0F, (float)(-1 + b0), -4.0F); + this.chin.setRotationPoint(0.0F, (float) (-1 + b0), -4.0F); this.body = new ModelRenderer(this, 0, 9); this.body.addBox(-3.0F, -4.0F, -3.0F, 6, 8, 6, 0.0F); - this.body.setRotationPoint(0.0F, (float)b0, 0.0F); + this.body.setRotationPoint(0.0F, (float) b0, 0.0F); this.rightLeg = new ModelRenderer(this, 26, 0); this.rightLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); - this.rightLeg.setRotationPoint(-2.0F, (float)(3 + b0), 1.0F); + this.rightLeg.setRotationPoint(-2.0F, (float) (3 + b0), 1.0F); this.leftLeg = new ModelRenderer(this, 26, 0); this.leftLeg.addBox(-1.0F, 0.0F, -3.0F, 3, 5, 3); - this.leftLeg.setRotationPoint(1.0F, (float)(3 + b0), 1.0F); + this.leftLeg.setRotationPoint(1.0F, (float) (3 + b0), 1.0F); this.rightWing = new ModelRenderer(this, 24, 13); this.rightWing.addBox(0.0F, 0.0F, -3.0F, 1, 4, 6); - this.rightWing.setRotationPoint(-4.0F, (float)(-3 + b0), 0.0F); + this.rightWing.setRotationPoint(-4.0F, (float) (-3 + b0), 0.0F); this.leftWing = new ModelRenderer(this, 24, 13); this.leftWing.addBox(-1.0F, 0.0F, -3.0F, 1, 4, 6); - this.leftWing.setRotationPoint(4.0F, (float)(-3 + b0), 0.0F); + this.leftWing.setRotationPoint(4.0F, (float) (-3 + b0), 0.0F); } /** * Sets the models various rotation angles then renders the model. */ - 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_) - { + 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_); - if (this.isChild) - { + if (this.isChild) { float f6 = 1.0F; GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 0F, 0F); @@ -66,10 +69,8 @@ public class ModelGiantChicken extends ModelChicken{ this.rightWing.render(p_78088_7_); this.leftWing.render(p_78088_7_); GL11.glPopMatrix(); - //super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); - } - else - { + // super.render(p_78088_1_, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, p_78088_7_); + } else { float f6 = 2.0F; GL11.glPushMatrix(); GL11.glScalef(1.0F * f6, 1.0F * f6, 1.0F * f6); @@ -95,18 +96,24 @@ public class ModelGiantChicken extends ModelChicken{ * 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. */ - 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.head.rotateAngleX = p_78087_5_ / (180F / (float)Math.PI); - this.head.rotateAngleY = p_78087_4_ / (180F / (float)Math.PI); + 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.head.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI); + this.head.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI); this.bill.rotateAngleX = this.head.rotateAngleX; this.bill.rotateAngleY = this.head.rotateAngleY; this.chin.rotateAngleX = this.head.rotateAngleX; this.chin.rotateAngleY = this.head.rotateAngleY; - this.body.rotateAngleX = ((float)Math.PI / 2F); + this.body.rotateAngleX = ((float) Math.PI / 2F); this.rightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_; - this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float)Math.PI) * 1.4F * p_78087_2_; + this.leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float) Math.PI) * 1.4F * p_78087_2_; this.rightWing.rotateAngleZ = p_78087_3_; this.leftWing.rotateAngleZ = -p_78087_3_; } -} \ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java b/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java index 455df761cb..7cfb7ec2ea 100644 --- a/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java +++ b/src/main/java/gtPlusPlus/core/client/model/ModelSickBlaze.java @@ -2,23 +2,20 @@ package gtPlusPlus.core.client.model; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - import net.minecraft.client.model.ModelBlaze; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; @SideOnly(Side.CLIENT) -public class ModelSickBlaze extends ModelBlaze -{ +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) - { + 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); } @@ -28,8 +25,7 @@ public class ModelSickBlaze extends ModelBlaze } @Override - public int func_78104_a() - { + public int func_78104_a() { return 8; } @@ -37,13 +33,18 @@ public class ModelSickBlaze extends ModelBlaze * 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_) - { + 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 (int i = 0; i < this.blazeSticks.length; ++i) - { + for (int i = 0; i < this.blazeSticks.length; ++i) { this.blazeSticks[i].render(p_78088_7_); } } @@ -54,40 +55,43 @@ public class ModelSickBlaze extends ModelBlaze * "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; + 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) - { + 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; + f6 = ((float) Math.PI / 4F) + p_78087_3_ * (float) Math.PI * 0.03F; - for (i = 4; i < 8; ++i) - { + 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; + f6 = 0.47123894F + p_78087_3_ * (float) Math.PI * -0.05F; - for (i = 8; i < 12; ++i) - { + 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); + this.blazeHead.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI); + this.blazeHead.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI); } -} \ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java b/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java index aa23635b4d..879e06516a 100644 --- a/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java +++ b/src/main/java/gtPlusPlus/core/client/model/ModelStaballoyConstruct.java @@ -2,7 +2,6 @@ package gtPlusPlus.core.client.model; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; - import net.minecraft.client.model.ModelIronGolem; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; @@ -10,21 +9,17 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityIronGolem; @SideOnly(Side.CLIENT) -public class ModelStaballoyConstruct extends ModelIronGolem -{ - - public ModelStaballoyConstruct() - { +public class ModelStaballoyConstruct extends ModelIronGolem { + + public ModelStaballoyConstruct() { this(0.0F); } - public ModelStaballoyConstruct(float p_i1161_1_) - { + public ModelStaballoyConstruct(float p_i1161_1_) { this(p_i1161_1_, -7.0F); } - public ModelStaballoyConstruct(float p_i1162_1_, float p_i1162_2_) - { + public ModelStaballoyConstruct(float p_i1162_1_, float p_i1162_2_) { short short1 = 128; short short2 = 128; this.ironGolemHead = (new ModelRenderer(this)).setTextureSize(short1, short2); @@ -54,8 +49,14 @@ public class ModelStaballoyConstruct extends ModelIronGolem * 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_) - { + 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_); @@ -71,10 +72,16 @@ public class ModelStaballoyConstruct extends ModelIronGolem * "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); + 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; @@ -86,35 +93,28 @@ public class ModelStaballoyConstruct extends ModelIronGolem * 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_; + 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) - { + 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 - { + } else { int j = entityirongolem.getHoldRoseTick(); - if (j > 0) - { + 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_; + } 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_) - { + 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); } -} \ No newline at end of file +} diff --git a/src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java b/src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java index 3a0cbb636b..2ec6e4f06d 100644 --- a/src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java +++ b/src/main/java/gtPlusPlus/core/client/model/tabula/ModelTabulaBase.java @@ -1,6 +1,5 @@ package gtPlusPlus.core.client.model.tabula; -import gtPlusPlus.api.objects.Logger; import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.data.Pair; import net.minecraft.client.model.ModelBase; @@ -11,20 +10,19 @@ import net.minecraft.client.model.ModelRenderer; * Created using Tabula 4.1.1 */ public abstract class ModelTabulaBase extends ModelBase { - - + public ModelTabulaBase(int aTexWidth, int aTexHeight) { this.textureWidth = aTexWidth; this.textureHeight = aTexHeight; } - + protected abstract AutoMap> getModelParts(); - + public void renderAll() { - for (Pair part : getModelParts()) { - //Logger.INFO("Rendering EggBox"); - part.getKey().render(part.getValue()); - } + for (Pair part : getModelParts()) { + // Logger.INFO("Rendering EggBox"); + part.getKey().render(part.getValue()); + } } /** diff --git a/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java b/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java index f40357495a..b24bc48dbd 100644 --- a/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java +++ b/src/main/java/gtPlusPlus/core/client/renderer/CustomItemBlockRenderer.java @@ -7,79 +7,78 @@ 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(); + public static CustomItemBlockRenderer instance = new CustomItemBlockRenderer(); - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return true; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { + return true; + } - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + @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) { + 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); + } - renderTextureAsBlock(renderer, item.getIconIndex(), translateX, translateY, translateZ); - } + public static void renderItemAsBlock( + RenderBlocks renderer, ItemStack item, double translateX, double translateY, double translateZ) { - public static void renderTextureAsBlock(RenderBlocks renderer, IIcon texture, double translateX, double translateY, double translateZ) { + renderTextureAsBlock(renderer, item.getIconIndex(), translateX, translateY, translateZ); + } - Tessellator tessellator = Tessellator.instance; - Block block = Blocks.stone; + public static void renderTextureAsBlock( + RenderBlocks renderer, IIcon texture, double translateX, double translateY, double translateZ) { - if (texture == null) { - return; - } - renderer.setRenderBoundsFromBlock(block); - GL11.glTranslated(translateX, translateY, translateZ); - tessellator.startDrawingQuads(); + Tessellator tessellator = Tessellator.instance; + Block block = Blocks.stone; - tessellator.setNormal(0.0F, -1.0F, 0.0F); - renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, texture); + if (texture == null) { + return; + } + renderer.setRenderBoundsFromBlock(block); + GL11.glTranslated(translateX, translateY, translateZ); + tessellator.startDrawingQuads(); - tessellator.setNormal(0.0F, 1.0F, 0.0F); - renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, texture); + tessellator.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(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, 1.0F, 0.0F); + renderer.renderFaceYPos(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(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(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(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.renderFaceXPos(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.draw(); - } + 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 index a0b34d3b0b..793e7093cb 100644 --- a/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java +++ b/src/main/java/gtPlusPlus/core/client/renderer/CustomOreBlockRenderer.java @@ -1,7 +1,5 @@ package gtPlusPlus.core.client.renderer; -import org.lwjgl.opengl.GL11; - import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import cpw.mods.fml.client.registry.RenderingRegistry; import gregtech.api.interfaces.ITexture; @@ -14,443 +12,537 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import org.lwjgl.opengl.GL11; 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((byte) 0), ((ITexturedBlock) tTileEntity).getTexture((byte) 1), ((ITexturedBlock) tTileEntity).getTexture((byte) 2), ((ITexturedBlock) tTileEntity).getTexture((byte) 3), ((ITexturedBlock) tTileEntity).getTexture((byte) 4), ((ITexturedBlock) tTileEntity).getTexture((byte) 5)}); - } - 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 (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].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 (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].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 (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].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 (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].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 (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].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 (int i = 0; i < aIcon.length; i++) { - if (aIcon[i] != null) { - aIcon[i].renderXPos(aRenderer, aBlock, aX, aY, aZ); - } - } - } - aRenderer.flipTexture = false; - } - - 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((byte) 0), 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((byte) 1), 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((byte) 2), 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((byte) 3), 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((byte) 4), 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((byte) 5), 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); - } - - 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); - } - - public boolean shouldRender3DInInventory(int aModel) { - return true; - } - - 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) - { + 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((byte) 0), + ((ITexturedBlock) tTileEntity).getTexture((byte) 1), + ((ITexturedBlock) tTileEntity).getTexture((byte) 2), + ((ITexturedBlock) tTileEntity).getTexture((byte) 3), + ((ITexturedBlock) tTileEntity).getTexture((byte) 4), + ((ITexturedBlock) tTileEntity).getTexture((byte) 5) + }); + } + 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 (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].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 (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].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 (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].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 (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].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 (int i = 0; i < aIcon.length; i++) { + if (aIcon[i] != null) { + aIcon[i].renderXNeg(aRenderer, aBlock, aX, aY, aZ); + } + } + } + aRenderer.flipTexture = false; + } + + public static void renderPosi