From def1137d80bf51de4fde882f83405611be866c3d Mon Sep 17 00:00:00 2001 From: Indyuce Date: Sat, 30 Oct 2021 12:30:21 +0200 Subject: [PATCH] Reintroduced shift-click-player-profile-check, disabled by default this time --- .../mmocore/listener/option/PlayerProfileCheck.java | 12 +++++++----- src/main/resources/config.yml | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/net/Indyuce/mmocore/listener/option/PlayerProfileCheck.java b/src/main/java/net/Indyuce/mmocore/listener/option/PlayerProfileCheck.java index eaac9db1..eab9afe3 100644 --- a/src/main/java/net/Indyuce/mmocore/listener/option/PlayerProfileCheck.java +++ b/src/main/java/net/Indyuce/mmocore/listener/option/PlayerProfileCheck.java @@ -1,15 +1,20 @@ package net.Indyuce.mmocore.listener.option; +import io.lumine.mythic.lib.MythicLib; +import io.lumine.mythic.lib.comp.target.InteractionType; +import net.Indyuce.mmocore.api.player.PlayerData; +import net.Indyuce.mmocore.manager.InventoryManager; +import org.bukkit.entity.EntityType; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractEntityEvent; +import org.bukkit.inventory.Inventory; public class PlayerProfileCheck implements Listener { @EventHandler public void a(PlayerInteractEntityEvent event) { - /** - if (event.getRightClicked().getType() != EntityType.PLAYER || !MythicLib.plugin.getEntities().canTarget(event.getPlayer(), event.getRightClicked(), InteractionType.SUPPORT_ACTION)) + if (event.getRightClicked().getType() != EntityType.PLAYER || !event.getPlayer().isSneaking() || !MythicLib.plugin.getEntities().canTarget(event.getPlayer(), event.getRightClicked(), InteractionType.SUPPORT_ACTION)) return; /* @@ -19,10 +24,7 @@ public class PlayerProfileCheck implements Listener { * Opening inventories like that to other players does NOT * necessarily works for any other custom inventory. * */ - /** Inventory inv = InventoryManager.PLAYER_STATS.newInventory(PlayerData.get(event.getRightClicked().getUniqueId())).getInventory(); event.getPlayer().openInventory(inv); - **/ } - } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 00a56201..65db53d6 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -133,7 +133,7 @@ vanilla-exp-redirection: override-vanilla-exp: true # Check the target player's RPG profile when shift when shift right clicking. -shift-click-player-profile-check: true +shift-click-player-profile-check: false # If main class experience holograms should be displayed # whenever a player earns main class exp