This commit is contained in:
HaHaWTH 2024-01-07 22:06:47 +08:00
parent d8d3e8544c
commit a9cb2d2490
2 changed files with 3 additions and 7 deletions

View File

@ -29,12 +29,8 @@ public class PlayerListenerHigherThan18 implements Listener {
@EventHandler(priority = EventPriority.LOWEST)
public void onSwitchHand(PlayerSwapHandItemsEvent event) {
Player player = event.getPlayer();
if ((!player.isSneaking() || !player.hasPermission("keybindings.use")) &&
settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
return;
}
event.setCancelled(true);
if (settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
if (player.isSneaking() && player.hasPermission("keybindings.use") && settings.getProperty(PluginSettings.MENU_UNREGISTER_COMPATIBILITY)) {
event.setCancelled(true);
Bukkit.dispatchCommand(event.getPlayer(), "help");
}
}

View File

@ -14,7 +14,7 @@ public final class PluginSettings implements SettingsHolder {
"If you are using TrMenu, don't enable this because TrMenu already implemented this."
})
public static final Property<Boolean> MENU_UNREGISTER_COMPATIBILITY =
newProperty("3rdPartyFeature.compatibility.menuPlugins", true);
newProperty("3rdPartyFeature.compatibility.menuPlugins", false);
@Comment({
"Do you want to enable the session feature?",