Skip to content

Commit

Permalink
1.20.4 Update
Browse files Browse the repository at this point in the history
  • Loading branch information
fantahund committed Dec 11, 2023
1 parent d4eb20b commit d981a5b
Show file tree
Hide file tree
Showing 15 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
fabric_version=0.91.2+1.20.4
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/main/java/fr/atesab/xray/config/BlockConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/fr/atesab/xray/widget/BlockConfigWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<Block> blocks = cfg.getBlocks().getObjects();

List<Block> 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);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/fr/atesab/xray/widget/ColorSelectorWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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) {
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/fr/atesab/xray/widget/EntityConfigWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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<ItemStack> stacks = Stream.concat(cfg.getEntities().getIcons(), cfg.getBlockEntities().getIcons());

List<ItemStack> 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);
Expand Down
5 changes: 1 addition & 4 deletions src/main/java/fr/atesab/xray/widget/LongItemWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/fr/atesab/xray/widget/MenuWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/fr/atesab/xray/widget/XrayButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/fr/atesab/xray/widget/XraySlider.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/pack.mcmeta
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"pack": {
"description": "XrayMod resources",
"pack_format": 4,
"pack_format": 26,
"_comment": "."
}
}
2 changes: 1 addition & 1 deletion src/main/resources/xray.sodium.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "fr.atesab.xray.mixins",
"compatibilityLevel": "JAVA_8",
"compatibilityLevel": "JAVA_17",
"mixins": [],
"client": [
"MixinBlock",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/xray.vanilla.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"required": true,
"minVersion": "0.8",
"package": "fr.atesab.xray.mixins",
"compatibilityLevel": "JAVA_8",
"compatibilityLevel": "JAVA_17",
"mixins": [],
"client": [
"MixinBlock",
Expand Down

0 comments on commit d981a5b

Please sign in to comment.