Skip to content

Commit

Permalink
Merge branch '1.20.2' into latest
Browse files Browse the repository at this point in the history
  • Loading branch information
Boxadactle committed Aug 18, 2024
2 parents d513bdd + f0505da commit 704fd1c
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 27 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ githubRelease {
targetCommitish = "latest"
releaseName = "Coordinates Display $project.version"
generateReleaseNotes = true
body = """"Coordinates Display $project.version for Minecraft $project.minecraft_version"
body = """Coordinates Display $project.version for Minecraft $project.minecraft_version
${new File(rootProject.rootDir, project.changelog_file).text}
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class CoordinatesDisplay {

public static final String MOD_ID = "coordinatesdisplay";

public static final String VERSION = "9.1.1";
public static final String VERSION = "10.1.1";

public static final String VERSION_STRING = MOD_NAME + " v" + VERSION;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public boolean shouldRender(VisibilityFilter filter) throws UnknownVisibilityFil

// have you ever seen anyone use this operand
bl &= !ClientUtils.getOptions().hideGui;
bl &= !ClientUtils.getOptions().renderDebug;
bl &= !ClientUtils.getClient().getDebugOverlay().showDebugScreen();
bl &= CoordinatesDisplay.shouldHudRender;
bl &= filter.getFilter().isVisible();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public RenderingLayout renderOverlay(int x, int y, Position pos) {
// C
Component c = definition(translation("c"));

String var2 = ClientUtils.getClient().level != null ? ClientUtils.getClient().levelRenderer.getChunkStatistics() : "C: 0/0";
String var2 = ClientUtils.getClient().level != null ? ClientUtils.getClient().levelRenderer.getSectionStatistics() : "C: 0/0";

// why is this field private mojang
Pattern cPattern = Pattern.compile("C: (\\d+)/(\\d+) \\(s\\)");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.boxadactle.coordinatesdisplay.hud.renderer;

import com.mojang.blaze3d.systems.RenderSystem;
import dev.boxadactle.boxlib.layouts.LayoutComponent;
import dev.boxadactle.boxlib.layouts.RenderingLayout;
import dev.boxadactle.boxlib.layouts.component.LayoutContainerComponent;
Expand All @@ -9,6 +8,7 @@
import dev.boxadactle.boxlib.layouts.layout.PaddingLayout;
import dev.boxadactle.boxlib.layouts.layout.RowLayout;
import dev.boxadactle.boxlib.math.geometry.Vec3;
import dev.boxadactle.boxlib.util.RenderUtils;
import dev.boxadactle.boxlib.util.WorldUtils;
import dev.boxadactle.coordinatesdisplay.CoordinatesDisplay;
import dev.boxadactle.coordinatesdisplay.hud.HudDisplayMode;
Expand Down Expand Up @@ -185,23 +185,22 @@ private ResourceLocation resolveCompassTexture(double d) {

// this copied from the minecraft compass json model
String[] textures = {
"item/compass_16", "item/compass_17", "item/compass_18", "item/compass_19", "item/compass_20", "item/compass_21", "item/compass_22", "item/compass_23",
"item/compass_24", "item/compass_25", "item/compass_26", "item/compass_27", "item/compass_28", "item/compass_29", "item/compass_30", "item/compass_31",
"item/compass_00", "item/compass_01", "item/compass_02", "item/compass_03", "item/compass_04", "item/compass_05", "item/compass_06", "item/compass_07",
"item/compass_08", "item/compass_09", "item/compass_10", "item/compass_11", "item/compass_12", "item/compass_13", "item/compass_14", "item/compass_15",
"item/compass_16"
"compass_16", "compass_17", "compass_18", "compass_19", "compass_20", "compass_21", "compass_22", "compass_23",
"compass_24", "compass_25", "compass_26", "compass_27", "compass_28", "compass_29", "compass_30", "compass_31",
"compass_00", "compass_01", "compass_02", "compass_03", "compass_04", "compass_05", "compass_06", "compass_07",
"compass_08", "compass_09", "compass_10", "compass_11", "compass_12", "compass_13", "compass_14", "compass_15",
"compass_16"
};

String texture = "textures/" + textures[(int) (range1 * textures.length)] + ".png";
return new ResourceLocation("minecraft", texture);
String texture = "textures/item/" + textures[(int) (range1 * textures.length)] + ".png";
return new ResourceLocation(texture);
}

@Override
public void render(GuiGraphics guiGraphics, int x, int y) {
double degrees = calculateRelativeDirection(component.position.getBlockPos(), new Vec3<>(spawnpoint.getX(), spawnpoint.getY(), spawnpoint.getZ()), component.headRot.wrapYaw());

RenderSystem.enableBlend();
guiGraphics.blit(resolveCompassTexture(degrees), x, y, 0, 0, size, size);
RenderUtils.drawTexture(resolveCompassTexture(degrees), guiGraphics, x, y, size, size, 0, 0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public CoordinatesScreen(Position pos) {

@Override
public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta) {
this.renderBackground(guiGraphics);
super.render(guiGraphics, mouseX, mouseY, delta);

Vec3<Double> player = pos.position.getPlayerPos();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected void init() {

@Override
public void render(GuiGraphics guiGraphics, int i, int j, float f) {
renderBackground(guiGraphics);
renderBackground(guiGraphics, i, j, f);
super.render(guiGraphics, i, j, f);

if (moveHud(i, j)) {
Expand Down
4 changes: 2 additions & 2 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
],
"depends": {
"fabricloader": ">=0.15.10",
"minecraft": "1.20",
"boxlib": "10.*",
"minecraft": "<=1.20.2",
"boxlib": "11.*",
"fabric": "*"
},
"recommends": {
Expand Down
4 changes: 2 additions & 2 deletions forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ side="BOTH"
[[dependencies.coordinatesdisplay]]
modId="minecraft"
mandatory=true
versionRange="[1.20,1.20.1)"
versionRange="[1.20.1,1.20.2]"
ordering="NONE"
side="BOTH"

[[dependencies.coordinatesdisplay]]
modId="boxlib"
mandatory=true
versionRange="[10.0.0,11.0.0)"
versionRange="[11.0.0,12.0.0)"
ordering="NONE"
side="CLIENT"
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ org.gradle.jvmargs=-Xmx2G
org.gradle.parallel=true

# Mod properties
mod_version = 9.1.1
mod_version = 10.1.1
maven_group = dev.boxadactle
archives_name = CoordinatesDisplay
enabled_platforms = fabric,forge

# Minecraft properties
minecraft_version = 1.20
minecraft_version = 1.20.2

# Dependencies
fabric_loader_version = 0.15.11
fabric_api_version = 0.83.0+1.20
forge_version = 46.0.14
fabric_api_version = 0.91.6+1.20.2
forge_version = 48.1.0

modmenu_version = 7.0.1
boxlib_version = 10.3.2
modmenu_version=8.0.1
boxlib_version = 11.3.2

# publishing
game_versions = 1.20
game_versions = 1.20.1,1.20.2
project_id_curseforge = 646464
project_id_modrinth = 3mW8PdUo
release_type = release
Expand Down

0 comments on commit 704fd1c

Please sign in to comment.