Search in sources :

Example 1 with NoClipManager

use of com.eintosti.buildsystem.manager.NoClipManager in project BuildSystem by einTosti.

the class BuildSystem method initClasses.

private void initClasses() {
    this.armorStandManager = new ArmorStandManager();
    this.playerManager = new PlayerManager(this);
    this.inventoryManager = new InventoryManager(this);
    this.inventoryManager.loadTypes();
    this.inventoryManager.loadStatus();
    this.noClipManager = new NoClipManager(this);
    this.worldManager = new WorldManager(this);
    this.settingsManager = new SettingsManager(this);
    this.spawnManager = new SpawnManager(this);
    this.archiveInventory = new ArchiveInventory(this);
    this.blocksInventory = new BlocksInventory(this);
    this.builderInventory = new BuilderInventory(this);
    this.createInventory = new CreateInventory(this);
    this.deleteInventory = new DeleteInventory(this);
    this.designInventory = new DesignInventory(this);
    this.editInventory = new EditInventory(this);
    this.gameRuleInventory = new GameRuleInventory(this);
    this.navigatorInventory = new NavigatorInventory(this);
    this.privateInventory = new PrivateInventory(this);
    this.settingsInventory = new SettingsInventory(this);
    this.setupInventory = new SetupInventory(this);
    this.speedInventory = new SpeedInventory(this);
    this.statusInventory = new StatusInventory(this);
    this.worldsInventory = new WorldsInventory(this);
    this.skullCache = new SkullCache(version);
}
Also used : ArmorStandManager(com.eintosti.buildsystem.manager.ArmorStandManager) PlayerManager(com.eintosti.buildsystem.manager.PlayerManager) SettingsManager(com.eintosti.buildsystem.manager.SettingsManager) WorldManager(com.eintosti.buildsystem.manager.WorldManager) InventoryManager(com.eintosti.buildsystem.manager.InventoryManager) SkullCache(com.eintosti.buildsystem.util.SkullCache) NoClipManager(com.eintosti.buildsystem.manager.NoClipManager) SpawnManager(com.eintosti.buildsystem.manager.SpawnManager)

Example 2 with NoClipManager

use of com.eintosti.buildsystem.manager.NoClipManager in project BuildSystem by Trichtern.

the class BuildSystem method initClasses.

private void initClasses() {
    this.armorStandManager = new ArmorStandManager();
    this.playerManager = new PlayerManager(this);
    this.inventoryManager = new InventoryManager(this);
    this.inventoryManager.loadTypes();
    this.inventoryManager.loadStatus();
    this.noClipManager = new NoClipManager(this);
    this.worldManager = new WorldManager(this);
    this.settingsManager = new SettingsManager(this);
    this.spawnManager = new SpawnManager(this);
    this.archiveInventory = new ArchiveInventory(this);
    this.blocksInventory = new BlocksInventory(this);
    this.builderInventory = new BuilderInventory(this);
    this.createInventory = new CreateInventory(this);
    this.deleteInventory = new DeleteInventory(this);
    this.designInventory = new DesignInventory(this);
    this.editInventory = new EditInventory(this);
    this.gameRuleInventory = new GameRuleInventory(this);
    this.navigatorInventory = new NavigatorInventory(this);
    this.privateInventory = new PrivateInventory(this);
    this.settingsInventory = new SettingsInventory(this);
    this.setupInventory = new SetupInventory(this);
    this.speedInventory = new SpeedInventory(this);
    this.statusInventory = new StatusInventory(this);
    this.worldsInventory = new WorldsInventory(this);
    this.skullCache = new SkullCache(version);
}
Also used : ArmorStandManager(com.eintosti.buildsystem.manager.ArmorStandManager) PlayerManager(com.eintosti.buildsystem.manager.PlayerManager) SettingsManager(com.eintosti.buildsystem.manager.SettingsManager) WorldManager(com.eintosti.buildsystem.manager.WorldManager) InventoryManager(com.eintosti.buildsystem.manager.InventoryManager) SkullCache(com.eintosti.buildsystem.util.SkullCache) NoClipManager(com.eintosti.buildsystem.manager.NoClipManager) SpawnManager(com.eintosti.buildsystem.manager.SpawnManager)

Example 3 with NoClipManager

use of com.eintosti.buildsystem.manager.NoClipManager in project BuildSystem by einTosti.

the class SettingsInventory method onInventoryClick.

