CCBlueX / LiquidBounce

A free mixin-based injection hacked client for Minecraft using the Fabric API
https://liquidbounce.net/
GNU General Public License v3.0
1.44k stars 463 forks source link

feat: damage particles & nametags for TNT fuse #3303

Closed MukjepScarlet closed 1 month ago

MukjepScarlet commented 3 months ago

ALERT: There was a fixed difference between TNTs' fuse time between Hypixel Bedwars and vanilla. Need to be checked.

TNTESP is also needed. (with red boxes or other styles)

1zun4 commented 3 months ago

What do you mean with temporary solution?

MukjepScarlet commented 3 months ago

What do you mean with temporary solution?

I think this implementation is too ugly, and needs improvement.

Here's a script for this feature with 1.8.9 years ago, for information.

script = registerScript({
    name: "TNTTime",
    authors: ["MukjepScarlet"],
    version: "1.0"
});

script.import("Core.lib");
script.import("utils/RenderUtils.js");

module = {
    name: "TNTTime",
    description: "Show the remain time of TNT primed.",
    category: "Render",
    onRender3D: function () {
        var sb = mc.theWorld.getScoreboard();
        var so = sb && sb.getObjectiveInDisplaySlot(1);
        var displayName = so && so.getDisplayName();

        var playingBedwars = sb && so && displayName && (displayName.match("BED WARS") || displayName.match("起床战争")); // hyp bw

        for each (var entity in mc.theWorld.loadedEntityList) {
            if (!(entity instanceof EntityTNTPrimed))
                continue;

            var tick = playingBedwars ? entity.fuse - 28 : entity.fuse;
            if (tick < 1) continue;

            var renderTag = (tick / 20).toFixed(2) + 's';

            var hue = Math.min(tick / (playingBedwars ? 52 : 80), 1) / 3;
            var color = java.awt.Color.getHSBColor(hue, 1, 1);
            var font = mc.fontRendererObj;
            var width = font.getStringWidth(renderTag);

            drawFaceToPlayer([entity.posX, entity.posY + 1.25, entity.posZ], function()  {
                Gui.drawRect(-width * 0.5 - 2, -font.FONT_HEIGHT - 1, width * 0.5 + 2, 0, 0x7F000000);
                font.drawString(renderTag, -width / 2, -font.FONT_HEIGHT, color.getRGB());
            });
        }
    }
};
MukjepScarlet commented 3 months ago

Added one more module. (ModuleManager is not included)

1zun4 commented 2 months ago

Sounds interesting. I will try it out and merge when I am back at home in few days.

1zun4 commented 2 months ago

The TNT fuse nametag works well, but the Damage Particles not really.

1zun4 commented 1 month ago

No response.