Commit Graph

245 Commits

Author SHA1 Message Date
tastybento
aa7fbabf82 Fixed bugs with NPEs in non-island worlds. 2018-06-10 22:34:01 -07:00
tastybento
92a7b0e596 Added admin "world" command.
This is used to set world settings.
2018-06-10 17:23:48 -07:00
tastybento
d364c006b0 Improvide code readability. 2018-06-10 15:42:21 -07:00
tastybento
90563dac35 World Flags are saved in the config.yml file.
Previously, world settings (world setting flags) were not actually being
saved anywhere. They are now saved in the config.yml.

WIP: RemoveMobsListener.java

Improved the FlagTest.
2018-06-09 22:09:20 -07:00
tastybento
1fc1780fd1 Fixed flag text and descriptions. 2018-06-09 17:22:38 -07:00
tastybento
27639f673a JavaDoc clean up. 2018-06-09 16:40:38 -07:00
tastybento
9a666e29ca Added specific WORLD_SETTING flag.
This flag is separate from island SETTING flags. The settings are done
in a different way and rather than try and work out which type is which,
it is better to specify them at the start.

Also added a SUB_MENU settings type.
2018-06-08 08:20:16 -07:00
tastybento
8a339f755a Added Invincible Visitor settings.
This led to work to enable saving of the config.yml file with comments.
I added the ability to have multiple lines of comments as annotations.
I also enabled comments to align with the exact path of the field.
To do this I used BSBConfig for the Settings class and retired ISettings
When the plugin disables, it now saves the config.yml with comments and
the Invincible Visitor settings.

Note that any settings in the config.yml stored in the jar will still
exist in the file and stay there unless they are manually deleted. They
just will not have any comments on them after saving.
2018-06-05 00:06:55 -07:00
tastybento
5904ef9194 Added Enter/Exit messages
This required adding support for world-specific toggle settings.

This also affected some other listeners.
2018-06-03 20:54:37 -07:00
tastybento
1289060bd4 Merge branch 'confirmation' into develop
Conflicts:
	locales/en-US.yml
	src/main/java/us/tastybento/bskyblock/commands/island/IslandResetCommand.java
2018-06-03 14:03:46 -07:00
tastybento
2ea268f90f Added confirmation code to CompositeCommand
How does this look?
2018-06-03 13:36:48 -07:00
Florian CUNY
3ab2c46eed Reduced notification delay to 4 seconds 2018-06-03 10:08:50 +02:00
Florian CUNY
f5b5426327 Created TextVariables class that contains common text placeholders 2018-06-03 10:07:58 +02:00
Florian CUNY
d7b2c70b78 Fixed unaccurate logic in PanelBuilder#nextSlot() 2018-06-02 21:41:27 +02:00
tastybento
e7649f19d4 Added cycling click to protection flags. 2018-06-02 11:27:51 -07:00
tastybento
320c9a9f43 Fixes help permissions. 2018-06-02 08:39:45 -07:00
tastybento
d94477034a Performed code cleanup using Intellij. 2018-05-31 18:52:05 -07:00
tastybento
6b6ec4c697 Fixed bug where worlds were not existing when islands loaded.
If islands are loaded before the world exists the island's world becomes
null. If an addon is creating an island then it must be loaded before
islands.

Also refactored some of the addon loading code.
2018-05-29 16:59:52 -07:00
tastybento
8f469eb339 Updated to work with addons like warps. 2018-05-28 15:46:07 -07:00
tastybento
b402450253 Cleaned up some vulnerabilities and code smells. 2018-05-27 21:37:00 -07:00
tastybento
60eac8e54e Fixed bugs
Fixed issues where Settings were used instead of WorldSettings.
Added getWorld to the Admin team commands.
2018-05-27 00:05:36 -07:00
tastybento
66d9ef857d Removed constants that reference the island and admin commands.
Fixed bug where addon onLoad was being called twice.
2018-05-26 18:20:02 -07:00
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