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:
@@ -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.
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -81,6 +81,7 @@ public interface NameTagConfig {
|
||||
*
|
||||
* @return true if the name tag is see-through, false otherwise
|
||||
*/
|
||||
@Deprecated
|
||||
boolean isSeeThrough();
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user