@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    if (!inventoryManager.checkIfValidClick(event, "settings_title")) {
        return;
    }
    Player player = (Player) event.getWhoClicked();
    Settings settings = settingsManager.getSettings(player);
    switch(event.getSlot()) {
        case 11:
            plugin.getDesignInventory().openInventory(player);
            XSound.ENTITY_ITEM_PICKUP.play(player);
            return;
        case 12:
            settings.setClearInventory(!settings.isClearInventory());
            break;
        case 13:
            settings.setDisableInteract(!settings.isDisableInteract());
            break;
        case 14:
            settings.setHidePlayers(!settings.isHidePlayers());
            toggleHidePlayers(player, settings);
            break;
        case 15:
            settings.setInstantPlaceSigns(!settings.isInstantPlaceSigns());
            break;
        case 20:
            settings.setKeepNavigator(!settings.isKeepNavigator());
            break;
        case 21:
            if (settings.getNavigatorType().equals(NavigatorType.OLD)) {
                settings.setNavigatorType(NavigatorType.NEW);
            } else {
                settings.setNavigatorType(NavigatorType.OLD);
                plugin.getArmorStandManager().removeArmorStands(player);
                if (player.hasPotionEffect(PotionEffectType.BLINDNESS)) {
                    player.removePotionEffect(PotionEffectType.BLINDNESS);
                }
            }
            break;
        case 22:
            if (!settings.isNightVision()) {
                settings.setNightVision(true);
                player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0, false, false));
            } else {
                settings.setNightVision(false);
                if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
                    player.removePotionEffect(PotionEffectType.NIGHT_VISION);
                }
            }
            break;
        case 23:
            NoClipManager noClipManager = plugin.getNoClipManager();
            if (!settings.isNoClip()) {
                settings.setNoClip(true);
                noClipManager.startNoClip(player);
            } else {
                settings.setNoClip(false);
                noClipManager.stopNoClip(player.getUniqueId());
            }
            break;
        case 24:
            settings.setTrapDoor(!settings.isTrapDoor());
            break;
        case 29:
            settings.setPlacePlants(!settings.isPlacePlants());
            break;
        case 30:
            if (!configValues.isScoreboard()) {
                XSound.ENTITY_ITEM_BREAK.play(player);
                return;
            }
            if (settings.isScoreboard()) {
                settings.setScoreboard(false);
                settingsManager.stopScoreboard(player);
            } else {
                settings.setScoreboard(true);
                settingsManager.startScoreboard(player);
                plugin.getPlayerManager().forceUpdateSidebar(player);
            }
            break;
        case 31:
            settings.setSlabBreaking(!settings.isSlabBreaking());
            break;
        case 32:
            settings.setSpawnTeleport(!settings.isSpawnTeleport());
            break;
        case 33:
            switch(settings.getWorldSort()) {
                case NAME_A_TO_Z:
                    settings.setWorldSort(WorldSort.NAME_Z_TO_A);
                    break;
                case NAME_Z_TO_A:
                    settings.setWorldSort(WorldSort.PROJECT_A_TO_Z);
                    break;
                case PROJECT_A_TO_Z:
                    settings.setWorldSort(WorldSort.PROJECT_Z_TO_A);
                    break;
                case PROJECT_Z_TO_A:
                    settings.setWorldSort(WorldSort.NEWEST_FIRST);
                    break;
                case NEWEST_FIRST:
                    settings.setWorldSort(WorldSort.OLDEST_FIRST);
                    break;
                case OLDEST_FIRST:
                    settings.setWorldSort(WorldSort.NAME_A_TO_Z);
                    break;
            }
            break;
        default:
            return;
    }
    XSound.ENTITY_ITEM_PICKUP.play(player);
    plugin.getSettingsInventory().openInventory(player);
}
Also used : Player(org.bukkit.entity.Player) PotionEffect(org.bukkit.potion.PotionEffect) NoClipManager(com.eintosti.buildsystem.manager.NoClipManager) Settings(com.eintosti.buildsystem.object.settings.Settings) EventHandler(org.bukkit.event.EventHandler)

Example 4 with NoClipManager

use of com.eintosti.buildsystem.manager.NoClipManager in project BuildSystem by Trichtern.

the class SettingsInventory method onInventoryClick.

