注册nf的config配置页面

This commit is contained in:
17146 2025-04-12 01:49:51 +08:00
parent 19aa60a17f
commit 3a3b857f0d
5 changed files with 8 additions and 15 deletions

View file

@ -8,12 +8,16 @@ import com.atsuishio.superbwarfare.config.ServerConfig;
import com.atsuishio.superbwarfare.init.*;
import com.atsuishio.superbwarfare.network.NetworkRegistry;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.bus.api.IEventBus;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.config.ModConfig;
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
import net.neoforged.fml.loading.FMLEnvironment;
import net.neoforged.neoforge.client.event.ClientTickEvent;
import net.neoforged.neoforge.client.gui.ConfigurationScreen;
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.tick.ServerTickEvent;
import org.apache.logging.log4j.LogManager;
@ -58,12 +62,15 @@ public class Mod {
ModCriteriaTriggers.REGISTRY.register(bus);
ModAttachments.ATTACHMENT_TYPES.register(bus);
// bus.addListener(this::onCommonSetup);
bus.addListener(this::onClientSetup);
bus.addListener(ModItems::registerDispenserBehavior);
bus.addListener(NetworkRegistry::register);
if (FMLEnvironment.dist == Dist.CLIENT) {
container.registerExtensionPoint(IConfigScreenFactory.class, ConfigurationScreen::new);
}
NeoForge.EVENT_BUS.register(this);
}
@ -71,7 +78,6 @@ public class Mod {
return ResourceLocation.fromNamespaceAndPath(MODID, path);
}
private static final Collection<AbstractMap.SimpleEntry<Runnable, Integer>> workQueue = new ConcurrentLinkedQueue<>();
private static final Collection<AbstractMap.SimpleEntry<Runnable, Integer>> workQueueC = new ConcurrentLinkedQueue<>();

View file

@ -201,11 +201,6 @@ public class ClickHandler {
handleDoubleJump(player);
}
// TODO do we need cloth config?
// if (key == ModKeyMappings.CONFIG.getKey().getValue() && ModKeyMappings.CONFIG.getKeyModifier().isActive(KeyConflictContext.IN_GAME)) {
// handleConfigScreen(player);
// }
if (key == ModKeyMappings.RELOAD.getKey().getValue()) {
ClientEventHandler.burstFireAmount = 0;
PacketDistributor.sendToServer(new ReloadMessage(0));

View file

@ -22,9 +22,6 @@ public class ModKeyMappings {
public static final KeyMapping DISMOUNT = new KeyMapping("key.superbwarfare.dismount", GLFW.GLFW_KEY_LEFT_ALT, "key.categories.superbwarfare");
public static final KeyMapping BREATH = new KeyMapping("key.superbwarfare.breath", GLFW.GLFW_KEY_LEFT_CONTROL, "key.categories.superbwarfare");
public static final KeyMapping CONFIG = new KeyMapping("key.superbwarfare.config", KeyConflictContext.IN_GAME,
KeyModifier.ALT, InputConstants.Type.KEYSYM, GLFW.GLFW_KEY_O, "key.categories.superbwarfare");
public static final KeyMapping EDIT_MODE = new KeyMapping("key.superbwarfare.edit_mode", GLFW.GLFW_KEY_H, "key.categories.superbwarfare");
public static final KeyMapping EDIT_SCOPE = new KeyMapping("key.superbwarfare.edit_scope", GLFW.GLFW_KEY_UP, "key.categories.superbwarfare");
public static final KeyMapping EDIT_BARREL = new KeyMapping("key.superbwarfare.edit_barrel", GLFW.GLFW_KEY_LEFT, "key.categories.superbwarfare");
@ -49,7 +46,6 @@ public class ModKeyMappings {
event.register(INTERACT);
event.register(DISMOUNT);
event.register(BREATH);
event.register(CONFIG);
event.register(EDIT_MODE);
event.register(EDIT_SCOPE);
event.register(EDIT_BARREL);

View file

@ -455,7 +455,6 @@
"key.superbwarfare.interact": "Interact",
"key.superbwarfare.dismount": "Dismount",
"key.superbwarfare.breath": "Breathe",
"key.superbwarfare.config": "Open Config Screen",
"key.superbwarfare.edit_mode": "Edit Weapon",
"key.superbwarfare.edit_scope": "Switch Scope",
"key.superbwarfare.edit_barrel": "Switch Barrel",
@ -493,7 +492,6 @@
"tips.superbwarfare.monitor.already_linked": "This monitor has been connected",
"tips.superbwarfare.drone.already_linked": "This device has been connected",
"tips.superbwarfare.monitor.unlinked": "Disconnect",
"tips.superbwarfare.no_cloth_config": "You have not installed Cloth Config API, cannot open the config interface",
"tips.superbwarfare.drone.distance": "DISTANCE:",
"tips.superbwarfare.drone.health": "HEALTH:",
"tips.superbwarfare.drone.ammo": "AMMO:",

View file

@ -453,7 +453,6 @@
"key.superbwarfare.interact": "交互",
"key.superbwarfare.dismount": "离开载具",
"key.superbwarfare.breath": "屏息",
"key.superbwarfare.config": "打开配置界面",
"key.superbwarfare.edit_mode": "改装",
"key.superbwarfare.edit_scope": "切换瞄准镜",
"key.superbwarfare.edit_barrel": "切换枪管配件",
@ -491,7 +490,6 @@
"tips.superbwarfare.monitor.already_linked": "这个遥控器已连接到一个设备!",
"tips.superbwarfare.drone.already_linked": "这个设备已被连接!",
"tips.superbwarfare.monitor.unlinked": "断开连接!",
"tips.superbwarfare.no_cloth_config": "您尚未安装 Cloth Config API无法打开配置界面",
"tips.superbwarfare.drone.distance": "飞手距离:",
"tips.superbwarfare.drone.health": "耐久值:",
"tips.superbwarfare.drone.ammo": "弹药:",