eliminate special render types except liquids

This commit is contained in:
Sen 2025-07-20 17:59:51 +02:00
parent 1b52b26f15
commit 028156c6a6
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
18 changed files with 108 additions and 264 deletions

View file

@ -147,10 +147,6 @@ public class BlockFloorPortal extends Block
map.put("floor_portal", 5);
}
public String getFallbackTexture() {
return "obsidian";
}
protected boolean hasRegisteredItem() {
return false;
}

View file

@ -262,11 +262,11 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
.w(name + "_side").noCull()
.e(name + "_side").noCull()
.add(7, 7, 0, 9, 11, 1)
.d(name + "_handle").uv(7, 8, 9, 9).noCull()
.u(name + "_handle").uv(7, 5, 9, 6).noCull()
.n(name + "_handle").noCull()
.w(name + "_handle").uv(8, 5, 9, 9).noCull()
.e(name + "_handle").uv(7, 5, 8, 9).noCull()
.d("chest_handle").uv(7, 8, 9, 9).noCull()
.u("chest_handle").uv(7, 5, 9, 6).noCull()
.n("chest_handle").noCull()
.w("chest_handle").uv(8, 5, 9, 9).noCull()
.e("chest_handle").uv(7, 5, 8, 9).noCull()
.rotate(ModelRotation.getNorthRot(state.getValue(FACING))) :
provider.getModel(name + "_top")
.add(1, 0, 1, 15, 10, 15)
@ -284,12 +284,12 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
.w(name + "_side").uv(1, 2, 15, 7).rot(90).noCull()
.e(name + "_side").uv(1, 2, 15, 7).rot(270).noCull()
.add(7, 23, 13, 9, 24, 17)
.n(name + "_handle").uv(7, 8, 9, 9).noCull()
.s(name + "_handle").uv(7, 5, 9, 6).rot(180).noCull()
.u(name + "_handle").uv(7, 5, 9, 9).rot(180).noCull()
.d(name + "_handle").uv(9, 5, 7, 9).noCull()
.w(name + "_handle").uv(8, 5, 9, 9).rot(90).noCull()
.e(name + "_handle").uv(7, 5, 8, 9).rot(270).noCull()
.n("chest_handle").uv(7, 8, 9, 9).noCull()
.s("chest_handle").uv(7, 5, 9, 6).rot(180).noCull()
.u("chest_handle").uv(7, 5, 9, 9).rot(180).noCull()
.d("chest_handle").uv(9, 5, 7, 9).noCull()
.w("chest_handle").uv(8, 5, 9, 9).rot(90).noCull()
.e("chest_handle").uv(7, 5, 8, 9).rot(270).noCull()
.rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
}
}

View file

@ -142,12 +142,4 @@ public class BlockSign extends Block implements ITileEntityProvider, Rotatable
{
return true;
}
public String getFallbackTexture() {
return "oak_planks";
}
public int getRenderType() {
return 2;
}
}

View file

@ -6,6 +6,9 @@ import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.item.CheatTab;
import common.item.ItemStack;
import common.model.Model;
import common.model.ModelProvider;
import common.model.ModelRotation;
import common.properties.PropertyInteger;
import common.tileentity.TileEntity;
import common.tileentity.TileEntitySign;
@ -101,4 +104,11 @@ public class BlockStandingSign extends BlockSign implements Rotatable
{
return side != Facing.DOWN && worldIn.getState(pos).getBlock().getMaterial().isSolid();
}
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel("oak_planks")
.add(0, 8, 7, 16, 16, 9).all().noCull()
.add(7, 0, 7, 9, 8, 9).all().noCull()
.rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
}
}

View file

@ -2,6 +2,9 @@ package common.block.tile;
import common.block.Block;
import common.block.Rotatable;
import common.model.Model;
import common.model.ModelProvider;
import common.model.ModelRotation;
import common.util.BlockPos;
import common.util.Facing;
import common.world.IWorldAccess;
@ -13,8 +16,8 @@ public class BlockWallSign extends BlockSign implements Rotatable
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
{
Facing enumfacing = (Facing)worldIn.getState(pos).getValue(FACING);
float f = 0.28125F;
float f1 = 0.78125F;
float f = 0.25f;
float f1 = 0.75f;
float f2 = 0.0F;
float f3 = 1.0F;
float f4 = 0.125F;
@ -55,4 +58,10 @@ public class BlockWallSign extends BlockSign implements Rotatable
protected boolean hasRegisteredItem() {
return false;
}
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel("oak_planks")
.add(0, 4, 14, 16, 12, 16).all().noCull()
.rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
}
}

View file

@ -6,7 +6,7 @@ import common.packet.SPacketUpdateSign;
import common.tags.TagObject;
public class TileEntitySign extends TileEntity {
public final String[] signText = new String[] {"", "", "", ""};
public final String[] text = new String[] {"", "", "", ""};
private EntityNPC player;
@ -14,7 +14,7 @@ public class TileEntitySign extends TileEntity {
super.writeTags(compound);
for(int i = 0; i < 4; ++i) {
compound.setString("Text" + (i + 1), this.signText[i]);
compound.setString("Text" + (i + 1), this.text[i]);
}
}
@ -22,13 +22,13 @@ public class TileEntitySign extends TileEntity {
super.readTags(compound);
for(int i = 0; i < 4; ++i) {
this.signText[i] = compound.getString("Text" + (i + 1));
this.text[i] = compound.getString("Text" + (i + 1));
}
}
public Packet getDescriptionPacket() {
String[] aichatcomponent = new String[4];
System.arraycopy(this.signText, 0, aichatcomponent, 0, 4);
System.arraycopy(this.text, 0, aichatcomponent, 0, 4);
// Sign sign = Server.getServer().getSigns().getEntry(new WorldPos(this).toString());
return new SPacketUpdateSign(this.pos, aichatcomponent);
}