Tastybento
180517cef3
Code smells cleanup
2018-02-10 14:00:40 -08:00
Tastybento
c76c854ed3
Code smells cleanup
...
Removed unnecessary cast in Island.
Combined if statement
Removed unnecessary {}
2018-02-10 13:56:44 -08:00
Tastybento
84e3ae3e8b
Removed imports
...
Fixed vulnerability issue with Pair
Fixed database connection issue with MySQLDatabaseHandler
2018-02-10 13:51:11 -08:00
Tastybento
65d34f5842
Reverted change of coords to long because not needed.
...
Mincreaft max coords are +/- 30 million.
2018-02-10 13:19:54 -08:00
Tastybento
ed65aa421d
Rewrote SafeSpotTeleport
...
Moved coords to longs instead of ints for island locations
Created a SafeTeleportBuilder class
Created a utility Pair class
2018-02-10 13:09:32 -08:00
Florian CUNY
4bd02a59ef
Added description to /bsb (reload and version) + added some aliases
2018-02-10 17:03:57 +01:00
Florian CUNY
b04602302b
Internal Placeholders are now working
...
It works, but it is more like a DIY patch thing. It has a few problems with the current implementation :
1. It doesn't suit our "code style" : it uses an Handler instead of a Manager, eg.
2. It is a bit laggy (I've got the feeling that it could be improved)
3. It doesn't hook to other Placeholder APIs for now
And a few other things.
I think this is more like a Proof of Concept : it will have to be improved in the next weeks.
2018-02-10 13:54:27 +01:00
Florian CUNY
65245a99f5
Fixes bug where the help could be seen even though not having the perms
2018-02-10 11:00:19 +01:00
tastybento
f8da3fbc61
Fixed bugs with MySQLDatabaseHandler
...
Code clean up, fixed bugs. Added automated tests.
2018-02-09 17:06:32 -08:00
Tastybento
aae4c6d0b2
Rewrote safe teleport.
...
Needs testing.
2018-02-08 23:47:11 -08:00
Tastybento
f3d7bf2af3
Refactored code to make it better to maintain and read.
2018-02-08 21:17:16 -08:00
Tastybento
80f0a78f08
Removed stack trace as exception already logged.
2018-02-08 20:12:23 -08:00
Tastybento
c916bbf827
Automated code cleanup.
...
Removes spaces, adds {} to if statements, etc.
2018-02-08 20:08:46 -08:00
Tastybento
98b49ea37a
Fixed bug where if statement had a ; in it
2018-02-08 20:06:00 -08:00
Tastybento
5314f3618a
Removed unused imports.
2018-02-07 21:33:55 -08:00
Tastybento
b253ff5c64
Code cleanup.
2018-02-07 21:33:36 -08:00
Tastybento
fc8876cf80
Fixed return values to match pass/fail.
2018-02-07 21:13:32 -08:00
Tastybento
2be005acb1
Removed vulnerabilities
...
Mainly leftover raw stacktrace prints in exceptions instead of propper
logging statements.
2018-02-07 21:11:23 -08:00
Tastybento
b833b17d22
Helped secure the prepared statement
2018-02-07 20:43:13 -08:00
Tastybento
41dd491f05
Code cleanup.
2018-02-07 19:44:10 -08:00
Tastybento
1d5086531d
Removed performance hit of logging
...
Since Java 8, we can use Supplier for logger, which will be evaluated
lazily.
In general, the debug stuff should be removed when we have more
stability.
2018-02-07 19:39:00 -08:00
Tastybento
29d09922b9
Switched to use Files.delete
...
When File.delete fails, this boolean method simply returns false with no
indication of the cause. On the other hand, when Files.delete fails,
this void method returns one of a series of exception types to better
indicate the cause of the failure. More information is generally better
in a debugging situation, so I'll use this option.
2018-02-07 19:33:59 -08:00
Tastybento
08b2e2579b
Reverted to using an explicit throw of all exceptions
2018-02-07 19:28:29 -08:00
Tastybento
e4fbc6fab1
Simplified code, no need for internal variable.
2018-02-07 19:16:05 -08:00
Tastybento
3f35afc76a
Close is handled automatically.
2018-02-07 19:13:40 -08:00
Tastybento
7e7b259531
Converted Map to EnumMap
...
When all the keys of a Map are values from the same enum, the Map can be
replaced with an EnumMap, which can be much more efficient than other
sets because the underlying data structure is a simple array.
2018-02-07 19:12:23 -08:00
Florian CUNY
7b55ca70b2
Fixed some Flags and added a security check in FlagsManager
...
...to avoid duplicates of Listeners
2018-02-07 13:41:37 +01:00
Florian CUNY
f33fa2477a
Use .equals() in #isBanned(UUID) in Island
2018-02-07 13:33:37 +01:00
Florian CUNY
12cac6b3aa
Minor adjustments to ranks-related methods in Island
2018-02-07 13:29:19 +01:00
Florian CUNY
293ab2ccf9
Added default values to Settings
2018-02-07 13:16:09 +01:00
Tastybento
e5a87ccf7a
Code cleanup and bug fixing.
...
This just cleans up a lot of code that could cause confusion or was
actually wrong.
2018-02-06 23:04:09 -08:00
Tastybento
1db21c10da
Fixed bug with help that I introduced.
...
Added specific convenience showHelp() method to Composite command.
2018-02-06 22:45:21 -08:00
Tastybento
61f0a6f997
Made homeTeleport void because it does not return anything useful
2018-02-06 22:02:14 -08:00
Tastybento
ad50b04177
Removed unneeded method.
2018-02-06 21:59:15 -08:00
Tastybento
eefcd48c7c
Fixed return values for execute.
2018-02-06 21:57:45 -08:00
Tastybento
af5c7e472e
Fixed execute return values.
2018-02-06 21:48:59 -08:00
Tastybento
a9373a3eea
Fixed return values - false = error
2018-02-06 21:46:59 -08:00
Tastybento
00470b1fc8
Return false if error.
2018-02-06 21:45:10 -08:00
Tastybento
3e2d2ec2d6
Return false if unsuccessful due to no island.
2018-02-06 21:44:40 -08:00
Tastybento
219d1e66ab
Fixed brackets.
2018-02-06 21:43:31 -08:00
Tastybento
f4c7a3fe45
Made command return false if unsuccessful.
2018-02-06 21:40:29 -08:00
Tastybento
81b0543f25
Added missing break statement to switch.
2018-02-06 21:34:48 -08:00
Tastybento
574febb327
Added missing break statement in switch.
2018-02-06 21:34:20 -08:00
Tastybento
2e89a2654f
Added more try-with-resource to auto-close prepared statement
2018-02-06 21:33:05 -08:00
Tastybento
fdc7a62990
Fixed issue where Optional was not being explicitly checked before get.
2018-02-06 21:31:59 -08:00
Tastybento
2d64070d3f
Avoided setting static variable in non-static method.
2018-02-06 21:31:19 -08:00
Tastybento
5a5ae2d077
Used Java standard ordering of words
2018-02-06 21:30:56 -08:00
Tastybento
ed622dc9c0
Fixed switch break bug.
2018-02-06 21:30:35 -08:00
tastybento
bb404380f5
Replaced raw stack trace dumps with helpful error messages.
2018-02-06 16:37:34 -08:00
tastybento
aac17990bc
Made description private.
2018-02-06 16:09:49 -08:00
tastybento
8b7d92d8e6
Added better error message for exception when loading addons.
2018-02-06 16:06:04 -08:00
tastybento
04a4394752
Make addon non-public and provide getter to address minor vulnerability.
2018-02-06 16:04:22 -08:00
tastybento
7e2f8052da
Improved exception handling error messages.
2018-02-06 15:59:42 -08:00
tastybento
1e920825ef
Added context to raw stack trace dump after exception.
2018-02-06 15:55:31 -08:00
tastybento
672d43fb67
Fixed unnecessary if statement and removed redundant code.
2018-02-06 14:11:10 -08:00
tastybento
56ff9f62e4
Used try-with-resources to ensure jar is closed.
2018-02-06 14:07:35 -08:00
tastybento
28b88763e6
Changed Optional map to ifPresent because return value is not needed.
2018-02-06 14:05:48 -08:00
tastybento
8743ac50ef
Removed duplicate sub-expression in if statement.
2018-02-06 14:02:58 -08:00
tastybento
941d9d3dc5
Removed if/else change because it is not required.
2018-02-06 14:01:52 -08:00
tastybento
d2098c3dbe
Check if Optional click handler exists before getting it.
2018-02-06 13:59:23 -08:00
tastybento
2c1d52761f
Cast operand to double.
2018-02-06 13:54:23 -08:00
tastybento
06e61d858c
Fixed a lot of unclosed prepared statements, connections and resultset
2018-02-06 13:52:25 -08:00
tastybento
84d36a1a24
Simplified some logic.
2018-02-06 13:35:17 -08:00
tastybento
f7c4e5a988
Added null checks.
2018-02-06 13:33:08 -08:00
tastybento
1ddf706c68
Bug fixes to avoid NPE's and Optional gets without isPresent
2018-02-06 13:21:08 -08:00
Tastybento
ace6294e23
Came full circle - kept Flags as final statics
...
This approach simulates an enum, but one that can be extended by others
to add custom flags. I added a handy values() method that uses
reflection to provide a list of all the flags in the class.
See TestBSkyBlock.java test classes for the tests of the default flag
registration and the custom flag registration.
2018-02-05 23:53:07 -08:00
tastybento
be5404e9c2
Added Setting type to flags.
...
Flags can be Protection type or Setting Type.
Still needs testing for PVP.
2018-02-05 17:39:04 -08:00
tastybento
645b4eb610
Implements flags as enum so flags are protected.
2018-02-05 14:51:03 -08:00
tastybento
ffbf938a32
WIP trying out moving flags into flag manager.
2018-02-05 14:30:35 -08:00
tastybento
812594783e
Made Adapter its own annotation.
2018-02-05 11:35:50 -08:00
Tastybento
26956d8386
Fixed missing locale text for invites.
...
Fixed config settings for teams.
2018-02-04 21:48:34 -08:00
Tastybento
fa1ccd0c99
Fixed bugs with MySQL saving and loading.
...
Added the adapter annotation to MySQL and fixed issues with empty
hashmaps causing null errors.
Added a flag serializer adapter for the protection flags so that flags
are saved and loaded correctly.
Renamed the Adapter notation class to be clearer about what it is doing.
2018-02-04 12:53:17 -08:00
Tastybento
83d0848429
Fixed bugs with protection.
...
Added serializer adapter for the Flags hashmap in Island.
Teams don't work. Need to work out why.
PVP doesn't work correctly. It allows members to hit visitors anytime,
but visitors can only hit others if PVP is off. This isn't how it is
supposed to work!
2018-02-03 20:42:12 -08:00
Tastybento
6c2078fbec
Added event tests.
...
Fixed bug with user being retained after a checkIsland.
2018-02-03 19:25:53 -08:00
Tastybento
c648409858
Reworked code so it can be tested using automated unit tests.
...
See TestBSkyBlock.java class for protection tests.
More to come!
2018-02-03 15:26:13 -08:00
Tastybento
df0ecca217
Added dependency injection (DI) for flag listeners for plugin.
...
This is required for automated testing (can't use static getInstance). I
really need automated testing of the protection classes, so even though
this adds a parameter to the classes, it's important to have it right
now.
2018-02-03 11:54:33 -08:00
Tastybento
1427f16bec
Merge branch 'ranks' of https://github.com/tastybento/bskyblock.git into ranks
2018-02-02 08:22:00 -08:00
Tastybento
0d645600fc
Fixed bugs with start up and flag registration.
...
Protection does not work yet. Still need more debugging.
2018-02-02 08:18:56 -08:00
Florian CUNY
3d7b1bc647
Renamed PVP and Item Drop/pickup related flags
...
Also assigned the ItemDropPickUpListener() to the related events
2018-02-02 15:29:24 +01:00
Florian CUNY
5293d647c0
Removed duplicate listeners in Flags
2018-02-02 15:22:37 +01:00
Tastybento
72c99656cc
Added the protection listeners. Took all day!
...
Generally these are very easy to understand. They use an abstract class
for common code.
I have not tested these in-game. I would like to see if I can create
some test classes but it may not be possible because of the static
BSkyBlock calls.
2018-02-01 20:30:57 -08:00
tastybento
4fe94bee3b
Finished up the place and break block listeners.
...
There's a lot more that needs to be checked in these listeners! I moved
some common methods into the abstract class because they will be used
again and again by other listeners.
Added an anvil listener.
Added the flags. They were from ASkyBlock so may have name changes.
2018-01-31 15:46:38 -08:00
tastybento
5b087c83e7
Fixed comment.
2018-01-30 17:00:09 -08:00
tastybento
177023f314
Added code to support protection flag listeners.
...
Made getIslandsAt() Optional to enable better code structures in the
listeners.
Created an abstract class to simplify flag protection listeners.
Added default setting for flags that will be able to be set by config.
This default is used for any space in the worlds not occupied by an
island.
2018-01-30 16:59:10 -08:00
Tastybento
f7b6898559
Added protection methods.
2018-01-28 20:44:57 -08:00
Tastybento
ba62989788
Shifted some constants around.
2018-01-28 18:13:45 -08:00
Tastybento
417f767705
Added a Ranks Manager
2018-01-28 12:47:17 -08:00
Tastybento
eec4e99172
Added ranks to island members. More to do!
2018-01-28 11:48:54 -08:00
Tastybento
f1072e5984
Fixed flag optional aspect.
2018-01-28 09:47:51 -08:00
Florian CUNY
1d5b0ab8dd
API Improvements on PanelItem and Flags
...
Their respective builders now have default values
Flags get automatically registered once built
Added some convenience methods
2018-01-28 13:31:07 +01:00
Tastybento
2b434bf93a
Added ability for panel description to be just a string.
2018-01-27 15:58:15 -08:00
Tastybento
970711ca63
Merge branch 'develop' of https://github.com/tastybento/bskyblock.git into develop
2018-01-27 15:48:53 -08:00
Tastybento
67e05955f8
Made skyblock sky again. The sea water level was being set.
2018-01-27 15:48:44 -08:00
Florian CUNY
72c862c0d5
Starting to implement some Flags to test the API
2018-01-27 17:04:08 +01:00
Florian CUNY
6c08763cbb
Made PanelItemBuilder methods' name suit the Builder style
2018-01-27 17:03:30 +01:00
Florian CUNY
9cc9518bc3
Fixed new-island.signs.line* locale entries
2018-01-27 16:47:30 +01:00
Florian CUNY
8b636a8ee3
Minor code quality fixes
2018-01-27 16:39:02 +01:00
Tastybento
475f9b1416
Made changes to fix events and support the FAWE addon.
2018-01-25 22:19:33 -08:00
Tastybento
9ce1dbf592
Added team kick and leave commands. Need full testing.
2018-01-24 20:49:08 -08:00
Tastybento
f6ca7f7866
Fixed subcommand aliases. Added admin tp command.
...
While writing the admin tp command, I realized that subcommand aliases
were not working. Also, it was not possible to tell what alias had been
used for a command. I added that capability. i.e., if the alias is used,
then the label of that command is set to the alias.
2018-01-21 12:58:35 -08:00