From 4f247671db946c6324114b38421188984633dd75 Mon Sep 17 00:00:00 2001 From: loyslow Date: Wed, 21 Jan 2026 19:37:42 +0200 Subject: [PATCH 1/4] Add sky_color,sky_light_color --- .../denizen/nms/abstracts/BiomeNMS.java | 8 +++ .../denizen/objects/BiomeTag.java | 62 +++++++++++++++++++ .../denizen/nms/v1_21/impl/BiomeNMSImpl.java | 20 ++++++ 3 files changed, 90 insertions(+) diff --git a/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/BiomeNMS.java b/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/BiomeNMS.java index f60e1129ad..a23607841c 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/BiomeNMS.java +++ b/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/BiomeNMS.java @@ -101,6 +101,14 @@ public void setWaterFogColor(int color) { throw new UnsupportedOperationException(); } + public int getSkyColor() { throw new UnsupportedOperationException(); } + + public void setSkyColor(int color) { throw new UnsupportedOperationException(); } + + public int getSkyLightColor() { throw new UnsupportedOperationException(); } + + public void setSkyLightColor(int color) { throw new UnsupportedOperationException(); } + public abstract void setTo(Block block); public ColorTag getColor(int x, int y) { diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java index d0f02e6750..1151f4b1cc 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java @@ -350,6 +350,34 @@ else if (attribute.startsWith("water", 2)) { return ColorTag.fromRGB(object.biome.getFogColor()); }); + // <--[tag] + // @attribute + // @returns ColorTag + // @mechanism BiomeTag.sky_color + // @description + // Returns the biome's sky color. + // @example + // # Sends the player a message in their current biome's sky color. + // - narrate "You are currently seeing sky that looks like <&color[]>this!" + // --> + tagProcessor.registerTag(ColorTag.class, "sky_color", (attribute, object) -> { + return ColorTag.fromRGB(object.biome.getSkyColor()); + }); + + // <--[tag] + // @attribute + // @returns ColorTag + // @mechanism BiomeTag.sky_light_color + // @description + // Returns the biome's skylight color. + // @example + // # Sends the player a message in their current biome's skylight color. + // - narrate "You are currently seeing skylight that looks like <&color[]>this!" + // --> + tagProcessor.registerTag(ColorTag.class, "sky_light_color", (attribute, object) -> { + return ColorTag.fromRGB(object.biome.getSkyLightColor()); + }); + // <--[tag] // @attribute // @returns ColorTag @@ -364,6 +392,40 @@ else if (attribute.startsWith("water", 2)) { return ColorTag.fromRGB(object.biome.getWaterFogColor()); }); + // <--[mechanism] + // @object BiomeTag + // @name sky_color + // @input ColorTag + // @description + // Sets the biome's sky color. + // @tags + // + // @example + // # Makes the plains biome's sky color red permanently, using a server start event to keep it applied. + // on server start: + // - adjust sky_color:red + // --> + tagProcessor.registerMechanism("sky_color", false, ColorTag.class, (object, mechanism, input) -> { + object.biome.setSkyColor(input.asRGB()); + }); + + // <--[mechanism] + // @object BiomeTag + // @name sky_light_color + // @input ColorTag + // @description + // Sets the biome's skylight color. + // @tags + // + // @example + // # Makes the plains biome's skylight color red permanently, using a server start event to keep it applied. + // on server start: + // - adjust sky_light_color:red + // --> + tagProcessor.registerMechanism("sky_light_color", false, ColorTag.class, (object, mechanism, input) -> { + object.biome.setSkyLightColor(input.asRGB()); + }); + // <--[mechanism] // @object BiomeTag // @name fog_color diff --git a/v1_21/src/main/java/com/denizenscript/denizen/nms/v1_21/impl/BiomeNMSImpl.java b/v1_21/src/main/java/com/denizenscript/denizen/nms/v1_21/impl/BiomeNMSImpl.java index d360c4318a..3eb8f2bd44 100644 --- a/v1_21/src/main/java/com/denizenscript/denizen/nms/v1_21/impl/BiomeNMSImpl.java +++ b/v1_21/src/main/java/com/denizenscript/denizen/nms/v1_21/impl/BiomeNMSImpl.java @@ -179,6 +179,26 @@ public void setWaterFogColor(int color) { setEnvironmentAttribute(EnvironmentAttributes.WATER_FOG_COLOR, color); } + @Override + public int getSkyColor() { + return getEnvironmentAttribute(EnvironmentAttributes.SKY_COLOR); + } + + @Override + public void setSkyColor(int color) { + setEnvironmentAttribute(EnvironmentAttributes.SKY_COLOR, color); + } + + @Override + public int getSkyLightColor() { + return getEnvironmentAttribute(EnvironmentAttributes.SKY_LIGHT_COLOR); + } + + @Override + public void setSkyLightColor(int color) { + setEnvironmentAttribute(EnvironmentAttributes.SKY_LIGHT_COLOR, color); + } + public T getEnvironmentAttribute(EnvironmentAttribute attribute) { return biomeHolder.value().getAttributes().applyModifier(attribute, attribute.defaultValue()); } From b2246e968c20974158a43eaf899632df6dc616b4 Mon Sep 17 00:00:00 2001 From: loyslow Date: Wed, 21 Jan 2026 20:30:42 +0200 Subject: [PATCH 2/4] Move sky registration to v1_21 check --- .../denizen/objects/BiomeTag.java | 127 +++++++++--------- 1 file changed, 65 insertions(+), 62 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java index 1151f4b1cc..0ac7361954 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java @@ -350,34 +350,6 @@ else if (attribute.startsWith("water", 2)) { return ColorTag.fromRGB(object.biome.getFogColor()); }); - // <--[tag] - // @attribute - // @returns ColorTag - // @mechanism BiomeTag.sky_color - // @description - // Returns the biome's sky color. - // @example - // # Sends the player a message in their current biome's sky color. - // - narrate "You are currently seeing sky that looks like <&color[]>this!" - // --> - tagProcessor.registerTag(ColorTag.class, "sky_color", (attribute, object) -> { - return ColorTag.fromRGB(object.biome.getSkyColor()); - }); - - // <--[tag] - // @attribute - // @returns ColorTag - // @mechanism BiomeTag.sky_light_color - // @description - // Returns the biome's skylight color. - // @example - // # Sends the player a message in their current biome's skylight color. - // - narrate "You are currently seeing skylight that looks like <&color[]>this!" - // --> - tagProcessor.registerTag(ColorTag.class, "sky_light_color", (attribute, object) -> { - return ColorTag.fromRGB(object.biome.getSkyLightColor()); - }); - // <--[tag] // @attribute // @returns ColorTag @@ -392,40 +364,6 @@ else if (attribute.startsWith("water", 2)) { return ColorTag.fromRGB(object.biome.getWaterFogColor()); }); - // <--[mechanism] - // @object BiomeTag - // @name sky_color - // @input ColorTag - // @description - // Sets the biome's sky color. - // @tags - // - // @example - // # Makes the plains biome's sky color red permanently, using a server start event to keep it applied. - // on server start: - // - adjust sky_color:red - // --> - tagProcessor.registerMechanism("sky_color", false, ColorTag.class, (object, mechanism, input) -> { - object.biome.setSkyColor(input.asRGB()); - }); - - // <--[mechanism] - // @object BiomeTag - // @name sky_light_color - // @input ColorTag - // @description - // Sets the biome's skylight color. - // @tags - // - // @example - // # Makes the plains biome's skylight color red permanently, using a server start event to keep it applied. - // on server start: - // - adjust sky_light_color:red - // --> - tagProcessor.registerMechanism("sky_light_color", false, ColorTag.class, (object, mechanism, input) -> { - object.biome.setSkyLightColor(input.asRGB()); - }); - // <--[mechanism] // @object BiomeTag // @name fog_color @@ -568,6 +506,71 @@ else if (attribute.startsWith("water", 2)) { object.biome.setPrecipitation(input.asEnum(BiomeNMS.DownfallType.class)); } }); + + if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21)) { + + // <--[mechanism] + // @object BiomeTag + // @name sky_color + // @input ColorTag + // @description + // Sets the biome's sky color. + // @tags + // + // @example + // # Makes the plains biome's sky color red permanently, using a server start event to keep it applied. + // on server start: + // - adjust sky_color:red + // --> + tagProcessor.registerMechanism("sky_color", false, ColorTag.class, (object, mechanism, input) -> { + object.biome.setSkyColor(input.asRGB()); + }); + + // <--[mechanism] + // @object BiomeTag + // @name sky_light_color + // @input ColorTag + // @description + // Sets the biome's skylight color. + // @tags + // + // @example + // # Makes the plains biome's skylight color red permanently, using a server start event to keep it applied. + // on server start: + // - adjust sky_light_color:red + // --> + tagProcessor.registerMechanism("sky_light_color", false, ColorTag.class, (object, mechanism, input) -> { + object.biome.setSkyLightColor(input.asRGB()); + }); + + // <--[tag] + // @attribute + // @returns ColorTag + // @mechanism BiomeTag.sky_color + // @description + // Returns the biome's sky color. + // @example + // # Sends the player a message in their current biome's sky color. + // - narrate "You are currently seeing sky that looks like <&color[]>this!" + // --> + tagProcessor.registerTag(ColorTag.class, "sky_color", (attribute, object) -> { + return ColorTag.fromRGB(object.biome.getSkyColor()); + }); + + // <--[tag] + // @attribute + // @returns ColorTag + // @mechanism BiomeTag.sky_light_color + // @description + // Returns the biome's skylight color. + // @example + // # Sends the player a message in their current biome's skylight color. + // - narrate "You are currently seeing skylight that looks like <&color[]>this!" + // --> + tagProcessor.registerTag(ColorTag.class, "sky_light_color", (attribute, object) -> { + return ColorTag.fromRGB(object.biome.getSkyLightColor()); + }); + } } public static final ObjectTagProcessor tagProcessor = new ObjectTagProcessor<>(); From 666bb779551ae369f99d3de5524041e07bb65e9c Mon Sep 17 00:00:00 2001 From: loyslow Date: Wed, 21 Jan 2026 21:40:01 +0200 Subject: [PATCH 3/4] Un-inline BiomeNMS methods --- .../denizen/nms/abstracts/BiomeNMS.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/BiomeNMS.java b/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/BiomeNMS.java index a23607841c..bc012894ef 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/BiomeNMS.java +++ b/plugin/src/main/java/com/denizenscript/denizen/nms/abstracts/BiomeNMS.java @@ -101,13 +101,21 @@ public void setWaterFogColor(int color) { throw new UnsupportedOperationException(); } - public int getSkyColor() { throw new UnsupportedOperationException(); } + public int getSkyColor() { + throw new UnsupportedOperationException(); + } - public void setSkyColor(int color) { throw new UnsupportedOperationException(); } + public void setSkyColor(int color) { + throw new UnsupportedOperationException(); + } - public int getSkyLightColor() { throw new UnsupportedOperationException(); } + public int getSkyLightColor() { + throw new UnsupportedOperationException(); + } - public void setSkyLightColor(int color) { throw new UnsupportedOperationException(); } + public void setSkyLightColor(int color) { + throw new UnsupportedOperationException(); + } public abstract void setTo(Block block); From 82cd2f400d08253d10d6a952eb16348f5f5e4c5b Mon Sep 17 00:00:00 2001 From: loyslow Date: Fri, 23 Jan 2026 05:31:16 +0200 Subject: [PATCH 4/4] Align registration order --- .../denizen/objects/BiomeTag.java | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java b/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java index 0ac7361954..f849e67d87 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java +++ b/plugin/src/main/java/com/denizenscript/denizen/objects/BiomeTag.java @@ -509,6 +509,34 @@ else if (attribute.startsWith("water", 2)) { if (NMSHandler.getVersion().isAtLeast(NMSVersion.v1_21)) { + // <--[tag] + // @attribute + // @returns ColorTag + // @mechanism BiomeTag.sky_color + // @description + // Returns the biome's sky color. + // @example + // # Sends the player a message in their current biome's sky color. + // - narrate "You are currently seeing sky that looks like <&color[]>this!" + // --> + tagProcessor.registerTag(ColorTag.class, "sky_color", (attribute, object) -> { + return ColorTag.fromRGB(object.biome.getSkyColor()); + }); + + // <--[tag] + // @attribute + // @returns ColorTag + // @mechanism BiomeTag.sky_light_color + // @description + // Returns the biome's skylight color. + // @example + // # Sends the player a message in their current biome's skylight color. + // - narrate "You are currently seeing skylight that looks like <&color[]>this!" + // --> + tagProcessor.registerTag(ColorTag.class, "sky_light_color", (attribute, object) -> { + return ColorTag.fromRGB(object.biome.getSkyLightColor()); + }); + // <--[mechanism] // @object BiomeTag // @name sky_color @@ -542,34 +570,6 @@ else if (attribute.startsWith("water", 2)) { tagProcessor.registerMechanism("sky_light_color", false, ColorTag.class, (object, mechanism, input) -> { object.biome.setSkyLightColor(input.asRGB()); }); - - // <--[tag] - // @attribute - // @returns ColorTag - // @mechanism BiomeTag.sky_color - // @description - // Returns the biome's sky color. - // @example - // # Sends the player a message in their current biome's sky color. - // - narrate "You are currently seeing sky that looks like <&color[]>this!" - // --> - tagProcessor.registerTag(ColorTag.class, "sky_color", (attribute, object) -> { - return ColorTag.fromRGB(object.biome.getSkyColor()); - }); - - // <--[tag] - // @attribute - // @returns ColorTag - // @mechanism BiomeTag.sky_light_color - // @description - // Returns the biome's skylight color. - // @example - // # Sends the player a message in their current biome's skylight color. - // - narrate "You are currently seeing skylight that looks like <&color[]>this!" - // --> - tagProcessor.registerTag(ColorTag.class, "sky_light_color", (attribute, object) -> { - return ColorTag.fromRGB(object.biome.getSkyLightColor()); - }); } }