mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-27 04:35:46 +01:00
Fix for MonsterHurting setting
This commit is contained in:
parent
59fc4f2bd9
commit
dffd68e503
@ -38,15 +38,4 @@ public class BrewingPermission extends ListeningPermission {
|
||||
if (CompatibleMaterial.getMaterial(block) == CompatibleMaterial.BREWING_STAND)
|
||||
cancelAndMessage(event, player, plugin, messageManager);
|
||||
}
|
||||
|
||||
@PermissionHandler
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
if (!(event.getDamager() instanceof Player)) return;
|
||||
Player player = (Player)event.getDamager();
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (!(entity instanceof Monster)) return;
|
||||
|
||||
cancelAndMessage(event, player, plugin, messageManager);
|
||||
}
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import com.songoda.skyblock.permission.ListeningPermission;
|
||||
import com.songoda.skyblock.permission.PermissionHandler;
|
||||
import com.songoda.skyblock.permission.PermissionPriority;
|
||||
import com.songoda.skyblock.permission.PermissionType;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
|
||||
@ -32,8 +33,8 @@ public class MonsterHurtingPermission extends ListeningPermission {
|
||||
|
||||
Entity entity = event.getEntity();
|
||||
|
||||
if (entity.getType() == EntityType.ARMOR_STAND || !(entity instanceof Monster)) return;
|
||||
|
||||
cancelAndMessage(event, player, plugin, messageManager);
|
||||
if (entity instanceof Monster){
|
||||
cancelAndMessage(event, player, plugin, messageManager);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user