Skip to content

A bit of everything. Minor code cleanup and Java 8

Parker Hawke requested to merge (removed):project-cleanup into master

Because a client of mine uses this plugin rather religiously, I figured I'd contribute a little bit and just give the codebase a little tiny clean. I've obviously not scrubbed through everything but these were some of the major warnings in my IDE that I figured I'd remove as well as a few things that I picked out while I was delving around the codebase. I may contribute at a later date with a few more changes to improve the project.

  • Add unknown generics to classes that require it (i.e. Class>, Constructor>, etc.)
  • Use inferred generic types where possible
  • Remove any unnecessary nesting in else clauses
  • Remove any instances of the section symbol or any other unicode character in source. Use instead the ChatColor enum and direct unicode value constants
  • Remove a few unnecessary casts
  • Replace unnecessary calls to #replaceAll() when #replace() is better suited
  • Replace calls to Player#getItemInHand() with PlayerInventory#getItemInMainHand(). It's 1.13 after all
  • Complete any missing Javadoc comments
  • Remove various unnecessary annotations
  • Add a utility method to WrappedPacket for easy construction

Merge request reports