BlockLock (coding liberary)

This is NOT an plugin with commands!
This plugin/code is NOT for any server extras.
VERY IMPORTANT:
Only java coders can use this!

BlockLock.start(String "TheLockName", Player PlayerWhoOpensLock, Runnable WhatToDoOnSucces, Plugin PluginThisActionShouldAttachTo, Runnable RunWhenCodeIsWrongCanBeNULLtoo, Boolean IsTheLockQuitable);
Preview for a login lock:
private Plugin me;
public void onEnable(){
if(getConfig().get("Created") == null){
getConfig().set("Created", true);
saveConfig();
reloadConfig();
me = this;
}
Bukkit.getServer().getPluginManager().registerEvents(this, this);
}
@EventHandler
public void onJoinLock(PlayerJoinEvent e){
final Player ply = (Player) e.getPlayer();
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable(){
@Override
public void run() {
BlockLock.start(ply, "Join_Login", new Runnable(){
@Override
public void run(){
ply.sendMessage("Welcome to ....'s network!");
}
}, me, new Runnable(){
@Override
public void run(){
ply.kickPlayer("Enter the correct code!");
}
}, false);
}
});
}

Events:

@EventHandler
public void onFail(LockDenyEvent e){
Player ply = (Player) e.getPlayer();
String LockName = e.lockName();
}
@EventHandler
public void onFinish(LockFinishEvent e){
Player ply = (Player) e.getPlayer();
String LockName = e.lockName();
}


Codes are saved to the config.
Hope this speedup your protection coding a bit!
Good luck, JMteam09

Milestones:
10 Downloads
50 Downloads
100 Downloads
250 Downloads
500 Downloads
1000 Downloads


Comments

Posts Quoted:
Reply
Clear All Quotes

About This Project

  • Project ID
    88829
  • Created
    Jan 21, 2015
  • Last Released File
    Jan 23, 2015
  • Total Downloads
    1,310
  • License

Categories

Members

Recent Files