Commit Graph

223 Commits

Author SHA1 Message Date
tastybento
a5a75c6854 Fixed tests. 2018-05-26 15:50:10 -07:00
tastybento
007a9af025 Redid API for multiworld.
Now AcidIsland uses its own command instead of island.

Added a world element to commands so they can operate only in specific
worlds.
2018-05-26 13:08:35 -07:00
tastybento
6d17d48bde Removed AbstractIslandTeamCommand
This was using static data structure that would not work well when other
addons use the command.
2018-05-26 11:43:22 -07:00
tastybento
35b715ff80 Fixed tests. 2018-05-25 17:58:07 -07:00
tastybento
74c86901d0 Fixed issue with player name not being set correctly. 2018-05-25 17:15:56 -07:00
tastybento
682d34849a Small change to clarify /island use outside of island worlds 2018-05-25 15:11:17 -07:00
tastybento
6a18cc4ccc More multi-world work.
This handles multiworld operation. Test with AcidIsland addon.
2018-05-25 12:19:46 -07:00
tastybento
9f6819bd3b WIP: Converted to a mutli-world/mutli-game type model
This branch adds a world aspect to almost all commands. Although the
Bukkit World class is used for reference, the world includes any nether
or end worlds too. By enabling multiworld, things like the protection
grid will operate independently in different world groups. The idea is
to enable one plugin to run mutliple worlds. For example run AcidIsland,
ASkyGrid and BSkyBlock at the same time.

In addition to this big change, I added an admin command to copy and
paste "simple" schematics that I called "schems". It does not work
completely correctly right now, especially for chest contents.
2018-05-17 21:25:12 -07:00
tastybento
060549b5ec Switched to List from LinkedList for tab complete.
Added FlyingMobs test.
2018-05-11 21:05:19 -07:00
tastybento
5eb6447f01 Added admin team add command
Unit tests pass, but not tested on real server yet.
2018-05-07 20:11:03 -07:00
Tastybento
ea089b5b7d Moved hasTeam and hasIsland from PlayersManager to IslandsManager
Added IslandTeamInviteCommandTest.
2018-05-06 16:26:40 -07:00
Tastybento
0eae384b97 Added DefaultHelpCommandTest
Changed CompositeCommand to use a StringBuilder for better efficiency.
2018-05-02 19:15:07 -07:00
Tastybento
de85f85bbe Enabled settings flag clicks to work.
A listener can be added to a flag. This listener is the same as a panel
item listener. When the settings flag is clicked, it'll call the
listener. There is a default listener. Right now the default is called
UpDownClick.java. This makes the rank go up when you left click and down
when you right click. Another implementation may be to just have the
rank loop around with left clicks.

I added two more ranks - Admin and Mod. These are special ranks that
have a value above owner. If a player is given this rank, they can
bypass protections. This will avoid the need to use permissions and also
enable islands to be set up that for example, only Admins can edit, but
Mods cannot.

So, it's now possible for an owner to lock out team members from the
island as well as visitors. This is a bit weird and so more click
classes should be created. For example, one that just toggles between
Owner and Visitor.

Currently, only an island owner can change settings, but this could be
expanded to allow members. Also, it will need to be expanded to allow
Admins.
2018-05-01 22:56:10 -07:00
Tastybento
6e810747f4 Added island lock class and test class
Island lock is combined with island ban in terms of the Listener. It is
LockAndBanListener. It is a flag because after thinking about it, it
made sense to be just like any other island setting. Also, island owners
can now (in theory) lock out others by rank.

Although the test class says everything works, the Settings GUI needs to
enable toggling so that players can lock the island.

Enjoy banning players!
2018-04-30 01:12:32 -07:00
Tastybento
3cbcf52319 Added ban enforcement class and test class.
This prevents players from entering islands when they are banned. In the
future, it should also be extended to enable island locking.

Still needs a bit of work around Ops and bypass perms.
2018-04-29 18:48:38 -07:00
Tastybento
729974c1be Added unban command and test class
Added ban and unban to the island command.

Added class and tests for tabComplete for both commands.

Tested.
2018-04-28 23:05:49 -07:00
Tastybento
08023c6dbf Added Island Ban command and test classes. 2018-04-28 18:17:12 -07:00
Tastybento
0bdc146da3 Added confirmation to IslandResetCommand
Added test class.
2018-04-28 12:50:07 -07:00
tastybento
1e50b9e4cf Added AdminCommand test.
Added "no such command" error message when trying a command that does
not exist.

