fix merge conflict

This commit is contained in:
Deauthorized 2024-05-06 15:34:18 -04:00 committed by GitHub
parent 5c609b3d8f
commit 52cc738d4d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -13,17 +13,7 @@ import dev.plex.util.BungeeUtil;
import dev.plex.util.PlexLog; import dev.plex.util.PlexLog;
import dev.plex.util.PlexUtils; import dev.plex.util.PlexUtils;
import dev.plex.util.TimeUtils; import dev.plex.util.TimeUtils;
import java.time.Instant;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import net.kyori.adventure.text.Component; import net.kyori.adventure.text.Component;
import network.darkhelmet.prism.api.PrismParameters;
import network.darkhelmet.prism.api.Result;
import network.darkhelmet.prism.api.actions.PrismProcessType;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -31,7 +21,12 @@ import org.bukkit.entity.Player;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
@CommandParameters(name = "ban", usage = "/<command> <player> [reason] [-nrb]", aliases = "offlineban,gtfo", description = "Bans a player, offline or online") import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Collections;
import java.util.List;
@CommandParameters(name = "ban", usage = "/<command> <player> [reason] [-rb]", aliases = "offlineban,gtfo", description = "Bans a player, offline or online")
@CommandPermissions(permission = "plex.ban", source = RequiredCommandSource.ANY) @CommandPermissions(permission = "plex.ban", source = RequiredCommandSource.ANY)
public class BanCMD extends PlexCommand public class BanCMD extends PlexCommand
@ -63,13 +58,13 @@ public class BanCMD extends PlexCommand
String reason; String reason;
Punishment punishment = new Punishment(plexPlayer.getUuid(), getUUID(sender)); Punishment punishment = new Punishment(plexPlayer.getUuid(), getUUID(sender));
punishment.setType(PunishmentType.BAN); punishment.setType(PunishmentType.BAN);
boolean rollBack = true; boolean rollBack = false;
if (args.length > 1) if (args.length > 1)
{ {
reason = StringUtils.join(args, " ", 1, args.length); reason = StringUtils.join(args, " ", 1, args.length);
String newReason = StringUtils.normalizeSpace(reason.replace("-nrb", "")); String newReason = StringUtils.normalizeSpace(reason.replace("-nrb", ""));
punishment.setReason(newReason.trim().isEmpty() ? messageString("noReasonProvided") : newReason); punishment.setReason(newReason.trim().isEmpty() ? messageString("noReasonProvided") : newReason);
rollBack = !reason.startsWith("-nrb") && !reason.endsWith("-nrb"); rollBack = reason.startsWith("-rb") || reason.endsWith("-rb");
} }
else else
{ {
@ -94,7 +89,7 @@ public class BanCMD extends PlexCommand
if (rollBack) if (rollBack)
{ {
if (plugin.getPrismHook() != null && plugin.getPrismHook().hasPrism()) /*if (plugin.getPrismHook() != null && plugin.getPrismHook().hasPrism())
{ {
PrismParameters parameters = plugin.getPrismHook().prismApi().createParameters(); PrismParameters parameters = plugin.getPrismHook().prismApi().createParameters();
parameters.addActionType("block-place"); parameters.addActionType("block-place");
@ -119,10 +114,10 @@ public class BanCMD extends PlexCommand
} }
}); });
} }
else if (plugin.getCoreProtectHook() != null && plugin.getCoreProtectHook().hasCoreProtect()) else */
if (plugin.getCoreProtectHook() != null && plugin.getCoreProtectHook().hasCoreProtect())
{ {
PlexLog.debug("Testing coreprotect"); Bukkit.getAsyncScheduler().runNow(plugin, scheduledTask ->
Bukkit.getGlobalRegionScheduler().run(plugin, scheduledTask ->
{ {
plugin.getCoreProtectHook().coreProtectAPI().performRollback(86400, Collections.singletonList(plexPlayer.getName()), null, null, null, null, 0, null); plugin.getCoreProtectHook().coreProtectAPI().performRollback(86400, Collections.singletonList(plexPlayer.getName()), null, null, null, null, 0, null);
}); });