Compatibility with upcoming CB 1.1-R5 and above: updated Enderman block monitors to use EntityChangeBlockEvent, removed register event convenience methods from MPlugin (no longer working or needed)

Updated Bukkit lib to newest dev version
This commit is contained in:
Brettflan 2012-02-20 16:59:18 -06:00
parent af85f0f503
commit 639dc16bf5
4 changed files with 7 additions and 29 deletions

Binary file not shown.

View File

@ -1,5 +1,5 @@
name: Factions
version: 1.6.5c
version: 1.6.6_dev
main: com.massivecraft.factions.P
authors: [Olof Larsson, Brett Flannigan]
softdepend: [PermissionsEx, Permissions, Essentials, EssentialsChat, HeroChat, iChat, LocalAreaChat, LWC, nChat, ChatManager, CAPI, AuthMe, Vault, Spout, WorldEdit, WorldGuard, AuthDB, CaptureThePoints, CombatTag]

View File

@ -7,6 +7,7 @@ import java.util.logging.Level;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Enderman;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Fireball;
import org.bukkit.entity.Player;
@ -16,8 +17,7 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EndermanPickupEvent;
import org.bukkit.event.entity.EndermanPlaceEvent;
import org.bukkit.event.entity.EntityChangeBlockEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
@ -434,27 +434,19 @@ public class FactionsEntityListener implements Listener
}
@EventHandler(priority = EventPriority.NORMAL)
public void onEndermanPickup(EndermanPickupEvent event)
public void onEntityChangeBlock(EntityChangeBlockEvent event)
{
if (event.isCancelled()) return;
// for now, only interested in Enderman tomfoolery
if (!(event.getEntity() instanceof Enderman)) return;
if (stopEndermanBlockManipulation(event.getBlock().getLocation()))
{
event.setCancelled(true);
}
}
@EventHandler(priority = EventPriority.NORMAL)
public void onEndermanPlace(EndermanPlaceEvent event)
{
if (event.isCancelled()) return;
if (stopEndermanBlockManipulation(event.getLocation()))
{
event.setCancelled(true);
}
}
private boolean stopEndermanBlockManipulation(Location loc)
{
if (loc == null)

View File

@ -110,20 +110,6 @@ public abstract class MPlugin extends JavaPlugin
this.getServer().getPluginManager().disablePlugin(this);
}
// -------------------------------------------- //
// Register Event convenience method
// -------------------------------------------- //
public void registerEvent(Event.Type type, Listener listener, Event.Priority priority)
{
Bukkit.getServer().getPluginManager().registerEvent(type, listener, priority, this);
}
public void registerEvent(Event.Type type, Listener listener)
{
registerEvent(type, listener, Event.Priority.Normal);
}
// -------------------------------------------- //
// Some inits...
// You are supposed to override these in the plugin if you aren't satisfied with the defaults