Spawn Config Option should be there now
Dieser Commit ist enthalten in:
Ursprung
1c1697fd9a
Commit
ac39697dba
@ -26,6 +26,12 @@ import org.bukkit.configuration.serialization.ConfigurationSerialization;
|
|||||||
|
|
||||||
public class Config {
|
public class Config {
|
||||||
|
|
||||||
|
public static double SpawnX = 0;
|
||||||
|
public static double SpawnY = 0;
|
||||||
|
public static double SpawnZ = 0;
|
||||||
|
public static float Pitch = 0;
|
||||||
|
public static float Yaw = 0;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
ConfigurationSerialization.registerClass(Portal.class);
|
ConfigurationSerialization.registerClass(Portal.class);
|
||||||
ConfigurationSerialization.registerClass(Hologram.class);
|
ConfigurationSerialization.registerClass(Hologram.class);
|
||||||
@ -38,12 +44,24 @@ public class Config {
|
|||||||
|
|
||||||
yml.getList("portals", Portal.getPortals());
|
yml.getList("portals", Portal.getPortals());
|
||||||
yml.getList("holograms", Hologram.getHolograms());
|
yml.getList("holograms", Hologram.getHolograms());
|
||||||
|
|
||||||
|
SpawnX = yml.getDouble("SpawnX");
|
||||||
|
SpawnY = yml.getDouble("SpawnY");
|
||||||
|
SpawnZ = yml.getDouble("SpawnZ");
|
||||||
|
Pitch = (float) yml.getDouble("Pitch");
|
||||||
|
Yaw = (float) yml.getDouble("Yaw");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void save() {
|
public void save() {
|
||||||
yml.set("portals", Portal.getPortals());
|
yml.set("portals", Portal.getPortals());
|
||||||
yml.set("holograms", Hologram.getHolograms());
|
yml.set("holograms", Hologram.getHolograms());
|
||||||
|
|
||||||
|
yml.set("SpawnX", 0);
|
||||||
|
yml.set("SpawnY", 0);
|
||||||
|
yml.set("SpawnZ", 0);
|
||||||
|
yml.set("Pitch", 0);
|
||||||
|
yml.set("Yaw", 0);
|
||||||
|
|
||||||
LobbySystem.getPlugin().saveConfig();
|
LobbySystem.getPlugin().saveConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
package de.steamwar.lobby.listener;
|
package de.steamwar.lobby.listener;
|
||||||
|
|
||||||
import de.steamwar.comms.packets.ImALobbyPacket;
|
import de.steamwar.comms.packets.ImALobbyPacket;
|
||||||
|
import de.steamwar.lobby.Config;
|
||||||
import de.steamwar.lobby.LobbySystem;
|
import de.steamwar.lobby.LobbySystem;
|
||||||
import de.steamwar.lobby.inventories.LobbyInventory;
|
import de.steamwar.lobby.inventories.LobbyInventory;
|
||||||
import de.steamwar.lobby.util.LobbyPlayer;
|
import de.steamwar.lobby.util.LobbyPlayer;
|
||||||
@ -42,12 +43,8 @@ public class PlayerConnection extends BasicListener {
|
|||||||
|
|
||||||
player.setGameMode(GameMode.ADVENTURE);
|
player.setGameMode(GameMode.ADVENTURE);
|
||||||
player.setWalkSpeed(0.5f);
|
player.setWalkSpeed(0.5f);
|
||||||
|
|
||||||
LobbyPlayer.getLobbyPlayer(player.getUniqueId()); //initialisiert einen neuen LP falls nicht vorhanden
|
LobbyPlayer.getLobbyPlayer(player.getUniqueId()); //initialisiert einen neuen LP falls nicht vorhanden
|
||||||
|
player.teleport(new Location(Bukkit.getWorlds().get(0), Config.SpawnX, Config.SpawnY, Config.SpawnZ, Config.Yaw, Config.Pitch));
|
||||||
//TODO: Config
|
|
||||||
player.teleport(new Location(Bukkit.getWorlds().get(0), 0, 60, 0, 0, 0));
|
|
||||||
|
|
||||||
player.getInventory().clear();
|
player.getInventory().clear();
|
||||||
LobbyInventory.givePlayerLobbyItems(player);
|
LobbyInventory.givePlayerLobbyItems(player);
|
||||||
player.setGameMode(GameMode.ADVENTURE);
|
player.setGameMode(GameMode.ADVENTURE);
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren