SteamWar/BauSystem2.0
Archiviert
12
0

Fix Warp and Compass a bit
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-10-16 17:45:18 +02:00
Ursprung 04e7c5f565
Commit 40dcee6eee
3 geänderte Dateien mit 5 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -20,6 +20,7 @@
package de.steamwar.bausystem.features.warp; package de.steamwar.bausystem.features.warp;
import de.steamwar.bausystem.worlddata.WorldData; import de.steamwar.bausystem.worlddata.WorldData;
import de.steamwar.core.Core;
import lombok.Getter; import lombok.Getter;
import org.bukkit.*; import org.bukkit.*;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -33,9 +34,9 @@ public class Warp {
private static Map<String, Warp> warpMap = new HashMap<>(); private static Map<String, Warp> warpMap = new HashMap<>();
static { public static void enable() {
Warp worldSpawn = new Warp("WorldSpawn"); 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); worldSpawn.setMat(Material.NETHER_STAR);
warpMap.put("WorldSpawn", worldSpawn); warpMap.put("WorldSpawn", worldSpawn);
} }

Datei anzeigen

@ -147,6 +147,7 @@ public class WarpCommand extends SWCommand implements Disable, Enable {
WorldData.getWarpData().forEach((name, yapionAnyType) -> { WorldData.getWarpData().forEach((name, yapionAnyType) -> {
new Warp(name, (YAPIONObject) yapionAnyType); new Warp(name, (YAPIONObject) yapionAnyType);
}); });
Warp.enable();
} }
@Override @Override

Datei anzeigen

@ -79,7 +79,6 @@ public class WarpListener implements Listener {
warpEntityServer.put(p, entityServer); warpEntityServer.put(p, entityServer);
Vector current = p.getLocation().clone().add(p.getLocation().getDirection().multiply(5)).toVector(); Vector current = p.getLocation().clone().add(p.getLocation().getDirection().multiply(5)).toVector();
current.setY(p.getLocation().getY() - 1);
Map<String, Location> locations = new HashMap<>(); Map<String, Location> locations = new HashMap<>();
if (sneaking) { if (sneaking) {
@ -110,7 +109,7 @@ public class WarpListener implements Listener {
Vector position = p.getLocation().toVector().clone().add(vector.normalize().multiply(5)); Vector position = p.getLocation().toVector().clone().add(vector.normalize().multiply(5));
position.setY(p.getLocation().getY() - 1); position.setY(p.getLocation().getY() - 1);
if (position.distanceSquared(current) < 0.2) { if (position.distanceSquared(current) < 0.1) {
name = "§a§l" + name; name = "§a§l" + name;
selected.computeIfAbsent(p, player -> new ArrayList<>()).add(location); selected.computeIfAbsent(p, player -> new ArrayList<>()).add(location);
} }