mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-15 17:05:09 +01:00
Fix MidnightConfig command on Forge
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package eu.midnightdust.core;
|
||||
|
||||
import eu.midnightdust.core.config.MidnightLibConfig;
|
||||
import eu.midnightdust.lib.config.AutoCommand;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
|
||||
|
||||
@@ -13,18 +13,12 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = "midnightlib", bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
|
||||
public class MidnightLibEvents {
|
||||
public class MidnightLibClientEvents {
|
||||
@SubscribeEvent
|
||||
public static void registerLayerDefinition(EntityRenderersEvent.RegisterLayerDefinitions event) {
|
||||
event.registerLayerDefinition(WitchHatFeatureRenderer.WITCH_HAT_MODEL_LAYER, WitchHatFeatureRenderer::getTexturedModelData);
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void registerCommands(RegisterCommandsEvent event) {
|
||||
for (LiteralArgumentBuilder<ServerCommandSource> command : AutoCommand.commands){
|
||||
event.getDispatcher().register(command);
|
||||
}
|
||||
}
|
||||
@SubscribeEvent
|
||||
public void registerClientTick(TickEvent.ClientTickEvent event) {
|
||||
MidnightColorUtil.tick();
|
||||
}
|
||||
@@ -33,6 +33,7 @@ public class MidnightLibForge {
|
||||
);
|
||||
ModLoadingContext.get().registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () ->
|
||||
new ConfigScreenHandler.ConfigScreenFactory((client, parent) -> MidnightConfig.getScreen(parent, "midnightlib")));
|
||||
MinecraftForge.EVENT_BUS.register(new MidnightLibEvents());
|
||||
MinecraftForge.EVENT_BUS.register(new MidnightLibClientEvents());
|
||||
MinecraftForge.EVENT_BUS.register(new MidnightLibServerEvents());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package eu.midnightdust.forge;
|
||||
|
||||
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
|
||||
import eu.midnightdust.hats.witch.WitchHatFeatureRenderer;
|
||||
import eu.midnightdust.lib.config.AutoCommand;
|
||||
import eu.midnightdust.lib.util.MidnightColorUtil;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.client.event.EntityRenderersEvent;
|
||||
import net.minecraftforge.event.RegisterCommandsEvent;
|
||||
import net.minecraftforge.event.TickEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
@Mod.EventBusSubscriber(modid = "midnightlib", bus = Mod.EventBusSubscriber.Bus.MOD, value = Dist.DEDICATED_SERVER)
|
||||
public class MidnightLibServerEvents {
|
||||
@SubscribeEvent
|
||||
public void registerCommands(RegisterCommandsEvent event) {
|
||||
for (LiteralArgumentBuilder<ServerCommandSource> command : AutoCommand.commands){
|
||||
event.getDispatcher().register(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ license = "MIT License"
|
||||
modId = "midnightlib"
|
||||
version = "${version}"
|
||||
displayName = "MidnightLib"
|
||||
logoFile = "midnightlib.png"
|
||||
authors = "TeamMidnightDust, Motschen"
|
||||
description = '''
|
||||
Common Library for Team MidnightDust's mods.
|
||||
|
||||
BIN
forge/src/main/resources/midnightlib.png
Normal file
BIN
forge/src/main/resources/midnightlib.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
Reference in New Issue
Block a user