Skip to content

Commit

Permalink
#6 Add support for Minecraft 1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
miraisoft-de committed Apr 4, 2023
1 parent 15b3941 commit e25ee9e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '0.13-SNAPSHOT'
id 'maven-publish'
}

Expand Down
15 changes: 8 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
org.gradle.jvmargs=-Xmx1G

# Fabric Properties
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.6
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17

# Mod Properties
mod_version = 1.3-mc1.19.x
mod_version = 1.3-mc1.19.4
maven_group = de.miraisoft
archives_base_name = ash2

# Dependencies
fabric_version=0.55.2+1.19
clothconfig_version=7.0.74
modmenu_version=4.0.0
fabric_version=0.76.0+1.19.4
clothconfig_version=10.0.96
modmenu_version=5.0.2
// modmenu_version=6.1.0-rc4
36 changes: 18 additions & 18 deletions src/main/java/de/miraisoft/ash2/mixin/InGameHudMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,43 +64,43 @@ private void drawCoordsAndDirection(MatrixStack matrixStack, MinecraftClient cli
return;
float degrees = MathHelper.wrapDegrees(cameraEntity.getYaw());
DirectionEnum directionEnum = DirectionEnum.getByYawDegrees(degrees);

// show coordinates

if (AshCommands.config.showCoords) {
matrixStack.push();
BlockPos blockPos = new BlockPos(cameraEntity.getX(), cameraEntity.getBoundingBox().getMin(Direction.Axis.Y),
cameraEntity.getZ());
BlockPos blockPos = new BlockPos((int) cameraEntity.getX(),
(int) cameraEntity.getBoundingBox().getMin(Direction.Axis.Y), (int) cameraEntity.getZ());
if (AshCommands.config.conciseCoords) {
String direction = "";
if (AshCommands.config.showDirection) {
direction += directionEnum.name();
}
String coordsText = String.format("%d / %d / %d %s", blockPos.getX(), blockPos.getY(), blockPos.getZ(), direction);
String coordsText = String.format("%d / %d / %d %s", blockPos.getX(), blockPos.getY(), blockPos.getZ(),
direction);
client.textRenderer.drawWithShadow(matrixStack, coordsText, TEXT_POS_X, textPosY,
AshCommands.config.hudColor);
} else {
String xText = String.format("x: %d", blockPos.getX());
String yText = String.format("y: %d", blockPos.getY());
String zText = String.format("z: %d", blockPos.getZ());

xText += directionEnum.getX();
zText += directionEnum.getZ();



int heightDiff = client.textRenderer.fontHeight + 1;
client.textRenderer.drawWithShadow(matrixStack, xText, TEXT_POS_X, textPosY, COLOR_X);
textPosY += heightDiff;
client.textRenderer.drawWithShadow(matrixStack, yText, TEXT_POS_X, textPosY, COLOR_Y);
textPosY += heightDiff;
client.textRenderer.drawWithShadow(matrixStack, zText, TEXT_POS_X, textPosY, COLOR_Z);
}
matrixStack.pop();
matrixStack.pop();
textPosY += client.textRenderer.fontHeight + 1;
}

// show direction

if (!AshCommands.config.showDirection || AshCommands.config.conciseCoords)
return;
matrixStack.push();
Expand All @@ -111,14 +111,14 @@ private void drawCoordsAndDirection(MatrixStack matrixStack, MinecraftClient cli

textPosY += client.textRenderer.fontHeight + 1;
}

private void drawLightLevel(MatrixStack matrixStack, MinecraftClient client, Entity cameraEntity) {
if (!AshCommands.config.showLightLevel)
return;
matrixStack.push();

BlockPos blockPos = new BlockPos(cameraEntity.getX(), cameraEntity.getBoundingBox().getMin(Direction.Axis.Y),
cameraEntity.getZ());
BlockPos blockPos = new BlockPos((int) cameraEntity.getX(),
(int) cameraEntity.getBoundingBox().getMin(Direction.Axis.Y), (int) cameraEntity.getZ());
int lightLevel = client.world.getLightLevel(LightType.BLOCK, blockPos);
String ashString = "Light Level: " + lightLevel;

Expand All @@ -138,8 +138,8 @@ private void drawBiome(MatrixStack matrixStack, MinecraftClient client, Entity c
return;
matrixStack.push();

BlockPos blockPos = new BlockPos(cameraEntity.getX(), cameraEntity.getBoundingBox().getMin(Direction.Axis.Y),
cameraEntity.getZ());
BlockPos blockPos = new BlockPos((int) cameraEntity.getX(),
(int) cameraEntity.getBoundingBox().getMin(Direction.Axis.Y), (int) cameraEntity.getZ());
String biomeKey = client.world.getBiome(blockPos).getKey().get().getValue().toTranslationKey("biome");
String ashString = "Biome: " + Text.translatable(biomeKey).getString();

Expand All @@ -148,7 +148,7 @@ private void drawBiome(MatrixStack matrixStack, MinecraftClient client, Entity c

textPosY += client.textRenderer.fontHeight + 1;
}

private void drawTime(MatrixStack matrixStack, MinecraftClient client, Entity cameraEntity) {
if (!AshCommands.config.showTime)
return;
Expand All @@ -158,7 +158,7 @@ private void drawTime(MatrixStack matrixStack, MinecraftClient client, Entity ca
int minutes = (int) ((client.world.getTimeOfDay() / 1000d * 60) % 60);
String ashString;
if (minutes <= 9) {
ashString = String.format("Time: %d:0%d", hour, minutes);
ashString = String.format("Time: %d:0%d", hour, minutes);
} else {
ashString = String.format("Time: %d:%d", hour, minutes);
}
Expand Down
7 changes: 4 additions & 3 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@
"ash2.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.6",
"fabricloader": ">=0.14.17",
"fabric": "*",
"minecraft": "1.19.x",
"java": ">=17"
"minecraft": "1.19.4",
"java": ">=17",
"cloth-config": ">=10"
}
}

0 comments on commit e25ee9e

Please sign in to comment.