Support 1.21.11 (#359)

* Support 1.21.11

* Update supported versions
This commit is contained in:
ZekerZhayard authored and GitHub committed 2025-12-14 23:23:34 +08:00
1 parent 73c31593f2
commit 73beb4c29e
34 files changed
+513 -164

No files matched your search

@@ -3,6 +3,7 @@ package customskinloader.fake.itf;
import java.io.InputStream;
import java.util.Optional;
import customskinloader.fake.FakeMinecraftProfileTexture;
import net.minecraft.client.resources.IResource;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.util.ResourceLocation;
@@ -12,8 +13,11 @@ public class FakeInterfaceManager {
return ((IFakeIResource.V2) resource).open();
}
public static Optional<IResource> IResourceManager_getResource(Object resourceManager, ResourceLocation location) {
return ((IFakeIResourceManager) resourceManager).getResource(location);
public static Optional<IResource> IResourceManager_getResource(Object resourceManager, Object location) {
if (resourceManager instanceof IFakeIResourceManager.V2) {
return ((IFakeIResourceManager.V2) resourceManager).getResource((IFakeResourceLocation) location);
}
return ((IFakeIResourceManager.V1) resourceManager).getResource((ResourceLocation) location);
}
public static IResourceManager Minecraft_getResourceManager(Object minecraft) {
@@ -27,4 +31,12 @@ public class FakeInterfaceManager {
public static void NativeImage_setPixel(Object nativeImage, int x, int y, int color) {
((IFakeNativeImage) nativeImage).setPixel(x, y, color);
}
public static FakeMinecraftProfileTexture ResourceLocation_getTexture(Object location) {
return ((IFakeResourceLocation) location).getTexture();
}
public static void ResourceLocation_setTexture(Object location, FakeMinecraftProfileTexture texture) {
((IFakeResourceLocation) location).setTexture(texture);
}
}