Updated old painting events to new hanging events so that item frames are also protected.

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:
Brettflan 2012-10-31 16:16:21 -05:00
parent 41cd9484d3
commit d31741fb34
3 changed files with 9 additions and 9 deletions

Binary file not shown.

View File

@ -92,7 +92,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;
} }

View File

@ -29,9 +29,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;
@ -364,29 +364,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().getBlock(), "remove paintings", false)) if ( ! FactionsBlockListener.playerCanBuildDestroyBlock((Player)breaker, event.getEntity().getLocation().getBlock(), "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;