Entity and Block renderers

master
Wynd 2025-04-11 23:11:47 +03:00
parent 1362d67c79
commit 6c1bdfb3e1
5 changed files with 180 additions and 2 deletions

View File

@ -0,0 +1,26 @@
--- src/ModelSkeleton.java.bak 2025-04-11 18:43:29.683052578 +0300
+++ src/ModelSkeleton.java 2025-04-11 22:15:12.390065531 +0300
@@ -4,6 +4,7 @@
package net.minecraft.src;
+import net.minecraft.src.finalbeta.ModConfig;
// Referenced classes of package net.minecraft.src:
// ModelZombie, ModelRenderer
@@ -29,4 +30,15 @@
bipedLeftLeg.addBox(-1F, 0.0F, -1F, 2, 12, 2, f);
bipedLeftLeg.setRotationPoint(2.0F, 12F, 0.0F);
}
+
+ public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) {
+ super.setRotationAngles(f, f1, f2, f3, f4, f5);
+ if (ModConfig.FIX_BOW_MODEL.get()) {
+ this.bipedLeftArm.rotateAngleY = 0.45f;
+ this.bipedRightArm.rotateAngleY = -0.2f;
+ this.bipedLeftArm.rotateAngleX -= 0.05f;
+ this.bipedRightArm.rotateAngleX -= 0.05f;
+ this.bipedRightArm.rotateAngleZ += 0.1f;
+ }
+ }
}

View File

@ -0,0 +1,25 @@
--- src/RenderBiped.java.bak 2025-04-11 18:43:30.910036551 +0300
+++ src/RenderBiped.java 2025-04-11 22:21:16.144036810 +0300
@@ -5,6 +5,7 @@
package net.minecraft.src;
import org.lwjgl.opengl.GL11;
+import net.minecraft.src.finalbeta.ModConfig;
// Referenced classes of package net.minecraft.src:
// RenderLiving, EntityLiving, ModelBiped, ModelRenderer,
@@ -53,6 +54,14 @@
GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F);
}
+
+ if (ModConfig.FIX_BOW_MODEL.get()) {
+ if (itemstack.itemID == Item.bow.shiftedIndex) {
+ GL11.glRotatef(-5, 1, 0, 0);
+ GL11.glTranslatef(0.2F, -0.5F, 0.2F);
+ }
+ }
+
renderManager.itemRenderer.renderItem(entityliving, itemstack);
GL11.glPopMatrix();
}

View File

