diff --git a/build.gradle b/build.gradle
index 3737e495..ea3f2e90 100644
--- a/build.gradle
+++ b/build.gradle
@@ -13,7 +13,7 @@ group = project.maven_group
loom {
accessWidenerPath = file("src/main/resources/carpet.accesswidener")
- runtimeOnlyLog4j = false // Can be turned on after TriConsumer is no longer present in public API
+ runtimeOnlyLog4j = true
}
dependencies {
diff --git a/src/main/java/carpet/settings/SettingsManager.java b/src/main/java/carpet/settings/SettingsManager.java
index d2c0760d..ed2dbd95 100644
--- a/src/main/java/carpet/settings/SettingsManager.java
+++ b/src/main/java/carpet/settings/SettingsManager.java
@@ -1,8 +1,6 @@
package carpet.settings;
import carpet.CarpetServer;
-import carpet.CarpetSettings;
-import carpet.api.settings.CarpetRule;
import carpet.utils.CommandHelper;
import com.mojang.brigadier.CommandDispatcher;
import net.minecraft.commands.CommandBuildContext;
@@ -10,7 +8,6 @@ import net.minecraft.commands.CommandSourceStack;
import net.minecraft.core.RegistryAccess;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.flag.FeatureFlags;
-import org.apache.logging.log4j.util.TriConsumer;
import java.util.Collection;
import java.util.List;
@@ -22,12 +19,6 @@ import java.util.List;
@SuppressWarnings("removal") // Gradle needs the explicit suppression
public class SettingsManager extends carpet.api.settings.SettingsManager
{
- /**
- * @deprecated Use {@link #locked()} instead
- */
- @Deprecated(forRemoval = true) //to private (or protected?)
- public boolean locked;
-
/**
* Creates a new {@link SettingsManager} without a fancy name.
* @see #SettingsManager(String, String, String)
@@ -57,61 +48,6 @@ public class SettingsManager extends carpet.api.settings.SettingsManager
super(version, identifier, fancyName);
}
- /**
- *
Adds a custom rule observer to changes in rules from
- * this specific {@link SettingsManager} instance.
- *
- * This outdated method may not be able to listen to all {@link CarpetRule} implementations
- *
- * @see SettingsManager#registerGlobalRuleObserver(RuleObserver)
- *
- * @param observer A {@link TriConsumer} that will be called with
- * the used {@link CommandSourceStack}, the changed
- * {@link ParsedRule} and a {@link String} being the
- * value that the user typed.
- * @deprecated Use {@link SettingsManager#registerRuleObserver(RuleObserver)} instead.
- */
- @Deprecated(forRemoval = true) //to remove
- public void addRuleObserver(TriConsumer, String> observer)
- {
- registerRuleObserver((source, rule, stringValue) -> {
- if (rule instanceof ParsedRule> pr)
- observer.accept(source, pr, stringValue);
- else
- CarpetSettings.LOG.warn("Failed to notify observer '" + observer.getClass().getName() + "' about rule change");
- });
- CarpetSettings.LOG.warn("""
- Extension added outdated rule observer, this is deprecated and will crash in later carpet versions \
- (way before the rest of the old settings api because of relying on log4j)!
- The observer class name is '%s'""".formatted(observer.getClass().getName()));
- }
-
- /**
- * Adds a custom rule observer to changes in rules from
- * any registered {@link SettingsManager} instance.
- * @see SettingsManager#addRuleObserver(TriConsumer)
- *
- * @param observer A {@link TriConsumer} that will be called with
- * the used {@link CommandSourceStack}, the changed
- * {@link ParsedRule} and a {@link String} being the
- * value that the user typed.
- * @deprecated Use {@link SettingsManager#registerRuleObserver(RuleObserver)} instead, given this one can't deal with {@link CarpetRule}
- */
- @Deprecated(forRemoval = true) // to remove. This isn't really used anywhere
- public static void addGlobalRuleObserver(TriConsumer, String> observer)
- {
- registerGlobalRuleObserver((source, rule, stringValue) -> {
- if (rule instanceof ParsedRule> pr)
- observer.accept(source, pr, stringValue);
- else
- CarpetSettings.LOG.warn("Failed to notify observer '" + observer.getClass().getName() + "' about rule change");
- });
- CarpetSettings.LOG.warn("""
- Extension added outdated rule observer, this is deprecated and will crash in later carpet versions \
- (way before the rest of the old settings api because of relying on log4j)!
- The observer class name is '%s'""".formatted(observer.getClass().getName()));
- }
-
/**
* @deprecated Use {@link #identifier()} instead
*/
@@ -178,34 +114,6 @@ public class SettingsManager extends carpet.api.settings.SettingsManager
return CommandHelper.canUseCommand(source, commandLevel);
}
- /**
- * @param commandLevel A {@link String} being a permission level according to
- * Carpet's standard for permissions (either 0-4, a {@link boolean},
- * or "ops".
- * @return An {@link int} with the translated Vanilla permission level
- *
- * @deprecated While there's not an API replacement for this (at least yet),
- * you can use the similar {@link CommandHelper#canUseCommand(CommandSourceStack, Object)} instead
- * @apiNote Note that this method returns {@code 2} for {@code false} and {@code 0} for {@code true}.
- * You probably want to use {@link #canUseCommand(CommandSourceStack, Object)}e
- */
- @Deprecated(forRemoval = true)
- public static int getCommandLevel(String commandLevel)
- {
- switch (commandLevel)
- {
- case "true": return 2;
- case "false": return 0;
- case "ops": return 2; // typical for other cheaty commands
- case "0":
- case "1":
- case "2":
- case "3":
- case "4":
- return Integer.parseInt(commandLevel);
- }
- return 0;
- }
@Deprecated(forRemoval = true)
public void registerCommand(CommandDispatcher dispatcher)
{