Files
betterminecraft/src/main/java/de/steev/bm/Manager/GameManager.java
2023-10-07 03:09:28 +02:00

65 lines
2.0 KiB
Java

package de.steev.bm.Manager;
import de.steev.bm.BetterMinecraft;
import org.bukkit.Material;
import org.bukkit.entity.Player;
/**
* Gamemanager controlls the plugins game logic
*/
public class GameManager {
private BetterMinecraft plugin;
private RecipyManager recipyManager;
private PlayerManager playerManager;
private ConfigManager configManager;
/**
* initilizes the Gamemanager and all systems beneath it
* @param plugin the plugin reference
*/
public GameManager(BetterMinecraft plugin) {
plugin.getLogger().info("Initializing Gamemanager");
this.plugin = plugin;
this.plugin.getLogger().info("Moving logger to internal plugin reference");
this.plugin.getLogger().info("Initilizing other managers");
this.recipyManager = new RecipyManager(this);
this.playerManager = new PlayerManager(this);
this.configManager = new ConfigManager(this);
if (this.configManager.GetBool("custom_recipes")) {
this.plugin.getLogger().info("registring Recipies");
this.plugin.getLogger().info("saddle");
char[] s_ing = {'L', 'S', 'I', 'W'};
String[] s_rec = {"LLL", "SWS", "I I"};
Material[] s_mat = {Material.LEATHER, Material.STRING, Material.IRON_INGOT, Material.WHITE_WOOL};
this.recipyManager.RegisterNew(s_ing, s_mat, s_rec, 1, Material.SADDLE, "Saddle");
this.plugin.getLogger().info("String");
char[] w_ing = {'W', 'F',};
String[] w_rec = {" W ", "WFW", " W "};
Material[] w_mat = {Material.WHITE_WOOL, Material.FLINT};
this.recipyManager.RegisterNew(w_ing, w_mat, w_rec, 4, Material.STRING, "String");
}
}
public BetterMinecraft getPlugin(){
return plugin;
}
public RecipyManager getRecipyManager() {
return recipyManager;
}
public PlayerManager getPlayerManager() {
return playerManager;
}
public ConfigManager getConfigManager() {
return configManager;
}
}