Added actuall mixin

This commit is contained in:
Olof Larsson 2013-03-12 07:51:38 +01:00
parent 8dbb8f793d
commit 9fe7a9c489
4 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,11 @@
package com.massivecraft.mcore.mixin;
import org.bukkit.event.player.PlayerJoinEvent;
import com.massivecraft.mcore.event.MCorePlayerLeaveEvent;
public interface ActuallMixin
{
public boolean isActuallJoin(PlayerJoinEvent event);
public boolean isActuallLeave(MCorePlayerLeaveEvent event);
}

View File

@ -0,0 +1,6 @@
package com.massivecraft.mcore.mixin;
public abstract class ActuallMixinAbstract implements ActuallMixin
{
}

View File

@ -0,0 +1,32 @@
package com.massivecraft.mcore.mixin;
import org.bukkit.event.player.PlayerJoinEvent;
import com.massivecraft.mcore.event.MCorePlayerLeaveEvent;
public class ActuallMixinDefault extends ActuallMixinAbstract
{
// -------------------------------------------- //
// INSTANCE & CONSTRUCT
// -------------------------------------------- //
private static ActuallMixinDefault i = new ActuallMixinDefault();
public static ActuallMixinDefault get() { return i; }
// -------------------------------------------- //
// OVERRIDE
// -------------------------------------------- //
@Override
public boolean isActuallJoin(PlayerJoinEvent event)
{
return true;
}
@Override
public boolean isActuallLeave(MCorePlayerLeaveEvent event)
{
return true;
}
}

View File

@ -7,10 +7,12 @@ import java.util.Set;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.permissions.Permissible; import org.bukkit.permissions.Permissible;
import com.massivecraft.mcore.PS; import com.massivecraft.mcore.PS;
import com.massivecraft.mcore.Predictate; import com.massivecraft.mcore.Predictate;
import com.massivecraft.mcore.event.MCorePlayerLeaveEvent;
public class Mixin public class Mixin
{ {
@ -58,6 +60,10 @@ public class Mixin
public static KickMixin getKickMixin() { return kickMixin; } public static KickMixin getKickMixin() { return kickMixin; }
public static void setKickMixin(KickMixin val) { kickMixin = val; } public static void setKickMixin(KickMixin val) { kickMixin = val; }
private static ActuallMixin actuallMixin = ActuallMixinDefault.get();
public static ActuallMixin getActuallMixin() { return actuallMixin; }
public static void setActuallMixin(ActuallMixin val) { actuallMixin = val; }
// -------------------------------------------- // // -------------------------------------------- //
// STATIC EXPOSE: WORLD // STATIC EXPOSE: WORLD
// -------------------------------------------- // // -------------------------------------------- //
@ -456,4 +462,18 @@ public class Mixin
return getKickMixin().kick(senderId, message); return getKickMixin().kick(senderId, message);
} }
// -------------------------------------------- //
// STATIC EXPOSE: ACTUALL
// -------------------------------------------- //
public static boolean isActuallJoin(PlayerJoinEvent event)
{
return getActuallMixin().isActuallJoin(event);
}
public static boolean isActuallLeave(MCorePlayerLeaveEvent event)
{
return getActuallMixin().isActuallLeave(event);
}
} }