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:
+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