make standing signs rotatable in normal directions

This commit is contained in:
Sen 2025-07-20 17:05:18 +02:00
parent ba3e80b15c
commit 1b52b26f15
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
8 changed files with 54 additions and 56 deletions

View file

@ -682,7 +682,7 @@ public class RenderGlobal
TileEntity tileentity1 = this.theWorld.getTileEntity(blockpos);
Block block = this.theWorld.getState(blockpos).getBlock();
if (tileentity1 != null && (block instanceof BlockChest || block instanceof BlockSign))
if (tileentity1 != null && block instanceof BlockSign)
{
TileEntityRenderer.instance.renderTile(tileentity1, partialTicks, destroyblockprogress.getPartialBlockDamage());
}
@ -1565,7 +1565,7 @@ public class RenderGlobal
double d5 = (double)blockpos.getZ() - d2;
Block block = this.theWorld.getState(blockpos).getBlock();
if (!(block instanceof BlockChest) && !(block instanceof BlockSign))
if (!(block instanceof BlockSign))
{
if (d3 * d3 + d4 * d4 + d5 * d5 > 1024.0D)
{

View file

@ -137,7 +137,7 @@ public class RenderItem
private void renderBuiltin(ItemStack stack) {
if(stack.getItem().getBlock() instanceof BlockStandingSign sign) {
this.state = sign.getState().withProperty(BlockStandingSign.ROTATION, 8);
this.state = sign.getState();
TileEntityRenderer.instance.renderItem(this.sign, 0.0D, 0.0D, 0.0D, 0.0F);
this.state = null;
}

View file

@ -31,7 +31,23 @@ public class SignRenderer extends TileRenderer<TileEntitySign>
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;
int r = state.getBlock() == Blocks.sign ? state.getValue(BlockWallSign.FACING).getIndex() : 0;
float f1 = 0.0F;
if (r == 2)
{
f1 = 180.0F;
}
if (r == 4)
{
f1 = 90.0F;
}
if (r == 5)
{
f1 = -90.0F;
}
GL11.glRotatef(-f1, 0.0F, 1.0F, 0.0F);
this.model.signStick.showModel = true;
}

View file

@ -10,7 +10,6 @@ import client.world.WorldClient;
import common.collect.Maps;
import common.entity.Entity;
import common.tileentity.TileEntity;
import common.tileentity.TileEntityChest;
import common.tileentity.TileEntityDisplay;
import common.tileentity.TileEntitySign;
import common.util.BlockPos;