use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by einTosti.
the class FilteredWorldsInventory method addWorlds.
private void addWorlds(Player player) {
int numWorlds = numOfWorlds(player);
int numInventories = (numWorlds % MAX_WORLDS == 0 ? numWorlds : numWorlds + 1) != 0 ? (numWorlds % MAX_WORLDS == 0 ? numWorlds : numWorlds + 1) : 1;
inventories = new Inventory[numInventories];
Inventory inventory = createInventory(player);
int index = 0;
inventories[index] = inventory;
if (numWorlds == 0) {
inventoryManager.addUrlSkull(inventory, 22, plugin.getString(noWorldsText), "https://textures.minecraft.net/texture/2e3f50ba62cbda3ecf5479b62fedebd61d76589771cc19286bf2745cd71e47c6");
return;
}
int columnWorld = 9, maxColumnWorld = 44;
for (BuildWorld buildWorld : inventoryManager.sortWorlds(worldManager, plugin.getSettingsManager().getSettings(player))) {
if (isValidWorld(player, buildWorld)) {
inventoryManager.addWorldItem(player, inventory, columnWorld++, buildWorld);
}
if (columnWorld > maxColumnWorld) {
columnWorld = 9;
inventory = createInventory(player);
inventories[++index] = inventory;
}
}
}
use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by einTosti.
the class GameRuleInventory method openInventory.
public void openInventory(Player player, BuildWorld buildWorld) {
World bukkitWorld = Bukkit.getWorld(buildWorld.getName());
Inventory inventory = plugin.getGameRules().getInventory(player, bukkitWorld);
fillGuiWithGlass(player, inventory);
player.openInventory(inventory);
}
use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by einTosti.
the class PrivateInventory method addWorldCreateItem.
private void addWorldCreateItem(Inventory inventory, Player player) {
BuildWorld buildWorld = worldManager.getBuildWorld(player.getName());
if (buildWorld != null || !player.hasPermission("buildsystem.create.private")) {
inventoryManager.addGlassPane(plugin, player, inventory, 49);
return;
}
inventoryManager.addUrlSkull(inventory, 49, plugin.getString("private_create_world"), "https://textures.minecraft.net/texture/3edd20be93520949e6ce789dc4f43efaeb28c717ee6bfcbbe02780142f716");
}
use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by einTosti.
the class BuildSystem method reloadConfigData.
public void reloadConfigData(boolean init) {
for (Player pl : Bukkit.getOnlinePlayers()) {
getSettingsManager().stopScoreboard(pl);
}
configValues.setConfigValues();
if (init) {
initVersionedClasses();
worldManager.getBuildWorlds().forEach(BuildWorld::manageUnload);
if (configValues.isScoreboard()) {
getSettingsManager().startScoreboard();
} else {
getSettingsManager().stopScoreboard();
}
}
}
use of com.eintosti.buildsystem.object.world.BuildWorld in project BuildSystem by einTosti.
the class BlockPhysicsListener method onEntityExplode.
@EventHandler
public void onEntityExplode(EntityExplodeEvent event) {
Location location = event.getLocation();
World bukkitWorld = location.getWorld();
BuildWorld buildWorld = worldManager.getBuildWorld(bukkitWorld.getName());
if (buildWorld != null && !buildWorld.isExplosions()) {
event.setCancelled(true);
}
}
Aggregations