mirror of
https://github.com/lukasabbe/bookshelf-inspector.git
synced 2026-04-30 10:40:53 +00:00
Start for snapshots, alot of small things had broken
This commit is contained in:
+5
-3
@@ -22,6 +22,8 @@ dependencies {
|
|||||||
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
|
||||||
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
|
||||||
|
|
||||||
|
//modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
|
||||||
|
|
||||||
Set<String> apiMudules = [
|
Set<String> apiMudules = [
|
||||||
"fabric-api-base",
|
"fabric-api-base",
|
||||||
"fabric-networking-api-v1",
|
"fabric-networking-api-v1",
|
||||||
@@ -32,11 +34,11 @@ dependencies {
|
|||||||
]
|
]
|
||||||
|
|
||||||
apiMudules.forEach {
|
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 "me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}" Turned off until they have been released
|
||||||
modApi "com.terraformersmc:modmenu:${project.modmenu}"
|
//modApi "com.terraformersmc:modmenu:${project.modmenu}"
|
||||||
|
|
||||||
include(implementation "org.yaml:snakeyaml:${project.YAML_snake}")
|
include(implementation "org.yaml:snakeyaml:${project.YAML_snake}")
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -2,16 +2,16 @@
|
|||||||
org.gradle.jvmargs=-Xmx4G
|
org.gradle.jvmargs=-Xmx4G
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://modmuss50.me/fabric.html
|
# check these on https://modmuss50.me/fabric.html
|
||||||
minecraft_version=25w14craftmine
|
minecraft_version=25w15a
|
||||||
yarn_mappings=25w14craftmine+build.2
|
yarn_mappings=25w15a+build.5
|
||||||
loader_version=0.16.13
|
loader_version=0.16.13
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=1.10+25w14craftmine
|
mod_version=1.10+1.21.6-SNAPSHOT.1
|
||||||
maven_group=me.lukasabbe
|
maven_group=me.lukasabbe
|
||||||
archives_base_name=Bookshelfinspector
|
archives_base_name=Bookshelfinspector
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabric_version=0.119.9+25w14craftmine
|
fabric_version=0.119.10+1.21.6
|
||||||
cloth_config=18.0.145
|
cloth_config=18.0.145
|
||||||
modmenu=14.0.0-rc.2
|
modmenu=14.0.0-rc.2
|
||||||
YAML_snake=2.3
|
YAML_snake=2.4
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
/*
|
||||||
package me.lukasabbe.bookshelfinspector.config;
|
package me.lukasabbe.bookshelfinspector.config;
|
||||||
|
|
||||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
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.MinecraftClient;
|
||||||
import net.minecraft.client.font.TextRenderer;
|
import net.minecraft.client.font.TextRenderer;
|
||||||
import net.minecraft.client.gui.DrawContext;
|
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.DataComponentTypes;
|
||||||
import net.minecraft.component.type.ItemEnchantmentsComponent;
|
import net.minecraft.component.type.ItemEnchantmentsComponent;
|
||||||
import net.minecraft.enchantment.Enchantment;
|
import net.minecraft.enchantment.Enchantment;
|
||||||
@@ -19,6 +19,7 @@ import net.minecraft.text.Style;
|
|||||||
import net.minecraft.text.Text;
|
import net.minecraft.text.Text;
|
||||||
import net.minecraft.text.Texts;
|
import net.minecraft.text.Texts;
|
||||||
import net.minecraft.util.Formatting;
|
import net.minecraft.util.Formatting;
|
||||||
|
import org.joml.Matrix3x2fStack;
|
||||||
|
|
||||||
@Environment(EnvType.CLIENT)
|
@Environment(EnvType.CLIENT)
|
||||||
public class HudRenderer {
|
public class HudRenderer {
|
||||||
@@ -27,6 +28,7 @@ public class HudRenderer {
|
|||||||
if(client.options.hudHidden) return;
|
if(client.options.hudHidden) return;
|
||||||
if(!BookshelfinspectorClient.bookShelfData.isCurrentBookDataToggled) return;
|
if(!BookshelfinspectorClient.bookShelfData.isCurrentBookDataToggled) return;
|
||||||
|
|
||||||
|
context.pushGuiLayer(GuiLayer.HUD);
|
||||||
final BookData currentBookData = BookshelfinspectorClient.currentBookData;
|
final BookData currentBookData = BookshelfinspectorClient.currentBookData;
|
||||||
final int screenWidth = client.getWindow().getScaledWidth();
|
final int screenWidth = client.getWindow().getScaledWidth();
|
||||||
final int screenHeight = client.getWindow().getScaledHeight();
|
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);
|
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){
|
private static void drawScaledText(DrawContext context, Text text, int centerX, int y, int color, TextRenderer textRenderer){
|
||||||
MatrixStack stack = context.getMatrices();
|
Matrix3x2fStack stack = context.getMatrices();
|
||||||
stack.push();
|
stack.pushMatrix();
|
||||||
stack.translate(centerX,y,0);
|
stack.translate(centerX,y);
|
||||||
final float scale = (float) BookshelfinspectorClient.config.scale / 10;
|
final float scale = (float) BookshelfinspectorClient.config.scale / 10;
|
||||||
stack.scale(scale, scale, scale);
|
stack.scale(scale, scale);
|
||||||
stack.translate(-centerX,-y,0);
|
stack.translate(-centerX,-y);
|
||||||
context.drawCenteredTextWithShadow(textRenderer,text,centerX,y,color);
|
context.drawCenteredTextWithShadow(textRenderer,text,centerX,y,color);
|
||||||
stack.pop();
|
stack.popMatrix();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,6 @@
|
|||||||
],
|
],
|
||||||
"main": [
|
"main": [
|
||||||
"me.lukasabbe.bookshelfinspector.Bookshelfinspector"
|
"me.lukasabbe.bookshelfinspector.Bookshelfinspector"
|
||||||
],
|
|
||||||
"modmenu": [
|
|
||||||
"me.lukasabbe.bookshelfinspector.config.ModMenu"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"mixins": [
|
"mixins": [
|
||||||
@@ -25,7 +22,7 @@
|
|||||||
],
|
],
|
||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=${loader_version}",
|
"fabricloader": ">=${loader_version}",
|
||||||
"minecraft": ">=1.21.6-alpha.25.14.craftmine",
|
"minecraft": ">=1.21.6-alpha.25.15.a",
|
||||||
"fabric-api-base": "*",
|
"fabric-api-base": "*",
|
||||||
"fabric-networking-api-v1": "*",
|
"fabric-networking-api-v1": "*",
|
||||||
"fabric-lifecycle-events-v1": "*",
|
"fabric-lifecycle-events-v1": "*",
|
||||||
|
|||||||
Reference in New Issue
Block a user