From d981a5bdb1ab378bcd74fc561d1741df489d1bce Mon Sep 17 00:00:00 2001 From: fanta Date: Mon, 11 Dec 2023 11:43:41 +0100 Subject: [PATCH] 1.20.4 Update --- build.gradle | 2 +- gradle.properties | 10 +++++----- gradle/wrapper/gradle-wrapper.properties | 2 +- src/main/java/fr/atesab/xray/config/BlockConfig.java | 2 +- .../java/fr/atesab/xray/widget/BlockConfigWidget.java | 4 +--- .../fr/atesab/xray/widget/ColorSelectorWidget.java | 3 +-- .../java/fr/atesab/xray/widget/EntityConfigWidget.java | 4 +--- .../java/fr/atesab/xray/widget/LongItemWidget.java | 5 +---- src/main/java/fr/atesab/xray/widget/MenuWidget.java | 2 +- src/main/java/fr/atesab/xray/widget/XrayButton.java | 5 ++--- src/main/java/fr/atesab/xray/widget/XraySlider.java | 5 ++--- src/main/resources/fabric.mod.json | 4 ++-- src/main/resources/pack.mcmeta | 2 +- src/main/resources/xray.sodium.mixins.json | 2 +- src/main/resources/xray.vanilla.mixins.json | 2 +- 15 files changed, 22 insertions(+), 32 deletions(-) diff --git a/build.gradle b/build.gradle index d50daaa..4adcd07 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'maven-publish' - id 'fabric-loom' version '1.0-SNAPSHOT' + id 'fabric-loom' version '1.4-SNAPSHOT' } sourceCompatibility = JavaVersion.VERSION_17 diff --git a/gradle.properties b/gradle.properties index 72f504a..bef7b3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,16 +5,16 @@ org.gradle.daemon=false # Fabric Properties # check these on https://fabricmc.net/use -minecraft_version=1.20.2 -yarn_mappings=1.20.2+build.4 -loader_version=0.14.23 +minecraft_version=1.20.4 +yarn_mappings=1.20.4+build.1 +loader_version=0.15.1 # Mod Properties -mod_version = 2.3.1 +mod_version = 2.3.2 maven_group = fr.atesab.xray archives_base_name = XrayMod 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.90.0+1.20.2 \ No newline at end of file +fabric_version=0.91.2+1.20.4 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 60c76b3..2bbac7d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file diff --git a/src/main/java/fr/atesab/xray/config/BlockConfig.java b/src/main/java/fr/atesab/xray/config/BlockConfig.java index 308ca52..72ad8a6 100644 --- a/src/main/java/fr/atesab/xray/config/BlockConfig.java +++ b/src/main/java/fr/atesab/xray/config/BlockConfig.java @@ -83,7 +83,7 @@ public enum Template implements EnumElement { 0, "Cave", ViewMode.INCLUSIVE, - Blocks.DIRT, Blocks.GRASS, Blocks.GRAVEL, Blocks.GRASS_BLOCK, + Blocks.DIRT, Blocks.SHORT_GRASS, Blocks.GRAVEL, Blocks.GRASS_BLOCK, Blocks.DIRT_PATH, Blocks.SAND, Blocks.SANDSTONE, Blocks.RED_SAND )), REDSTONE("x13.mod.template.redstone", new ItemStack(Blocks.REDSTONE_ORE), new BlockConfig( diff --git a/src/main/java/fr/atesab/xray/widget/BlockConfigWidget.java b/src/main/java/fr/atesab/xray/widget/BlockConfigWidget.java index 85588fc..3bba509 100644 --- a/src/main/java/fr/atesab/xray/widget/BlockConfigWidget.java +++ b/src/main/java/fr/atesab/xray/widget/BlockConfigWidget.java @@ -9,7 +9,6 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; import net.minecraft.text.Text; @@ -41,13 +40,12 @@ public void setDeltaY(int deltaY) { } @Override - public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) { + public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) { int fit = (width - 2) / 17; List blocks = cfg.getBlocks().getObjects(); List view = blocks.subList(0, Math.min(fit, blocks.size())); - MinecraftClient client = MinecraftClient.getInstance(); if (mouseX >= this.getX() && mouseX <= this.getX() + this.width && mouseY >= this.getY() && mouseY <= this.getY() + this.height) { context.fill(getX(), getY(), getX() + width, getY() + height, 0x33ffaa00); diff --git a/src/main/java/fr/atesab/xray/widget/ColorSelectorWidget.java b/src/main/java/fr/atesab/xray/widget/ColorSelectorWidget.java index da596df..7bc8e83 100644 --- a/src/main/java/fr/atesab/xray/widget/ColorSelectorWidget.java +++ b/src/main/java/fr/atesab/xray/widget/ColorSelectorWidget.java @@ -10,7 +10,6 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.widget.PressableWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; public class ColorSelectorWidget extends PressableWidget { @@ -35,7 +34,7 @@ protected void appendClickableNarrations(NarrationMessageBuilder builder) { } @Override - public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) { + public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) { boolean hovered = isHovered(); int color = getter.getAsInt() & 0xFFFFFF; if (hovered) { diff --git a/src/main/java/fr/atesab/xray/widget/EntityConfigWidget.java b/src/main/java/fr/atesab/xray/widget/EntityConfigWidget.java index f8c98ab..88040f3 100644 --- a/src/main/java/fr/atesab/xray/widget/EntityConfigWidget.java +++ b/src/main/java/fr/atesab/xray/widget/EntityConfigWidget.java @@ -9,7 +9,6 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; import net.minecraft.text.Text; @@ -41,13 +40,12 @@ public void setDeltaY(int deltaY) { } @Override - public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) { + public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) { int fit = (width - 2) / 17; Stream stacks = Stream.concat(cfg.getEntities().getIcons(), cfg.getBlockEntities().getIcons()); List view = stacks.limit(fit).toList(); - MinecraftClient client = MinecraftClient.getInstance(); if (mouseX >= this.getX() && mouseX <= this.getX() + this.width && mouseY >= this.getY() && mouseY <= this.getY() + this.height) { context.fill(getX(), getY(), getX() + width, getY() + height, 0x33ffaa00); diff --git a/src/main/java/fr/atesab/xray/widget/LongItemWidget.java b/src/main/java/fr/atesab/xray/widget/LongItemWidget.java index 6f94e01..7140278 100644 --- a/src/main/java/fr/atesab/xray/widget/LongItemWidget.java +++ b/src/main/java/fr/atesab/xray/widget/LongItemWidget.java @@ -7,8 +7,6 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.narration.NarrationMessageBuilder; import net.minecraft.client.gui.widget.PressableWidget; -import net.minecraft.client.render.item.ItemRenderer; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; import net.minecraft.text.Text; @@ -39,7 +37,7 @@ protected void appendClickableNarrations(NarrationMessageBuilder builder) { } @Override - public void renderButton(DrawContext context, int mouseX, int mouseY, float delta) { + public void renderWidget(DrawContext context, int mouseX, int mouseY, float delta) { MinecraftClient client = MinecraftClient.getInstance(); boolean hovered = isHovered(); int color; @@ -53,7 +51,6 @@ public void renderButton(DrawContext context, int mouseX, int mouseY, float delt Text message = getMessage(); TextRenderer textRenderer = client.textRenderer; - ItemRenderer renderer = client.getItemRenderer(); int deltaH = (getHeight() - 16); diff --git a/src/main/java/fr/atesab/xray/widget/MenuWidget.java b/src/main/java/fr/atesab/xray/widget/MenuWidget.java index 19b79b8..edd5a6e 100644 --- a/src/main/java/fr/atesab/xray/widget/MenuWidget.java +++ b/src/main/java/fr/atesab/xray/widget/MenuWidget.java @@ -28,7 +28,7 @@ public MenuWidget(int x, int y, int w, int h, Text text, ItemStack stack, OnPres } @Override - public void renderButton(DrawContext graphics, int mouseX, int mouseY, float delta) { + public void renderWidget(DrawContext graphics, int mouseX, int mouseY, float delta) { MinecraftClient client = MinecraftClient.getInstance(); boolean hovered = isHovered(); int centerX = getX() + width / 2; diff --git a/src/main/java/fr/atesab/xray/widget/XrayButton.java b/src/main/java/fr/atesab/xray/widget/XrayButton.java index 80a8a59..b0bcb6c 100644 --- a/src/main/java/fr/atesab/xray/widget/XrayButton.java +++ b/src/main/java/fr/atesab/xray/widget/XrayButton.java @@ -7,7 +7,6 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.tooltip.Tooltip; import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import org.jetbrains.annotations.Nullable; @@ -91,10 +90,10 @@ public XrayButton(int x, int y, int w, int h, Text text, ButtonWidget.PressActio } @Override - public void renderButton(DrawContext context, int mx, int my, float delta) { + public void renderWidget(DrawContext context, int mx, int my, float delta) { Skin skin = XrayMain.getMod().getConfig().getSkin(); if (skin.renderButton(this, context, getX(), getY(), width, height)) { - super.renderButton(context, mx, my, delta); + super.renderWidget(context, mx, my, delta); } } diff --git a/src/main/java/fr/atesab/xray/widget/XraySlider.java b/src/main/java/fr/atesab/xray/widget/XraySlider.java index e9774cb..02b3033 100644 --- a/src/main/java/fr/atesab/xray/widget/XraySlider.java +++ b/src/main/java/fr/atesab/xray/widget/XraySlider.java @@ -4,7 +4,6 @@ import fr.atesab.xray.color.Skin; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.widget.SliderWidget; -import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.Text; import net.minecraft.util.math.MathHelper; @@ -14,10 +13,10 @@ public XraySlider(int x, int y, int width, int height, Text text, double value) } @Override - public void renderButton(DrawContext context, int mx, int my, float delta) { + public void renderWidget(DrawContext context, int mx, int my, float delta) { Skin skin = XrayMain.getMod().getConfig().getSkin(); if (skin.renderSlider(this, context, getX(), getY(), width, height)) { - super.renderButton(context, mx, my, delta); + super.renderWidget(context, mx, my, delta); } } public void setValue(double value) { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ab0d0e4..061df2a 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -21,9 +21,9 @@ "mixins": ["xray.sodium.mixins.json", "xray.vanilla.mixins.json"], "depends": { - "fabricloader": ">=0.14.17", + "fabricloader": ">=0.15.0", "fabric": "*", - "minecraft": ">=1.20" + "minecraft": ">=1.20.3" }, "conflicts": { "optifabric": "*" diff --git a/src/main/resources/pack.mcmeta b/src/main/resources/pack.mcmeta index 01eb89b..9513379 100644 --- a/src/main/resources/pack.mcmeta +++ b/src/main/resources/pack.mcmeta @@ -1,7 +1,7 @@ { "pack": { "description": "XrayMod resources", - "pack_format": 4, + "pack_format": 26, "_comment": "." } } diff --git a/src/main/resources/xray.sodium.mixins.json b/src/main/resources/xray.sodium.mixins.json index 71e9568..248b158 100644 --- a/src/main/resources/xray.sodium.mixins.json +++ b/src/main/resources/xray.sodium.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "fr.atesab.xray.mixins", - "compatibilityLevel": "JAVA_8", + "compatibilityLevel": "JAVA_17", "mixins": [], "client": [ "MixinBlock", diff --git a/src/main/resources/xray.vanilla.mixins.json b/src/main/resources/xray.vanilla.mixins.json index 694ed2f..f303f51 100644 --- a/src/main/resources/xray.vanilla.mixins.json +++ b/src/main/resources/xray.vanilla.mixins.json @@ -2,7 +2,7 @@ "required": true, "minVersion": "0.8", "package": "fr.atesab.xray.mixins", - "compatibilityLevel": "JAVA_8", + "compatibilityLevel": "JAVA_17", "mixins": [], "client": [ "MixinBlock",