Updated old painting events to new hanging events so that item frames are also protected.
Added wither boss initial explosion to our fireball explosion protection (only needed in 1.6 branch). Also updated CraftBukkit lib and (hopefully) further clarified error message for GSON libs not being found in CB 1.3.2+ location.
This commit is contained in:
parent
1707582e80
commit
ee6c7c07d2
Binary file not shown.
@ -87,7 +87,7 @@ public class P extends MPlugin
|
|||||||
}
|
}
|
||||||
catch (ClassNotFoundException ex)
|
catch (ClassNotFoundException ex)
|
||||||
{
|
{
|
||||||
this.log(Level.SEVERE, "CraftBukkit 1.3.2-R0.1 (build 2340) or newer required. Your CraftBukkit build is not compatible.");
|
this.log(Level.SEVERE, "GSON lib not found. Your CraftBukkit build is too old (< 1.3.2) or otherwise not compatible.");
|
||||||
this.suicide();
|
this.suicide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import org.bukkit.entity.LivingEntity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Projectile;
|
import org.bukkit.entity.Projectile;
|
||||||
import org.bukkit.entity.TNTPrimed;
|
import org.bukkit.entity.TNTPrimed;
|
||||||
|
import org.bukkit.entity.Wither;
|
||||||
import org.bukkit.entity.WitherSkull;
|
import org.bukkit.entity.WitherSkull;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
@ -31,9 +32,9 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
|||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.EntityTargetEvent;
|
import org.bukkit.event.entity.EntityTargetEvent;
|
||||||
import org.bukkit.event.entity.PotionSplashEvent;
|
import org.bukkit.event.entity.PotionSplashEvent;
|
||||||
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
|
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||||
import org.bukkit.event.painting.PaintingBreakEvent;
|
import org.bukkit.event.hanging.HangingBreakEvent;
|
||||||
import org.bukkit.event.painting.PaintingPlaceEvent;
|
import org.bukkit.event.hanging.HangingPlaceEvent;
|
||||||
import org.bukkit.potion.PotionEffect;
|
import org.bukkit.potion.PotionEffect;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
|
|
||||||
@ -164,7 +165,7 @@ public class FactionsEntityListener implements Listener
|
|||||||
}
|
}
|
||||||
else if
|
else if
|
||||||
(
|
(
|
||||||
(boomer instanceof Fireball || boomer instanceof WitherSkull)
|
(boomer instanceof Fireball || boomer instanceof WitherSkull || boomer instanceof Wither)
|
||||||
&&
|
&&
|
||||||
(
|
(
|
||||||
(faction.isNone() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName()))
|
(faction.isNone() && Conf.wildernessBlockFireballs && !Conf.worldsNoWildernessProtection.contains(loc.getWorld().getName()))
|
||||||
@ -483,29 +484,29 @@ public class FactionsEntityListener implements Listener
|
|||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onPaintingBreak(PaintingBreakEvent event)
|
public void onPaintingBreak(HangingBreakEvent event)
|
||||||
{
|
{
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
|
|
||||||
if (! (event instanceof PaintingBreakByEntityEvent))
|
if (! (event instanceof HangingBreakByEntityEvent))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Entity breaker = ((PaintingBreakByEntityEvent)event).getRemover();
|
Entity breaker = ((HangingBreakByEntityEvent)event).getRemover();
|
||||||
if (! (breaker instanceof Player))
|
if (! (breaker instanceof Player))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ! FactionsBlockListener.playerCanBuildDestroyBlock((Player)breaker, event.getPainting().getLocation(), "remove paintings", false))
|
if ( ! FactionsBlockListener.playerCanBuildDestroyBlock((Player)breaker, event.getEntity().getLocation(), "remove paintings", false))
|
||||||
{
|
{
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onPaintingPlace(PaintingPlaceEvent event)
|
public void onPaintingPlace(HangingPlaceEvent event)
|
||||||
{
|
{
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user