mirror of
https://github.com/lukasabbe/bookshelf-inspector.git
synced 2026-04-30 10:40:53 +00:00
25w06a
This commit is contained in:
+3
-3
@@ -2,8 +2,8 @@
|
||||
org.gradle.jvmargs=-Xmx4G
|
||||
# Fabric Properties
|
||||
# check these on https://modmuss50.me/fabric.html
|
||||
minecraft_version=25w02a
|
||||
yarn_mappings=25w02a+build.9
|
||||
minecraft_version=25w06a
|
||||
yarn_mappings=25w06a+build.7
|
||||
loader_version=0.16.10
|
||||
# Mod Properties
|
||||
mod_version=1.9+1.21.5-SNAPSHOT.1
|
||||
@@ -11,7 +11,7 @@ maven_group=me.lukasabbe
|
||||
archives_base_name=Bookshelfinspector
|
||||
|
||||
# Dependencies
|
||||
fabric_version=0.114.1+1.21.5
|
||||
fabric_version=0.116.0+1.21.5
|
||||
cloth_config=17.0.144
|
||||
modmenu=13.0.0
|
||||
YAML_snake=2.3
|
||||
@@ -22,13 +22,13 @@ public class Bookshelfinspector implements ModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
//Registers request types
|
||||
PayloadTypeRegistry.playC2S().register(BookShelfInventoryRequestPayload.ID,BookShelfInventoryRequestPayload.CODEC);
|
||||
PayloadTypeRegistry.playC2S().register(LecternInventoryRequestPayload.ID, LecternInventoryRequestPayload.CODEC);
|
||||
PayloadTypeRegistry.playS2C().register(BookShelfInventoryPayload.ID,BookShelfInventoryPayload.CODEC);
|
||||
PayloadTypeRegistry.playS2C().register(ModCheckPayload.ID, ModCheckPayload.CODEC);
|
||||
|
||||
ServerPlayNetworking.registerGlobalReceiver(BookShelfInventoryRequestPayload.ID, new BookShelfInventoryRequestPayloadHandler());
|
||||
|
||||
ServerPlayNetworking.registerGlobalReceiver(LecternInventoryRequestPayload.ID, new LecternInventoryRequestPayloadHandler());
|
||||
|
||||
ServerPlayConnectionEvents.JOIN.register(((handler, sender, server) -> {
|
||||
|
||||
@@ -23,7 +23,9 @@ public class BookshelfinspectorClient implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
|
||||
config.loadConfig();
|
||||
|
||||
ClientPlayNetworking.registerGlobalReceiver(BookShelfInventoryPayload.ID, new BookShelfInventoryHandler());
|
||||
ClientPlayNetworking.registerGlobalReceiver(ModCheckPayload.ID,new ModPayloadHandler());
|
||||
|
||||
|
||||
@@ -15,12 +15,14 @@ public class BookshelfTools {
|
||||
final World world = Bookshelfinspector.serverInstance.getPlayerManager().getPlayer(player.getUuid()).getWorld();
|
||||
|
||||
if(world == null) return null;
|
||||
Optional<ChiseledBookshelfBlockEntity> blockEntityOptional = world.getBlockEntity(pos,BlockEntityType.CHISELED_BOOKSHELF);
|
||||
|
||||
final Optional<ChiseledBookshelfBlockEntity> blockEntityOptional = world.getBlockEntity(pos,BlockEntityType.CHISELED_BOOKSHELF);
|
||||
|
||||
if(blockEntityOptional.isEmpty()) return null;
|
||||
|
||||
ChiseledBookshelfBlockEntity blockEntity = blockEntityOptional.get();
|
||||
|
||||
final ChiseledBookshelfBlockEntity blockEntity = blockEntityOptional.get();
|
||||
final ItemStack stack = blockEntity.getStack(slotNum);
|
||||
|
||||
if(stack.isEmpty()) return null;
|
||||
|
||||
return stack;
|
||||
|
||||
@@ -24,19 +24,20 @@ import net.minecraft.util.Formatting;
|
||||
public class HudRenderer {
|
||||
public static void hudRender(DrawContext context, MinecraftClient client){
|
||||
if(!BookshelfinspectorClient.modAvailable) return;
|
||||
|
||||
if(client.options.hudHidden) return;
|
||||
if(!BookshelfinspectorClient.bookShelfData.isCurrentBookDataToggled) return;
|
||||
|
||||
if(BookshelfinspectorClient.bookShelfData.isCurrentBookDataToggled){
|
||||
final BookData currentBookData = BookshelfinspectorClient.currentBookData;
|
||||
int screenWidth = client.getWindow().getScaledWidth();
|
||||
int screenHeight = client.getWindow().getScaledHeight();
|
||||
int x = screenWidth / 2;
|
||||
int y = screenHeight / 2;
|
||||
final int screenWidth = client.getWindow().getScaledWidth();
|
||||
final int screenHeight = client.getWindow().getScaledHeight();
|
||||
final int x = screenWidth / 2;
|
||||
final int y = screenHeight / 2;
|
||||
final ItemStack itemStack = currentBookData.itemStack;
|
||||
|
||||
int color = 0xFFFFFFFF;
|
||||
|
||||
final Integer colorValue = itemStack.getRarity().getFormatting().getColorValue();
|
||||
|
||||
if(colorValue != null){
|
||||
color = colorValue;
|
||||
}
|
||||
@@ -78,7 +79,6 @@ public class HudRenderer {
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
private static void drawScaledText(DrawContext context, Text text, int centerX, int y, int color, TextRenderer textRenderer){
|
||||
MatrixStack stack = context.getMatrices();
|
||||
stack.push();
|
||||
|
||||
Reference in New Issue
Block a user