diff --git a/src/main/java/io/github/gaming32/worldhost/ResourceLocations.java b/src/main/java/io/github/gaming32/worldhost/ResourceLocations.java index 79b41a5..874d40e 100644 --- a/src/main/java/io/github/gaming32/worldhost/ResourceLocations.java +++ b/src/main/java/io/github/gaming32/worldhost/ResourceLocations.java @@ -3,14 +3,28 @@ import net.minecraft.resources.ResourceLocation; public final class ResourceLocations { + private static final ResourceLocation WORLD_HOST_TEMPLATE = namespaced("world-host", ""); + private ResourceLocations() { } public static ResourceLocation minecraft(String path) { + //#if MC >= 1.21 + //$$ return ResourceLocation.withDefaultNamespace(path); + //#else return new ResourceLocation(ResourceLocation.DEFAULT_NAMESPACE, path); + //#endif } public static ResourceLocation worldHost(String path) { - return new ResourceLocation("world-host", path); + return WORLD_HOST_TEMPLATE.withPath(path); + } + + public static ResourceLocation namespaced(String namespace, String path) { + //#if MC >= 1.21 + //$$ return ResourceLocation.fromNamespaceAndPath(namespace, path); + //#else + return new ResourceLocation(namespace, path); + //#endif } } diff --git a/src/main/java/io/github/gaming32/worldhost/mixin/MixinGameRenderer.java b/src/main/java/io/github/gaming32/worldhost/mixin/MixinGameRenderer.java index 8bd9ceb..2dca594 100644 --- a/src/main/java/io/github/gaming32/worldhost/mixin/MixinGameRenderer.java +++ b/src/main/java/io/github/gaming32/worldhost/mixin/MixinGameRenderer.java @@ -53,7 +53,12 @@ private void toastRender(CallbackInfo ci) { //#else new GuiGraphics(minecraft, renderBuffers.bufferSource()), //#endif - mouseX, mouseY, minecraft.getFrameTime() + mouseX, mouseY, + //#if MC >= 1.21 + //$$ minecraft.getTimer().getRealtimeDeltaTicks() + //#else + minecraft.getFrameTime() + //#endif ); } //#endif