Skip to content

Commit ccafa5e

Browse files
committed
Remove Server config and change commands to always require op
1 parent 5967d2b commit ccafa5e

File tree

8 files changed

+7
-92
lines changed

8 files changed

+7
-92
lines changed

neoforge-main/src/main/java/dev/compactmods/machines/CompactMachinesCommon.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import dev.compactmods.machines.compat.InterModCompat;
66
import dev.compactmods.machines.feature.CMFeaturePacks;
77
import dev.compactmods.machines.gamerule.CMGameRules;
8-
import dev.compactmods.machines.server.ServerConfig;
98
import dev.compactmods.machines.dimension.Dimension;
109
import dev.compactmods.machines.dimension.WorldBorderFixer;
1110
import dev.compactmods.machines.machine.Machines;
@@ -39,7 +38,6 @@ public CompactMachinesCommon(IEventBus modBus, ModContainer modContainer) {
3938

4039
private static void initConfigs(ModContainer modContainer) {
4140
modContainer.registerConfig(ModConfig.Type.COMMON, CommonConfig.CONFIG);
42-
modContainer.registerConfig(ModConfig.Type.SERVER, ServerConfig.CONFIG);
4341
}
4442

4543
private static void prepare() {

neoforge-main/src/main/java/dev/compactmods/machines/command/CMGiveMachineSubcommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import dev.compactmods.machines.i18n.RoomTranslations;
1111
import dev.compactmods.machines.api.room.template.RoomTemplateHelper;
1212
import dev.compactmods.machines.command.argument.Suggestors;
13-
import dev.compactmods.machines.server.ServerConfig;
1413
import dev.compactmods.machines.machine.Machines;
1514
import net.minecraft.commands.CommandSourceStack;
1615
import net.minecraft.commands.Commands;
@@ -27,7 +26,7 @@ public class CMGiveMachineSubcommand {
2726

2827
public static LiteralArgumentBuilder<CommandSourceStack> make() {
2928
final var subRoot = Commands.literal("give")
30-
.requires(cs -> cs.hasPermission(ServerConfig.giveMachineLevel()));
29+
.requires(cs -> cs.hasPermission(Commands.LEVEL_GAMEMASTERS));
3130

3231

3332
// /cm give new [template]

neoforge-main/src/main/java/dev/compactmods/machines/command/CMRebindSubcommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import dev.compactmods.machines.api.CompactMachines;
88
import dev.compactmods.machines.i18n.MachineTranslations;
99
import dev.compactmods.machines.LoggingUtil;
10-
import dev.compactmods.machines.server.ServerConfig;
1110
import dev.compactmods.machines.machine.block.BoundCompactMachineBlockEntity;
1211
import net.minecraft.commands.CommandSourceStack;
1312
import net.minecraft.commands.Commands;
@@ -17,7 +16,7 @@ public class CMRebindSubcommand {
1716

1817
public static LiteralArgumentBuilder<CommandSourceStack> make() {
1918
final var subRoot = Commands.literal("rebind")
20-
.requires(cs -> cs.hasPermission(ServerConfig.rebindLevel()));
19+
.requires(cs -> cs.hasPermission(Commands.LEVEL_GAMEMASTERS));
2120

2221
subRoot.then(Commands.argument("pos", BlockPosArgument.blockPos())
2322
.then(Commands.argument("bindTo", StringArgumentType.string())

neoforge-main/src/main/java/dev/compactmods/machines/command/CMTeleportSubcommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import dev.compactmods.machines.i18n.RoomTranslations;
1111
import dev.compactmods.machines.api.room.history.RoomEntryPoint;
1212
import dev.compactmods.machines.command.argument.Suggestors;
13-
import dev.compactmods.machines.server.ServerConfig;
1413
import dev.compactmods.machines.room.RoomHelper;
1514
import net.minecraft.commands.CommandSourceStack;
1615
import net.minecraft.commands.Commands;
@@ -25,7 +24,7 @@ public class CMTeleportSubcommand {
2524

2625
public static LiteralArgumentBuilder<CommandSourceStack> make() {
2726
final var subRoot = Commands.literal("tp")
28-
.requires(cs -> cs.hasPermission(ServerConfig.giveMachineLevel()));
27+
.requires(cs -> cs.hasPermission(Commands.LEVEL_GAMEMASTERS));
2928

3029
subRoot.then(Commands.argument("room", StringArgumentType.string())
3130
.suggests(Suggestors.ROOM_CODES)

neoforge-main/src/main/java/dev/compactmods/machines/command/CMUnbindSubcommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import dev.compactmods.machines.LoggingUtil;
77
import dev.compactmods.machines.api.dimension.CompactDimension;
88
import dev.compactmods.machines.i18n.MachineTranslations;
9-
import dev.compactmods.machines.server.ServerConfig;
109
import dev.compactmods.machines.machine.Machines;
1110
import dev.compactmods.machines.machine.block.BoundCompactMachineBlockEntity;
1211
import net.minecraft.commands.CommandSourceStack;
@@ -18,7 +17,7 @@ public class CMUnbindSubcommand {
1817

1918
public static LiteralArgumentBuilder<CommandSourceStack> make() {
2019
final var subRoot = Commands.literal("unbind")
21-
.requires(cs -> cs.hasPermission(ServerConfig.rebindLevel()));
20+
.requires(cs -> cs.hasPermission(Commands.LEVEL_GAMEMASTERS));
2221

2322
subRoot.then(Commands.argument("pos", BlockPosArgument.blockPos())
2423
.executes(CMUnbindSubcommand::doUnbind));

neoforge-main/src/main/java/dev/compactmods/machines/command/RoomUpgradesSubcommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
import dev.compactmods.machines.command.argument.Suggestors;
1111
import dev.compactmods.machines.feature.CMFeatureFlags;
1212
import dev.compactmods.machines.room.upgrade.RoomUpgrades;
13-
import dev.compactmods.machines.server.ServerConfig;
1413
import net.minecraft.commands.CommandSourceStack;
1514
import net.minecraft.commands.Commands;
1615
import net.minecraft.commands.arguments.ResourceLocationArgument;
@@ -27,7 +26,8 @@ public class RoomUpgradesSubcommand {
2726

2827
public static LiteralArgumentBuilder<CommandSourceStack> make() {
2928
final var subRoot = Commands.literal("upgrades")
30-
.requires(cs -> CMFeatureFlags.ROOM_UPGRADES.isSubsetOf(cs.enabledFeatures()) && cs.hasPermission(ServerConfig.giveMachineLevel()));
29+
.requires(cs -> CMFeatureFlags.ROOM_UPGRADES.isSubsetOf(cs.enabledFeatures())
30+
&& cs.hasPermission(Commands.LEVEL_GAMEMASTERS));
3131

3232
// /cm upgrades add [id]
3333
subRoot.then(Commands.literal("add")

neoforge-main/src/main/java/dev/compactmods/machines/command/SpawnSubcommand.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import com.mojang.brigadier.context.CommandContext;
66
import dev.compactmods.machines.api.CompactMachines;
77
import dev.compactmods.machines.i18n.CommandTranslations;
8-
import dev.compactmods.machines.server.ServerConfig;
98
import net.minecraft.commands.CommandSourceStack;
109
import net.minecraft.commands.Commands;
1110
import net.minecraft.network.chat.Component;
@@ -16,7 +15,7 @@ public class SpawnSubcommand {
1615
final var spawnRoot = Commands.literal("spawn");
1716

1817
final var resetSpawn = Commands.literal("reset")
19-
.requires(cs -> cs.hasPermission(ServerConfig.changeRoomSpawn()))
18+
.requires(cs -> cs.hasPermission(Commands.LEVEL_GAMEMASTERS))
2019
.then(Commands.argument("room", StringArgumentType.string())
2120
.executes(SpawnSubcommand::resetRoomSpawn));
2221

neoforge-main/src/main/java/dev/compactmods/machines/server/ServerConfig.java

Lines changed: 0 additions & 78 deletions
This file was deleted.

0 commit comments

Comments
 (0)