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