SteamWar/BauSystem2.0
Archiviert
12
0

Move WorldEditUtils
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2022-09-09 17:10:43 +02:00
Ursprung ac9b75e009
Commit 8bdc9c69d8
5 geänderte Dateien mit 18 neuen und 8 gelöschten Zeilen

Datei anzeigen

@ -20,7 +20,7 @@
package de.steamwar.bausystem.features.slaves.laufbau;
import com.sk89q.worldedit.EditSession;
import de.steamwar.bausystem.features.slaves.WorldEditUtils;
import de.steamwar.bausystem.utils.WorldEditUtils;
import de.steamwar.bausystem.features.slaves.laufbau.states.*;
import lombok.Getter;
import org.bukkit.Location;
@ -28,8 +28,6 @@ import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.util.Vector;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;

Datei anzeigen

@ -22,7 +22,7 @@ package de.steamwar.bausystem.features.slaves.laufbau;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.features.slaves.WorldEditUtils;
import de.steamwar.bausystem.utils.WorldEditUtils;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.bausystem.shared.Pair;

Datei anzeigen

@ -23,7 +23,7 @@ import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.world.block.BaseBlock;
import com.sk89q.worldedit.world.block.BlockTypes;
import de.steamwar.bausystem.features.slaves.WorldEditUtils;
import de.steamwar.bausystem.utils.WorldEditUtils;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.LinkageUtils;
import lombok.Getter;

Datei anzeigen

@ -22,7 +22,7 @@ package de.steamwar.bausystem.features.slaves.panzern;
import de.steamwar.bausystem.BauSystem;
import de.steamwar.bausystem.Permission;
import de.steamwar.bausystem.SWUtils;
import de.steamwar.bausystem.features.slaves.WorldEditUtils;
import de.steamwar.bausystem.utils.WorldEditUtils;
import de.steamwar.bausystem.linkage.LinkageType;
import de.steamwar.bausystem.linkage.Linked;
import de.steamwar.bausystem.shared.Pair;

Datei anzeigen

@ -1,7 +1,7 @@
/*
* This file is a part of the SteamWar software.
*
* Copyright (C) 2021 SteamWar.de-Serverteam
* Copyright (C) 2022 SteamWar.de-Serverteam
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@ -17,7 +17,7 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package de.steamwar.bausystem.features.slaves;
package de.steamwar.bausystem.utils;
import com.sk89q.worldedit.EditSession;
import com.sk89q.worldedit.IncompleteRegionException;
@ -26,11 +26,14 @@ import com.sk89q.worldedit.bukkit.BukkitAdapter;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.regions.RegionSelector;
import de.steamwar.bausystem.shared.Pair;
import lombok.SneakyThrows;
import lombok.experimental.UtilityClass;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import java.util.Iterator;
@UtilityClass
public class WorldEditUtils {
@ -42,6 +45,15 @@ public class WorldEditUtils {
WorldEdit.getInstance().getSessionManager().get(BukkitAdapter.adapt(player)).remember(editSession);
}
@SneakyThrows
public Iterator<BlockVector3> getSelectionIterator(Player player) {
RegionSelector regionSelector = WorldEdit.getInstance()
.getSessionManager()
.get(BukkitAdapter.adapt(player))
.getRegionSelector(BukkitAdapter.adapt(player.getWorld()));
return regionSelector.getRegion().iterator();
}
public Pair<Location, Location> getSelection(Player player) {
RegionSelector regionSelector = WorldEdit.getInstance()
.getSessionManager()