移植cloth config适配
This commit is contained in:
parent
32a5b41cca
commit
8b50a729b8
10 changed files with 252 additions and 19 deletions
|
@ -133,9 +133,9 @@ dependencies {
|
||||||
runtimeOnly "mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}"
|
runtimeOnly "mezz.jei:jei-${minecraft_version}-neoforge:${jei_version}"
|
||||||
implementation "curse.maven:jade-324717:6291517"
|
implementation "curse.maven:jade-324717:6291517"
|
||||||
|
|
||||||
// // Cloth Config相关
|
// Cloth Config相关
|
||||||
// implementation fg.deobf("me.shedaniel.cloth:cloth-config-forge:${cloth_config_version}")
|
implementation "me.shedaniel.cloth:cloth-config-neoforge:15.0.140"
|
||||||
//
|
|
||||||
// // 测试用mod
|
// // 测试用mod
|
||||||
// implementation fg.deobf("curse.maven:oculus-581495:6020952")
|
// implementation fg.deobf("curse.maven:oculus-581495:6020952")
|
||||||
// implementation fg.deobf("curse.maven:embeddium-908741:5681725")
|
// implementation fg.deobf("curse.maven:embeddium-908741:5681725")
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.atsuishio.superbwarfare;
|
package com.atsuishio.superbwarfare;
|
||||||
|
|
||||||
import com.atsuishio.superbwarfare.client.MouseMovementHandler;
|
import com.atsuishio.superbwarfare.client.MouseMovementHandler;
|
||||||
|
import com.atsuishio.superbwarfare.compat.CompatHolder;
|
||||||
|
import com.atsuishio.superbwarfare.compat.clothconfig.ClothConfigHelper;
|
||||||
import com.atsuishio.superbwarfare.component.ModDataComponents;
|
import com.atsuishio.superbwarfare.component.ModDataComponents;
|
||||||
import com.atsuishio.superbwarfare.config.ClientConfig;
|
import com.atsuishio.superbwarfare.config.ClientConfig;
|
||||||
import com.atsuishio.superbwarfare.config.CommonConfig;
|
import com.atsuishio.superbwarfare.config.CommonConfig;
|
||||||
|
@ -8,11 +10,13 @@ import com.atsuishio.superbwarfare.config.ServerConfig;
|
||||||
import com.atsuishio.superbwarfare.init.*;
|
import com.atsuishio.superbwarfare.init.*;
|
||||||
import com.atsuishio.superbwarfare.network.NetworkRegistry;
|
import com.atsuishio.superbwarfare.network.NetworkRegistry;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.bus.api.IEventBus;
|
import net.neoforged.bus.api.IEventBus;
|
||||||
import net.neoforged.bus.api.SubscribeEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
import net.neoforged.fml.ModContainer;
|
import net.neoforged.fml.ModContainer;
|
||||||
import net.neoforged.fml.config.ModConfig;
|
import net.neoforged.fml.config.ModConfig;
|
||||||
import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent;
|
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.event.ClientTickEvent;
|
||||||
import net.neoforged.neoforge.common.NeoForge;
|
import net.neoforged.neoforge.common.NeoForge;
|
||||||
import net.neoforged.neoforge.event.tick.ServerTickEvent;
|
import net.neoforged.neoforge.event.tick.ServerTickEvent;
|
||||||
|
@ -58,12 +62,15 @@ public class Mod {
|
||||||
ModCriteriaTriggers.REGISTRY.register(bus);
|
ModCriteriaTriggers.REGISTRY.register(bus);
|
||||||
ModAttachments.ATTACHMENT_TYPES.register(bus);
|
ModAttachments.ATTACHMENT_TYPES.register(bus);
|
||||||
|
|
||||||
// bus.addListener(this::onCommonSetup);
|
|
||||||
bus.addListener(this::onClientSetup);
|
bus.addListener(this::onClientSetup);
|
||||||
bus.addListener(ModItems::registerDispenserBehavior);
|
bus.addListener(ModItems::registerDispenserBehavior);
|
||||||
|
|
||||||
bus.addListener(NetworkRegistry::register);
|
bus.addListener(NetworkRegistry::register);
|
||||||
|
|
||||||
|
if (FMLEnvironment.dist == Dist.CLIENT) {
|
||||||
|
CompatHolder.hasMod(CompatHolder.CLOTH_CONFIG, ClothConfigHelper::registerScreen);
|
||||||
|
}
|
||||||
|
|
||||||
NeoForge.EVENT_BUS.register(this);
|
NeoForge.EVENT_BUS.register(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.atsuishio.superbwarfare.client;
|
package com.atsuishio.superbwarfare.client;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.compat.CompatHolder;
|
||||||
|
import com.atsuishio.superbwarfare.compat.clothconfig.ClothConfigHelper;
|
||||||
import com.atsuishio.superbwarfare.config.client.ReloadConfig;
|
import com.atsuishio.superbwarfare.config.client.ReloadConfig;
|
||||||
import com.atsuishio.superbwarfare.entity.MortarEntity;
|
import com.atsuishio.superbwarfare.entity.MortarEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
|
import com.atsuishio.superbwarfare.entity.vehicle.base.ArmedVehicleEntity;
|
||||||
|
@ -15,6 +17,7 @@ import com.atsuishio.superbwarfare.tools.NBTTool;
|
||||||
import com.atsuishio.superbwarfare.tools.SeekTool;
|
import com.atsuishio.superbwarfare.tools.SeekTool;
|
||||||
import com.atsuishio.superbwarfare.tools.TraceTool;
|
import com.atsuishio.superbwarfare.tools.TraceTool;
|
||||||
import com.mojang.blaze3d.platform.InputConstants;
|
import com.mojang.blaze3d.platform.InputConstants;
|
||||||
|
import net.minecraft.ChatFormatting;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.screens.Screen;
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
import net.minecraft.core.component.DataComponents;
|
import net.minecraft.core.component.DataComponents;
|
||||||
|
@ -29,6 +32,7 @@ import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
import net.neoforged.api.distmarker.Dist;
|
import net.neoforged.api.distmarker.Dist;
|
||||||
import net.neoforged.bus.api.SubscribeEvent;
|
import net.neoforged.bus.api.SubscribeEvent;
|
||||||
|
import net.neoforged.fml.ModList;
|
||||||
import net.neoforged.fml.common.EventBusSubscriber;
|
import net.neoforged.fml.common.EventBusSubscriber;
|
||||||
import net.neoforged.neoforge.client.event.InputEvent;
|
import net.neoforged.neoforge.client.event.InputEvent;
|
||||||
import net.neoforged.neoforge.client.settings.KeyConflictContext;
|
import net.neoforged.neoforge.client.settings.KeyConflictContext;
|
||||||
|
@ -204,10 +208,9 @@ public class ClickHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO do we need cloth config?
|
if (key == ModKeyMappings.CONFIG.getKey().getValue() && ModKeyMappings.CONFIG.getKeyModifier().isActive(KeyConflictContext.IN_GAME)) {
|
||||||
// if (key == ModKeyMappings.CONFIG.getKey().getValue() && ModKeyMappings.CONFIG.getKeyModifier().isActive(KeyConflictContext.IN_GAME)) {
|
handleConfigScreen(player);
|
||||||
// handleConfigScreen(player);
|
}
|
||||||
// }
|
|
||||||
|
|
||||||
if (key == ModKeyMappings.RELOAD.getKey().getValue()) {
|
if (key == ModKeyMappings.RELOAD.getKey().getValue()) {
|
||||||
ClientEventHandler.burstFireAmount = 0;
|
ClientEventHandler.burstFireAmount = 0;
|
||||||
|
@ -423,6 +426,14 @@ public class ClickHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void handleConfigScreen(Player player) {
|
||||||
|
if (ModList.get().isLoaded(CompatHolder.CLOTH_CONFIG)) {
|
||||||
|
CompatHolder.hasMod(CompatHolder.CLOTH_CONFIG, () -> Minecraft.getInstance().setScreen(ClothConfigHelper.getConfigScreen(null)));
|
||||||
|
} else {
|
||||||
|
player.displayClientMessage(Component.translatable("tips.superbwarfare.no_cloth_config").withStyle(ChatFormatting.RED), true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static void handleDismountPress(Player player) {
|
private static void handleDismountPress(Player player) {
|
||||||
var vehicle = player.getVehicle();
|
var vehicle = player.getVehicle();
|
||||||
if (!(vehicle instanceof VehicleEntity)) return;
|
if (!(vehicle instanceof VehicleEntity)) return;
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.atsuishio.superbwarfare.compat;
|
package com.atsuishio.superbwarfare.compat;
|
||||||
|
|
||||||
//@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD)
|
import net.neoforged.fml.ModList;
|
||||||
|
|
||||||
public class CompatHolder {
|
public class CompatHolder {
|
||||||
|
|
||||||
public static final String DMV = "dreamaticvoyage";
|
public static final String DMV = "dreamaticvoyage";
|
||||||
|
@ -16,14 +17,9 @@ public class CompatHolder {
|
||||||
// @ObjectHolder(registryName = "minecraft:entity_type", value = VRC + ":rain_shower_butterfly")
|
// @ObjectHolder(registryName = "minecraft:entity_type", value = VRC + ":rain_shower_butterfly")
|
||||||
// public static final EntityType<? extends Projectile> VRC_RAIN_SHOWER_BUTTERFLY = null;
|
// public static final EntityType<? extends Projectile> VRC_RAIN_SHOWER_BUTTERFLY = null;
|
||||||
|
|
||||||
// @SubscribeEvent
|
public static void hasMod(String modid, Runnable runnable) {
|
||||||
// public static void onInterModEnqueue(final InterModEnqueueEvent event) {
|
if (ModList.get().isLoaded(modid)) {
|
||||||
// event.enqueueWork(() -> hasMod(CLOTH_CONFIG, () -> DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> ClothConfigHelper::registerScreen)));
|
runnable.run();
|
||||||
// }
|
}
|
||||||
|
}
|
||||||
// public static void hasMod(String modid, Runnable runnable) {
|
|
||||||
// if (ModList.get().isLoaded(modid)) {
|
|
||||||
// runnable.run();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
package com.atsuishio.superbwarfare.compat.clothconfig;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.compat.clothconfig.client.DisplayClothConfig;
|
||||||
|
import com.atsuishio.superbwarfare.compat.clothconfig.client.KillMessageClothConfig;
|
||||||
|
import com.atsuishio.superbwarfare.compat.clothconfig.client.ReloadClothConfig;
|
||||||
|
import com.atsuishio.superbwarfare.compat.clothconfig.client.VehicleControlClothConfig;
|
||||||
|
import com.atsuishio.superbwarfare.compat.clothconfig.common.GameplayClothConfig;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||||
|
import net.minecraft.client.gui.screens.Screen;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
import net.neoforged.fml.ModLoadingContext;
|
||||||
|
import net.neoforged.neoforge.client.gui.IConfigScreenFactory;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
public class ClothConfigHelper {
|
||||||
|
|
||||||
|
public static ConfigBuilder getConfigBuilder() {
|
||||||
|
ConfigBuilder root = ConfigBuilder.create().setTitle(Component.translatable("config.superbwarfare.title"));
|
||||||
|
root.setGlobalized(true);
|
||||||
|
root.setGlobalizedExpanded(false);
|
||||||
|
ConfigEntryBuilder entryBuilder = root.entryBuilder();
|
||||||
|
|
||||||
|
ReloadClothConfig.init(root, entryBuilder);
|
||||||
|
KillMessageClothConfig.init(root, entryBuilder);
|
||||||
|
DisplayClothConfig.init(root, entryBuilder);
|
||||||
|
VehicleControlClothConfig.init(root, entryBuilder);
|
||||||
|
|
||||||
|
GameplayClothConfig.init(root, entryBuilder);
|
||||||
|
|
||||||
|
return root;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void registerScreen() {
|
||||||
|
ModLoadingContext.get().registerExtensionPoint(IConfigScreenFactory.class, () ->
|
||||||
|
(client, parent) -> getConfigScreen(parent));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Screen getConfigScreen(@Nullable Screen parent) {
|
||||||
|
return ClothConfigHelper.getConfigBuilder().setParentScreen(parent).build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
package com.atsuishio.superbwarfare.compat.clothconfig.client;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.config.client.DisplayConfig;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
|
public class DisplayClothConfig {
|
||||||
|
|
||||||
|
public static void init(ConfigBuilder root, ConfigEntryBuilder entryBuilder) {
|
||||||
|
ConfigCategory category = root.getOrCreateCategory(Component.translatable("config.superbwarfare.client.display"));
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.display.kill_indication"), DisplayConfig.KILL_INDICATION.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(DisplayConfig.KILL_INDICATION::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.kill_indication.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.display.ammo_hud"), DisplayConfig.AMMO_HUD.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(DisplayConfig.AMMO_HUD::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.ammo_hud.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.display.float_cross_hair"), DisplayConfig.FLOAT_CROSS_HAIR.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(DisplayConfig.FLOAT_CROSS_HAIR::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.float_cross_hair.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.display.camera_rotate"), DisplayConfig.CAMERA_ROTATE.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(DisplayConfig.CAMERA_ROTATE::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.camera_rotate.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.display.armor_plate_hud"), DisplayConfig.ARMOR_PLATE_HUD.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(DisplayConfig.ARMOR_PLATE_HUD::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.armor_plate_hud.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.display.stamina_hud"), DisplayConfig.STAMINA_HUD.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(DisplayConfig.STAMINA_HUD::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.display.stamina_hud.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.atsuishio.superbwarfare.compat.clothconfig.client;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.config.client.KillMessageConfig;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
|
public class KillMessageClothConfig {
|
||||||
|
|
||||||
|
public static void init(ConfigBuilder root, ConfigEntryBuilder entryBuilder) {
|
||||||
|
ConfigCategory category = root.getOrCreateCategory(Component.translatable("config.superbwarfare.client.kill_message"));
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.kill_message.show_kill_message"), KillMessageConfig.SHOW_KILL_MESSAGE.get())
|
||||||
|
.setDefaultValue(false)
|
||||||
|
.setSaveConsumer(KillMessageConfig.SHOW_KILL_MESSAGE::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.kill_message.show_kill_message.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startIntField(Component.translatable("config.superbwarfare.client.kill_message.kill_message_count"), KillMessageConfig.KILL_MESSAGE_COUNT.get())
|
||||||
|
.setDefaultValue(5)
|
||||||
|
.setMin(1)
|
||||||
|
.setMax(20)
|
||||||
|
.setSaveConsumer(KillMessageConfig.KILL_MESSAGE_COUNT::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.kill_message.kill_message_count.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.atsuishio.superbwarfare.compat.clothconfig.client;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.config.client.ReloadConfig;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
|
public class ReloadClothConfig {
|
||||||
|
|
||||||
|
public static void init(ConfigBuilder root, ConfigEntryBuilder entryBuilder) {
|
||||||
|
ConfigCategory category = root.getOrCreateCategory(Component.translatable("config.superbwarfare.client.reload"));
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.reload.left_click_reload"), ReloadConfig.LEFT_CLICK_RELOAD.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(ReloadConfig.LEFT_CLICK_RELOAD::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.reload.left_click_reload.des")).build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.atsuishio.superbwarfare.compat.clothconfig.client;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.config.client.VehicleControlConfig;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
|
public class VehicleControlClothConfig {
|
||||||
|
|
||||||
|
|
||||||
|
public static void init(ConfigBuilder root, ConfigEntryBuilder entryBuilder) {
|
||||||
|
ConfigCategory category = root.getOrCreateCategory(Component.translatable("config.superbwarfare.client.vehicle"));
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.client.vehicle.invert_aircraft_control"), VehicleControlConfig.INVERT_AIRCRAFT_CONTROL.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(VehicleControlConfig.INVERT_AIRCRAFT_CONTROL::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.client.vehicle.left_click_reload.des")).build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.atsuishio.superbwarfare.compat.clothconfig.common;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.config.common.GameplayConfig;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigBuilder;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigCategory;
|
||||||
|
import me.shedaniel.clothconfig2.api.ConfigEntryBuilder;
|
||||||
|
import net.minecraft.network.chat.Component;
|
||||||
|
|
||||||
|
public class GameplayClothConfig {
|
||||||
|
|
||||||
|
public static void init(ConfigBuilder root, ConfigEntryBuilder entryBuilder) {
|
||||||
|
ConfigCategory category = root.getOrCreateCategory(Component.translatable("config.superbwarfare.common.gameplay"));
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.common.gameplay.respawn_reload"), GameplayConfig.RESPAWN_RELOAD.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(GameplayConfig.RESPAWN_RELOAD::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.common.gameplay.respawn_reload.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.common.gameplay.global_indication"), GameplayConfig.GLOBAL_INDICATION.get())
|
||||||
|
.setDefaultValue(false)
|
||||||
|
.setSaveConsumer(GameplayConfig.GLOBAL_INDICATION::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.common.gameplay.global_indication.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
|
||||||
|
category.addEntry(entryBuilder
|
||||||
|
.startBooleanToggle(Component.translatable("config.superbwarfare.common.gameplay.respawn_auto_armor"), GameplayConfig.RESPAWN_AUTO_ARMOR.get())
|
||||||
|
.setDefaultValue(true)
|
||||||
|
.setSaveConsumer(GameplayConfig.RESPAWN_AUTO_ARMOR::set)
|
||||||
|
.setTooltip(Component.translatable("config.superbwarfare.common.gameplay.respawn_auto_armor.des"))
|
||||||
|
.build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue