mirror of
https://github.com/SunNetservers/MiniGames.git
synced 2025-12-04 18:08:48 +01:00
Updates README, and allows the un-setting of kill plane and obstacle blocks
This commit is contained in:
@@ -485,8 +485,8 @@ public class ParkourArena implements Arena {
|
||||
*
|
||||
* @param killPlaneBlockNames <p>The names of the blocks that will cause players to lose</p>
|
||||
*/
|
||||
public boolean setKillPlaneBlocks(@NotNull Set<String> killPlaneBlockNames) {
|
||||
if (killPlaneBlockNames.isEmpty()) {
|
||||
public boolean setKillPlaneBlocks(@Nullable Set<String> killPlaneBlockNames) {
|
||||
if (killPlaneBlockNames == null || killPlaneBlockNames.isEmpty()) {
|
||||
this.killPlaneBlockNames = null;
|
||||
this.killPlaneBlocks = null;
|
||||
} else {
|
||||
@@ -507,8 +507,8 @@ public class ParkourArena implements Arena {
|
||||
*
|
||||
* @param obstacleBlockNames <p>The names of the obstacle blocks</p>
|
||||
*/
|
||||
public boolean setObstacleBlocks(@NotNull Set<String> obstacleBlockNames) {
|
||||
if (obstacleBlockNames.isEmpty()) {
|
||||
public boolean setObstacleBlocks(@Nullable Set<String> obstacleBlockNames) {
|
||||
if (obstacleBlockNames == null || obstacleBlockNames.isEmpty()) {
|
||||
this.obstacleBlockNames = null;
|
||||
this.obstacleBlocks = null;
|
||||
} else {
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package net.knarcraft.minigames.command;
|
||||
|
||||
import net.knarcraft.minigames.config.DropperConfiguration;
|
||||
import net.knarcraft.minigames.util.InputValidationHelper;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
@@ -120,9 +122,13 @@ public abstract class EditArenaCommand implements CommandExecutor {
|
||||
* @param input <p>The input string to get as a set</p>
|
||||
* @return <p>The resulting string set</p>
|
||||
*/
|
||||
@NotNull
|
||||
@Nullable
|
||||
protected Set<String> asSet(@NotNull String input) {
|
||||
return new HashSet<>(List.of(input.split(",")));
|
||||
if (InputValidationHelper.isEmptyValue(input)) {
|
||||
return null;
|
||||
} else {
|
||||
return new HashSet<>(List.of(input.split(",")));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user