moved code to new structure
This commit is contained in:
41
src/main/java/de/steev/bm/Manager/PlayerManager.java
Normal file
41
src/main/java/de/steev/bm/Manager/PlayerManager.java
Normal file
@ -0,0 +1,41 @@
|
||||
package de.steev.bm.Manager;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* houses all functions controlling players
|
||||
*/
|
||||
public class PlayerManager {
|
||||
|
||||
private GameManager gameManager;
|
||||
|
||||
/**
|
||||
* initilizes a player manager
|
||||
* @param gameManager the Gamemanager reference
|
||||
*/
|
||||
public PlayerManager(GameManager gameManager) {
|
||||
this.gameManager = gameManager;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
|
||||
/**
|
||||
* gives a player a given itemstack
|
||||
* @param player the players reference
|
||||
* @param itemStack the items the player should receive
|
||||
*/
|
||||
public void givePlayerItems(Player player, ItemStack itemStack){
|
||||
player.getInventory().addItem(itemStack);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user