Inactive [ADMN] IWarnYou v1.5.3 - Simple but advanced warning system! [1.1-R6]

Discussion in 'Inactive/Unsupported Plugins' started by CraigEge, Oct 27, 2011.


What should I add next?

  1. Swear Word Blocker

  2. Deleting specific warnings

  3. Warnings time out

  1. IWarnYou v1.5.3
    IWarnYou is a simple warnings plugin designed to alert users of there wrong doings but also so staff can check if a user has previously broke the rules.
    Thanks to learning more about Java coding and the Bukkit API I am currently working on a complete recode and remake of the plugin that will complete reinvent the way it works, what it can do and how well it works, it will make everyones life easier when handling the warnings and the weight each warning has (because currently a spam warning weighs as much as a grief warning even though they make a big difference).
    I have currently implemented in to the remake:
    • Simple config file (both layout and the way the plugin handles it)
    • MCBans Support
    • A version update detector with auto downloading
    • Any normal startup code has been cleaned up to be more efficient
    • Permissions
    • Swear detector
    • Warning check signs
    • Freeze warn (Freeze a player when they are warned)
    NOTE: Sorry about the delays in the update, my computer went crazy and I could not use it properly to get coding again until now, I have started development on the update again and am making good progress :)
    /warn (username) (reason)N/Aiwarnyou.warnWarn a user
    /warnings [username]N/Aiwarnyou.checkCheck yours or another users warnings (must be op or have node to view others)
    /clearwarns (username) [id]/cwarnsiwarnyou.clearClears the warns set to a user, add a ID to the end to remove a specific warning
    /modifywarn/mwarniwarnyou.editModify a already created warning
    /twarnsN/Aiwarnyou.twarnsToggle the ability for users to view there warnings without accessing the config file
    /iwyreloadN/Aiwarnyou.reloadReload IWarnYou
    /iwyN/AN/AView available commands
    To create a warnings sign you need the permission node iwarnyou.sign if you have it create a sign with [Warnings] on the top line to view the users own warnings or add a username on the second line so when you right clicked it will tell you that users warnings!​
    By default the configuration file shows this:

    # IWarnYou config file
    WarningsToBan: 5
    BanMsg: You have been banned for reaching &4%num&f out of &4%total&f allowed warnings!
    ShowAllOnLogin: false
    ShowOnLogin: true
    AutoBan: false
    viewOwnWarnings: false
    announceWarnings: true
    Here is a rundown of all the settings:
    How many warnings a user can have at any one time before they are auto-banned (AutoBan must be set to true)
    The message a user gets when they are banned
    Should the user see all there warnings when they sign in
    Should the user see a warning count when they sign in
    Should users be auto banned when they reach the WarningsToBan limit
    Should the user be able to view their own warnings without having the permission node or being a op
    Should every user in the warned users world see that they where warned​
    Currently added in next version
    • Only OPs and people with the iwarnyou.sign permission node can destroy [Warnings] signs
    • Cursing blocker that automatically warns the user and blocks the fowl language
    • Ability to add location to warning with extra argument (e.g. -loc)
    • Warnings time out (edit time in config file)
    • Plugin will tell you when a update is available
    Contact Me
    If you have any problems, bugs or ideas then please contact me at [email protected] or leave a comment!
    31/10/2011 - v1.5.2
    - Fixed error that stopped a ingame user warn a offline user
    - Added colours to the [Warnings] signs​
    - Happy Halloween!​
    30/10/2011 - v1.5.1
    - Fixed database update error
    30/10/2011 - v1.5
    - Warnings have there own unique ID which is stated after the # when you type /warnings [username]
    - Automatically updates the old databases to support the new ID's
    - The ability to delete a warning by ID
    - The ability to edit a warning by ID
    - A warning sign that when you right click tells you information
    29/10/2011 - v1.4
    - Removed some debugging I forgot to remove (when it says the server didnt reload ignore it)
    - Added the ability to announce the warning to everyone in that world (change in config)
    - OPs can see version number in /iwy
    - Fixed the /clearwarns bug when typed in game and the user is offline
    - Case insensitivity if the player is online, otherwise warns case sensitive offline user
    27/10/2011 - v1.3
    - Fixed a bug where clearing a offline users warnings would create a error
    - Added /twarns so you can toggle if users can view there own warnings without accessing the config
    - Updated HelpMe support to work with the new Maven system
    - Added /twarns to HelpMe
    27/10/2011 - v1.2
    - Added HelpMe Support
    27/10/2011 - v1.1
    - Adding console support (commands now work in the console)
    26/10/201 - v1.0
    - Initial Release
  2. Offline


  3. Thank you :)
    BetaStream likes this.
  4. Offline


    Great, man! Thank you!
  5. Offline


    I like this plugin. A lot.
  6. I have tried this out and i cant warn offline players?
    Any assistance for this :D?
  7. @Aaron Mullins(CoWs) When warning a offline user it is case sensitive, are you just typing the persons username in lowercase? I will be adding case insensitivity to users who are warned offline soon ;)
  8. Offline


    Should the user see all there warnings when they sign in" Should it be "Their"?
  9. Fixed :p
  10. Erm, i think i am typing the name right D:?
    It just says, "An internal error occurred whilst attempting this command" and produces this
    30.10 10:38:22 [Server] INFO     ... 12 more
    30.10 10:38:22 [Server] INFO     at org.bukkit.command.PluginCommand.execute(
    30.10 10:38:22 [Server] INFO     at me.craigege.IWarnYou.iwy.onCommand(
    30.10 10:38:22 [Server] INFO Caused by: java.lang.NullPointerException
    30.10 10:38:22 [Server] INFO     at
    30.10 10:38:22 [Server] INFO     at
    30.10 10:38:22 [Server] INFO     at net.minecraft.server.MinecraftServer.h(
    30.10 10:38:22 [Server] INFO     at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    30.10 10:38:22 [Server] INFO     at net.minecraft.server.NetServerHandler.a(
    30.10 10:38:22 [Server] INFO     at net.minecraft.server.NetworkManager.b(
    30.10 10:38:22 [Server] INFO     at net.minecraft.server.Packet3Chat.a(
    30.10 10:38:22 [Server] INFO     at net.minecraft.server.NetServerHandler.a(
    30.10 10:38:22 [Server] INFO     at
    30.10 10:38:22 [Server] INFO     at net.minecraft.server.NetServerHandler.handleCommand(
    30.10 10:38:22 [Server] INFO     at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
    30.10 10:38:22 [Server] INFO     at org.bukkit.command.SimpleCommandMap.dispatch(
    30.10 10:38:22 [Server] INFO     at org.bukkit.command.PluginCommand.execute(
    30.10 10:38:22 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'warn' in plugin IWarnYou v1.4
    30.10 10:38:22 [Server] SEVERE null
  11. @Aaron Mullins(CoWs) Im stupid and just realised I fixed this bug in v1.5, I just have to update when I fix one last bug :)
  12. Sure, let me know when the new version is up :D
  13. v1.5 added ^_^

    Also added [Warnings] signs to make up for the late release :p
  14. Awesome, i will test it now :) and let you know

    I tried it out and it produced this error when i tried to warn an offline player D:

    31.10 17:42:52 [Server] INFO     ... 12 more
    31.10 17:42:52 [Server] INFO     at org.bukkit.command.PluginCommand.execute(
    31.10 17:42:52 [Server] INFO     at me.craigege.IWarnYou.iwy.onCommand(
    31.10 17:42:52 [Server] INFO Caused by: java.lang.NullPointerException
    31.10 17:42:52 [Server] INFO     at
    31.10 17:42:52 [Server] INFO     at
    31.10 17:42:52 [Server] INFO     at net.minecraft.server.MinecraftServer.h(
    31.10 17:42:52 [Server] INFO     at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    31.10 17:42:52 [Server] INFO     at net.minecraft.server.NetServerHandler.a(
    31.10 17:42:52 [Server] INFO     at net.minecraft.server.NetworkManager.b(
    31.10 17:42:52 [Server] INFO     at net.minecraft.server.Packet3Chat.a(
    31.10 17:42:52 [Server] INFO     at net.minecraft.server.NetServerHandler.a(
    31.10 17:42:52 [Server] INFO     at
    31.10 17:42:52 [Server] INFO     at net.minecraft.server.NetServerHandler.handleCommand(
    31.10 17:42:52 [Server] INFO     at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
    31.10 17:42:52 [Server] INFO     at org.bukkit.command.SimpleCommandMap.dispatch(
    31.10 17:42:52 [Server] INFO     at org.bukkit.command.PluginCommand.execute(
    31.10 17:42:52 [Server] INFO org.bukkit.command.CommandException: Unhandled exception executing command 'warn' in plugin IWarnYou v1.5
    31.10 17:42:52 [Server] SEVERE null
    good job anyway :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 20, 2016
  15. @Aaron Mullins(CoWs) Bug already tracked down and removed, will update the client to v1.5.2 when I add colours to the [Warnings] signs (now added in v1.5.2) ;)
  16. Awesome, good job! :D
  17. Offline


    Simple and useful! Good job! [gold]
  18. Bug fix and better [Warnings] signs released (v1.5.2)!
  19. Offline


    like it
  20. Offline


    I've been playing with this, (1.5.2). Cool concept, but there are a lot of bugs that I've found doing light testing...
    • /iwyreload changes all the settings back to defaults every time. A full plugin reload seems to make the settings stick (/reload or using a plugin reloader).
    • WarningsToBan feature doesn't work. It kicks the player, but they can rejoin. I tried de-opping, removing all permissions, nothing seemed to have an effect, player can always rejoin.
    There are probably more, but I gave up once I figured out that WarningsToBan was busted. No errors in the server.log.
  21. @phrstbrn Thats really weird because I still keep testing it and WarningsToBan works every time for me! I just tested it again and once again it worked, what plugins do you also have installed?

    This is what I was planning in the first place for /iwyreload as if you mess up the config and didnt know the defaults you could fix it quickly, how many people would like me to change it to just restart instead of set config to defaults?
  22. Offline


    I recompiled the .jar you released to take a quick peek and see what you were doing, I am certain the .jar you released, 1.5.2 doesn't work with regards to WarningsToBan. Either you released the wrong jar, or you're using a different .jar, but I'm certain you are mistaken.

    If /iwyreload is going to reset the config values to defaults, please rename the command. It's misleading. I personally would have no use for such a command. If I did need to reset to defaults, I would just delete the configuration file (and most plugins would re-create it for me).
  23. @phrstbrn I will rename or replace the /iwyreload command but as for the WarningsToBan goes it works 100% for me even when I downloaded the link myself, do you have anything that overrides the ban list and are you enabling AutoBan in the config file aswell?
  24. Offline


    It kicks you, but nothing stops you from rejoining the server. That's called a kick, not a ban. You need to do an event.disallow() in the onPlayerJoin event if you want to prevent the player from rejoining the server, and you never try to do that.

    I'm 110% certain you are mistaken.
  25. @phrstbrn On my local test server and on my friends server I keep testing and every time it adds the user to the ban list, 100% of the time without fail! Do you have AutoBan enabled?
  26. Offline


    Yes, AutoBan is enabled. But seriously. Decompile you're own .jar, I'm telling you, it doesn't work.

    I'll break it down for you, since you don't seem to understand.

      public void onPlayerJoin(PlayerJoinEvent event) {
    Player player event.getPlayer();
    String pname player.getName();
    Boolean sol this.plugin.showOnLogin;
    Boolean saol this.plugin.showAllOnLogin;
    Boolean banned this.plugin.isBanned(pname); #YOU DON'T DO ANYTHING WITH THIS VARIABLE
    if (sol.booleanValue()) {
          if (!
    saol.booleanValue()) {
    Integer warns Integer.valueOf(0);
    warns this.plugin.getTotalWarnings(pname);
            if (
    warns.intValue() != 0)
    player.sendMessage(ChatColor.RED "You have " ChatColor.AQUA warns ChatColor.RED " warning(s)!");
          if (
    saol.booleanValue()) {
    Integer warns Integer.valueOf(0);
    warns this.plugin.getTotalWarnings(pname);
    Integer i Integer.valueOf(1);
            if (
    warns.intValue() != 0)
    player.sendMessage(ChatColor.RED "You have " ChatColor.AQUA warns ChatColor.RED " warning(s)!");
    player.sendMessage(ChatColor.RED "Your warnings are:");
              for (
    Integer.valueOf(1); i.intValue() < warns.intValue() + 1Integer.valueOf(i.intValue() + 1)) {
    String warning this.plugin.getWarning(pnamei);
    Integer warnid this.plugin.getWarningID(pnamei);
    player.sendMessage(ChatColor.RED "#" warnid ": " ChatColor.AQUA warning);
    # We're at the end, and you never call event.disallow().  There is no snowballs chance in hell this prevents the player from logging in.
  27. @phrstbrn It dosent ban the player from there, look at the main file on line 212 it says:

    if(warnee.getName().equals(pname)) {
    warnee.kickPlayer(cmsg.replaceAll("(&([a-f0-9]))", "\u00A7$2"));

    and really, it works 100% for me and everyone I know every time using the jar file on BukkitDev (Download link on this page links there)!
  28. Offline


    Okay, I see that, but that STILL doesn't ban the player. It kicks them from the server... and then they can re-connect. Then what? Do you get it yet? Do I have to spell it out for you?
  29. @phrstbrn When I try to reconnect from the servers I've tested it on I try to login and it says "The ban hammer has spoken" that means banned! I dont know whats happening for you but everyone I know thats helped me test is successfully banned with the exception of you.

    It's my first plugin but everyone else seems to use it fine, I dont know whats happening for you, also they shouldnt be able to join as it IS banning them as you can see from this example:

    I am using this same ban method and that is official bukkit code
  30. Offline


    You're banning the player after they are kicked. You're triggering a race condition. At that point you are banning an online player, which is really offline, which is probably preventing the ban from being recorded (don't use the Player interface on players who are not logged in). The official code uses the OfflinePlayer interface, you use the Player interface.

Share This Page