mirror of
https://github.com/songoda/FabledSkyBlock.git
synced 2024-11-07 03:00:29 +01:00
Added IronGolems settings
This commit is contained in:
parent
03efacf747
commit
432d4b2d8c
@ -83,6 +83,7 @@ public class PermissionManager {
|
||||
new ItemDropPermission(),
|
||||
new FishingPermission(plugin),
|
||||
new CauldronPermission(plugin),
|
||||
new IronGolemPermission(plugin),
|
||||
|
||||
// Basic
|
||||
new MemberPermission(),
|
||||
|
@ -0,0 +1,36 @@
|
||||
package com.songoda.skyblock.permission.permissions.listening;
|
||||
|
||||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.skyblock.SkyBlock;
|
||||
import com.songoda.skyblock.permission.ListeningPermission;
|
||||
import com.songoda.skyblock.permission.PermissionHandler;
|
||||
import com.songoda.skyblock.permission.PermissionType;
|
||||
import org.bukkit.entity.IronGolem;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
import org.bukkit.entity.minecart.ExplosiveMinecart;
|
||||
import org.bukkit.event.entity.EntityChangeBlockEvent;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
import org.bukkit.event.vehicle.VehicleDestroyEvent;
|
||||
|
||||
public class IronGolemPermission extends ListeningPermission {
|
||||
|
||||
private final SkyBlock plugin;
|
||||
|
||||
public IronGolemPermission(SkyBlock plugin) {
|
||||
super("IronGolems", CompatibleMaterial.IRON_BLOCK, PermissionType.ISLAND);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@PermissionHandler
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
if (event.getDamager() instanceof IronGolem) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.songoda.skyblock.SkyBlock;
|
||||
import com.songoda.skyblock.permission.ListeningPermission;
|
||||
import com.songoda.skyblock.permission.PermissionHandler;
|
||||
import com.songoda.skyblock.permission.PermissionType;
|
||||
import org.bukkit.entity.IronGolem;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.TNTPrimed;
|
||||
@ -29,7 +30,7 @@ public class MobGriefingPermission extends ListeningPermission {
|
||||
public void onEntityExplode(EntityExplodeEvent event) {
|
||||
if (!(event.getEntity() instanceof Player)
|
||||
&& (!(event.getEntity() instanceof org.bukkit.entity.Projectile)
|
||||
|| !(((org.bukkit.entity.Projectile) event.getEntity()).getShooter() instanceof Player))
|
||||
|| !(((org.bukkit.entity.Projectile) event.getEntity()).getShooter() instanceof Player))
|
||||
&& !(event.getEntity() instanceof TNTPrimed)
|
||||
&& !(event.getEntity() instanceof ExplosiveMinecart)) {
|
||||
event.setCancelled(true);
|
||||
@ -40,7 +41,7 @@ public class MobGriefingPermission extends ListeningPermission {
|
||||
public void onVehicleDamage(VehicleDamageEvent event) {
|
||||
if (!(event.getAttacker() instanceof Player)
|
||||
&& (!(event.getAttacker() instanceof org.bukkit.entity.Projectile)
|
||||
|| !(((org.bukkit.entity.Projectile) event.getAttacker()).getShooter() instanceof Player))
|
||||
|| !(((org.bukkit.entity.Projectile) event.getAttacker()).getShooter() instanceof Player))
|
||||
&& !(event.getAttacker() instanceof TNTPrimed)
|
||||
&& !(event.getAttacker() instanceof ExplosiveMinecart)) {
|
||||
event.setCancelled(true);
|
||||
@ -51,7 +52,7 @@ public class MobGriefingPermission extends ListeningPermission {
|
||||
public void onVehicleDestroy(VehicleDestroyEvent event) {
|
||||
if (!(event.getAttacker() instanceof Player)
|
||||
&& (!(event.getAttacker() instanceof org.bukkit.entity.Projectile)
|
||||
|| !(((org.bukkit.entity.Projectile) event.getAttacker()).getShooter() instanceof Player))
|
||||
|| !(((org.bukkit.entity.Projectile) event.getAttacker()).getShooter() instanceof Player))
|
||||
&& !(event.getAttacker() instanceof TNTPrimed)
|
||||
&& !(event.getAttacker() instanceof ExplosiveMinecart)) {
|
||||
event.setCancelled(true);
|
||||
@ -62,9 +63,10 @@ public class MobGriefingPermission extends ListeningPermission {
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
if (!(event.getDamager() instanceof Player)
|
||||
&& (!(event.getDamager() instanceof org.bukkit.entity.Projectile)
|
||||
|| !(((org.bukkit.entity.Projectile) event.getDamager()).getShooter() instanceof Player))
|
||||
|| !(((org.bukkit.entity.Projectile) event.getDamager()).getShooter() instanceof Player))
|
||||
&& !(event.getDamager() instanceof TNTPrimed)
|
||||
&& !(event.getDamager() instanceof ExplosiveMinecart)) {
|
||||
&& !(event.getDamager() instanceof ExplosiveMinecart)
|
||||
&& !(event.getDamager() instanceof IronGolem)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
@ -1323,6 +1323,8 @@ Menu:
|
||||
Displayname: '&aLeaf Decay'
|
||||
MobGriefing:
|
||||
Displayname: '&aMob Griefing'
|
||||
IronGolems:
|
||||
Displayname: '&aIron Golems'
|
||||
Status:
|
||||
Enabled:
|
||||
Lore:
|
||||
@ -1793,6 +1795,8 @@ Menu:
|
||||
Displayname: '&aNatural Mob Spawning'
|
||||
MobGriefing:
|
||||
Displayname: '&aMob Griefing'
|
||||
IronGolems:
|
||||
Displayname: '&aIron Golems'
|
||||
PvP:
|
||||
Displayname: '&aPvP'
|
||||
Explosions:
|
||||
|
@ -167,6 +167,7 @@ Settings:
|
||||
Owner:
|
||||
NaturalMobSpawning: true
|
||||
MobGriefing: true
|
||||
IronGolems: true
|
||||
Explosions: true
|
||||
FireSpread: true
|
||||
LeafDecay: true
|
||||
|
Loading…
Reference in New Issue
Block a user