9
0
mirror of https://github.com/Xiao-MoMi/Custom-Nameplates.git synced 2025-12-19 15:09:23 +00:00

improve rendering

This commit is contained in:
XiaoMoMi
2025-10-15 01:37:47 +08:00
parent d9ee1bbb21
commit e405d1c4f1
5 changed files with 18 additions and 17 deletions

View File

@@ -18,6 +18,7 @@
package net.momirealms.customnameplates.api;
import net.momirealms.customnameplates.api.feature.bossbar.BossBar;
import net.momirealms.customnameplates.api.feature.tag.NameTagConfig;
import net.momirealms.customnameplates.api.network.PacketEvent;
import net.momirealms.customnameplates.api.placeholder.Placeholder;
import net.momirealms.customnameplates.api.util.Alignment;
@@ -189,13 +190,7 @@ public interface Platform {
*/
Consumer<List<Object>> createTranslationModifier(Vector3 translation);
/**
* Creates a modifier to change the opacity of a text display.
*
* @param opacity the new opacity
* @return a consumer that applies the modifier to a list of packets
*/
Consumer<List<Object>> createOpacityModifier(byte opacity);
Consumer<List<Object>> createSneakModifier(boolean isSneaking, NameTagConfig config);
/**
* Updates an existing text display entity with modifiers.

View File

@@ -162,13 +162,6 @@ public abstract class AbstractTag implements Tag {
}
}
@Override
public void darkTag(CNPlayer viewer, boolean dark) {
Consumer<List<Object>> modifiers = CustomNameplates.getInstance().getPlatform().createOpacityModifier(dark ? 64 : opacity());
Object packet = CustomNameplates.getInstance().getPlatform().updateTextDisplayPacket(entityID, List.of(modifiers));
CustomNameplates.getInstance().getPacketSender().sendPacket(viewer, packet);
}
@Override
public void onPlayerScaleUpdate(double scale) {
for (CNPlayer viewer : viewerArray) {

View File

@@ -81,6 +81,7 @@ public interface NameTagConfig {
*
* @return true if the name tag is see-through, false otherwise
*/
@Deprecated
boolean isSeeThrough();
/**