Removed HotbarSwap option because of a dupe bug that has been found.

This commit is contained in:
Ka0rX 2023-05-04 10:46:19 +01:00
parent b0cab10da2
commit 528606628d
3 changed files with 1 additions and 63 deletions

View File

@ -19,13 +19,6 @@ public class MMOCoreBukkit {
if (plugin.configManager.overrideVanillaExp) if (plugin.configManager.overrideVanillaExp)
Bukkit.getPluginManager().registerEvents(new VanillaExperienceOverride(), plugin); 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")) if (plugin.getConfig().getBoolean("prevent-spawner-xp"))
Bukkit.getPluginManager().registerEvents(new NoSpawnerEXP(), plugin); Bukkit.getPluginManager().registerEvents(new NoSpawnerEXP(), plugin);

View File

@ -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);
}
}
}
}

View File

@ -15,7 +15,7 @@ mysql:
port: 3306 port: 3306
database: minecraft database: minecraft
user: mmolover user: mmolover
pass: ILoveAria pass: ILovePhoenixDev
properties: properties:
cachePrepStmts: true cachePrepStmts: true
prepStmtCacheSize: 250 prepStmtCacheSize: 250
@ -213,20 +213,6 @@ max-skill-slots: 8
# When set to false, unlocked skills will take effect right away. # When set to false, unlocked skills will take effect right away.
passive-skill-need-bound: true 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 # Set this to true to allow players in
# creative mode to enter casting mode # creative mode to enter casting mode
can-creative-cast: false can-creative-cast: false