remove skull tile entity

This commit is contained in:
Sen 2025-06-01 16:02:45 +02:00
parent bda91dac26
commit 618a076c0f
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
24 changed files with 165 additions and 879 deletions

View file

@ -30,7 +30,6 @@ import client.world.WorldClient;
import common.block.Block;
import common.block.tech.BlockChest;
import common.block.tile.BlockSign;
import common.block.tile.BlockSkull;
import common.collect.Lists;
import common.collect.Maps;
import common.collect.Sets;
@ -702,7 +701,7 @@ public class RenderGlobal
Block block = this.theWorld.getState(blockpos).getBlock();
if (tileentity1 != null && (block instanceof BlockChest || /* block instanceof BlockWarpChest || */ block instanceof BlockSign || block instanceof BlockSkull))
if (tileentity1 != null && (block instanceof BlockChest || block instanceof BlockSign))
{
TileEntityRendererDispatcher.instance.renderTileEntity(tileentity1, partialTicks, destroyblockprogress.getPartialBlockDamage());
}
@ -1570,7 +1569,7 @@ public class RenderGlobal
double d5 = (double)blockpos.getZ() - d2;
Block block = this.theWorld.getState(blockpos).getBlock();
if (!(block instanceof BlockChest) && /* !(block instanceof BlockWarpChest) && */ !(block instanceof BlockSign) && !(block instanceof BlockSkull))
if (!(block instanceof BlockChest) && !(block instanceof BlockSign))
{
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
{

View file

@ -100,11 +100,6 @@ public class ModelManager
return this.texMap.getAtlasSprite("blocks/water_still");
}
if (block == Blocks.skull)
{
return this.texMap.getAtlasSprite("blocks/soul_sand");
}
// if (block == Blocks.barrier)
// {
// return this.modelManager.getTextureMap().getAtlasSprite("items/barrier");

View file

@ -1,36 +0,0 @@
package client.renderer.model;
import common.entity.Entity;
public class ModelHumanoidHead extends ModelHead
{
private final ModelRenderer head = new ModelRenderer(this, 32, 0);
public ModelHumanoidHead()
{
super(0, 0, 64, 64);
this.head.addBox(-4.0F, -8.0F, -4.0F, 8, 8, 8, 0.25F);
this.head.setRotationPoint(0.0F, 0.0F, 0.0F);
}
/**
* Sets the models various rotation angles then renders the model.
*/
public void render(Entity entityIn, float p_78088_2_, float p_78088_3_, float p_78088_4_, float p_78088_5_, float p_78088_6_, float scale)
{
super.render(entityIn, p_78088_2_, p_78088_3_, p_78088_4_, p_78088_5_, p_78088_6_, scale);
this.head.render(scale);
}
/**
* 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.
*/
public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
{
super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
this.head.rotateAngleY = this.mainHead.rotateAngleY;
this.head.rotateAngleX = this.mainHead.rotateAngleX;
}
}

View file

@ -1,64 +1,27 @@
package client.renderer.tileentity;
import org.lwjgl.opengl.GL11;
import client.renderer.GlState;
import common.block.Block;
import common.init.Blocks;
import common.init.Items;
import common.item.ItemStack;
import common.tileentity.TileEntityBanner;
import common.tileentity.TileEntityChest;
import common.tileentity.TileEntitySkull;
import common.util.Facing;
public class TileEntityItemStackRenderer
{
public static TileEntityItemStackRenderer instance = new TileEntityItemStackRenderer();
private TileEntityChest field_147717_b = new TileEntityChest(0);
private TileEntityChest field_147718_c = new TileEntityChest(1);
// private TileEntityWarpChest warpChest = new TileEntityWarpChest();
private TileEntityBanner banner = new TileEntityBanner();
private TileEntitySkull skull = new TileEntitySkull();
public class TileEntityItemStackRenderer {
public static TileEntityItemStackRenderer instance = new TileEntityItemStackRenderer();
public void renderByItem(ItemStack itemStackIn)
{
if (itemStackIn.getItem() == Items.banner)
{
this.banner.setItemValues(itemStackIn);
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.banner, 0.0D, 0.0D, 0.0D, 0.0F);
}
else if (itemStackIn.getItem() == Items.skull)
{
if (TileEntitySkullRenderer.instance != null)
{
GL11.glPushMatrix();
GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
GL11.glScalef(2.0F, 2.0F, 2.0F);
boolean flag = GlState.isCullEnabled();
GlState.disableCull();
TileEntitySkullRenderer.instance.renderSkull(0.0F, 0.0F, 0.0F, Facing.UP, 0.0F, -1);
if(flag)
GlState.enableCull();
GL11.glPopMatrix();
}
}
else
{
Block block = itemStackIn.getItem().getBlock();
private final TileEntityChest chest = new TileEntityChest(0);
private final TileEntityChest trapChest = new TileEntityChest(1);
private final TileEntityBanner banner = new TileEntityBanner();
// if (block == Blocks.warp_chest)
// {
// TileEntityRendererDispatcher.instance.renderTileEntityAt(this.warpChest, 0.0D, 0.0D, 0.0D, 0.0F);
// }
if (block == Blocks.trapped_chest)
{
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147718_c, 0.0D, 0.0D, 0.0D, 0.0F);
}
else
{
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.field_147717_b, 0.0D, 0.0D, 0.0D, 0.0F);
}
}
}
public void renderByItem(ItemStack stack) {
if(stack.getItem() == Items.banner) {
this.banner.setItemValues(stack);
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.banner, 0.0D, 0.0D, 0.0D, 0.0F);
}
else if(stack.getItem() == Items.trapped_chest) {
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.trapChest, 0.0D, 0.0D, 0.0D, 0.0F);
}
else if(stack.getItem() == Items.chest) {
TileEntityRendererDispatcher.instance.renderTileEntityAt(this.chest, 0.0D, 0.0D, 0.0D, 0.0F);
}
}
}

