Start for snapshots, alot of small things had broken

This commit is contained in:
lukasabbe
2025-04-10 19:03:51 +02:00
parent 56d9d69e1b
commit ad2f95d7ad
5 changed files with 24 additions and 19 deletions
+5 -3
View File
@@ -22,6 +22,8 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
//modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
Set<String> apiMudules = [
"fabric-api-base",
"fabric-networking-api-v1",
@@ -32,11 +34,11 @@ dependencies {
]
apiMudules.forEach {
modImplementation(fabricApi.module(it,project.fabric_version))
modImplementation(fabricApi.module(it, project.fabric_version))
}
modApi "me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}"
modApi "com.terraformersmc:modmenu:${project.modmenu}"
//modApi "me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}" Turned off until they have been released
//modApi "com.terraformersmc:modmenu:${project.modmenu}"
include(implementation "org.yaml:snakeyaml:${project.YAML_snake}")
}
+5 -5
View File
@@ -2,16 +2,16 @@
org.gradle.jvmargs=-Xmx4G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=25w14craftmine
yarn_mappings=25w14craftmine+build.2
minecraft_version=25w15a
yarn_mappings=25w15a+build.5
loader_version=0.16.13
# Mod Properties
mod_version=1.10+25w14craftmine
mod_version=1.10+1.21.6-SNAPSHOT.1
maven_group=me.lukasabbe
archives_base_name=Bookshelfinspector
# Dependencies
fabric_version=0.119.9+25w14craftmine
fabric_version=0.119.10+1.21.6
cloth_config=18.0.145
modmenu=14.0.0-rc.2
YAML_snake=2.3
YAML_snake=2.4
@@ -1,3 +1,4 @@
/*
package me.lukasabbe.bookshelfinspector.config;
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
@@ -44,3 +45,4 @@ public class ModMenu implements ModMenuApi {
};
}
}
*/
@@ -7,7 +7,7 @@ import net.fabricmc.api.Environment;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.gui.GuiLayer;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.component.type.ItemEnchantmentsComponent;
import net.minecraft.enchantment.Enchantment;
@@ -19,6 +19,7 @@ import net.minecraft.text.Style;
import net.minecraft.text.Text;
import net.minecraft.text.Texts;
import net.minecraft.util.Formatting;
import org.joml.Matrix3x2fStack;
@Environment(EnvType.CLIENT)
public class HudRenderer {
@@ -27,6 +28,7 @@ public class HudRenderer {
if(client.options.hudHidden) return;
if(!BookshelfinspectorClient.bookShelfData.isCurrentBookDataToggled) return;
context.pushGuiLayer(GuiLayer.HUD);
final BookData currentBookData = BookshelfinspectorClient.currentBookData;
final int screenWidth = client.getWindow().getScaledWidth();
final int screenHeight = client.getWindow().getScaledHeight();
@@ -78,15 +80,17 @@ public class HudRenderer {
drawScaledText(context, Text.translatable("book.byAuthor",writtenBookContentComponent.author()), x,y+(int)(20*scaleFactor), 0xFFFFFFFF,client.textRenderer);
}
context.popGuiLayer();
}
private static void drawScaledText(DrawContext context, Text text, int centerX, int y, int color, TextRenderer textRenderer){
MatrixStack stack = context.getMatrices();
stack.push();
stack.translate(centerX,y,0);
Matrix3x2fStack stack = context.getMatrices();
stack.pushMatrix();
stack.translate(centerX,y);
final float scale = (float) BookshelfinspectorClient.config.scale / 10;
stack.scale(scale, scale, scale);
stack.translate(-centerX,-y,0);
stack.scale(scale, scale);
stack.translate(-centerX,-y);
context.drawCenteredTextWithShadow(textRenderer,text,centerX,y,color);
stack.pop();
stack.popMatrix();
}
}
+1 -4
View File
@@ -15,9 +15,6 @@
],
"main": [
"me.lukasabbe.bookshelfinspector.Bookshelfinspector"
],
"modmenu": [
"me.lukasabbe.bookshelfinspector.config.ModMenu"
]
},
"mixins": [
@@ -25,7 +22,7 @@
],
"depends": {
"fabricloader": ">=${loader_version}",
"minecraft": ">=1.21.6-alpha.25.14.craftmine",
"minecraft": ">=1.21.6-alpha.25.15.a",
"fabric-api-base": "*",
"fabric-networking-api-v1": "*",
"fabric-lifecycle-events-v1": "*",