fix overlay

This commit is contained in:
Sen 2025-08-01 20:54:39 +02:00
parent b5e5cb0444
commit 330ee75a27
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
10 changed files with 38 additions and 11 deletions

View file

@ -1175,16 +1175,15 @@ public class Client implements IThreadListener {
Block block = state.getBlock();
if(block != Blocks.air) {
desc = block.getDisplay();
if(block.getMiningTool() != null)
line2 = Color.BLUE + "Werkzeug" + Color.DARK_GRAY + ": " + Color.GREEN + block.getMiningTool().getDisplay() + (block.getMiningTool().isLevelled() ? Color.ORK + " Level " + Color.DARK_GREEN + (block.getMiningLevel() + 1) : "");
line1 = block.getInfo(this.world, this.pointed.block, state, this.player);
boolean harvestable = this.player.canHarvestBlock(block);
line2 = Color.BLUE + "Werkzeug" + Color.DARK_GRAY + ": " + (block.getMiningTool() != null ? (block.getMaterial().isToolRequired() ? (harvestable ? Color.GREEN : Color.RED) : Color.LIGHT_GRAY) + block.getMiningTool().getDisplay() + (block.getMiningTool().isLevelled() ? (harvestable ? Color.ORK : Color.CRIMSON) + " Level " + (harvestable ? Color.DARK_GREEN : Color.DARK_RED) + (block.getMiningLevel() + 1) : "") : Color.GRAY + "Keins");
}
}
else if(this.pointed != null && this.pointed.type == ObjectType.ENTITY && this.pointed.entity != null) {
Entity entity = this.pointed.entity;
desc = entity.getName();
if(entity instanceof EntityLiving living) {
line1 = living.formatStatsFull();
}
line1 = entity.getInfo(this.player);
line2 = Color.CYAN + EntityRegistry.getEntityName(EntityRegistry.getEntityString(entity));
}
if(desc != null) {

View file

@ -144,7 +144,7 @@ public abstract class RenderRegistry {
map.put(EntityBullet.class, new RenderBullet(mgr));
map.put(EntityMissile.class, new RenderMissile(mgr));
map.put(EntityLightning.class, new RenderLightning(mgr));
models.put(ModelType.HUMANOID, new RenderHumanoid(mgr, 12, 12, "textures/npc/char.png"));
models.put(ModelType.HUMANOID, new RenderHumanoid(mgr, 12, 12, "textures/npc/knight_1.png"));
models.put(ModelType.ARACHNOID, new RenderArachnoid(mgr));
models.put(ModelType.SLIME, new RenderSlime(mgr));
models.put(ModelType.DWARF, new RenderHumanoid(mgr, 10, 10, "textures/npc/dwarf.png"));

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Before After
Before After

View file

@ -1098,4 +1098,9 @@ public class Block {
@Clientside
public void getTooltips(ItemStack stack, EntityNPC player, List<String> tooltip) {
}
@Clientside
public String getInfo(World world, BlockPos pos, State state, EntityNPC player) {
return null;
}
}

View file

@ -1,5 +1,6 @@
package common.block.tech;
import java.util.List;
import java.util.Map;
import common.block.Block;
@ -28,6 +29,7 @@ import common.tileentity.TileEntity;
import common.tileentity.TileEntityChest;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.Clientside;
import common.util.Facing;
import common.util.Color;
import common.vars.Vars;
@ -250,6 +252,16 @@ public class BlockChest extends Block implements ITileEntityProvider, Rotatable
return true;
}
@Clientside
public void getTooltips(ItemStack stack, EntityNPC player, List<String> tooltip) {
tooltip.add(Color.DARK_GREEN + "Kapazität" + Color.DARK_GRAY + ": " + Color.GREEN + (this.width * this.height));
}
@Clientside
public String getInfo(World world, BlockPos pos, State state, EntityNPC player) {
return Color.DARK_GREEN + "Kapazität für " + Color.GREEN + (this.width * this.height) + Color.DARK_GREEN + " Gegenstände";
}
public Model getModel(ModelProvider provider, String name, State state) {
return !state.getValue(OPEN) ?
provider.getModel(name + "_top")

View file

@ -2572,4 +2572,8 @@ public abstract class Entity
public InventoryBasic getEntityInventory() {
return null;
}
public String getInfo(EntityNPC player) {
return null;
}
}

View file

@ -1167,8 +1167,8 @@ public abstract class EntityNPC extends EntityLiving implements IInventory
return super.formatStats() + (this.getManaPoints() == 0 ? "" : Color.GRAY + " [" + Color.MIDNIGHT + this.getManaPoints() + Color.GRAY + "]");
}
public String formatStatsFull() {
return super.formatStatsFull() + (this.getManaPoints() == 0 ? "" : Color.DARK_GRAY + " | " + Color.BLUE + this.getManaPoints() + Color.MIDNIGHT + " Mana");
public String getInfo(EntityNPC player) {
return super.getInfo(player) + (this.getManaPoints() == 0 ? "" : Color.DARK_GRAY + " | " + Color.BLUE + this.getManaPoints() + Color.MIDNIGHT + " Mana");
}
public MerchantRecipeList getTrades(EntityNPC player) {

View file

@ -2235,7 +2235,7 @@ public abstract class EntityLiving extends Entity
this.getHealth(), this.getMaxHealth());
}
public String formatStatsFull() {
public String getInfo(EntityNPC player) {
return String.format(this.getAlignment().color + this.getAlignment().display + Color.DARK_GRAY + " | " + getHealthColor(this.getHealth(), this.getMaxHealth()) + "%d" +
Color.GRAY + " / " + getMaxHpColor(this.getMaxHealth()) + "%d" + Color.RED + " HP",
this.getHealth(), this.getMaxHealth());

View file

@ -258,7 +258,14 @@ public abstract class CraftingRegistry
addShapeless(new ItemStack(Items.fireball, 3), Items.gunpowder, Items.blazing_powder, Items.coal);
addShapeless(new ItemStack(Items.fireball, 3), Items.gunpowder, Items.blazing_powder, Items.charcoal);
add(new ItemStack(Items.hopper), "I I", "ICI", " I ", 'I', Items.iron_ingot, 'C', Items.wood_chest);
add(new ItemStack(Items.stone_chest), "III", "ICI", "III", 'I', Items.cobblestone, 'C', Items.wood_chest);
add(new ItemStack(Items.iron_chest), "III", "ICI", "III", 'I', Items.iron_ingot, 'C', Items.stone_chest);
add(new ItemStack(Items.platinum_chest), "III", "ICI", "III", 'I', Items.platinum_ingot, 'C', Items.iron_chest);
add(new ItemStack(Items.silver_chest), "III", "ICI", "III", 'I', Items.silver_ingot, 'C', Items.platinum_chest);
add(new ItemStack(Items.thetium_chest), "III", "ICI", "III", 'I', Items.thi_fragment, 'C', Items.silver_chest);
add(new ItemStack(Items.black_metal_chest), "III", "ICI", "III", 'I', Items.black_metal_ingot, 'C', Items.thetium_chest);
add(new ItemStack(Items.nichun_chest), "III", "ICI", "III", 'I', Items.nieh_fragment, 'C', Items.thetium_chest);
add(new ItemStack(Items.dynamite, 1), "X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Items.clay_lump);
add(new ItemStack(Items.dynamite_1), "X#X", "#X#", "X#X", 'X', Items.gunpowder, '#', Items.dynamite);

View file

@ -86,7 +86,7 @@ public abstract class SpeciesRegistry {
}
static void register() {
registerSpecies("Cpu", EntityCpu.class, null, "Test-NSC", 0x202020, 0x8000ff, "Test:char", "Troll:trollface", "Hacker");
registerSpecies("Cpu", EntityCpu.class, null, "Test-NSC", 0x202020, 0x8000ff, "Troll:trollface", "Hacker");
registerSpecies("Cultivator", EntityCultivator.class, "nienrath", "Kultivator", 0x000000, 0xff0000, "Wei Wuxian", 0x000000, 0xff0000,
"Lan Wangji", 0xffffff, 0x80e0ff, "Jiang Cheng", 0x200000, 0xaf00ff, "Shen Qingqiu", 0xffffff, 0x80ff80,
"Luo Binghe", 0x600000, 0x000000);