Fixed version num
This commit is contained in:
parent
e26775eea1
commit
57899690b2
@ -17,7 +17,7 @@ import com.redstoner.misc.Main;
|
|||||||
import com.redstoner.misc.Utils;
|
import com.redstoner.misc.Utils;
|
||||||
import com.redstoner.modules.Module;
|
import com.redstoner.modules.Module;
|
||||||
|
|
||||||
@Version(major = 2, minor = 0, revision = 1, compatible = 2)
|
@Version(major = 2, minor = 1, revision = 0, compatible = 2)
|
||||||
public class ClearOnJoin implements Module, Listener
|
public class ClearOnJoin implements Module, Listener
|
||||||
{
|
{
|
||||||
private File listLocation = new File(Main.plugin.getDataFolder(), "clearonjoins.json");
|
private File listLocation = new File(Main.plugin.getDataFolder(), "clearonjoins.json");
|
||||||
@ -36,7 +36,7 @@ public class ClearOnJoin implements Module, Listener
|
|||||||
@Command(hook = "clearonjoinself")
|
@Command(hook = "clearonjoinself")
|
||||||
public void clearOnJoinSelf(CommandSender sender)
|
public void clearOnJoinSelf(CommandSender sender)
|
||||||
{
|
{
|
||||||
String name = sender.getName().toLowerCase();
|
String name = ((Player)sender).getUniqueId().toString();
|
||||||
if (list.contains(name))
|
if (list.contains(name))
|
||||||
{
|
{
|
||||||
list.remove(name);
|
list.remove(name);
|
||||||
@ -53,18 +53,18 @@ public class ClearOnJoin implements Module, Listener
|
|||||||
public void uponJoin(PlayerJoinEvent e)
|
public void uponJoin(PlayerJoinEvent e)
|
||||||
{
|
{
|
||||||
Player player = e.getPlayer();
|
Player player = e.getPlayer();
|
||||||
String playerName = player.getName().toLowerCase();
|
String playerName = player.getUniqueId().toString();
|
||||||
if (list.contains(playerName))
|
if (list.contains(playerName))
|
||||||
{
|
{
|
||||||
e.getPlayer().getInventory().clear();
|
e.getPlayer().getInventory().clear();
|
||||||
Utils.sendMessage(e.getPlayer(), null, "Inventory Cleared.");
|
Utils.sendMessage(player, null, "Inventory cleared.");
|
||||||
}
|
}
|
||||||
else if (list.contains("!" + playerName))
|
else if (list.contains("!" + playerName))
|
||||||
{
|
{
|
||||||
e.getPlayer().getInventory().clear();
|
player.getInventory().clear();
|
||||||
list.remove("!" + playerName);
|
list.remove("!" + playerName);
|
||||||
saveList();
|
saveList();
|
||||||
Utils.sendMessage(e.getPlayer(), null, "Inventory Cleared.");
|
Utils.sendMessage(player, null, "Inventory cleared.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,19 +83,13 @@ public class ClearOnJoin implements Module, Listener
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onDisable()
|
|
||||||
{
|
|
||||||
saveList();
|
|
||||||
}
|
|
||||||
|
|
||||||
// @noformat
|
// @noformat
|
||||||
@Override
|
@Override
|
||||||
public String getCommandString()
|
public String getCommandString()
|
||||||
{
|
{
|
||||||
return "command clearonjoin {\n" +
|
return "command clearonjoin {\n" +
|
||||||
" [string:name] {\n" +
|
" [string:name] {\n" +
|
||||||
" help Clears that players inventory the nect time they join.;\n" +
|
" help Clears that player's inventory the nect time they join.;\n" +
|
||||||
" run clearonjoin name;\n" +
|
" run clearonjoin name;\n" +
|
||||||
" perm utils.clearonjoin.other;\n" +
|
" perm utils.clearonjoin.other;\n" +
|
||||||
" }\n" +
|
" }\n" +
|
||||||
|
Reference in New Issue
Block a user