moved code from other version to repo

This commit is contained in:
2023-10-05 00:15:20 +02:00
parent 9e70177f87
commit e938d9a829
24 changed files with 1497 additions and 26 deletions

View File

@ -0,0 +1,37 @@
package de.vortexhq.lobby.Manager;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
public class PlayerManager {
private LobbyManager lobbyManager;
public PlayerManager(LobbyManager lobbyManager) {
this.lobbyManager = lobbyManager;
}
/**
* teleports a player to a location
* @param player the wanted player
* @param loc the wanted location
*/
public void teleportPlayer(Player player, Location loc) {
player.teleport(loc);
}
/**
* Moves a player from a server to another
* @param dest the destination
* @param target the player to send
*/
public void moveFromServer(String dest, Player target) {
ByteArrayDataOutput aOut = ByteStreams.newDataOutput();
aOut.writeUTF("Connect");
aOut.writeUTF(dest);
target.sendPluginMessage(this.lobbyManager.getLobby(), "BungeeCord", aOut.toByteArray());
}
}