Fix powertool toggle checking the wrong key.
@@ -12,7 +12,7 @@ import io.github.nucleuspowered.nucleus.internal.command.AbstractCommand;
import io.github.nucleuspowered.nucleus.internal.command.NucleusParameters;
import io.github.nucleuspowered.nucleus.internal.docgen.annotations.EssentialsEquivalent;
import io.github.nucleuspowered.nucleus.internal.userprefs.UserPreferenceService;
-import io.github.nucleuspowered.nucleus.modules.teleport.TeleportUserPrefKeys;
+import io.github.nucleuspowered.nucleus.modules.powertool.PowertoolUserPreferenceKeys;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.command.args.CommandElement;
@@ -38,11 +38,11 @@ public class TogglePowertoolCommand extends AbstractCommand<Player> {
@Override
public CommandResult executeCommand(Player src, CommandContext args, Cause cause) {
UserPreferenceService ups = getServiceManager().getServiceUnchecked(UserPreferenceService.class);
- boolean keys = ups.get(src.getUniqueId(), TeleportUserPrefKeys.TELEPORT_TARGETABLE).orElse(true);
+ boolean keys = ups.get(src.getUniqueId(), PowertoolUserPreferenceKeys.POWERTOOL_ENABLED).orElse(true);
// If specified - get the key. Else, the inverse of what we have now.
boolean toggle = args.<Boolean>getOne(NucleusParameters.Keys.BOOL).orElse(!keys);
- ups.set(src.getUniqueId(), TeleportUserPrefKeys.TELEPORT_TARGETABLE, toggle);
+ ups.set(src.getUniqueId(), PowertoolUserPreferenceKeys.POWERTOOL_ENABLED, toggle);
sendMessageTo(src, "command.powertool.toggle", getMessageFor(src, toggle ? "standard.enabled" : "standard.disabled"));
return CommandResult.success();
