Skip to content

Commit 15bfccd

Browse files
fix: runtime issues + added checkerboard pattern for fill
1 parent 7fbc12d commit 15bfccd

4 files changed

Lines changed: 18 additions & 4 deletions

File tree

build.gradle

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java-library'
3-
id 'fabric-loom' version '1.10-SNAPSHOT' apply(false)
3+
id 'fabric-loom' version '1.11-SNAPSHOT' apply(false)
44
id 'net.neoforged.moddev' version '2.0.105' apply(false)
55
id "me.modmuss50.mod-publish-plugin" version "0.8.4"
66
}
@@ -77,6 +77,15 @@ subprojects {
7777
filesMatching(["META-INF/neoforge.mods.toml", "fabric.mod.json", "META-INF/mods.toml"]) {
7878
expand replaceProperties
7979
}
80+
81+
// This is less than ideal, we'll need to look into this.
82+
if (project.name == "fabric" || project.name == "neoforge") {
83+
tasks.named('processResources') {
84+
from(project(":common").file("src/main/resources")) {
85+
into "."
86+
}
87+
}
88+
}
8089
}
8190

8291
publishing {
@@ -135,4 +144,4 @@ publishMods {
135144
file = project.provider { project(":neoforge").tasks.jar }.flatMap { it.archiveFile }
136145
additionalFiles.from project.provider { project(":fabric").tasks.remapJar }.flatMap { it.archiveFile }
137146
}
138-
}
147+
}

common/src/main/java/pro/mikey/xray/screens/ScanConfigureScreen.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import net.minecraft.client.gui.components.SpriteIconButton;
88
import net.minecraft.client.gui.layouts.GridLayout;
99
import net.minecraft.client.gui.layouts.Layout;
10+
import net.minecraft.client.renderer.RenderPipelines;
1011
import net.minecraft.client.resources.language.I18n;
1112
import net.minecraft.network.chat.Component;
1213
import net.minecraft.resources.ResourceLocation;
@@ -27,6 +28,7 @@
2728

2829
public class ScanConfigureScreen extends GuiBase {
2930
private static final ResourceLocation TRASH_ICON = XRay.assetLocation("gui/trash.png");
31+
private static final ResourceLocation TRANSPARENT_BACKGROUND = XRay.assetLocation("gui/transparent_background.png");
3032

3133
private EditBox oreName;
3234

@@ -183,8 +185,11 @@ public void tick() {
183185
public void renderExtra(GuiGraphics graphics, int x, int y, float partialTicks) {
184186
graphics.drawString(font, selectBlock.getName().getString(), getWidth() / 2 - 100, getHeight() / 2 - 90, 0xffffffff);
185187

188+
// blit render the TRANSPARENT_BACKGROUND texture, a 16x16 checkerboard pattern that should tile to fit the fill area
189+
graphics.blit(RenderPipelines.GUI_TEXTURED, TRANSPARENT_BACKGROUND, this.getWidth() / 2 - 100, this.getHeight() / 2 - 45, 0, 0, 202, 24, 16, 16, 0x80FFFFFF);
190+
186191
int color = ((int) (this.alphaSlider.getValue() * 255) << 24) | ((int) (this.redSlider.getValue() * 255) << 16) | ((int) (this.greenSlider.getValue() * 255) << 8) | (int) (this.blueSlider.getValue() * 255);
187-
graphics.fill(this.getWidth() / 2 - 100, this.getHeight() / 2 - 45, (this.getWidth() / 2 + 2) + 100, (this.getHeight() / 2 - 45) + 25, color);
192+
graphics.fill(this.getWidth() / 2 - 100, this.getHeight() / 2 - 45, (this.getWidth() / 2 + 2) + 100, (this.getHeight() / 2 - 45) + 24, color);
188193

189194
oreName.render(graphics, x, y, partialTicks);
190195

120 Bytes
Loading

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)