View file

@ -14,7 +14,6 @@ import common.tileentity.TileEntityChest;
import common.tileentity.TileEntityMobSpawner;
import common.tileentity.TileEntityPiston;
import common.tileentity.TileEntitySign;
import common.tileentity.TileEntitySkull;
import common.util.BlockPos;
import common.world.World;
@ -51,11 +50,6 @@ public class TileEntityRendererDispatcher
this.mapSpecialRenderers.put(TileEntityMobSpawner.class, new TileEntityMobSpawnerRenderer());
this.mapSpecialRenderers.put(TileEntityPiston.class, new TileEntityPistonRenderer());
this.mapSpecialRenderers.put(TileEntityChest.class, new TileEntityChestRenderer());
// this.mapSpecialRenderers.put(TileEntityWarpChest.class, new TileEntityWarpChestRenderer());
// this.mapSpecialRenderers.put(TileEntityEnchantmentTable.class, new TileEntityEnchantmentTableRenderer());
// this.mapSpecialRenderers.put(TileEntityPortal.class, new TileEntityPortalRenderer());
// this.mapSpecialRenderers.put(TileEntityBeacon.class, new TileEntityBeaconRenderer());
this.mapSpecialRenderers.put(TileEntitySkull.class, new TileEntitySkullRenderer());
this.mapSpecialRenderers.put(TileEntityBanner.class, new TileEntityBannerRenderer());
for (TileEntitySpecialRenderer<?> tileentityspecialrenderer : this.mapSpecialRenderers.values())

View file

@ -1,124 +0,0 @@
package client.renderer.tileentity;
import org.lwjgl.opengl.GL11;
import client.renderer.GlState;
import client.renderer.model.ModelHumanoidHead;
import common.tileentity.TileEntitySkull;
import common.util.Facing;
public class TileEntitySkullRenderer extends TileEntitySpecialRenderer<TileEntitySkull>
{
private static final String TEXTURE_SKULL = "textures/entity/skull.png";
public static TileEntitySkullRenderer instance;
private final ModelHumanoidHead humanoidHead = new ModelHumanoidHead();
public void renderTileEntityAt(TileEntitySkull te, double x, double y, double z, float partialTicks, int destroyStage)
{
Facing enumfacing = Facing.getFront(te.getBlockMetadata() & 7);
this.renderSkull((float)x, (float)y, (float)z, enumfacing, (float)(te.getSkullRotation() * 360) / 16.0F, destroyStage);
}
public void setRendererDispatcher(TileEntityRendererDispatcher rendererDispatcherIn)
{
super.setRendererDispatcher(rendererDispatcherIn);
instance = this;
}
public void renderSkull(float x, float y, float z, Facing dir, float rot, int destroyStage)
{
// ModelBase modelbase = this.skeletonHead;
if (destroyStage >= 0)
{
this.bindTexture(DESTROY_STAGES[destroyStage]);
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPushMatrix();
GL11.glScalef(4.0F, 2.0F, 1.0F);
GL11.glTranslatef(0.0625F, 0.0625F, 0.0625F);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
else
{
// switch (p_180543_6_)
// {
// case 0:
// default:
// this.bindTexture(SKELETON_TEXTURES);
// break;
//
// case 1:
// this.bindTexture(WITHER_SKELETON_TEXTURES);
// break;
//
// case 2:
// this.bindTexture(ZOMBIE_TEXTURES);
// modelbase = this.humanoidHead;
// break;
//
// case 3:
// modelbase = this.humanoidHead;
// String tex = TEXTURE_SKULL; // EntitySkinManager.TEXTURE_DEF;
// if (user != null && EntityTexManager.getModel(user) == ModelType.HUMANOID)
// {
// tex = EntityTexManager.getSkin(user, ModelType.HUMANOID);
// }
this.bindTexture(TEXTURE_SKULL);
// break;
//
// case 4:
// this.bindTexture(CREEPER_TEXTURES);
// }
}
GL11.glPushMatrix();
GlState.disableCull();
if (dir != Facing.UP)
{
switch (dir)
{
case NORTH:
GL11.glTranslatef(x + 0.5F, y + 0.25F, z + 0.74F);
break;
case SOUTH:
GL11.glTranslatef(x + 0.5F, y + 0.25F, z + 0.26F);
rot = 180.0F;
break;
case WEST:
GL11.glTranslatef(x + 0.74F, y + 0.25F, z + 0.5F);
rot = 270.0F;
break;
case EAST:
default:
GL11.glTranslatef(x + 0.26F, y + 0.25F, z + 0.5F);
rot = 90.0F;
}
}
else
{
GL11.glTranslatef(x + 0.5F, y, z + 0.5F);
}
float f = 0.0625F;
GlState.enableRescaleNormal();
GL11.glScalef(-1.0F, -1.0F, 1.0F);
GlState.enableAlpha();
this.humanoidHead.render(null, 0.0F, 0.0F, 0.0F, rot, 0.0F, f);
GL11.glPopMatrix();
if (destroyStage >= 0)
{
GL11.glMatrixMode(GL11.GL_TEXTURE);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 308 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB