mirror of
https://github.com/lukasabbe/bookshelf-inspector.git
synced 2026-04-30 10:40:53 +00:00
1.21.9 version, :)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
name: build
|
||||
on: [push, pull_request]
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
plugins {
|
||||
// see https://fabricmc.net/develop/ for new versions
|
||||
id 'fabric-loom' version '1.10-SNAPSHOT' apply false
|
||||
id 'fabric-loom' version '1.11-SNAPSHOT' apply false
|
||||
// see https://projects.neoforged.net/neoforged/moddevgradle for new versions
|
||||
id 'net.neoforged.moddev' version '2.0.97' apply false
|
||||
id 'net.neoforged.moddev' version '2.0.107' apply false
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.lukasabbe.bookshelfinspector.mixin;
|
||||
|
||||
import net.minecraft.world.level.block.ChiseledBookShelfBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
import java.util.OptionalInt;
|
||||
|
||||
@Mixin(ChiseledBookShelfBlock.class)
|
||||
public interface BookshelfInvoker {
|
||||
@Invoker("getHitSlot")
|
||||
OptionalInt invokerGetSlotForHitPos(BlockHitResult hit, BlockState state);
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.lukasabbe.bookshelfinspector.mixin;
|
||||
|
||||
import com.lukasabbe.bookshelfinspector.Constants;
|
||||
import com.lukasabbe.bookshelfinspector.renderer.Inspector;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
|
||||
@@ -3,13 +3,11 @@ package com.lukasabbe.bookshelfinspector.renderer;
|
||||
import com.lukasabbe.bookshelfinspector.BookshelfInspectorClient;
|
||||
import com.lukasabbe.bookshelfinspector.data.BookData;
|
||||
import com.lukasabbe.bookshelfinspector.data.Tags;
|
||||
import com.lukasabbe.bookshelfinspector.mixin.BookshelfInvoker;
|
||||
import com.lukasabbe.bookshelfinspector.network.packets.BookShelfInventoryRequestPayload;
|
||||
import com.lukasabbe.bookshelfinspector.network.packets.LecternInventoryRequestPayload;
|
||||
import com.lukasabbe.bookshelfinspector.platform.Services;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.block.Blocks;
|
||||
import net.minecraft.world.level.block.ChiseledBookShelfBlock;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.phys.BlockHitResult;
|
||||
@@ -23,9 +21,9 @@ public class Inspector {
|
||||
public void inspect(Minecraft client){
|
||||
if(!modAvailable) return;
|
||||
|
||||
if(client.cameraEntity == null || client.player == null) return;
|
||||
if(client.getCameraEntity() == null || client.player == null) return;
|
||||
|
||||
HitResult hit = client.cameraEntity.pick(5f,0f,false);
|
||||
HitResult hit = client.getCameraEntity().pick(5f,0f,false);
|
||||
|
||||
//find block hit, if not found block returns
|
||||
final HitResult.Type type = hit.getType();
|
||||
@@ -81,7 +79,7 @@ public class Inspector {
|
||||
|
||||
//Gets index position for a book in the bookshelf
|
||||
ChiseledBookShelfBlock bookshelfBlock = (ChiseledBookShelfBlock) blockState.getBlock();
|
||||
OptionalInt optionalInt = ((BookshelfInvoker)bookshelfBlock).invokerGetSlotForHitPos(blockHitResult,blockState);
|
||||
OptionalInt optionalInt = bookshelfBlock.getHitSlot(blockHitResult, blockState.getValue(ChiseledBookShelfBlock.FACING));
|
||||
|
||||
//if the position is empty, return
|
||||
if(optionalInt.isEmpty()) {
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
],
|
||||
"client": [
|
||||
"BookshelfMixin",
|
||||
"InGameHudMixin",
|
||||
"BookshelfInvoker"
|
||||
"InGameHudMixin"
|
||||
],
|
||||
"server": [],
|
||||
"injectors": {
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ dependencies {
|
||||
modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}"
|
||||
|
||||
modApi "me.shedaniel.cloth:cloth-config-fabric:${project.cloth_config}"
|
||||
modApi "com.terraformersmc:modmenu:${project.mod_menu}"
|
||||
//modApi "com.terraformersmc:modmenu:${project.mod_menu}"
|
||||
|
||||
include(implementation "org.yaml:snakeyaml:${project.YAML_snake}")
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
package com.lukasabbe.bookshelfinspector;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
@@ -40,3 +41,4 @@ public class ModMenu implements ModMenuApi {
|
||||
};
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -20,9 +20,6 @@
|
||||
],
|
||||
"client": [
|
||||
"com.lukasabbe.bookshelfinspector.BookshelfInspectorFabricClient"
|
||||
],
|
||||
"modmenu": [
|
||||
"com.lukasabbe.bookshelfinspector.ModMenu"
|
||||
]
|
||||
},
|
||||
"mixins": [
|
||||
@@ -31,7 +28,7 @@
|
||||
"depends": {
|
||||
"fabricloader": ">=${fabric_loader_version}",
|
||||
"fabric-api": "*",
|
||||
"minecraft": "~${minecraft_version}",
|
||||
"minecraft": "~1.21.9-beta.1",
|
||||
"java": ">=${java_version}"
|
||||
}
|
||||
}
|
||||
|
||||
+7
-6
@@ -1,9 +1,9 @@
|
||||
version=2.1+1.21.8
|
||||
version=2.1+1.21.9-pre1
|
||||
group=com.lukasabbe.bookshelfinspector
|
||||
java_version=21
|
||||
|
||||
# Common
|
||||
minecraft_version=1.21.8
|
||||
minecraft_version=1.21.9-pre1
|
||||
mod_name=BookshelfInspector
|
||||
mod_author=Lukasabbe
|
||||
mod_id=bookshelfinspector
|
||||
@@ -12,17 +12,18 @@ credits=
|
||||
description=Inspect any book in a chiseled bookshelf.
|
||||
minecraft_version_range=[1.21.8, 1.22)
|
||||
|
||||
neo_form_version=1.21.8-20250717.133445
|
||||
# https://projects.neoforged.net/neoforged/neoform
|
||||
neo_form_version=1.21.9-pre1-20250916.160523
|
||||
# The version of ParchmentMC that is used, see https://parchmentmc.org/docs/getting-started#choose-a-version for new versions
|
||||
parchment_minecraft=1.21.8
|
||||
parchment_version=2025.07.20
|
||||
|
||||
# Fabric
|
||||
fabric_version=0.132.0+1.21.8
|
||||
fabric_version=0.133.7+1.21.9
|
||||
fabric_loader_version=0.17.2
|
||||
|
||||
# NeoForge
|
||||
neoforge_version=21.8.39
|
||||
neoforge_version=21.8.47
|
||||
neoforge_loader_version_range=[4,)
|
||||
|
||||
# Gradle
|
||||
@@ -32,4 +33,4 @@ org.gradle.daemon=false
|
||||
# Global dep
|
||||
YAML_snake=2.4
|
||||
cloth_config=19.0.147
|
||||
mod_menu=15.0.0-beta.3
|
||||
mod_menu=15.0.0
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
||||
+10
-2
@@ -3,6 +3,12 @@ pluginManagement {
|
||||
gradlePluginPortal()
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
name = 'Fabric'
|
||||
url = uri('https://maven.fabricmc.net')
|
||||
}
|
||||
|
||||
/*
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
@@ -14,7 +20,9 @@ pluginManagement {
|
||||
includeGroup('net.fabricmc')
|
||||
includeGroup('fabric-loom')
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
exclusiveContent {
|
||||
forRepository {
|
||||
maven {
|
||||
@@ -50,4 +58,4 @@ include('common')
|
||||
include('fabric')
|
||||
include('neoforge')
|
||||
|
||||
include 'spigot'
|
||||
// include 'spigot'
|
||||
Reference in New Issue
Block a user