mirror of
https://github.com/CompeyDev/elytra-lock-fabric.git
synced 2025-01-06 03:09:09 +00:00
feat: implement 1.21 compatibility, use new APIs
This commit is contained in:
parent
5d5d1b66d6
commit
1ffb313426
2 changed files with 5 additions and 3 deletions
|
@ -11,7 +11,7 @@ import dev.isxander.yacl3.config.v2.api.serializer.GsonConfigSerializerBuilder;
|
||||||
public class ConfigHandler {
|
public class ConfigHandler {
|
||||||
private boolean isLoaded = false;
|
private boolean isLoaded = false;
|
||||||
public static final ConfigClassHandler<ConfigModel> HANDLER = ConfigClassHandler.createBuilder(ConfigModel.class)
|
public static final ConfigClassHandler<ConfigModel> HANDLER = ConfigClassHandler.createBuilder(ConfigModel.class)
|
||||||
.id(new Identifier("elytralock", "config"))
|
.id(Identifier.of("elytralock", "config"))
|
||||||
.serializer(config -> GsonConfigSerializerBuilder.create(config)
|
.serializer(config -> GsonConfigSerializerBuilder.create(config)
|
||||||
.setPath(ElytraLock.LOADER.getConfigDir().resolve("elytra-lock.json"))
|
.setPath(ElytraLock.LOADER.getConfigDir().resolve("elytra-lock.json"))
|
||||||
.setJson5(true)
|
.setJson5(true)
|
||||||
|
|
|
@ -4,6 +4,7 @@ import xyz.devcomp.elytralock.ElytraLock;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
import net.minecraft.client.gui.DrawContext;
|
||||||
|
import net.minecraft.client.render.RenderTickCounter;
|
||||||
import net.minecraft.client.util.Window;
|
import net.minecraft.client.util.Window;
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
|
@ -11,9 +12,10 @@ public class HudRenderHandler implements HudRenderCallback {
|
||||||
public static final int WIDTH = 16;
|
public static final int WIDTH = 16;
|
||||||
public static final int HEIGHT = 16;
|
public static final int HEIGHT = 16;
|
||||||
|
|
||||||
public void onHudRender(DrawContext context, float delta) {
|
@Override
|
||||||
|
public void onHudRender(DrawContext context, RenderTickCounter tickCounter) {
|
||||||
// FIXME: Perhaps don't check whether the elytra is locked on every frame
|
// FIXME: Perhaps don't check whether the elytra is locked on every frame
|
||||||
Identifier icon = new Identifier("elytra-lock",
|
Identifier icon = Identifier.of("elytra-lock",
|
||||||
"textures/gui/" + (ElytraLock.isLocked() ? "locked" : "unlocked") + ".png");
|
"textures/gui/" + (ElytraLock.isLocked() ? "locked" : "unlocked") + ".png");
|
||||||
|
|
||||||
Window window = ElytraLock.client.getWindow();
|
Window window = ElytraLock.client.getWindow();
|
||||||
|
|
Loading…
Reference in a new issue