Merge pull request #17 from DroppingAnvil/1.6.x
Fixed grace period issues!
This commit is contained in:
commit
4046ab62e2
@ -477,35 +477,28 @@ public class FactionsBlockListener implements Listener {
|
|||||||
//Grace
|
//Grace
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onBreak(EntityExplodeEvent e) {
|
public void onBreak(EntityExplodeEvent e) {
|
||||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("f-grace.Enabled"))
|
if (!Conf.gracePeriod) return;
|
||||||
return;
|
|
||||||
|
|
||||||
if (!graceisEnabled()) {
|
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void entityDamage(EntityDamageEvent e) {
|
public void entityDamage(EntityDamageEvent e) {
|
||||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("f-grace.Enabled"))
|
if (!Conf.gracePeriod) return;
|
||||||
return;
|
|
||||||
|
|
||||||
if (!graceisEnabled()) {
|
|
||||||
if (e.getEntity() instanceof Player) {
|
if (e.getEntity() instanceof Player) {
|
||||||
if (e.getCause() == EntityDamageEvent.DamageCause.PROJECTILE) {
|
if (e.getCause() == EntityDamageEvent.DamageCause.PROJECTILE) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onTNTPlace(BlockPlaceEvent e1) {
|
public void onTNTPlace(BlockPlaceEvent e1) {
|
||||||
FPlayer fp = FPlayers.getInstance().getByPlayer(e1.getPlayer());
|
FPlayer fp = FPlayers.getInstance().getByPlayer(e1.getPlayer());
|
||||||
if (!FactionsPlugin.getInstance().getConfig().getBoolean("f-grace.Enabled"))
|
if (!Conf.gracePeriod) return;
|
||||||
return;
|
|
||||||
|
|
||||||
if (!graceisEnabled() && !fp.isAdminBypassing()) {
|
if (!fp.isAdminBypassing()) {
|
||||||
if (e1.getBlock().getType().equals(Material.TNT)) {
|
if (e1.getBlock().getType().equals(Material.TNT)) {
|
||||||
e1.setCancelled(true);
|
e1.setCancelled(true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user