Skip to content

Commit

Permalink
lwc mods should be able do "custom" damage to itemframes
Browse files Browse the repository at this point in the history
  • Loading branch information
Brokkonaut committed Dec 29, 2022
1 parent 774fc63 commit 00dad6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/griefcraft/listeners/LWCPlayerListener.java
Expand Up @@ -224,8 +224,8 @@ public void onProtectedEntityDamageByEntity(EntityDamageByEntityEvent e) {
}
// owner permission is required for damaging entities
if (!lwc.canDestoryProtection(p, protection)) {
if (e.getCause() == DamageCause.ENTITY_ATTACK && entity instanceof ItemFrame) {
ItemStack item = ((ItemFrame) entity).getItem();
if ((e.getCause() == DamageCause.CUSTOM || e.getCause() == DamageCause.ENTITY_ATTACK) && entity instanceof ItemFrame frame) {
ItemStack item = frame.getItem();
if (item != null && item.getType() != Material.AIR) {
return; // special case for ItemFrames: they call a damageevent when the contained item is removed.
// this is allowed for protection members.
Expand Down

0 comments on commit 00dad6c

Please sign in to comment.