mirror of
https://github.com/lukasabbe/bookshelf-inspector.git
synced 2026-04-30 10:40:53 +00:00
+3
-1
@@ -26,7 +26,9 @@ dependencies {
|
||||
"fabric-api-base",
|
||||
"fabric-networking-api-v1",
|
||||
"fabric-lifecycle-events-v1",
|
||||
"fabric-resource-loader-v0"
|
||||
"fabric-resource-loader-v0",
|
||||
"fabric-client-tags-api-v1",
|
||||
"fabric-convention-tags-v2",
|
||||
]
|
||||
|
||||
apiMudules.forEach {
|
||||
|
||||
+5
-5
@@ -1,17 +1,17 @@
|
||||
# Done to increase the memory available to gradle.
|
||||
org.gradle.jvmargs=-Xmx1G
|
||||
org.gradle.jvmargs=-Xmx4G
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=1.21.3
|
||||
yarn_mappings=1.21.3+build.2
|
||||
minecraft_version=1.21.4
|
||||
yarn_mappings=1.21.4+build.1
|
||||
loader_version=0.16.9
|
||||
# Mod Properties
|
||||
mod_version=1.8+1.21.3
|
||||
mod_version=1.9+1.21.4-SNAPSHOT.4
|
||||
maven_group=me.lukasabbe
|
||||
archives_base_name=Bookshelfinspector
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.107.3+1.21.3
|
||||
fabric_version=0.110.5+1.21.4
|
||||
cloth_config=16.0.141
|
||||
modmenu=12.0.0-beta.1
|
||||
YAML_snake=2.2
|
||||
@@ -10,7 +10,7 @@ public record ModCheckPayload(boolean modActivated) implements CustomPayload {
|
||||
public static final CustomPayload.Id<ModCheckPayload> ID = new CustomPayload.Id<>(BookShelfInspectorNetworkConstants.MOD_CHECK_PACKET_ID);
|
||||
|
||||
public static final PacketCodec<RegistryByteBuf, ModCheckPayload> CODEC = PacketCodec.tuple(
|
||||
PacketCodecs.BOOL, ModCheckPayload::modActivated,
|
||||
PacketCodecs.BOOLEAN, ModCheckPayload::modActivated,
|
||||
ModCheckPayload::new
|
||||
);
|
||||
|
||||
|
||||
@@ -52,17 +52,21 @@ public class HudRenderer {
|
||||
final int level = storedComponents.getLevel(enchantment);
|
||||
if(level != 1)
|
||||
lvl = String.valueOf(level);
|
||||
final MutableText append;
|
||||
final MutableText enchantmentText;
|
||||
|
||||
if(!BookshelfinspectorClient.config.useRoman || level == -1)
|
||||
append = enchantment.value().description().copy().append(" " + lvl);
|
||||
enchantmentText = enchantment.value().description().copy().append(" " + lvl);
|
||||
else if (level != 1)
|
||||
enchantmentText = enchantment.value().description().copy().append(" " + RomanNumerals.toRoman(level));
|
||||
else
|
||||
append = enchantment.value().description().copy().append(" " + RomanNumerals.toRoman(level));
|
||||
enchantmentText = enchantment.value().description().copy();
|
||||
|
||||
if(enchantment.isIn(EnchantmentTags.CURSE)) {
|
||||
Texts.setStyleIfAbsent(append, Style.EMPTY.withColor(Formatting.RED));
|
||||
Texts.setStyleIfAbsent(enchantmentText, Style.EMPTY.withColor(Formatting.RED));
|
||||
}else {
|
||||
Texts.setStyleIfAbsent(append, Style.EMPTY.withColor(Formatting.GRAY));
|
||||
Texts.setStyleIfAbsent(enchantmentText, Style.EMPTY.withColor(Formatting.GRAY));
|
||||
}
|
||||
drawScaledText(context, append, x,y+i, 0xFFFFFFFF,client.textRenderer);
|
||||
drawScaledText(context, enchantmentText, x,y+i, 0xFFFFFFFF,client.textRenderer);
|
||||
i+=(int)(10*scaleFactor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,17 +8,16 @@ import me.lukasabbe.bookshelfinspector.network.packets.LecternInventoryRequestPa
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.fabricmc.fabric.api.tag.convention.v2.ConventionalBlockTags;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.ChiseledBookshelfBlock;
|
||||
import net.minecraft.block.entity.BlockEntityType;
|
||||
import net.minecraft.block.entity.LecternBlockEntity;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.registry.tag.BlockTags;
|
||||
import net.minecraft.util.hit.BlockHitResult;
|
||||
import net.minecraft.util.hit.HitResult;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.OptionalInt;
|
||||
|
||||
import static me.lukasabbe.bookshelfinspector.BookshelfinspectorClient.*;
|
||||
@@ -53,6 +52,7 @@ public class Inspector {
|
||||
}
|
||||
bookShelfData.latestPos = pos;
|
||||
|
||||
|
||||
if(client.player.getWorld().getBlockState(pos).isOf(Blocks.CHISELED_BOOKSHELF)){
|
||||
bookShelfInspect(pos, blockHitResult, client);
|
||||
}else if(client.player.getWorld().getBlockState(pos).isOf(Blocks.LECTERN) && config.lecternToggle){
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"schemaVersion": 1,
|
||||
"id": "bookshelfinspector",
|
||||
"version": "${version}",
|
||||
"name": "Bookshelfinspector",
|
||||
"name": "Bookshelf Inspector",
|
||||
"description": "Inspect any book in a chiseled bookshelf.",
|
||||
"authors": ["Lukasabbe"],
|
||||
"contact": {},
|
||||
@@ -25,7 +25,7 @@
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=${loader_version}",
|
||||
"minecraft": ">=1.21.3",
|
||||
"minecraft": ">=1.21.4",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-networking-api-v1": "*",
|
||||
"fabric-lifecycle-events-v1": "*",
|
||||
|
||||
Reference in New Issue
Block a user