mirror of
https://github.com/Xiao-MoMi/Custom-Nameplates.git
synced 2026-01-03 06:02:32 +00:00
fixed is see through
This commit is contained in:
@@ -66,7 +66,7 @@ public class NameTag extends AbstractTag implements RelationalFeature {
|
||||
0, 0, 0,
|
||||
component, config.backgroundColor(),
|
||||
(owner.isSpectator() && affectedBySpectator()) || (owner.isCrouching() && affectedByCrouching()) ? 64 : opacity(),
|
||||
config.hasShadow(), config.isSeeThrough(), config.useDefaultBackgroundColor(),
|
||||
config.hasShadow(), config.isSeeThrough().asBoolean() && (!affectedByCrouching() || !tracker.isCrouching()), config.useDefaultBackgroundColor(),
|
||||
config.alignment(), config.viewRange(), config.shadowRadius(), config.shadowStrength(),
|
||||
(affectedByScaling() ? scale(viewer).multiply(tracker.getScale()) : scale(viewer)),
|
||||
(affectedByScaling() ? translation(viewer).multiply(tracker.getScale()) : translation(viewer)),
|
||||
@@ -77,7 +77,9 @@ public class NameTag extends AbstractTag implements RelationalFeature {
|
||||
|
||||
@Override
|
||||
public void darkTag(CNPlayer viewer, boolean dark) {
|
||||
Consumer<List<Object>> modifiers = CustomNameplates.getInstance().getPlatform().createSneakModifier(dark, this.config);
|
||||
Tracker tracker = owner.getTracker(viewer);
|
||||
boolean seeThrough = config.isSeeThrough().asBoolean() && (!affectedByCrouching() || !tracker.isCrouching());
|
||||
Consumer<List<Object>> modifiers = CustomNameplates.getInstance().getPlatform().createSneakModifier(dark, seeThrough, this.config);
|
||||
Object packet = CustomNameplates.getInstance().getPlatform().updateTextDisplayPacket(entityID, List.of(modifiers));
|
||||
CustomNameplates.getInstance().getPacketSender().sendPacket(viewer, packet);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@ import net.momirealms.customnameplates.api.requirement.Requirement;
|
||||
import net.momirealms.customnameplates.api.util.Alignment;
|
||||
import net.momirealms.customnameplates.api.util.ConfigUtils;
|
||||
import net.momirealms.customnameplates.api.util.Vector3;
|
||||
import net.momirealms.customnameplates.common.util.Tristate;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -302,7 +303,7 @@ public class UnlimitedTagManagerImpl implements UnlimitedTagManager, PlayerListe
|
||||
.shadowStrength(section.getFloat("shadow-strength", 1f))
|
||||
.lineWidth(section.getInt("line-width", 200))
|
||||
.hasShadow(section.getBoolean("has-shadow", false))
|
||||
.seeThrough(section.getBoolean("is-see-through", false))
|
||||
.seeThrough(Tristate.fromBoolean((Boolean) section.get("is-see-through")))
|
||||
.opacity(section.getByte("opacity", (byte) -1))
|
||||
.useDefaultBackgroundColor(section.getBoolean("use-default-background-color", false))
|
||||
.backgroundColor(ConfigUtils.argb(section.getString("background-color", "64,0,0,0")))
|
||||
|
||||
@@ -22,6 +22,7 @@ unlimited:
|
||||
affected-by-spectator: true
|
||||
line-width: 1024
|
||||
background-color: 64,0,0,0
|
||||
is-see-through: false
|
||||
tag_image_part:
|
||||
text: '%np_tag-image%'
|
||||
translation: 0,0.2,0
|
||||
@@ -35,6 +36,7 @@ unlimited:
|
||||
affected-by-spectator: true
|
||||
line-width: 1024
|
||||
background-color: 0,0,0,0
|
||||
is-see-through: false
|
||||
tag_text_part:
|
||||
text: '%np_tag-text%'
|
||||
translation: 0.01,0.2,0.01
|
||||
@@ -47,4 +49,5 @@ unlimited:
|
||||
affected-by-scale-attribute: true
|
||||
affected-by-spectator: true
|
||||
line-width: 1024
|
||||
background-color: 0,0,0,0
|
||||
background-color: 0,0,0,0
|
||||
is-see-through: false
|
||||
Reference in New Issue
Block a user