Commit Graph

91 Commits

Author SHA1 Message Date
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
21aa1691a5 Added Names database object to enable name->UUID lookup.
Added test classes for Players, Names and PlayersManager.
Debugged a number of issues with these classes.
2018-05-13 17:02:24 -07:00
tastybento
dd0770cf8c Added NetherPortalsTest class 2018-05-12 09:06:46 -07:00
tastybento
060549b5ec Switched to List from LinkedList for tab complete.
Added FlyingMobs test.
2018-05-11 21:05:19 -07:00
tastybento
366690116b Added test for Admin Info command 2018-05-09 16:37:12 -07:00
tastybento
a8cdce5d18 Added admin register command and test.
Unit tests pass, not tested in-game yet. Still no WiFi.

North Platte, Nebraska. 1856km to San Francisco. 800kph ground speed.
107kph headwind. -56C outside temperature. 12035m altitude.
2018-05-09 00:14:20 -04:00
tastybento
4f9c3e49df Added admin unregister island command and test.
Unit test passes. Not tested in-game yet.
2474km to San Francisco. 11552m high above Des Moines, Iowa.
2018-05-08 23:26:01 -04:00
tastybento
62d8249468 Added admin Make Leader command and test.
Unit test passes. Not tested in-game because I'm 9930m above Chicago,
it's 2858km to San Francisco, it's dark, I'm wearing sunglasses, and I
have no Wi-Fi!
2018-05-08 22:56:24 -04: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
354aff14f4 Added team admin commands kick and disband. 2018-05-07 15:55:35 -07:00
Tastybento
ea089b5b7d Moved hasTeam and hasIsland from PlayersManager to IslandsManager
Added IslandTeamInviteCommandTest.
2018-05-06 16:26:40 -07:00
Tastybento
030e7e44ca Added test classes for Team Kick and Leave.
Fixed bugs in the team classes.

Completed the Island Info command.
2018-05-06 15:24:32 -07:00
Tastybento
c7d9fed400 Added a lot of tests to IslandManagerTest class. 2018-05-05 22:26:25 -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
41631e8a18 Fixed a few code smells for tests. 2018-04-29 19:01:30 -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
76711f5d09 Added /island banlist command and test class.
Note that preventing players from entering banned islands must still be
implemented.
2018-04-29 11:17:12 -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
673c404719 Finished up /island reset confirm 2018-04-28 16:32:34 -07:00
Tastybento
0bdc146da3 Added confirmation to IslandResetCommand
Added test class.
2018-04-28 12:50:07 -07:00
Tastybento
72306035f6 Added test for SafeSpotTeleport
It's not a great test.
2018-04-28 10:32:03 -07:00
Tastybento
26eb6c275e Added test for SafeTeleportBuilder. 2018-04-28 09: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
ca5fdbd71d Implemented User class JUnit tests.
Fixed some bugs in User, Notifier.
2018-04-27 09:20:51 +09:00
tastybento
135f35131c Finished IslandCacheTest. 2018-04-24 14:22:33 -07:00
tastybento
bf5a30e7a1 Added IslandCacheTest WIP
Cleaned up IslandCache, IslandsManager and Island.
2018-04-24 13:18:22 -07: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
0a9e9c2916 Removed stack print and added a test. 2018-04-04 19:25:13 -07:00
Tastybento
e09cb30cb5 Made head getting async for panels. 2018-03-31 18:34:49 -07:00
Tastybento
3bdf029b1d Added test for safe teleport. 2018-03-11 17:21:15 -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
c10f413173 Added PotionEffectTypeAdapter for GSON 2018-03-12 04:09:05 +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
tastybento
6626a9a4b0 Merge branch 'develop' into jsondb 2018-03-10 16:08:17 +09:00
Florian CUNY
e1f3da9449 Minor changes to existing Flags
Splited TRAPDOOR from DOOR
Splited HURT_VILLAGERS from HURT_ANIMALS
Renamed HURT_MOBS to HURT_ANIMALS
Renamed MOB_SPAWN to ANIMAL_SPAWN
Made FIRE_SPREAD a SETTING type Flag
Fixed MobSpawnListener with mishandling of ANIMAL/MONSTER spawn
2018-03-02 15:37:01 +01: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
1a233e3e83 Added test for glow() in PanelItemBuilder 2018-03-01 11:14:58 +01:00
Tastybento
fcede01a11 WIP using JSON and GSON for database.
Causes stack overflow right now. In the middle of debugging, but I need
this in github so I can grab it elsewhere.
2018-02-28 08:38:56 -08:00
Florian CUNY
c6c7e0b4ee Removed FlagsManager#getFlagByIcon() as it is useless 2018-02-26 10:07:25 +01: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