@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
    if (!inventoryManager.checkIfValidClick(event, "settings_title")) {
        return;
    }
    Player player = (Player) event.getWhoClicked();
    Settings settings = settingsManager.getSettings(player);
    switch(event.getSlot()) {
        case 11:
            plugin.getDesignInventory().openInventory(player);
            XSound.ENTITY_ITEM_PICKUP.play(player);
            return;
        case 12:
            settings.setClearInventory(!settings.isClearInventory());
            break;
        case 13:
            settings.setDisableInteract(!settings.isDisableInteract());
            break;
        case 14:
            settings.setHidePlayers(!settings.isHidePlayers());
            toggleHidePlayers(player, settings);
            break;
        case 15:
            settings.setInstantPlaceSigns(!settings.isInstantPlaceSigns());
            break;
        case 20:
            settings.setKeepNavigator(!settings.isKeepNavigator());
            break;
        case 21:
            if (settings.getNavigatorType().equals(NavigatorType.OLD)) {
                settings.setNavigatorType(NavigatorType.NEW);
            } else {
                settings.setNavigatorType(NavigatorType.OLD);
                plugin.getArmorStandManager().removeArmorStands(player);
                if (player.hasPotionEffect(PotionEffectType.BLINDNESS)) {
                    player.removePotionEffect(PotionEffectType.BLINDNESS);
                }
            }
            break;
        case 22:
            if (!settings.isNightVision()) {
                settings.setNightVision(true);
                player.addPotionEffect(new PotionEffect(PotionEffectType.NIGHT_VISION, Integer.MAX_VALUE, 0, false, false));
            } else {
                settings.setNightVision(false);
                if (player.hasPotionEffect(PotionEffectType.NIGHT_VISION)) {
                    player.removePotionEffect(PotionEffectType.NIGHT_VISION);
                }
            }
            break;
        case 23:
            NoClipManager noClipManager = plugin.getNoClipManager();
            if (!settings.isNoClip()) {
                settings.setNoClip(true);
                noClipManager.startNoClip(player);
            } else {
                settings.setNoClip(false);
                noClipManager.stopNoClip(player.getUniqueId());
            }
            break;
        case 24:
            settings.setTrapDoor(!settings.isTrapDoor());
            break;
        case 29:
            settings.setPlacePlants(!settings.isPlacePlants());
            break;
        case 30:
            if (!configValues.isScoreboard()) {
                XSound.ENTITY_ITEM_BREAK.play(player);
                return;
            }
            if (settings.isScoreboard()) {
                settings.setScoreboard(false);
                settingsManager.stopScoreboard(player);
            } else {
                settings.setScoreboard(true);
                settingsManager.startScoreboard(player);
                plugin.getPlayerManager().forceUpdateSidebar(player);
            }
            break;
        case 31:
            settings.setSlabBreaking(!settings.isSlabBreaking());
            break;
        case 32:
            settings.setSpawnTeleport(!settings.isSpawnTeleport());
            break;
        case 33:
            switch(settings.getWorldSort()) {
                case NAME_A_TO_Z:
                    settings.setWorldSort(WorldSort.NAME_Z_TO_A);
                    break;
                case NAME_Z_TO_A:
                    settings.setWorldSort(WorldSort.PROJECT_A_TO_Z);
                    break;
                case PROJECT_A_TO_Z:
                    settings.setWorldSort(WorldSort.PROJECT_Z_TO_A);
                    break;
                case PROJECT_Z_TO_A:
                    settings.setWorldSort(WorldSort.NEWEST_FIRST);
                    break;
                case NEWEST_FIRST:
                    settings.setWorldSort(WorldSort.OLDEST_FIRST);
                    break;
                case OLDEST_FIRST:
                    settings.setWorldSort(WorldSort.NAME_A_TO_Z);
                    break;
            }
            break;
        default:
            return;
    }
    XSound.ENTITY_ITEM_PICKUP.play(player);
    plugin.getSettingsInventory().openInventory(player);
}
Also used : Player(org.bukkit.entity.Player) PotionEffect(org.bukkit.potion.PotionEffect) NoClipManager(com.eintosti.buildsystem.manager.NoClipManager) Settings(com.eintosti.buildsystem.object.settings.Settings) EventHandler(org.bukkit.event.EventHandler)

Aggregations

NoClipManager (com.eintosti.buildsystem.manager.NoClipManager)4 ArmorStandManager (com.eintosti.buildsystem.manager.ArmorStandManager)2 InventoryManager (com.eintosti.buildsystem.manager.InventoryManager)2 PlayerManager (com.eintosti.buildsystem.manager.PlayerManager)2 SettingsManager (com.eintosti.buildsystem.manager.SettingsManager)2 SpawnManager (com.eintosti.buildsystem.manager.SpawnManager)2 WorldManager (com.eintosti.buildsystem.manager.WorldManager)2 Settings (com.eintosti.buildsystem.object.settings.Settings)2 SkullCache (com.eintosti.buildsystem.util.SkullCache)2 Player (org.bukkit.entity.Player)2 EventHandler (org.bukkit.event.EventHandler)2 PotionEffect (org.bukkit.potion.PotionEffect)2