mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-29 21:54:20 +01:00
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:
parent
41cd9484d3
commit
d31741fb34
Binary file not shown.
@ -92,7 +92,7 @@ public class P extends MPlugin
|
||||
}
|
||||
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();
|
||||
return;
|
||||
}
|
||||
|
@ -29,9 +29,9 @@ import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.entity.PotionSplashEvent;
|
||||
import org.bukkit.event.painting.PaintingBreakByEntityEvent;
|
||||
import org.bukkit.event.painting.PaintingBreakEvent;
|
||||
import org.bukkit.event.painting.PaintingPlaceEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakByEntityEvent;
|
||||
import org.bukkit.event.hanging.HangingBreakEvent;
|
||||
import org.bukkit.event.hanging.HangingPlaceEvent;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
@ -364,29 +364,29 @@ public class FactionsEntityListener implements Listener
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPaintingBreak(PaintingBreakEvent event)
|
||||
public void onPaintingBreak(HangingBreakEvent event)
|
||||
{
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
if (! (event instanceof PaintingBreakByEntityEvent))
|
||||
if (! (event instanceof HangingBreakByEntityEvent))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Entity breaker = ((PaintingBreakByEntityEvent)event).getRemover();
|
||||
Entity breaker = ((HangingBreakByEntityEvent)event).getRemover();
|
||||
if (! (breaker instanceof Player))
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPaintingPlace(PaintingPlaceEvent event)
|
||||
public void onPaintingPlace(HangingPlaceEvent event)
|
||||
{
|
||||
if (event.isCancelled()) return;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user