update textures #1

This commit is contained in:
Sen 2025-07-19 15:46:25 +02:00
parent 4b313dd869
commit a3ceadd0ff
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
100 changed files with 217 additions and 787 deletions

View file

@ -2,6 +2,7 @@ package client.renderer.layers;
import org.lwjgl.opengl.GL11;
import client.Client;
import client.renderer.GlState;
import client.renderer.entity.RendererLivingEntity;
import client.renderer.model.ModelArmor;
@ -14,14 +15,14 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
{
protected static final String ENCHANTED_ITEM_GLINT_RES = "textures/glint.png";
protected ModelBiped modelLeggings;
protected ModelBiped modelArmor;
protected ModelArmor modelLeggings;
protected ModelArmor modelArmor;
private final RendererLivingEntity<?> renderer;
private float alpha = 1.0F;
private float colorR = 1.0F;
private float colorG = 1.0F;
private float colorB = 1.0F;
private boolean skipRenderGlint;
// private boolean skipRenderGlint;
// private static final Map<String, String> ARMOR_TEXTURE_RES_MAP = Maps.<String, String>newHashMap();
public LayerArmor(RendererLivingEntity<?> rendererIn, int arms, int legs)
@ -32,12 +33,12 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
this.modelArmor = new ModelArmor(1.0F, arms, legs);
}
public void doRenderLayer(EntityLiving entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
public void doRenderLayer(EntityLiving entity, float limbSwing, float limbSwingAmount, float partial, float yaw, float pitch, float factor, float scale)
{
this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 4);
this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 3);
this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 2);
this.renderLayer(entitylivingbaseIn, p_177141_2_, p_177141_3_, partialTicks, p_177141_5_, p_177141_6_, p_177141_7_, scale, 1);
this.renderLayer(entity, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale, 4);
this.renderLayer(entity, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale, 3);
this.renderLayer(entity, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale, 2);
this.renderLayer(entity, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale, 1);
}
public boolean shouldCombineTextures()
@ -45,19 +46,23 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
return false;
}
private void renderLayer(EntityLiving entitylivingbaseIn, float p_177182_2_, float p_177182_3_, float partialTicks, float p_177182_5_, float p_177182_6_, float p_177182_7_, float scale, int armorSlot)
private void renderLayer(EntityLiving entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partial, float yaw, float pitch, float factor, float scale, int armorSlot)
{
ItemStack itemstack = this.getCurrentArmor(entitylivingbaseIn, armorSlot);
if (itemstack != null && itemstack.getItem() instanceof ItemArmor)
{
ItemArmor itemarmor = (ItemArmor)itemstack.getItem();
ModelBiped t = this.getArmorModel(armorSlot);
t.setModelAttributes(this.renderer.getMainModel());
t.setLivingAnimations(entitylivingbaseIn, p_177182_2_, p_177182_3_, partialTicks);
ModelArmor t = this.getArmorModel(armorSlot);
t.setModelAttributes(this.renderer != null ? this.renderer.getMainModel() : null);
t.setLivingAnimations(entitylivingbaseIn, limbSwing, limbSwingAmount, partial);
this.setModelPartVisible(t, armorSlot);
boolean flag = this.isSlotForLeggings(armorSlot);
this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, null));
String tex = this.getArmorResource(itemarmor, flag, null);
if(this.renderer != null)
this.renderer.bindTexture(tex);
else
Client.CLIENT.getTextureManager().bindTexture(tex);
if (itemarmor.getArmorMaterial().canBeDyed())
{
@ -66,8 +71,12 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
float f1 = (float)(i >> 8 & 255) / 255.0F;
float f2 = (float)(i & 255) / 255.0F;
GlState.color(this.colorR * f, this.colorG * f1, this.colorB * f2, this.alpha);
t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale);
this.renderer.bindTexture(this.getArmorResource(itemarmor, flag, "overlay"));
t.render(entitylivingbaseIn, limbSwing, limbSwingAmount, yaw, pitch, factor, scale);
String overlay = this.getArmorResource(itemarmor, flag, "overlay");
if(this.renderer != null)
this.renderer.bindTexture(overlay);
else
Client.CLIENT.getTextureManager().bindTexture(overlay);
}
// case CHAIN:
@ -76,13 +85,13 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
// case DIAMOND:
if(itemarmor.getArmorMaterial().hasArmor()) {
GlState.color(this.colorR, this.colorG, this.colorB, this.alpha);
t.render(entitylivingbaseIn, p_177182_2_, p_177182_3_, p_177182_5_, p_177182_6_, p_177182_7_, scale);
t.render(entitylivingbaseIn, limbSwing, limbSwingAmount, yaw, pitch, factor, scale);
}
// default:
if (!this.skipRenderGlint && itemstack.isItemEnchanted())
if (itemstack.isItemEnchanted())
{
this.renderGlint(entitylivingbaseIn, t, p_177182_2_, p_177182_3_, partialTicks, p_177182_5_, p_177182_6_, p_177182_7_, scale);
this.renderGlint(entitylivingbaseIn, t, limbSwing, limbSwingAmount, partial, yaw, pitch, factor, scale);
}
}
}
@ -92,7 +101,7 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
return entitylivingbaseIn.getArmor(armorSlot - 1);
}
public ModelBiped getArmorModel(int armorSlot)
public ModelArmor getArmorModel(int armorSlot)
{
return this.isSlotForLeggings(armorSlot) ? this.modelLeggings : this.modelArmor;
}
@ -102,10 +111,13 @@ public class LayerArmor implements LayerRenderer<EntityLiving>
return armorSlot == 2;
}
private void renderGlint(EntityLiving entitylivingbaseIn, ModelBiped modelbaseIn, float p_177183_3_, float p_177183_4_, float partialTicks, float p_177183_6_, float p_177183_7_, float p_177183_8_, float scale)
private void renderGlint(EntityLiving entitylivingbaseIn, ModelArmor modelbaseIn, float p_177183_3_, float p_177183_4_, float partialTicks, float p_177183_6_, float p_177183_7_, float p_177183_8_, float scale)
{
float f = (float)entitylivingbaseIn.ticksExisted + partialTicks;
this.renderer.bindTexture(ENCHANTED_ITEM_GLINT_RES);
float f = entitylivingbaseIn == null ? (float)(System.currentTimeMillis() % 1000000L) / 50.0f : (float)entitylivingbaseIn.ticksExisted + partialTicks;
if(this.renderer != null)
this.renderer.bindTexture(ENCHANTED_ITEM_GLINT_RES);
else
Client.CLIENT.getTextureManager().bindTexture(ENCHANTED_ITEM_GLINT_RES);
GlState.enableBlend();
GlState.depthFunc(GL11.GL_EQUAL);
GlState.depthMask(false);

View file

@ -114,12 +114,12 @@ public abstract class ModelBiped extends ModelBase
{
this.bipedHead.rotateAngleY = netHeadYaw / (180F / (float)Math.PI);
this.bipedHead.rotateAngleX = headPitch / (180F / (float)Math.PI);
this.bipedRightArm.rotateAngleX = ((EntityLiving)entityIn).getArmRotation() * ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) * /* 2.0F * */ limbSwingAmount; // * 0.5F;
this.bipedLeftArm.rotateAngleX = ((EntityLiving)entityIn).getArmRotation() * ExtMath.cos(limbSwing * 0.6662F) * /* 2.0F * */ limbSwingAmount; // * 0.5F;
this.bipedRightArm.rotateAngleX = (entityIn == null ? 1.0f : ((EntityLiving)entityIn).getArmRotation()) * ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) * /* 2.0F * */ limbSwingAmount; // * 0.5F;
this.bipedLeftArm.rotateAngleX = (entityIn == null ? 1.0f : ((EntityLiving)entityIn).getArmRotation()) * ExtMath.cos(limbSwing * 0.6662F) * /* 2.0F * */ limbSwingAmount; // * 0.5F;
this.bipedRightArm.rotateAngleZ = 0.0F;
this.bipedLeftArm.rotateAngleZ = 0.0F;
this.bipedRightLeg.rotateAngleX = ((EntityLiving)entityIn).getLegRotation() * ExtMath.cos(limbSwing * 0.6662F) /* * 1.4F */ * limbSwingAmount;
this.bipedLeftLeg.rotateAngleX = ((EntityLiving)entityIn).getLegRotation() * ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) /* * 1.4F */ * limbSwingAmount;
this.bipedRightLeg.rotateAngleX = (entityIn == null ? 1.4f : ((EntityLiving)entityIn).getLegRotation()) * ExtMath.cos(limbSwing * 0.6662F) /* * 1.4F */ * limbSwingAmount;
this.bipedLeftLeg.rotateAngleX = (entityIn == null ? 1.4f : ((EntityLiving)entityIn).getLegRotation()) * ExtMath.cos(limbSwing * 0.6662F + (float)Math.PI) /* * 1.4F */ * limbSwingAmount;
this.bipedRightLeg.rotateAngleY = 0.0F;
this.bipedLeftLeg.rotateAngleY = 0.0F;
@ -231,7 +231,8 @@ public abstract class ModelBiped extends ModelBase
public void setModelAttributes(ModelBase model)
{
super.setModelAttributes(model);
if(model != null)
super.setModelAttributes(model);
if (model instanceof ModelBiped)
{

View file

@ -1,8 +1,18 @@
package client.renderer.tileentity;
import org.lwjgl.opengl.GL11;
import client.renderer.GlState;
import client.renderer.layers.LayerArmor;
import common.block.tech.BlockChest;
import common.block.tile.BlockSign;
import common.block.tile.BlockStandingSign;
import common.entity.types.EntityLiving;
import common.item.ItemStack;
import common.item.block.ItemSign;
import common.item.tool.ItemArmor;
import common.tileentity.TileEntityChest;
import common.tileentity.TileEntitySign;
import common.util.Facing;
import common.world.State;
@ -10,6 +20,7 @@ public class TileEntityItemStackRenderer {
public static TileEntityItemStackRenderer instance = new TileEntityItemStackRenderer();
private State state;
private ItemStack stack;
private final TileEntityChest chest = new TileEntityChest(0) {
public boolean hasWorldObj() {
@ -21,10 +32,58 @@ public class TileEntityItemStackRenderer {
}
};
private final TileEntitySign sign = new TileEntitySign() {
public boolean hasWorldObj() {
return true;
}
public State getBlockState() {
return TileEntityItemStackRenderer.this.state;
}
};
private final LayerArmor armor = new LayerArmor(null, 12, 12) {
public ItemStack getCurrentArmor(EntityLiving entitylivingbaseIn, int armorSlot) {
return ((ItemArmor)TileEntityItemStackRenderer.this.stack.getItem()).armorType.getIndex() == armorSlot ? TileEntityItemStackRenderer.this.stack : null;
}
};
public void renderByItem(ItemStack stack) {
if(stack.getItem() != null && stack.getItem().getBlock() instanceof BlockChest chest) {
this.state = chest.getState().withProperty(BlockChest.FACING, Facing.SOUTH);
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chest, 0.0D, 0.0D, 0.0D, 0.0F);
}
else if(stack.getItem() instanceof ItemSign sign) {
this.state = sign.getBlock().getState().withProperty(BlockStandingSign.ROTATION, 8);
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.sign, 0.0D, 0.0D, 0.0D, 0.0F);
}
else if(stack.getItem() instanceof ItemArmor armor) {
this.stack = stack;
GL11.glPushMatrix();
float offset = 0.0f;
switch(armor.armorType) {
case HEAD:
offset = -0.15f;
break;
case BODY:
offset = 0.45f;
break;
case LEGS:
offset = 1.35f;
break;
case FEET:
offset = 1.7f;
break;
}
GL11.glTranslatef(1.0f, offset, 0.0f);
GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f);
GL11.glScalef(1.4f, -1.4f, 1.4f);
boolean cull = GlState.isCullEnabled();
if(cull)
GlState.disableCull();
this.armor.doRenderLayer(null, 0.0f, 0.0f, 0.0f, 0, 0, 0.0f, 0.0625F);
if(cull)
GlState.enableCull();
GL11.glPopMatrix();
}
}
}

View file

@ -22,12 +22,11 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntity
public void renderTileEntityAt(TileEntitySign te, double x, double y, double z, float partialTicks, int destroyStage)
{
Block block = te.getBlockType();
GL11.glPushMatrix();
float f = 0.6666667F;
State state = te.getBlockState();
if (block == Blocks.sign)
if (state.getBlock() == Blocks.sign)
{
GL11.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F);
float f1 = state.getBlock() == Blocks.sign ? (float)(state.getValue(BlockStandingSign.ROTATION) * 360) / 16.0F : 0.0F;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 496 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 5.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 248 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 287 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 581 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 333 B

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 291 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 239 B

View file

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 4.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 4.8 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 5.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 541 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 795 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 4.7 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 223 B

View file

Before

Width:  |  Height:  |  Size: 190 B

After

Width:  |  Height:  |  Size: 190 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 452 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 434 B

After

Width:  |  Height:  |  Size: 5.3 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 B

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB