improve shaders
@@ -487,41 +487,39 @@ public class ResourcePackManagerImpl implements ResourcePackManager {
|
||||
|
||||
public static final String Nameplates_Shader_1_20_5 =
|
||||
"if (Color.xyz == vec3(255., 254., 253.) / 255.) {\n" +
|
||||
" vertexColor = Color*texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertex.y += 1;\n" +
|
||||
" vertex.x += 1;\n" +
|
||||
" gl_Position = ProjMat * ModelViewMat * vertex;\n" +
|
||||
" } else if (Color.xyz == vec3(254., 254., 254.) / 255.) {\n" +
|
||||
" vertexColor = Color*texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertex.z *= 1.001;\n" +
|
||||
" vertex.x *= 1.001;\n" +
|
||||
" } else if (Color.xyz == vec3(240., 240., 240.) / 255.) {\n" +
|
||||
" vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertexColor.rgb = texelFetch(Sampler2, UV2 / 16, 0).rgb;\n" +
|
||||
" gl_Position = ProjMat * ModelViewMat * vertex;\n" +
|
||||
" } else if (Color.xyz == vec3(253., 254., 254.) / 255.) {\n" +
|
||||
" vertexColor = Color*texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertex.z *= 1.001001;\n" +
|
||||
" vertex.x *= 1.001001;\n" +
|
||||
" } else if (Color.xyz == vec3(60., 60., 60.) / 255.) {\n" +
|
||||
" vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" depthLevel = 114514.0;\n" +
|
||||
" gl_Position = ProjMat * ModelViewMat * vertex;\n" +
|
||||
" } else {\n" +
|
||||
" vertexColor = Color*texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" gl_Position = ProjMat * ModelViewMat * vertex;\n" +
|
||||
" }";
|
||||
|
||||
public static final String Nameplates_Shader_1_20_4 =
|
||||
"if (Color.xyz == vec3(255., 254., 253.) / 255.) {\n" +
|
||||
" vertexColor = Color*texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertex.y += 1;\n" +
|
||||
" vertex.x += 1;\n" +
|
||||
" gl_Position = ProjMat * ModelViewMat * vertex;\n" +
|
||||
" } else if (Color.xyz == vec3(254., 254., 254.) / 255.) {\n" +
|
||||
" vertexColor = Color*texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertex.z -= 0.001;\n" +
|
||||
" } else if (Color.xyz == vec3(240., 240., 240.) / 255.) {\n" +
|
||||
" vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertexColor.rgb = texelFetch(Sampler2, UV2 / 16, 0).rgb;\n" +
|
||||
" gl_Position = ProjMat * ModelViewMat * vertex;\n" +
|
||||
" } else if (Color.xyz == vec3(253., 254., 254.) / 255.) {\n" +
|
||||
" vertexColor = Color*texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertex.z -= 0.0011;\n" +
|
||||
" } else if (Color.xyz == vec3(60., 60., 60.) / 255.) {\n" +
|
||||
" vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" depthLevel = 114514.0;\n" +
|
||||
" gl_Position = ProjMat * ModelViewMat * vertex;\n" +
|
||||
" } else {\n" +
|
||||
" vertexColor = Color*texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" vertexColor = Color * texelFetch(Sampler2, UV2 / 16, 0);\n" +
|
||||
" gl_Position = ProjMat * ModelViewMat * vertex;\n" +
|
||||
" }";
|
||||
|
||||
|
||||
@@ -179,6 +179,22 @@ public class PlaceholderManagerImpl implements PlaceholderManager {
|
||||
});
|
||||
this.registerSharedPlaceholder("%shared_np_is-latest%", () -> String.valueOf(plugin.isUpToDate()));
|
||||
this.registerPlayerPlaceholder("%np_is-latest%", (player) -> String.valueOf(plugin.isUpToDate()));
|
||||
for (int i = 1; i <= 20; i++) {
|
||||
int speed = i;
|
||||
this.registerPlayerPlaceholder("%np_gradient_" + i + "%", (player) -> {
|
||||
int currentTicks = MainTask.getTicks();
|
||||
double progress = currentTicks * 0.01 * speed;
|
||||
return String.format("%.2f", -1 + (progress % 2.0001));
|
||||
});
|
||||
}
|
||||
for (int i = 1; i <= 20; i++) {
|
||||
int speed = i;
|
||||
this.registerPlayerPlaceholder("%np_gradient_" + i + "%", (player) -> {
|
||||
int currentTicks = MainTask.getTicks();
|
||||
double progress = currentTicks * 0.01 * speed;
|
||||
return String.format("%.2f", -1 + (progress % 2.0001));
|
||||
});
|
||||
}
|
||||
this.registerPlayerPlaceholder("%np_time%", (player) -> {
|
||||
long time = player.playerTime() % 24_000;
|
||||
String ap = time >= 6000 && time < 18000 ? " PM" : " AM";
|
||||
@@ -284,8 +300,7 @@ public class PlaceholderManagerImpl implements PlaceholderManager {
|
||||
Image full = requireNonNull(plugin.getImageManager().imageById(inner.getString("images.full")), "image.full should not be null");
|
||||
String currentValue = section.getString("placeholder.value", "1");
|
||||
String maxValue = section.getString("placeholder.max-value", currentValue);
|
||||
boolean removeShadow = section.getBoolean("remove-shadow", false);
|
||||
VanillaHud vanillaHud = new VanillaHud(empty, half, full, reverse, currentValue, maxValue, removeShadow);
|
||||
VanillaHud vanillaHud = new VanillaHud(empty, half, full, reverse, currentValue, maxValue);
|
||||
List<PreParsedDynamicText> list = List.of(vanillaHud.getCurrent(), vanillaHud.getMax());
|
||||
Placeholder placeholder1 = registerSharedPlaceholder("%shared_np_vanilla_" + id + "%", vanillaHud::create);
|
||||
Placeholder placeholder2 = registerPlayerPlaceholder("%np_vanilla_" + id + "%", vanillaHud::create);
|
||||
@@ -349,7 +364,7 @@ public class PlaceholderManagerImpl implements PlaceholderManager {
|
||||
Bubble bubble = plugin.getBubbleManager().bubbleById(bbID);
|
||||
if (bubble != null) {
|
||||
AdaptiveImageText<Bubble> adaptiveImageText = AdaptiveImageText.create(
|
||||
id, inner.getString("text"), bubble, inner.getBoolean("remove-shadow"),
|
||||
id, inner.getString("text"), bubble, inner.getBoolean("remove-shadow"), !inner.getBoolean("shadow", false),
|
||||
inner.getInt("left-margin", 1), inner.getInt("right-margin", 1)
|
||||
);
|
||||
List<PreParsedDynamicText> list = new ArrayList<>();
|
||||
@@ -387,7 +402,7 @@ public class PlaceholderManagerImpl implements PlaceholderManager {
|
||||
Nameplate nameplate = plugin.getNameplateManager().nameplateById(npID);
|
||||
if (nameplate != null) {
|
||||
AdaptiveImageText<Nameplate> adaptiveImageText = AdaptiveImageText.create(
|
||||
id, inner.getString("text"), nameplate, inner.getBoolean("remove-shadow"),
|
||||
id, inner.getString("text"), nameplate, inner.getBoolean("remove-shadow"), !inner.getBoolean("shadow", false),
|
||||
inner.getInt("left-margin", 1), inner.getInt("right-margin", 1)
|
||||
);
|
||||
List<PreParsedDynamicText> list = new ArrayList<>();
|
||||
@@ -425,8 +440,8 @@ public class PlaceholderManagerImpl implements PlaceholderManager {
|
||||
Background background = plugin.getBackgroundManager().backgroundById(bgID);
|
||||
if (background != null) {
|
||||
AdaptiveImageText<Background> adaptiveImageText = AdaptiveImageText.create(
|
||||
id, inner.getString("text"), background, inner.getBoolean("remove-shadow"),
|
||||
inner.getInt("left-margin", 2), inner.getInt("right-margin", 0)
|
||||
id, inner.getString("text"), background, inner.getBoolean("remove-shadow"), !inner.getBoolean("shadow", false),
|
||||
inner.getInt("left-margin", 1), inner.getInt("right-margin", 1)
|
||||
);
|
||||
List<PreParsedDynamicText> list = new ArrayList<>();
|
||||
list.add(adaptiveImageText.getPreParsedDynamicText());
|
||||
|
||||
@@ -52,8 +52,8 @@ public class StorageManagerImpl implements StorageManager, JoinQuitListener {
|
||||
this.redisManager.getPlayerData(uuid, async).thenAccept(playerData1 -> {
|
||||
if (playerData1.isPresent()) {
|
||||
PlayerData data = playerData1.get();
|
||||
handleDataLoad(player, data);
|
||||
((AbstractCNPlayer) player).setLoaded(true);
|
||||
handleDataLoad(player, data);
|
||||
plugin.getEventManager().dispatch(DataLoadEvent.class, data);
|
||||
this.redisManager.updatePlayerData(data, async).thenAccept(result -> {
|
||||
if (!result) {
|
||||
@@ -64,8 +64,8 @@ public class StorageManagerImpl implements StorageManager, JoinQuitListener {
|
||||
this.dataSource().getPlayerData(uuid, async).thenAccept(playerData2 -> {
|
||||
if (playerData2.isPresent()) {
|
||||
PlayerData data = playerData2.get();
|
||||
handleDataLoad(player, data);
|
||||
((AbstractCNPlayer) player).setLoaded(true);
|
||||
handleDataLoad(player, data);
|
||||
plugin.getEventManager().dispatch(DataLoadEvent.class, data);
|
||||
this.redisManager.updatePlayerData(data, async).thenAccept(result -> {
|
||||
if (!result) {
|
||||
@@ -82,8 +82,8 @@ public class StorageManagerImpl implements StorageManager, JoinQuitListener {
|
||||
this.dataSource().getPlayerData(uuid, async).thenAccept(playerData -> {
|
||||
if (playerData.isPresent()) {
|
||||
PlayerData data = playerData.get();
|
||||
handleDataLoad(player, data);
|
||||
((AbstractCNPlayer) player).setLoaded(true);
|
||||
handleDataLoad(player, data);
|
||||
} else {
|
||||
plugin.getPluginLogger().warn("Failed to load player data for " + player.name());
|
||||
}
|
||||
|
||||
@@ -20,8 +20,15 @@ void main() {
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
if (depthLevel == 114514.0) {
|
||||
discard;
|
||||
}
|
||||
if (texColor.a == 254.0/255.0) {
|
||||
if (depthLevel == 0.00) {
|
||||
if (depthLevel == 0.0
|
||||
|| depthLevel == 100
|
||||
|| depthLevel == 200
|
||||
|| depthLevel == 400
|
||||
) {
|
||||
discard;
|
||||
} else {
|
||||
color = vec4(texColor.rgb, 1.0) * vertexColor * ColorModulator;
|
||||
|
||||
@@ -20,8 +20,19 @@ void main() {
|
||||
if (color.a < 0.1) {
|
||||
discard;
|
||||
}
|
||||
if (depthLevel == 114514.0) {
|
||||
discard;
|
||||
}
|
||||
if (texColor.a == 254.0/255.0) {
|
||||
if (depthLevel == 1000.00) {
|
||||
if (depthLevel == 1000.0
|
||||
|| depthLevel == 2200
|
||||
|| depthLevel == 50
|
||||
|| depthLevel == 2650
|
||||
|| depthLevel == 200
|
||||
|| depthLevel == 400
|
||||
|| depthLevel == 2800
|
||||
|| depthLevel == 2400
|
||||
) {
|
||||
discard;
|
||||
} else {
|
||||
color = vec4(texColor.rgb, 1.0) * vertexColor * ColorModulator;
|
||||
|
||||
@@ -56,7 +56,7 @@ resource-pack:
|
||||
shader:
|
||||
# Enables shader generation
|
||||
enable: true
|
||||
# Hides scoreboard numbers
|
||||
# Hides scoreboard numbers (1.20.4- requires shader to remove that)
|
||||
hide-scoreboard-number: false
|
||||
# Enables support for animated text shaders
|
||||
animated-text: false
|
||||
|
||||
@@ -39,33 +39,47 @@ nameplate-text:
|
||||
halloween:
|
||||
nameplate: halloween
|
||||
text: '<gradient:#FFD700:#FFA500:#FFD700>Today is Halloween! Trick or treat!</gradient>'
|
||||
left-margin: 1
|
||||
right-margin: 1
|
||||
|
||||
# https://mo-mi.gitbook.io/xiaomomi-plugins/plugin-wiki/customnameplates/custom-placeholders/background-text
|
||||
background-text:
|
||||
location:
|
||||
background: bedrock_1
|
||||
text: '%np_image_compass% %np_shift_location%'
|
||||
remove-shadow: true
|
||||
shadow: false
|
||||
left-margin: 1
|
||||
right-margin: 1
|
||||
time:
|
||||
background: bedrock_1
|
||||
text: '%np_image_clock% %np_shift_time%'
|
||||
remove-shadow: true
|
||||
shadow: false
|
||||
left-margin: 1
|
||||
right-margin: 1
|
||||
weather:
|
||||
background: bedrock_1
|
||||
text: '%np_image_weather% %np_shift_weather%'
|
||||
remove-shadow: true
|
||||
shadow: false
|
||||
left-margin: 1
|
||||
right-margin: 1
|
||||
hello:
|
||||
background: bedrock_1
|
||||
text: '%np_image_bubble% %np_shift_hello%'
|
||||
remove-shadow: true
|
||||
shadow: false
|
||||
left-margin: 1
|
||||
right-margin: 1
|
||||
update:
|
||||
background: bedrock_1
|
||||
text: '%np_image_bell% %np_shift_update%'
|
||||
remove-shadow: true
|
||||
shadow: false
|
||||
left-margin: 1
|
||||
right-margin: 1
|
||||
other_actionbar:
|
||||
background: bedrock_2
|
||||
text: '%np_actionbar%'
|
||||
remove-shadow: true
|
||||
shadow: false
|
||||
left-margin: 1
|
||||
right-margin: 1
|
||||
|
||||
# https://mo-mi.gitbook.io/xiaomomi-plugins/plugin-wiki/customnameplates/custom-placeholders/static-text
|
||||
static-text:
|
||||
@@ -104,6 +118,34 @@ shift-text:
|
||||
|
||||
# https://mo-mi.gitbook.io/xiaomomi-plugins/plugin-wiki/customnameplates/custom-placeholders/switch-text
|
||||
switch-text:
|
||||
nameplate_color_prefix:
|
||||
switch: "%np_equipped_nameplate%"
|
||||
default: ""
|
||||
case:
|
||||
'wither': "<gradient:#FF0000:#000000:%np_gradient_3%>"
|
||||
'halloween': "<gradient:#FF0000:#000000:%np_gradient_3%>"
|
||||
'hutao': "<gradient:#FFFFFF:#FF4500:%np_gradient_3%>"
|
||||
'rabbit': "<gradient:#FFFFFF:#DB7093:%np_gradient_3%>"
|
||||
'starsky': "<gradient:#FFFFF0:#696969:%np_gradient_3%>"
|
||||
'trident': "<gradient:#E1FFFF:#008B8B:%np_gradient_10%>"
|
||||
'cheems': "<gradient:#C0C0C0:#F5F5F5:%np_gradient_5%>"
|
||||
'egg': "<gradient:#FFFFFF:#FFA500:%np_gradient_5%>"
|
||||
'cat': "<gradient:#FFFFFF:#1E90FF:%np_gradient_5%>"
|
||||
'xmas': "<gradient:#FFFFFF:#FF4500:%np_gradient_5%>"
|
||||
nameplate_color_suffix:
|
||||
switch: "%np_equipped_nameplate%"
|
||||
default: ""
|
||||
case:
|
||||
'wither': "</gradient>"
|
||||
'halloween': "</gradient>"
|
||||
'hutao': "</gradient>"
|
||||
'rabbit': "</gradient>"
|
||||
'starsky': "</gradient>"
|
||||
'trident': "</gradient>"
|
||||
'cheems': "</gradient>"
|
||||
'egg': "</gradient>"
|
||||
'cat': "</gradient>"
|
||||
'xmas': "</gradient>"
|
||||
world:
|
||||
switch: '%player_world%'
|
||||
case:
|
||||
|
||||
@@ -11,13 +11,13 @@ always-show: false
|
||||
nameplate:
|
||||
# Prefix to be displayed before the player's name.
|
||||
# The prefix here will become part of the nameplate
|
||||
prefix: ''
|
||||
prefix: '%np_switch_nameplate_color_prefix%'
|
||||
# Placeholder for the player's name
|
||||
# The default configuration uses shift to ensure that the player name not affected by the clientside `force-unicode-font` setting.
|
||||
player-name: '%np_shift_player_name%'
|
||||
# Suffix to be displayed after the player's name.
|
||||
# The suffix here will become part of the nameplate
|
||||
suffix: ''
|
||||
suffix: '%np_switch_nameplate_color_suffix%'
|
||||
|
||||
# Configuration for Unlimited tags.
|
||||
unlimited:
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 120 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 115 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 148 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 124 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 117 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 131 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 118 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 139 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 121 B |
@@ -1,16 +1,16 @@
|
||||
left:
|
||||
image: b0
|
||||
height: 14
|
||||
ascent: 7
|
||||
ascent: 6
|
||||
|
||||
right:
|
||||
image: b0
|
||||
height: 14
|
||||
ascent: 7
|
||||
ascent: 6
|
||||
|
||||
middle:
|
||||
height: 14
|
||||
ascent: 7
|
||||
ascent: 6
|
||||
1: b1
|
||||
2: b2
|
||||
4: b4
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
left:
|
||||
image: b0
|
||||
height: 14
|
||||
ascent: 12
|
||||
ascent: 11
|
||||
|
||||
right:
|
||||
image: b0
|
||||
height: 14
|
||||
ascent: 12
|
||||
ascent: 11
|
||||
|
||||
middle:
|
||||
height: 14
|
||||
ascent: 12
|
||||
ascent: 11
|
||||
1: b1
|
||||
2: b2
|
||||
4: b4
|
||||
|
||||