mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-11-23 00:05:52 +01:00
Removed HotbarSwap option because of a dupe bug that has been found.
This commit is contained in:
parent
b0cab10da2
commit
528606628d
@ -19,13 +19,6 @@ public class MMOCoreBukkit {
|
||||
if (plugin.configManager.overrideVanillaExp)
|
||||
Bukkit.getPluginManager().registerEvents(new VanillaExperienceOverride(), plugin);
|
||||
|
||||
if (plugin.getConfig().getBoolean("hotbar-swapping.enabled"))
|
||||
try {
|
||||
Bukkit.getPluginManager().registerEvents(new HotbarSwap(plugin.getConfig().getConfigurationSection("hotbar-swapping")), plugin);
|
||||
} catch (RuntimeException exception) {
|
||||
plugin.getLogger().log(Level.WARNING, "Could not load hotbar swapping: " + exception.getMessage());
|
||||
}
|
||||
|
||||
if (plugin.getConfig().getBoolean("prevent-spawner-xp"))
|
||||
Bukkit.getPluginManager().registerEvents(new NoSpawnerEXP(), plugin);
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
package net.Indyuce.mmocore.listener.option;
|
||||
|
||||
import io.lumine.mythic.lib.UtilityMethods;
|
||||
import net.Indyuce.mmocore.MMOCore;
|
||||
import net.Indyuce.mmocore.api.event.PlayerKeyPressEvent;
|
||||
import net.Indyuce.mmocore.api.SoundEvent;
|
||||
import net.Indyuce.mmocore.skill.cast.PlayerKey;
|
||||
import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class HotbarSwap implements Listener {
|
||||
private final PlayerKey keybind;
|
||||
private final boolean crouching;
|
||||
|
||||
public HotbarSwap(ConfigurationSection config) {
|
||||
this.keybind = PlayerKey.valueOf(UtilityMethods.enumName(Objects.requireNonNull(config.getString("keybind"), "Could not find keybind")));
|
||||
this.crouching = config.getBoolean("crouching");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void keyPress(PlayerKeyPressEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
if (event.getPressed() == keybind && event.getPlayer().isSneaking() == crouching) {
|
||||
|
||||
if (event.getPressed().shouldCancelEvent())
|
||||
event.setCancelled(true);
|
||||
|
||||
MMOCore.plugin.soundManager.getSound(SoundEvent.HOTBAR_SWAP).playTo(player);
|
||||
for (int j = 0; j < 9; j++) {
|
||||
ItemStack replaced = player.getInventory().getItem(j + 9 * 3);
|
||||
player.getInventory().setItem(j + 9 * 3, player.getInventory().getItem(j));
|
||||
player.getInventory().setItem(j, replaced);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -15,7 +15,7 @@ mysql:
|
||||
port: 3306
|
||||
database: minecraft
|
||||
user: mmolover
|
||||
pass: ILoveAria
|
||||
pass: ILovePhoenixDev
|
||||
properties:
|
||||
cachePrepStmts: true
|
||||
prepStmtCacheSize: 250
|
||||
@ -213,20 +213,6 @@ max-skill-slots: 8
|
||||
# When set to false, unlocked skills will take effect right away.
|
||||
passive-skill-need-bound: true
|
||||
|
||||
# Fun extra RPG feature that switches the player's hotbar with
|
||||
# the 9 lower row items of his inventory. This allows the player
|
||||
# to have two different item sets or quickly have access to pots
|
||||
# Requires a SERVER reload when changed.
|
||||
hotbar-swapping:
|
||||
enabled: true
|
||||
|
||||
# Keybind which triggers
|
||||
# Available keybinds
|
||||
keybind: SWAP_HANDS
|
||||
|
||||
# If the player has to sneak to swap hotbars
|
||||
crouching: true
|
||||
|
||||
# Set this to true to allow players in
|
||||
# creative mode to enter casting mode
|
||||
can-creative-cast: false
|
||||
|
Loading…
Reference in New Issue
Block a user