From 16d5d9f95f94d3834dac112b6d9a95d9f3ed204b Mon Sep 17 00:00:00 2001 From: nossr50 Date: Wed, 27 Nov 2024 13:24:01 -0800 Subject: [PATCH] temporarily disable party item sharing feature --- Changelog.txt | 4 ++++ .../nossr50/listeners/PlayerListener.java | 21 ++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 3929043b3..f2b0c001b 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -7,7 +7,11 @@ Version 2.2.029 Added Stripped_Pale_Oak_Wood to experience.yml for Woodcutting Added Bonus_Drops.Woodcutting.Pale_Oak_Wood to config.yml to enable double/triple drops for Pale Oak Wood Added Bonus_Drops.Woodcutting.Pale_Oak_Log to config.yml to enable double/triple drops for Pale Oak Log + Temporarily disabled the party item share functionality until it is fixed or potentially removed (see notes) + Notes: + I noticed some issues with the party item share feature, so I've temporarily disabled it until those issues are addressed. + I'm not even sure people like or dislike this feature, I'm personally not a fan.. I'd like to hear what you guys think. Version 2.2.028 Fixed stack overflow during ChunkUnloadEvent diff --git a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java index e76696ae7..0825318ed 100644 --- a/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java +++ b/src/main/java/com/gmail/nossr50/listeners/PlayerListener.java @@ -255,14 +255,15 @@ public class PlayerListener implements Listener { return; } - Item drop = event.getItemDrop(); - ItemStack dropStack = drop.getItemStack(); - if (ItemUtils.isSharable(dropStack)) { - drop.setMetadata(MetadataConstants.METADATA_KEY_TRACKED_ITEM, MetadataConstants.MCMMO_METADATA_VALUE); - } + // TODO: This sharing item system seems very unoptimized, temporarily disabling + /*if (ItemUtils.isSharable(event.getItemDrop().getItemStack())) { + event.getItemDrop().getItemStack().setMetadata( + MetadataConstants.METADATA_KEY_TRACKED_ITEM, + MetadataConstants.MCMMO_METADATA_VALUE); + }*/ - SkillUtils.removeAbilityBuff(dropStack); + SkillUtils.removeAbilityBuff(event.getItemDrop().getItemStack()); } /** @@ -494,8 +495,7 @@ public class PlayerListener implements Listener { return; } - Item drop = event.getItem(); - ItemStack dropStack = drop.getItemStack(); + final Item drop = event.getItem(); //Remove tracking if (drop.hasMetadata(MetadataConstants.METADATA_KEY_TRACKED_ARROW)) { @@ -510,13 +510,14 @@ public class PlayerListener implements Listener { return; } - if (!drop.hasMetadata(MetadataConstants.METADATA_KEY_TRACKED_ITEM) && mcMMOPlayer.inParty() && ItemUtils.isSharable(dropStack)) { + // TODO: Temporarily disabling sharing items... + /*if (!drop.hasMetadata(MetadataConstants.METADATA_KEY_TRACKED_ITEM) && mcMMOPlayer.inParty() && ItemUtils.isSharable(dropStack)) { event.setCancelled(ShareHandler.handleItemShare(drop, mcMMOPlayer)); if (event.isCancelled()) { SoundManager.sendSound(player, player.getLocation(), SoundType.POP); } - } + }*/ /*if (player.getInventory().getItemInMainHand().getType() == Material.AIR) { Unarmed.handleItemPickup(player, event);