Skip to content

Commit 108ab73

Browse files
Merge branch 'main' into 1.21.8
2 parents d5270c6 + e835644 commit 108ab73

File tree

11 files changed

+75
-5
lines changed

11 files changed

+75
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
Please clear changelog after each release.
22
Put the changelog BELOW the dashes. ANYTHING ABOVE IS IGNORED.
33
-----------------
4+
- Fixed Observers using the incorrect render type, now being able to display their emissive layers properly.
5+
- Glowtone overlay textures that are completely transparent will no longer be loaded.
6+
- This means the texture will not be added to and indexed in Minecraft's texture atlas.
7+
- This also means that blocks which would've received an additional overlay model face for the texture will no longer add these additional faces.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ Avoid the use of abbreviations in javadocs, except if they describe the name of
5656
`@ModifyConstant` should never be used in a case where a `ModifyExpressionValue` could be used.
5757

5858
The `$` character can be used in mixins to mark a semantic separation in the name.
59-
It allows to separate the actual name of the variable and the namespace, `wilderWild`.
59+
It allows to separate the actual name of the variable and the namespace, `glowtone`.
6060

61-
Fields marked as `@Unique` must be prefixed with `wilderWild$` or `WILDERWILD$` if the field is static and final.
61+
Fields marked as `@Unique` must be prefixed with `glowtone$` or `GLOWTONE$` if the field is static and final.
6262

63-
Methods marked with `@Unique` must be prefixed with `wilderWild$`.
63+
Methods marked with `@Unique` must be prefixed with `glowtone$`.
6464

6565
Injector or modifier methods do not need to be prefixed. Fabric takes care of that.
6666

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
# Mod Properties
1818
mod_id = glowtone
19-
mod_version = 1.0
19+
mod_version = 1.0.2
2020
maven_group = net.frozenblock
2121
archives_base_name = Glowtone
2222

settings.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ pluginManagement {
1414
}
1515
}
1616

17-
rootProject.name = "FrozenLib"
17+
rootProject.name = "Glowtone"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright 2025 FrozenBlock
3+
* This file is part of Glowtone.
4+
*
5+
* This program is free software; you can modify it under
6+
* the terms of version 1 of the FrozenBlock Modding Oasis License
7+
* as published by FrozenBlock Modding Oasis.
8+
*
9+
* This program is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* FrozenBlock Modding Oasis License for more details.
13+
*
14+
* You should have received a copy of the FrozenBlock Modding Oasis License
15+
* along with this program; if not, see <https://github.com/FrozenBlock/Licenses>.
16+
*/
17+
18+
package net.frozenblock.glowtone.mixin.client;
19+
20+
import com.llamalad7.mixinextras.sugar.Local;
21+
import java.util.Arrays;
22+
import com.mojang.blaze3d.platform.NativeImage;
23+
import net.fabricmc.api.EnvType;
24+
import net.fabricmc.api.Environment;
25+
import net.frozenblock.glowtone.GlowtoneConstants;
26+
import net.minecraft.client.renderer.texture.SpriteContents;
27+
import net.minecraft.client.renderer.texture.atlas.SpriteResourceLoader;
28+
import net.minecraft.resources.ResourceLocation;
29+
import net.minecraft.util.ARGB;
30+
import org.spongepowered.asm.mixin.Mixin;
31+
import org.spongepowered.asm.mixin.injection.At;
32+
import org.spongepowered.asm.mixin.injection.Inject;
33+
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
34+
35+
@Environment(EnvType.CLIENT)
36+
@Mixin(SpriteResourceLoader.class)
37+
public interface SpriteResourceLoaderMixin {
38+
39+
@Inject(
40+
method = "method_52851",
41+
at = @At(
42+
value = "INVOKE",
43+
target = "Lnet/minecraft/server/packs/resources/ResourceMetadata;getSection(Lnet/minecraft/server/packs/metadata/MetadataSectionType;)Ljava/util/Optional;"
44+
),
45+
cancellable = true
46+
)
47+
private static void glowtone$discardEmptyOverlays(
48+
CallbackInfoReturnable<SpriteContents> info,
49+
@Local(argsOnly = true) ResourceLocation id,
50+
@Local NativeImage image
51+
) {
52+
if (!GlowtoneConstants.GLOWTONE_EMISSIVES) return;
53+
if (image == null) return;
54+
if (!id.getPath().endsWith("_glowtone_emissive")) return;
55+
56+
try {
57+
final int[] pixels = image.getPixels();
58+
if (Arrays.stream(pixels).allMatch(pixel -> ARGB.alpha(pixel) == 0)) info.setReturnValue(null);
59+
} catch (Exception ignored) {}
60+
}
61+
62+
}
-4 Bytes
Loading
-5 Bytes
Loading
-2 Bytes
Loading
-5 Bytes
Loading

src/main/resources/glowtone.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"client.ModelManagerMixin",
1515
"client.SimpleUnbakedGeometryMixin",
1616
"client.SpriteLoaderMixin",
17+
"client.SpriteResourceLoaderMixin",
1718
"client.block.BlocksMixin",
1819
"client.redstone_dust_particle.DustColorTransitionOptionsMixin",
1920
"client.redstone_dust_particle.DustColorTransitionParticleMixin",

0 commit comments

Comments
 (0)