From 17e053b0b190f2013918e3a1dc33ccff4c0c2687 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Wed, 25 Mar 2015 19:22:51 +0100 Subject: [PATCH] Fix a bug in choosing the plugin name for MassiveCommand and add contains entity to WorldExceptionSet. --- .../massivecore/MassiveCoreEngineCommandRegistration.java | 4 ++-- .../massivecore/collections/WorldExceptionSet.java | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/massivecraft/massivecore/MassiveCoreEngineCommandRegistration.java b/src/com/massivecraft/massivecore/MassiveCoreEngineCommandRegistration.java index e60ab4ae..ee3a7fe5 100644 --- a/src/com/massivecraft/massivecore/MassiveCoreEngineCommandRegistration.java +++ b/src/com/massivecraft/massivecore/MassiveCoreEngineCommandRegistration.java @@ -109,8 +109,8 @@ public class MassiveCoreEngineCommandRegistration extends EngineAbstract MassiveCoreBukkitCommand command = new MassiveCoreBukkitCommand(name, target); // ... and finally register it. - Plugin plugin = massiveCurrent.getRegisteredPlugin(); - String pluginName = plugin != null ? plugin.getName() : "MassiveCore"; + Plugin plugin = command.getPlugin(); + String pluginName = (plugin != null ? plugin.getName() : "MassiveCore"); simpleCommandMap.register(pluginName, command); } diff --git a/src/com/massivecraft/massivecore/collections/WorldExceptionSet.java b/src/com/massivecraft/massivecore/collections/WorldExceptionSet.java index 662c29cb..61a4abbf 100644 --- a/src/com/massivecraft/massivecore/collections/WorldExceptionSet.java +++ b/src/com/massivecraft/massivecore/collections/WorldExceptionSet.java @@ -1,6 +1,7 @@ package com.massivecraft.massivecore.collections; import org.bukkit.World; +import org.bukkit.entity.Entity; import com.massivecraft.massivecore.CaseInsensitiveComparator; @@ -28,5 +29,10 @@ public class WorldExceptionSet { return this.contains(world.getName()); } + + public boolean contains(Entity entity) + { + return this.contains(entity.getWorld()); + } }