Filled Punishment GUI [ASAP]

Discussion in 'Plugin Requests' started by OfficerDeveloper, Jul 6, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    Tecno_Wizard

    @Chiller, I had it exponentially. I think that if you were to temp mute someone 5 times, you wouldn't want it to be only a few hours. Also, I noticed you switched the K&R to allman. I'll stick with allman for this, but for someone who has used K&R for a year it's hard to read. Lol. I'll get used to it.

    @OfficerDeveloper, is there anything else you want? I'm up.
     
    Last edited: Jul 25, 2015
  2. Offline

    Chiller

    @Tecno_Wizard Ya I just think Allman looks a lot nicer, but that is personal preference. In eclipse there is a reformat key shortcut, there is probably one in IntelliJ. Also what happened to your repo?
     
  3. Offline

    Chiller

    @OfficerDeveloper

    Github Download v1.0.3

    This release should be pretty stable! Please test it out and notify me of any bugs!

    Added:
    • Customizable lore message for history items, in config
    • Exponential time increase instead of linear
    • Message for unknown reason or expiration time
    Fixed:
    • Re-arranged classes and packages
     
    Last edited: Jul 25, 2015
  4. @Chiller Ok thank you!, Going to test it now

    @Chiller I want wherever the arrows are to be another blank row of inv slots: http://prntscr.com/7wucn6

    @Chiller I don't think you saw that ^

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 4, 2016
  5. Offline

    Chiller

    @OfficerDeveloper Ya I did not see that.

    Github Download v1.0.4

    Added:
    • Blank rows to the main menu

    @Tecno_Wizard @OfficerDeveloper

    So I just created a BukkitDev page, I made you, Tecno, the former author.
    It is awaiting approval right now so it should be up soon!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 4, 2016
  6. Offline

    Tecno_Wizard

    @Chiller, sounds good. Yi did see that gravity low's updater was embedded correct? That can be activated once there's a project ID. Also, plugin metrics is already mapped to my account, but as with my other plugins, I could give you all of the full size image links.
     
  7. Offline

    Chiller

    @Tecno_Wizard Well I actually took out the updater and metrics, I created the bukkitdev so that I can add the updater in, as for metrics I have never used it but I might just use your metrics.
     
  8. @Chiller So when I added the jar to my build path, and I copied/pasted the mute code into my custom chat file, whenever someone types it sends double messages.
     
  9. Offline

    Chiller

    @OfficerDeveloper Im not quite understanding what you are referring to...
    Please elaborate and post some pics!
     
  10. Offline

    Tecno_Wizard

    @Chiller, the messgaes are being sent twice. Somehow there are duplicates class instances somewhere.
     
  11. @Tecno_Wizard No no no

    @Chiller I copied/pasted the code that was in the PunishmentChecker class (only the chat event) into my CUSTOM chat event class in my main plugin for the server, and when someone talks it sends double messages of the punish message.
     
  12. Offline

    Tecno_Wizard

    @Chiller, we need an custom event it seems.
     
  13. @Tecno_Wizard No no no, I have a custom chat class right? With AsyncChatEvent... I copied/pasted the code from the plugin, and implemented the plugin into my build path.

    Now it sends double message.
     
  14. Offline

    Tecno_Wizard

  15. Offline

    Chiller

    @OfficerDeveloper Well thats because my plugin registers the event and sends out a message no matter what.
    Then your plugin also registers a chat event and also sends out the message.

    There is no way for my chat event to be overridden.

    I would have to add in something for that.

    @OfficerDeveloper Or you could set your chatevent priority higher than the normal so that you can cancel my event.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 4, 2016
  16. Offline

    Tecno_Wizard

    @Chiller, there is an interface for events called cancelable. Use that. (I'll fork and put in a pull request)
     
  17. @Chiller If I made mine High yours would cancel?
     
  18. Offline

    Chiller

    @OfficerDeveloper You would have to use EventPriority.LOW, then you should be fine

    @OfficerDeveloper Actually I have to change one minor thing.

    Github Download v1.0.5

    Added:
    • Ability to cancel out my chat event handler

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jan 4, 2016
  19. @Chiller You're the best! Testing it later when I get the chance ;)
     
  20. Offline

    Tecno_Wizard

    @Chiller, if I may ask, do you work as a programmer? Your Java knowledge seems to supersede mine 3-fold.
     
  21. @Tecno_Wizard And mine ;-; His bio shows hes an adult, so Im guessing either freelance software dev or web dev
     
  22. Offline

    Tecno_Wizard

    @OfficerDeveloper, I deleted and recreated the repo because he built using maven making the 2 repos unmergable.
     
  23. @Tecno_Wizard Ok, just cuirous if this could be private since I don't want to use public plugins except for plotme .-.
     
  24. Offline

    Tecno_Wizard

    @OfficerDeveloper, we're not allowed to make private plugins through communications on bukkit
     
  25. Offline

    Chiller

    @OfficerDeveloper @Tecno_Wizard

    I am not that old, I am 18 and about to be in college. I am a construction worker intern as of right now.
    I have never taken any classes on programming, all my knowledge has been learned from youtube!
    But I will be going to college to become a software engineer, I guess I will already know everything before I take the class!
     
  26. Offline

    Tecno_Wizard

    @Chiller, no kidding... I had a feeling you were just doing it as a hobby. Most professionals don't use Allman, but you really know your stuff. I might ask for your help on a lib of mine in the future. JSON based databases optimized for Bukkit use. It will allow people to get the advantages in speed of SQL with a file-based system. YML just doesn't cut it when it comes to parse speed. However, parsing Objects to JSON isn't the prettiest process as you've likely seen from ConfigurationSerializable. Here's my take on it.
    Code:
     public <T> T get(String key, Class<T> type) {
            Object obj = jsonObject.get(key);
            if(type.isInstance(obj)) return (T)obj;
    
            // if obj is a map or the parsed data of obj is a map (obj is set to parsed data)
            else if(obj instanceof Map || (obj instanceof String && (obj = JSONValue.parse((String)obj)) instanceof Map)){
                Class[] clazzes = type.getInterfaces();
                for(Class clazz: clazzes) {
                    if(clazz.equals(DatabaseSerializable.class)) {
                        try {
                           return (T)type.getMethod("deserialize", Map.class).invoke(null, (Map<String, Object>) obj);
                        } catch (java.lang.Exception exception) {
                            System.out.println("Error: Deserialization of class " + type.getName() + " was attempted but" +
                                    " failed. \"deserialize\" has not been implemented correctly or the key is not mapped" +
                                    " to the object that was specified for deserialization.");
                            return null;
                        }
                    }
                }
            } return null;
        }
     
    Last edited: Jul 25, 2015
  27. @Chiller the new version's config is the same as the old one, for my plugin I had to put it at HIGHEST priority for it to work. Also the config keeps resetting with no errors in console
     
  28. Offline

    Chiller

    @OfficerDeveloper Ya the config will not update for you because it only copy's over if you do not already have a config...
    Do you stop your server then edit it then start it?

    Default Config:
    Code:
    # Time increments are in seconds
    message_prefix: '&c&lPUNISH&r'
    message_suffix: '&aUnfairly punished? Contact us on the forums!'
    messages:
      warn: '%message_prefix% &4You have been warned &6(%reason%) &4by &6%punisher%'
      unmute: '%message_prefix% &aYou are no longer muted.'
      perm_ban: '%message_prefix% &4You have been permanantly banned &6(%reason%) &4by
        &6%punisher%#n%message_suffix%'
      perm_mute: '%message_prefix% &4You have been permanantly muted &6(%reason%) &4by
        &6%punisher%'
      temp_ban: '%message_prefix% &4You have been banned until &b%date% &6(%reason%) &4by
        &6%punisher%#n%message_suffix%'
      temp_mute: '%message_prefix% &4You have been temporarily muted &6(%reason%) &4by
        &6%punisher%'
      login_perm_ban: '%message_prefix% &4You have been permanantly banned &6(%reason%)
        &4by &6%punisher%#n%message_suffix%'
      login_temp_ban: '%message_prefix% &4You have been banned until &b%date% &6(%reason%)
        &4by &6%punisher%#n%message_suffix%'
      perm_muted: '%message_prefix% &4You are permanently muted for &6%reason% &4by &3%punisher%'
      temp_muted: '%message_prefix% &4You are muted until &b%date% &4for &6%reason% &4by
        &3%punisher%'
      perm_ban_unknown: 'You have been banned for an unknown reason.#n%message_suffix%'
      perm_ban_unknown: 'You have been banned for an unknown reason and an undeclared amount of time.#n%message_suffix%'
    lore:
      history: '&6Reason: &c%reason%#n&6Given by: &c%punisher%#n&6Date: &c%date%'
      history_removed_by: '#n&6Removed by: &c%remover%#n&6Removed reason: &c%remove_reason%'
    time:
      ban_increment: 240
      mute_increment: 120
    date_format: 'MM/dd/yyyy h:mm:ss a'
    
     
Thread Status:
Not open for further replies.

Share This Page