Dieser Commit ist enthalten in:
Ursprung
04e7c5f565
Commit
40dcee6eee
@ -20,6 +20,7 @@
|
||||
package de.steamwar.bausystem.features.warp;
|
||||
|
||||
import de.steamwar.bausystem.worlddata.WorldData;
|
||||
import de.steamwar.core.Core;
|
||||
import lombok.Getter;
|
||||
import org.bukkit.*;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -33,9 +34,9 @@ public class Warp {
|
||||
|
||||
private static Map<String, Warp> warpMap = new HashMap<>();
|
||||
|
||||
static {
|
||||
public static void enable() {
|
||||
Warp worldSpawn = new Warp("WorldSpawn");
|
||||
worldSpawn.setLocation(Bukkit.getWorlds().get(0).getSpawnLocation());
|
||||
worldSpawn.setLocation(Bukkit.getWorlds().get(0).getSpawnLocation().clone().add(0.5, Core.getVersion() == 20 ? 124 : 1, 0.5));
|
||||
worldSpawn.setMat(Material.NETHER_STAR);
|
||||
warpMap.put("WorldSpawn", worldSpawn);
|
||||
}
|
||||
|
@ -147,6 +147,7 @@ public class WarpCommand extends SWCommand implements Disable, Enable {
|
||||
WorldData.getWarpData().forEach((name, yapionAnyType) -> {
|
||||
new Warp(name, (YAPIONObject) yapionAnyType);
|
||||
});
|
||||
Warp.enable();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -79,7 +79,6 @@ public class WarpListener implements Listener {
|
||||
warpEntityServer.put(p, entityServer);
|
||||
|
||||
Vector current = p.getLocation().clone().add(p.getLocation().getDirection().multiply(5)).toVector();
|
||||
current.setY(p.getLocation().getY() - 1);
|
||||
|
||||
Map<String, Location> locations = new HashMap<>();
|
||||
if (sneaking) {
|
||||
@ -110,7 +109,7 @@ public class WarpListener implements Listener {
|
||||
Vector position = p.getLocation().toVector().clone().add(vector.normalize().multiply(5));
|
||||
position.setY(p.getLocation().getY() - 1);
|
||||
|
||||
if (position.distanceSquared(current) < 0.2) {
|
||||
if (position.distanceSquared(current) < 0.1) {
|
||||
name = "§a§l" + name;
|
||||
selected.computeIfAbsent(p, player -> new ArrayList<>()).add(location);
|
||||
}
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren