Skip to content

Commit

Permalink
feat: 24w46a
Browse files Browse the repository at this point in the history
  • Loading branch information
uku3lig committed Nov 14, 2024
1 parent 7a6cfb7 commit 0b1e817
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 19 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.21.2
yarn_mappings=1.21.2+build.1
loader_version=0.16.7
minecraft_version=24w46a
yarn_mappings=24w46a+build.5
loader_version=0.16.9

# Mod Properties
mod_version=1.5.0
Expand All @@ -14,5 +14,5 @@ archives_base_name=ukulib

# Dependencies
toml4j_version=0.7.2
fabric_version=0.106.1+1.21.2
fabric_version=0.108.1+1.21.4
modmenu_version=12.0.0-beta.1
17 changes: 3 additions & 14 deletions src/main/java/net/uku3lig/ukulib/utils/Ukutils.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.option.KeyBinding;
import net.minecraft.client.texture.ResourceTexture;
import net.minecraft.client.texture.TextureManager;
import net.minecraft.client.toast.SystemToast;
import net.minecraft.client.toast.ToastManager;
import net.minecraft.resource.ResourceManager;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.OrderedText;
import net.minecraft.text.Text;
Expand All @@ -22,7 +22,6 @@
import org.joml.Vector2i;
import org.joml.Vector2ic;

import java.io.IOException;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.Locale;
Expand Down Expand Up @@ -149,19 +148,9 @@ public static void sendToast(Text title, @Nullable Text body) {
*/
public static boolean textureExists(Identifier texture) {
TextureManager textureManager = MinecraftClient.getInstance().getTextureManager();
ResourceManager resourceManager = MinecraftClient.getInstance().getResourceManager();

if (texture == null) {
return false;
} else if (textureManager.getOrDefault(texture, null) != null) {
return true;
} else {
try (ResourceTexture resourceTexture = new ResourceTexture(texture)) {
resourceTexture.load(MinecraftClient.getInstance().getResourceManager());
return true;
} catch (IOException e) {
return false;
}
}
return texture != null && (textureManager.textures.containsKey(texture) || resourceManager.getResource(texture).isPresent());
}

/**
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/ukulib.accesswidener
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
accessWidener v2 named

accessible field net/minecraft/client/gui/widget/TabNavigationWidget tabs Lcom/google/common/collect/ImmutableList;
accessible field net/minecraft/client/gui/widget/TabNavigationWidget tabs Lcom/google/common/collect/ImmutableList;
accessible field net/minecraft/client/texture/TextureManager textures Ljava/util/Map;

0 comments on commit 0b1e817

Please sign in to comment.