Skip to content

Commit

Permalink
1.21 compiles
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Jun 14, 2024
1 parent cdb54fd commit c24d4e0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c24d4e0

Please sign in to comment.