various fixes, better worldhandling
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package eu.mhsl.craftattack.worldmuseum.items;
|
||||
|
||||
import eu.mhsl.craftattack.worldmuseum.worlds.World;
|
||||
import eu.mhsl.craftattack.worldmuseum.worlds.WorldManager;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.minestom.server.inventory.Inventory;
|
||||
import net.minestom.server.inventory.InventoryType;
|
||||
import net.minestom.server.item.ItemStack;
|
||||
import net.minestom.server.item.Material;
|
||||
public class CompassManager {
|
||||
static CompassManager instance;
|
||||
ItemStack compass;
|
||||
Inventory inventory;
|
||||
public static CompassManager getInstance() {
|
||||
if (instance == null) instance = new CompassManager();
|
||||
return instance;
|
||||
}
|
||||
public void loadCommpassManager() {
|
||||
compass = ItemStack.builder(Material.COMPASS).displayName(Component.text("World-changer")).build();
|
||||
inventory = new Inventory(InventoryType.CHEST_1_ROW, Component.text("World-changer"));
|
||||
|
||||
for (World w : WorldManager.getInstance().getWorlds()) {
|
||||
inventory.addItemStack(w.getItem());
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack getCompass() {
|
||||
return compass;
|
||||
}
|
||||
|
||||
public Inventory getInventory() {
|
||||
return inventory;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user