mirror of
https://github.com/lukasabbe/bookshelf-inspector.git
synced 2026-04-30 10:40:53 +00:00
1.21.9 but without cloth-config
This commit is contained in:
-7
@@ -7,14 +7,7 @@ public interface IPlatformHelper {
|
||||
|
||||
boolean isModLoaded(String modId);
|
||||
|
||||
boolean isDevelopmentEnvironment();
|
||||
|
||||
Path getConfigPath(String file);
|
||||
|
||||
Path getFileInModContainer(String mod, String fileName);
|
||||
|
||||
default String getEnvironmentName() {
|
||||
|
||||
return isDevelopmentEnvironment() ? "development" : "production";
|
||||
}
|
||||
}
|
||||
-6
@@ -19,12 +19,6 @@ public class FabricPlatformHelper implements IPlatformHelper {
|
||||
return FabricLoader.getInstance().isModLoaded(modId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDevelopmentEnvironment() {
|
||||
|
||||
return FabricLoader.getInstance().isDevelopmentEnvironment();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path getConfigPath(String file) {
|
||||
return FabricLoader.getInstance().getConfigDir().resolve(file);
|
||||
|
||||
+6
-6
@@ -1,29 +1,29 @@
|
||||
version=2.1+1.21.9-rc1
|
||||
version=2.1+1.21.9-Beta.1
|
||||
group=com.lukasabbe.bookshelfinspector
|
||||
java_version=21
|
||||
|
||||
# Common
|
||||
minecraft_version=1.21.9-rc1
|
||||
minecraft_version=1.21.9
|
||||
mod_name=BookshelfInspector
|
||||
mod_author=Lukasabbe
|
||||
mod_id=bookshelfinspector
|
||||
license=MIT
|
||||
credits=
|
||||
description=Inspect any book in a chiseled bookshelf.
|
||||
minecraft_version_range=[1.21.8, 1.22)
|
||||
minecraft_version_range=[1.21.9, 1.22)
|
||||
|
||||
# https://projects.neoforged.net/neoforged/neoform
|
||||
neo_form_version=1.21.9-rc1-20250925.142447
|
||||
neo_form_version=1.21.9-20250930.151910
|
||||
# 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.133.13+1.21.9
|
||||
fabric_version=0.133.14+1.21.9
|
||||
fabric_loader_version=0.17.2
|
||||
|
||||
# NeoForge
|
||||
neoforge_version=21.8.47
|
||||
neoforge_version=21.9.0-beta
|
||||
neoforge_loader_version_range=[4,)
|
||||
|
||||
# Gradle
|
||||
|
||||
@@ -18,7 +18,7 @@ neoForge {
|
||||
mappingsVersion = parchment_version
|
||||
}
|
||||
dependencies {
|
||||
api "me.shedaniel.cloth:cloth-config-neoforge:${cloth_config}"
|
||||
//api "me.shedaniel.cloth:cloth-config-neoforge:${cloth_config}"
|
||||
}
|
||||
|
||||
runs {
|
||||
|
||||
+1
-4
@@ -1,18 +1,15 @@
|
||||
package com.lukasabbe.bookshelfinspector;
|
||||
|
||||
import com.lukasabbe.bookshelfinspector.config.ClothConfigGenerator;
|
||||
import com.lukasabbe.bookshelfinspector.util.EventHandler;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.bus.api.IEventBus;
|
||||
import net.neoforged.fml.ModLoadingContext;
|
||||
import net.neoforged.fml.common.Mod;
|
||||
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
|
||||
|
||||
@Mod(value = Constants.MOD_ID, dist = Dist.CLIENT)
|
||||
public class BookshelfInspectorNeoForgeClient {
|
||||
public BookshelfInspectorNeoForgeClient(IEventBus bus) {
|
||||
EventHandler.initClient();
|
||||
BookshelfInspectorClient.clientInit();
|
||||
ModLoadingContext.get().registerExtensionPoint(IConfigScreenFactory.class, () -> (client, parent) -> ClothConfigGenerator.createConfig(parent));
|
||||
//ModLoadingContext.get().registerExtensionPoint(IConfigScreenFactory.class, () -> (client, parent) -> ClothConfigGenerator.createConfig(parent));
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
package com.lukasabbe.bookshelfinspector.config;
|
||||
|
||||
import com.lukasabbe.bookshelfinspector.BookshelfInspectorClient;
|
||||
@@ -37,3 +38,4 @@ public class ClothConfigGenerator {
|
||||
return builder.build();
|
||||
}
|
||||
}
|
||||
*/
|
||||
+2
-8
@@ -8,6 +8,7 @@ import net.neoforged.fml.loading.FMLLoader;
|
||||
import net.neoforged.fml.loading.FMLPaths;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
public class NeoForgePlatformHelper implements IPlatformHelper {
|
||||
|
||||
@@ -19,16 +20,9 @@ public class NeoForgePlatformHelper implements IPlatformHelper {
|
||||
|
||||
@Override
|
||||
public boolean isModLoaded(String modId) {
|
||||
|
||||
return ModList.get().isLoaded(modId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDevelopmentEnvironment() {
|
||||
|
||||
return !FMLLoader.isProduction();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Path getConfigPath(String file) {
|
||||
return FMLPaths.CONFIGDIR.get().resolve(file);
|
||||
@@ -38,6 +32,6 @@ public class NeoForgePlatformHelper implements IPlatformHelper {
|
||||
public Path getFileInModContainer(String mod, String fileName) {
|
||||
if(ModList.get().getModContainerById(mod).isEmpty()) return null;
|
||||
ModContainer container = ModList.get().getModContainerById(mod).get();
|
||||
return container.getModInfo().getOwningFile().getFile().findResource(fileName);
|
||||
return Paths.get(container.getModInfo().getOwningFile().getFile().getContents().findFile(fileName).get());
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class EventHandler {
|
||||
public static void initServer(){ NeoForge.EVENT_BUS.addListener(EventHandler::onJoin); }
|
||||
|
||||
private static void onJoin(PlayerEvent.PlayerLoggedInEvent event){
|
||||
playerJoinEvents.forEach(onPlayerJoinEvent -> onPlayerJoinEvent.onPlayerJoin((ServerPlayer) event.getEntity(),event.getEntity().getServer()));
|
||||
playerJoinEvents.forEach(onPlayerJoinEvent -> onPlayerJoinEvent.onPlayerJoin((ServerPlayer) event.getEntity(), ((ServerPlayer)event.getEntity()).level().getServer()));
|
||||
}
|
||||
|
||||
private static void onDisconnect(ClientPlayerNetworkEvent.LoggingOut event){
|
||||
|
||||
Reference in New Issue
Block a user