diff --git a/gradle.properties b/gradle.properties index e1994f2..72f504a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ org.gradle.daemon=false # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.20 -yarn_mappings=1.20+build.1 -loader_version=0.14.21 +minecraft_version=1.20.2 +yarn_mappings=1.20.2+build.4 +loader_version=0.14.23 # Mod Properties mod_version = 2.3.1 @@ -17,4 +17,4 @@ artifactId = xray # Dependencies # currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api -fabric_version=0.83.0+1.20 \ No newline at end of file +fabric_version=0.90.0+1.20.2 \ No newline at end of file diff --git a/src/main/java/fr/atesab/xray/XrayMain.java b/src/main/java/fr/atesab/xray/XrayMain.java index 37dea8f..5cdad22 100644 --- a/src/main/java/fr/atesab/xray/XrayMain.java +++ b/src/main/java/fr/atesab/xray/XrayMain.java @@ -279,7 +279,7 @@ public void onHudRender(DrawContext context, float tickDelta) { TextRenderer render = mc.textRenderer; ClientPlayerEntity player = mc.player; - if (!config.getLocationConfig().isEnabled() || player == null || mc.options.debugEnabled) { + if (!config.getLocationConfig().isEnabled() || player == null || mc.getDebugHud().shouldShowDebugHud()) { return; } diff --git a/src/main/java/fr/atesab/xray/mixins/MixinBlockOcclusionCache.java b/src/main/java/fr/atesab/xray/mixins/MixinBlockOcclusionCache.java index 3bfe4f6..3f9a104 100644 --- a/src/main/java/fr/atesab/xray/mixins/MixinBlockOcclusionCache.java +++ b/src/main/java/fr/atesab/xray/mixins/MixinBlockOcclusionCache.java @@ -12,7 +12,7 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Pseudo -@Mixin(targets = "me.jellysquid.mods.sodium.client.render.occlusion.BlockOcclusionCache") +@Mixin(targets = "me.jellysquid.mods.sodium.client.render.chunk.compile.pipeline.BlockOcclusionCache") public class MixinBlockOcclusionCache { @Inject(at = @At("HEAD"), method = "shouldDrawSide", cancellable = true, remap = false) private void shouldDrawSide(BlockState state, BlockView reader, BlockPos pos, Direction face, diff --git a/src/main/java/fr/atesab/xray/screen/BlockSelector.java b/src/main/java/fr/atesab/xray/screen/BlockSelector.java index ba97dac..772a819 100644 --- a/src/main/java/fr/atesab/xray/screen/BlockSelector.java +++ b/src/main/java/fr/atesab/xray/screen/BlockSelector.java @@ -126,7 +126,7 @@ public List getView() { @Override public void render(DrawContext context, int mouseX, int mouseY, float partialTick) { - renderBackground(context); + renderInGameBackground(context); searchBar.render(context, mouseX, mouseY, partialTick); int left = width / 2 - elementsX * 18 / 2; int top = height / 2 - elementsY * 18 / 2; diff --git a/src/main/java/fr/atesab/xray/screen/ColorSelector.java b/src/main/java/fr/atesab/xray/screen/ColorSelector.java index 1c21ed4..58c831b 100644 --- a/src/main/java/fr/atesab/xray/screen/ColorSelector.java +++ b/src/main/java/fr/atesab/xray/screen/ColorSelector.java @@ -165,14 +165,6 @@ public ColorSelector(Screen parent, Consumer setter, OptionalInt co @Override public void tick() { - tfr.tick(); - tfg.tick(); - tfb.tick(); - tfh.tick(); - tfs.tick(); - tfl.tick(); - hexColor.tick(); - intColor.tick(); super.tick(); } @@ -181,7 +173,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float partialTic // allow multiple color modifiers setPickerState(localHue, localSaturation, localLightness); - renderBackground(context); + renderInGameBackground(context); if (!advanced) { // S PICKER diff --git a/src/main/java/fr/atesab/xray/screen/KeySelector.java b/src/main/java/fr/atesab/xray/screen/KeySelector.java index 4a5f12f..8ad7a08 100644 --- a/src/main/java/fr/atesab/xray/screen/KeySelector.java +++ b/src/main/java/fr/atesab/xray/screen/KeySelector.java @@ -98,7 +98,7 @@ public boolean shouldCloseOnEsc() { @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); + renderInGameBackground(context); context.drawCenteredTextWithShadow(textRenderer, getTitle(), width / 2, height / 2 - 30 - textRenderer.fontHeight, 0xffffffff); diff --git a/src/main/java/fr/atesab/xray/screen/XrayAbstractModeConfig.java b/src/main/java/fr/atesab/xray/screen/XrayAbstractModeConfig.java index 8a5e21d..78c5468 100644 --- a/src/main/java/fr/atesab/xray/screen/XrayAbstractModeConfig.java +++ b/src/main/java/fr/atesab/xray/screen/XrayAbstractModeConfig.java @@ -55,13 +55,12 @@ protected void init() { @Override public void tick() { - nameBox.tick(); super.tick(); } @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); + renderInGameBackground(context); nameBox.render(context, mouseX, mouseY, delta); super.render(context, mouseX, mouseY, delta); } diff --git a/src/main/java/fr/atesab/xray/screen/XrayBlockMenu.java b/src/main/java/fr/atesab/xray/screen/XrayBlockMenu.java index 7b2ffd1..be1136f 100644 --- a/src/main/java/fr/atesab/xray/screen/XrayBlockMenu.java +++ b/src/main/java/fr/atesab/xray/screen/XrayBlockMenu.java @@ -142,7 +142,7 @@ public List getView() { @Override public void render(DrawContext context, int mouseX, int mouseY, float partialTick) { - renderBackground(context); + renderInGameBackground(context); searchBar.render(context, mouseX, mouseY, partialTick); int left = width / 2 - elementsX * 18 / 2; diff --git a/src/main/java/fr/atesab/xray/screen/XrayConfigMenu.java b/src/main/java/fr/atesab/xray/screen/XrayConfigMenu.java index 91d9d8a..bc790c4 100644 --- a/src/main/java/fr/atesab/xray/screen/XrayConfigMenu.java +++ b/src/main/java/fr/atesab/xray/screen/XrayConfigMenu.java @@ -117,7 +117,7 @@ private void openLink(URL url) { @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); + renderInGameBackground(context); context.drawCenteredTextWithShadow(textRenderer, title, width / 2, height / 2 - 52 - textRenderer.fontHeight, 0xffffffff); super.render(context, mouseX, mouseY, delta); diff --git a/src/main/java/fr/atesab/xray/screen/XrayEntityMenu.java b/src/main/java/fr/atesab/xray/screen/XrayEntityMenu.java index 8350451..7e9d886 100644 --- a/src/main/java/fr/atesab/xray/screen/XrayEntityMenu.java +++ b/src/main/java/fr/atesab/xray/screen/XrayEntityMenu.java @@ -186,7 +186,7 @@ public List getView() { @Override public void render(DrawContext context, int mouseX, int mouseY, float partialTick) { - renderBackground(context); + renderInGameBackground(context); searchBar.render(context, mouseX, mouseY, partialTick); int left = width / 2 - elementsX * 18 / 2; diff --git a/src/main/java/fr/atesab/xray/screen/XrayLocationConfig.java b/src/main/java/fr/atesab/xray/screen/XrayLocationConfig.java index 27cb0ef..87bcf5f 100644 --- a/src/main/java/fr/atesab/xray/screen/XrayLocationConfig.java +++ b/src/main/java/fr/atesab/xray/screen/XrayLocationConfig.java @@ -47,7 +47,7 @@ protected void init() { format.setText(mod.getConfig().getLocationConfig().getFormat()); format.setChangedListener(mod.getConfig().getLocationConfig()::setFormat); if (position != 0) { - format.setCursor(position); + format.setCursor(position, false); position = 0; } addSelectableChild(format); @@ -100,13 +100,12 @@ public void resize(MinecraftClient client, int w, int h) { @Override public void tick() { - format.tick(); super.tick(); } @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); + renderInGameBackground(context); context.drawCenteredTextWithShadow(textRenderer, Text.translatable("x13.mod.location"), width / 2, height / 2 - 52 - textRenderer.fontHeight, 0xffffffff); GuiUtils.drawRightString(context, textRenderer, I18n.translate("x13.mod.location.format") + ": ", format, diff --git a/src/main/java/fr/atesab/xray/screen/XrayLocationConfigBoxScreen.java b/src/main/java/fr/atesab/xray/screen/XrayLocationConfigBoxScreen.java index 46dcaed..72ff6a6 100644 --- a/src/main/java/fr/atesab/xray/screen/XrayLocationConfigBoxScreen.java +++ b/src/main/java/fr/atesab/xray/screen/XrayLocationConfigBoxScreen.java @@ -129,7 +129,7 @@ protected void applyValue() { @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); + renderInGameBackground(context); super.render(context, mouseX, mouseY, delta); } } diff --git a/src/main/java/fr/atesab/xray/screen/XrayMenu.java b/src/main/java/fr/atesab/xray/screen/XrayMenu.java index dd17c39..4ee5ef3 100644 --- a/src/main/java/fr/atesab/xray/screen/XrayMenu.java +++ b/src/main/java/fr/atesab/xray/screen/XrayMenu.java @@ -77,7 +77,7 @@ protected void save() { @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); + renderInGameBackground(context); MatrixStack stack = context.getMatrices(); stack.push(); stack.translate(width / 2f, height / 2f - 70, 0); diff --git a/src/main/java/fr/atesab/xray/screen/page/PagedElement.java b/src/main/java/fr/atesab/xray/screen/page/PagedElement.java index 332ea65..c4fc4e1 100644 --- a/src/main/java/fr/atesab/xray/screen/page/PagedElement.java +++ b/src/main/java/fr/atesab/xray/screen/page/PagedElement.java @@ -97,9 +97,9 @@ public boolean mouseReleased(double mouseX, double mouseY, int button) { } @Override - public boolean mouseScrolled(double mouseX, double mouseY, double scroll) { + public boolean mouseScrolled(double mouseX, double mouseY, double scroll, double verticalAmount) { for (Element w : guiListeners) - if (w.mouseScrolled(mouseX, mouseY, scroll)) + if (w.mouseScrolled(mouseX, mouseY, scroll, verticalAmount)) return true; return false; } diff --git a/src/main/java/fr/atesab/xray/screen/page/PagedScreen.java b/src/main/java/fr/atesab/xray/screen/page/PagedScreen.java index ae21675..3368e0f 100644 --- a/src/main/java/fr/atesab/xray/screen/page/PagedScreen.java +++ b/src/main/java/fr/atesab/xray/screen/page/PagedScreen.java @@ -237,7 +237,7 @@ private void computePages(boolean updateDelta) { @Override public void render(DrawContext context, int mouseX, int mouseY, float delta) { - renderBackground(context); + renderInGameBackground(context); applyToAllElement((element, deltaY) -> { MatrixStack stack = context.getMatrices(); stack.translate(0, deltaY, 0); @@ -297,14 +297,14 @@ public boolean mouseReleased(double mouseX, double mouseY, int button) { } @Override - public boolean mouseScrolled(double mouseX, double mouseY, double scroll) { + public boolean mouseScrolled(double mouseX, double mouseY, double scroll, double verticalAmount) { if (scroll < 0) { nextPage(); } else { lastPage(); } - applyToAllElement((element, deltaY) -> element.mouseScrolled(mouseX, mouseY - deltaY, scroll)); - return super.mouseScrolled(mouseX, mouseY, scroll); + applyToAllElement((element, deltaY) -> element.mouseScrolled(mouseX, mouseY - deltaY, scroll, verticalAmount)); + return super.mouseScrolled(mouseX, mouseY, scroll, verticalAmount); } @Override