Removed unnecessary imports.
2018-04-28 14:36:17 +09:00
tastybento
aad5239ba3 Added logging methods to BSkyBlock to avoid plugin.getLogger()
plugin.getLogger() is a final class and so cannot be mocked. It was
making development of tests very hard. By making three logging methods
in BSkyBlock.java, they default to do nothing when BSkyBlock is mocked.
Previously, every time there was a use of logger in testing it was
throwing NPE's because plugin.getLogger() was returning null and the
getLogger() method could not be made not null by mocking because it was
final (in JavaPlugin).
2018-04-28 13:02:15 +09:00
tastybento
b2e68c22d4 Added Addon class unit tests. 2018-04-27 16:34:17 +09:00
tastybento
5cc71c2a2f WIP AddonTest class 2018-04-27 11:29:15 +09:00
tastybento
8fb9512f16 Filled in a few more User class tests. 2018-04-27 10:26:50 +09:00
tastybento
a2a23d0771 Merge remote-tracking branch 'origin/develop' into develop 2018-04-27 09:21:03 +09:00
tastybento
ca5fdbd71d Implemented User class JUnit tests.
Fixed some bugs in User, Notifier.
2018-04-27 09:20:51 +09:00
Florian CUNY
ecb630fac3 Fixed some code smells 2018-04-25 13:48:58 +02:00
Florian CUNY
5ebbc2e374 Created the language panel. It is currently not localized. 2018-04-23 21:16:08 +02:00
Tastybento
6ff8c1a3d8 Added obsidian scooping.
In ordeer to test, I needed to change a few other classes.
2018-04-21 09:03:39 -07:00
Tastybento
e881a5bd2b Removal of code smells.
Removed a lot of debug code.

Refactored some loops into lambas.
2018-04-18 19:07:20 -07:00
Tastybento
2e1c055cd7 Made BSBDatabase much easier to use for addons
Now obtaining the database handler is easy and understandable.
2018-04-15 17:30:42 -07:00
Tastybento
a5cc4c20ea Updates due to Challenges development. 2018-04-08 19:54:37 -07:00
Tastybento
a95e869cc9 Now reads addon.yml as a YAML file
Also imports level 1 permissions, i.e., does not handle children.
2018-04-05 18:56:48 -07:00
Tastybento
c49e2b07d3 Fixed issues with panels not scaling in size correctly. 2018-04-02 18:20:54 -07:00
Tastybento
e09cb30cb5 Made head getting async for panels. 2018-03-31 18:34:49 -07:00
Tastybento
b20fbd55a4 Cleaned up imports and unneeded exceptions 2018-03-11 15:59:03 -07:00
tastybento
8e97186caf Fixed merge conflicts. 2018-03-12 05:11:02 +09:00
tastybento
cf792779f9 Now using JSON-based data for MySQL
Large number of changes to improve database functions.
2018-03-12 04:08:19 +09:00
Florian CUNY
f511e54429 Unit testing is working greatly, fixed CompositeCommand 2018-03-01 15:12:31 +01:00
Florian CUNY
e4cedb58d0 Removed useless constructor in CompositeCommand + updated unit tests 2018-03-01 14:43:33 +01:00
Florian CUNY
6ba27eef4e Moved User to its own package + added Notifier to avoid massive "Island protected" spam 2018-03-01 14:25:09 +01:00
Florian CUNY
4a86784535 Fixes bug with nextSlot() not taking care of size if it was set 2018-03-01 11:05:19 +01:00
Florian CUNY
c60f92b7b3 MAJOR changes to Panel API
All methods in PanelBuilder follow the Builder pattern (no more "set...")
nextSlot() now returns the first unoccupied slot
2018-03-01 11:02:11 +01:00
Florian CUNY
f648c936ad Continued working on the SettingsPanel. Did minor fixes in PanelItemBuilder 2018-02-26 20:18:09 +01:00
Tastybento
e598fa7c93 Cleaned up a vunerability and some code smells. 2018-02-25 23:05:21 -08:00
Tastybento
bdca10636e Added Config comment capability.
See the challenges addon for examples.
2018-02-25 22:44:22 -08:00
Tastybento
1315dd990c user or listener can be null, so need to us ofNullable. 2018-02-25 20:46:13 -08:00
Tastybento
9db2602f78 Added FlagsManagerTest class to test the flags manager.
Added some code to the Flag, Flags and FlagManager classes to enable
passing the tests.
Realized that some flags had duplicate icons. This means that the
getFlagByIcon() method doesn't work because there could be more than
one. If we want to allow duplicate icons then we need to change the
manager. Also, do we need to getFlagByIcon method?
2018-02-25 19:48:01 -08:00
Tastybento
97491b1d89 Removed unused imports 2018-02-25 18:21:42 -08:00
Tastybento
7fa038bfce Merge branch 'develop' of https://github.com/tastybento/bskyblock.git into develop 2018-02-25 18:20:01 -08:00
Tastybento
00121e7e37 Added a specific config class to store objects as YAML 2018-02-25 18:19:52 -08:00