use of com.eintosti.buildsystem.object.settings.Settings in project BuildSystem by Trichtern.
the class SettingsInventory method getInventory.
private Inventory getInventory(Player player) {
Inventory inventory = Bukkit.createInventory(null, 45, plugin.getString("settings_title"));
fillGuiWithGlass(player, inventory);
Settings settings = settingsManager.getSettings(player);
addDesignItem(inventory, player);
addClearInventoryItem(inventory, player);
addSettingsItem(inventory, 13, XMaterial.DIAMOND_AXE, settings.isDisableInteract(), plugin.getString("settings_disableinteract_item"), plugin.getStringList("settings_disableinteract_lore"));
addSettingsItem(inventory, 14, XMaterial.ENDER_EYE, settings.isHidePlayers(), plugin.getString("settings_hideplayers_item"), plugin.getStringList("settings_hideplayers_lore"));
addSettingsItem(inventory, 15, XMaterial.OAK_SIGN, settings.isInstantPlaceSigns(), plugin.getString("settings_instantplacesigns_item"), plugin.getStringList("settings_instantplacesigns_lore"));
addSettingsItem(inventory, 20, XMaterial.SLIME_BLOCK, settings.isKeepNavigator(), plugin.getString("settings_keep_navigator_item"), plugin.getStringList("settings_keep_navigator_lore"));
addSettingsItem(inventory, 21, configValues.getNavigatorItem(), settings.getNavigatorType().equals(NavigatorType.NEW), plugin.getString("settings_new_navigator_item"), plugin.getStringList("settings_new_navigator_lore"));
addSettingsItem(inventory, 22, XMaterial.GOLDEN_CARROT, settings.isNightVision(), plugin.getString("settings_nightvision_item"), plugin.getStringList("settings_nightvision_lore"));
addSettingsItem(inventory, 23, XMaterial.BRICKS, settings.isNoClip(), plugin.getString("settings_no_clip_item"), plugin.getStringList("settings_no_clip_lore"));
addSettingsItem(inventory, 24, XMaterial.IRON_TRAPDOOR, settings.isTrapDoor(), plugin.getString("settings_open_trapdoors_item"), plugin.getStringList("settings_open_trapdoors_lore"));
addSettingsItem(inventory, 29, XMaterial.FERN, settings.isPlacePlants(), plugin.getString("settings_placeplants_item"), plugin.getStringList("settings_placeplants_lore"));
addSettingsItem(inventory, 30, XMaterial.PAPER, settings.isScoreboard(), configValues.isScoreboard() ? plugin.getString("settings_scoreboard_item") : plugin.getString("settings_scoreboard_disabled_item"), configValues.isScoreboard() ? plugin.getStringList("settings_scoreboard_lore") : plugin.getStringList("settings_scoreboard_disabled_lore"));
addSettingsItem(inventory, 31, getSlabBreakingMaterial(), settings.isSlabBreaking(), plugin.getString("settings_slab_breaking_item"), plugin.getStringList("settings_slab_breaking_lore"));
addSettingsItem(inventory, 32, XMaterial.MAGMA_CREAM, settings.isSpawnTeleport(), plugin.getString("settings_spawnteleport_item"), plugin.getStringList("settings_spawnteleport_lore"));
addWorldSortItem(inventory, player);
return inventory;
}
use of com.eintosti.buildsystem.object.settings.Settings in project BuildSystem by Trichtern.
the class PlayerInventoryClearListener method onPlayerInventoryClear.
@EventHandler
public void onPlayerInventoryClear(PlayerInventoryClearEvent event) {
Player player = event.getPlayer();
Settings settings = settingsManager.getSettings(player);
if (!settings.isKeepNavigator() || !player.hasPermission("buildsystem.navigator.item")) {
return;
}
PlayerInventory playerInventory = player.getInventory();
ItemStack navigatorItem = inventoryManager.getItemStack(plugin.getConfigValues().getNavigatorItem(), plugin.getString("navigator_item"));
event.getNavigatorSlots().forEach(slot -> playerInventory.setItem(slot, navigatorItem));
}
use of com.eintosti.buildsystem.object.settings.Settings in project BuildSystem by Trichtern.
the class PlayerMoveListener method onPlayerMove.
@EventHandler
public void onPlayerMove(PlayerMoveEvent event) {
Player player = event.getPlayer();
if (!playerManager.getOpenNavigator().contains(player)) {
return;
}
Settings settings = settingsManager.getSettings(player);
if (!settings.getNavigatorType().equals(NavigatorType.NEW)) {
return;
}
Location to = event.getTo();
if (to == null) {
return;
}
Location from = event.getFrom();
if (from.getBlockX() != to.getBlockX() || from.getBlockZ() != to.getBlockZ()) {
Bukkit.getServer().getScheduler().runTaskLater(plugin, () -> playerManager.closeNavigator(player), 5L);
}
}
use of com.eintosti.buildsystem.object.settings.Settings in project BuildSystem by Trichtern.
the class PlayerRespawnListener method onPlayerRespawn.
@EventHandler
public void onPlayerRespawn(PlayerRespawnEvent event) {
Player player = event.getPlayer();
Settings settings = settingsManager.getSettings(player);
if (settings.isSpawnTeleport() && spawnManager.spawnExists()) {
event.setRespawnLocation(spawnManager.getSpawn());
}
}
use of com.eintosti.buildsystem.object.settings.Settings in project BuildSystem by Trichtern.
the class SettingsInteractListener method manageSlabSetting.
@EventHandler
public void manageSlabSetting(PlayerInteractEvent event) {
if (!isValid(event)) {
return;
}
Player player = event.getPlayer();
Action action = event.getAction();
Settings settings = settingsManager.getSettings(player);
if (settings.isSlabBreaking() && action == Action.LEFT_CLICK_BLOCK) {
plugin.getCustomBlocks().modifySlab(event);
}
}
Aggregations