@ -0,0 +1,84 @@
--- src/RenderBlocks.java.bak 2025-04-11 18:43:30.925036355 +0300
+++ src/RenderBlocks.java 2025-04-11 23:08:23.255669667 +0300
@@ -4,8 +4,9 @@
package net.minecraft.src;
-import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
+import net.minecraft.client.Minecraft;
+import net.minecraft.src.finalbeta.ModConfig;
// Referenced classes of package net.minecraft.src:
// Block, BlockRail, ModLoader, Tessellator,
@@ -1557,6 +1558,17 @@
tessellator.addVertexWithUV(d10 + d3, d1 + 0.0D, (d2 - d13) + d4, f, f3);
tessellator.addVertexWithUV(d9 + d3, d1 + 0.0D, (d2 - d13) + d4, f1, f3);
tessellator.addVertexWithUV(d9, d1 + 1.0D, d2 - d13, f1, f2);
+
+ double u3 = f + 0.02734375D;
+ double v3 = f2 + 0.0434375D;
+ double u4 = f + 0.03515625D;
+ double v4 = f2 + 0.05125D;
+ double w2 = 0.0625D;
+
+ tessellator.addVertexWithUV(d + d3 * 1.0D - w2, d1, d2 + d4 * 1.0D + w2, u3, v3);
+ tessellator.addVertexWithUV(d + d3 * 1.0D - w2, d1, d2 + d4 * 1.0D - w2, u3, v4);
+ tessellator.addVertexWithUV(d + d3 * 1.0D + w2, d1, d2 + d4 * 1.0D - w2, u4, v4);
+ tessellator.addVertexWithUV(d + d3 * 1.0D + w2, d1, d2 + d4 * 1.0D + w2, u4, v3);
}
public void renderCrossedSquares(Block block, int i, double d, double d1, double d2)
@@ -2702,10 +2714,37 @@
{
flag2 = true;
}
+
boolean flag3 = blockAccess.getBlockId(i - 1, j, k) == block.blockID;
boolean flag4 = blockAccess.getBlockId(i + 1, j, k) == block.blockID;
boolean flag5 = blockAccess.getBlockId(i, j, k - 1) == block.blockID;
boolean flag6 = blockAccess.getBlockId(i, j, k + 1) == block.blockID;
+
+ if (ModConfig.FENCE_CONNECT.get()) {
+ if (this.blockAccess.getBlockMaterial(i - 1, j, k).isSolid() || this.blockAccess.getBlockMaterial(i + 1, j, k).isSolid()) {
+ flag1 = true;
+ }
+
+ if (this.blockAccess.getBlockMaterial(i, j, k - 1).isSolid() || this.blockAccess.getBlockMaterial(i, j, k + 1).isSolid()) {
+ flag2 = true;
+ }
+
+ Block xpTile = Block.blocksList[this.blockAccess.getBlockId(i + 1, j, k)];
+ Block xnTile = Block.blocksList[this.blockAccess.getBlockId(i - 1, j, k)];
+ Block zpTile = Block.blocksList[this.blockAccess.getBlockId(i, j, k + 1)];
+ Block znTile = Block.blocksList[this.blockAccess.getBlockId(i, j, k - 1)];
+
+ boolean xpCheck = xpTile != null && (xpTile.renderAsNormalBlock() || xpTile.blockID == Block.fence.blockID);
+ boolean xnCheck = xnTile != null && (xnTile.renderAsNormalBlock() || xnTile.blockID == Block.fence.blockID);
+ boolean zpCheck = zpTile != null && (zpTile.renderAsNormalBlock() || zpTile.blockID == Block.fence.blockID);
+ boolean znCheck = znTile != null && (znTile.renderAsNormalBlock() || znTile.blockID == Block.fence.blockID);
+
+ flag3 = this.blockAccess.getBlockMaterial(i - 1, j, k).isSolid() && xnCheck;
+ flag4 = this.blockAccess.getBlockMaterial(i + 1, j, k).isSolid() && xpCheck;
+ flag5 = this.blockAccess.getBlockMaterial(i, j, k - 1).isSolid() && znCheck;
+ flag6 = this.blockAccess.getBlockMaterial(i, j, k + 1).isSolid() && zpCheck;
+ }
+
if(!flag1 && !flag2)
{
flag1 = true;
@@ -3509,6 +3548,14 @@
tessellator.draw();
tessellator.startDrawingQuads();
tessellator.setNormal(0.0F, 1.0F, 0.0F);
+
+ if (block.blockID == Block.grass.blockID) {
+ float r = (ColorizerGrass.getGrassColor(0.96, 0.44) >> 16 & 255) / 255.0F;
+ float g = (ColorizerGrass.getGrassColor(0.96, 0.44) >> 8 & 255) / 255.0F;
+ float b = (ColorizerGrass.getGrassColor(0.96, 0.44) & 255) / 255.0F;
+ tessellator.setColorOpaque_F(r * f, g * f, b * f);
+ }
+
renderTopFace(block, 0.0D, 0.0D, 0.0D, block.getBlockTextureFromSideAndMetadata(1, i));
tessellator.draw();
tessellator.startDrawingQuads();

View File

@ -0,0 +1,36 @@
--- src/RenderPlayer.java.bak 2025-04-11 18:43:31.156033337 +0300
+++ src/RenderPlayer.java 2025-04-11 21:33:18.370893092 +0300
@@ -5,6 +5,7 @@
package net.minecraft.src;
import net.minecraft.client.Minecraft;
+import net.minecraft.src.finalbeta.ModConfig;
import org.lwjgl.opengl.GL11;
// Referenced classes of package net.minecraft.src:
@@ -53,6 +54,13 @@
public void renderPlayer(EntityPlayer entityplayer, double d, double d1, double d2,
float f, float f1)
{
+ if (ModConfig.FIX_LEG_ARMOR_ON_VEHICLES.get()) {
+ ItemStack stack = entityplayer.inventory.armorItemInSlot(1);
+ if (stack != null && stack.getItem() instanceof ItemArmor) {
+ this.modelArmor.isRiding = entityplayer.isRiding();
+ }
+ }
+
ItemStack itemstack = entityplayer.inventory.getCurrentItem();
modelArmorChestplate.field_1278_i = modelArmor.field_1278_i = modelBipedMain.field_1278_i = itemstack != null;
modelArmorChestplate.isSneak = modelArmor.isSneak = modelBipedMain.isSneak = entityplayer.isSneaking();
@@ -237,6 +245,11 @@
GL11.glRotatef(-90F, 1.0F, 0.0F, 0.0F);
GL11.glRotatef(20F, 0.0F, 0.0F, 1.0F);
}
+
+ if (ModConfig.FIX_BOW_MODEL.get() && itemstack1.itemID == Item.bow.shiftedIndex) {
+ GL11.glTranslatef(0.0F, -0.5F, 0.0F);
+ }
+
renderManager.itemRenderer.renderItem(entityplayer, itemstack1);
GL11.glPopMatrix();
}

View File

@ -64,9 +64,16 @@ public class mod_FinalBeta extends BaseMod {
// minecraft.thePlayer.dropItem(Block.stoneOvenIdle.blockID, 1); // minecraft.thePlayer.dropItem(Block.stoneOvenIdle.blockID, 1);
// minecraft.thePlayer.dropItem(ModBlock.COAL_BLOCK.blockID, 1); // minecraft.thePlayer.dropItem(ModBlock.COAL_BLOCK.blockID, 1);
// minecraft.thePlayer.dropItem(ModBlock.REDSTONE_BLOCK.blockID, 1); // minecraft.thePlayer.dropItem(Block.grass.blockID, 2);
// minecraft.thePlayer.dropItem(Block.fence.blockID, 64);
// minecraft.theWorld.setWorldTime(0); // minecraft.thePlayer.dropItem(Item.boat.shiftedIndex, 1);
// minecraft.thePlayer.dropItem(Item.helmetDiamond.shiftedIndex, 1);
// minecraft.thePlayer.dropItem(Item.legsDiamond.shiftedIndex, 1);
// minecraft.thePlayer.dropItem(Item.plateDiamond.shiftedIndex, 1);
// minecraft.thePlayer.dropItem(Item.bootsDiamond.shiftedIndex, 1);
minecraft.theWorld.setWorldTime(0);
} }
else { else {
if (keyTimer > 0) { if (keyTimer > 0) {