Skip to content

Commit

Permalink
Protect decorated pots on 1.20.3+ (#2181)
Browse files Browse the repository at this point in the history
Also fixes a paper issue introduced with 1.20.2 build 315: players not dropping items when in pvp. This bug was fixed in paper build 334.
  • Loading branch information
QarthO committed Jan 5, 2024
1 parent e49446d commit f7e86c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -985,7 +985,7 @@ private void chorusFlower(ProjectileHitEvent event)
Block block = event.getHitBlock();

// Ensure projectile affects block.
if (block == null || block.getType() != Material.CHORUS_FLOWER)
if (block == null || (block.getType() != Material.CHORUS_FLOWER && block.getType() != Material.DECORATED_POT))
return;

Claim claim = dataStore.getClaimAt(block.getLocation(), false, null);
Expand Down
Expand Up @@ -1062,7 +1062,7 @@ public void onPlayerDropItem(PlayerDropItemEvent event)
//them or give them away to other players before they are defeated

//if in combat, don't let him drop it
if (!instance.config_pvp_allowCombatItemDrop && playerData.inPvpCombat())
if (!instance.config_pvp_allowCombatItemDrop && playerData.inPvpCombat() && !player.isDead())
{
GriefPrevention.sendMessage(player, TextMode.Err, Messages.PvPNoDrop);
event.setCancelled(true);
Expand Down Expand Up @@ -1725,7 +1725,8 @@ void onPlayerInteract(PlayerInteractEvent event)
clickedBlockType == Material.RESPAWN_ANCHOR ||
clickedBlockType == Material.ROOTED_DIRT ||
clickedBlockType == Material.STONECUTTER ||
clickedBlockType == Material.SWEET_BERRY_BUSH
clickedBlockType == Material.SWEET_BERRY_BUSH ||
clickedBlockType == Material.DECORATED_POT
)))
{
if (playerData == null) playerData = this.dataStore.getPlayerData(player.getUniqueId());
Expand Down

0 comments on commit f7e86c0

Please sign in to comment.