Commit Graph

252 Commits

Author SHA1 Message Date
Florian CUNY
2c16f88013 Updated tests 2018-08-13 21:05:47 +02:00
tastybento
6eeff3f383 Added test classes for coop, uncoop, trust and untrust commands. 2018-08-12 17:15:11 -07:00
tastybento
c1a6a233a9 Added team coop, uncoop, trust and untrust commands. 2018-08-12 16:43:47 -07:00
tastybento
82c35f9aa9 Fixed test breaks. 2018-08-12 14:28:25 -07:00
tastybento
bcb44c4cce Fixed PlayerManager tests. 2018-08-12 04:14:07 +09:00
Florian CUNY
9c240fbf54 Fixed tests in DefaultHelpCommandTest 2018-08-11 14:39:12 +02:00
tastybento
ea0f64a770 WIP added AdminDeleteCommand 2018-08-09 05:13:54 +09:00
Florian CUNY
cd7f8ddf24 Commented the failing test out, so Travis builds again 2018-08-07 16:02:54 +02:00
Florian CUNY
90a868bc40 Updated ItemParser to use the new banner materials 2018-08-07 16:02:29 +02:00
Florian CUNY
e232452f65 Fixed 2 out of 3 tests 2018-08-07 10:44:13 +02:00
Florian CUNY
cfbf3df1c3 BREAKING: Renamed [...]DatabaseConnecter to [...]DatabaseConnector
It was a typo shown by IntelliJ
2018-08-06 15:32:15 +02:00
Florian CUNY
5fa8f3997f BREAKING: Renamed a few API classes to a more generic name
`BBConfig` to `Config`.
`BBDatabase` to `Database`.
`BBDbSetup` to `DatabaseSetup`.

Sorry @tastybento, hope it won't bother you too much :/
2018-08-06 15:19:06 +02:00
tastybento
ba557a1068 API Breaker: renamed BSB classes to be just BB
Hopefully, this is the last API breaker. I renamed the classes that
started with BSB to be just BB (bentobox). I now have to fix all the
add-ons I just broke...
2018-08-05 20:08:03 -07:00
tastybento
cfdabbb176 Removed AboutCommand test to get a clean build.
Please see my comment on the commit. Final classes can't be mocked (as
far as I know) so it's kinda impossible to make a test for this one.
2018-08-05 20:00:23 -07:00
Florian CUNY
f8366cafec Started a test unit for AboutCommand 2018-08-05 10:56:15 +02:00
tastybento
765268aa25 Code cleanup using Intellij 2018-08-04 21:50:10 -07:00
tastybento
1256b0ee22 Added a bentobox command
Added reference about and info commands. These command run across worlds
and currently have no perms associated with them.

The main point was to enable BentoBox to have is own commands.
2018-08-04 20:43:38 -07:00
tastybento
783caf985f Added generic cooldown methods to CompositeCommand
This API enables any command to have a cool down and to have that cool
down called by another command. For example, the Kick command sets the
cool down on the Invite command. It is possible for commands to set cool
downs on themselves too.
Currently, cool downs are not stored persistently in the database so
they disappear if the server is reloaded. This should be okay for now.
2018-08-04 18:45:13 -07:00
tastybento
2cc6d36997 Reworked test classes for managers
There are some weird NPE's that I couldn't work out in the test classes.
They do not occur when the class is run by itself, only when it is run
with all the others so I don't know why it is happening.
2018-08-04 10:13:08 -07:00
tastybento
25164d824b Rewrote IslandsManager test class 2018-08-04 09:37:21 -07:00
tastybento
08604fc27d Rewrote PlayersManagerTest class 2018-08-04 09:21:24 -07:00
tastybento
53f28eb68d Changed island team kick to use confirm API
Fix for:
https://github.com/BentoBoxWorld/bentobox/issues/214
2018-08-03 19:22:35 -07:00
tastybento
bad870d3da Reapplied commit to improve Maven.
Fixed test class failure.
2018-08-03 19:10:09 -07:00
tastybento
3c74ef0694 Moved admin and island commands into API package 2018-08-02 19:26:46 -07:00
tastybento
4a1dede795 Removed deprecated calls from IslandsManager for trapdoor check 2018-08-02 19:01:23 -07:00
tastybento
a9da00478d Fixed EndermanListenerTest class to use BlockData properly. 2018-08-01 18:19:47 -04:00
tastybento
df5d63acf0 Clean up on the test classes for 1.13. 2018-08-01 10:12:43 -07:00
tastybento
4fab167d10 Fixed build errors.
Reverted back the generic commands for use by addons.

WIP - some tests need fixing for 1.13.
2018-08-01 08:55:48 -07:00
tastybento
cbc27ae715 Revert "Removed commands test units"
This reverts commit efb2adb455.
2018-08-01 08:29:20 -07:00
Florian CUNY
138b8e7568 Updated test units to 1.13 API 2018-08-01 11:21:29 +02:00
Florian CUNY
efb2adb455 Removed commands test units 2018-08-01 11:02:13 +02:00
Florian CUNY
3473fb48e6 Renamed 'world.bentobox.bbox' to 'world.bentobox.bentobox' 2018-07-31 18:03:32 +02:00
tastybento
c7ff1bbae4 Converted references of BSkyBlock to BentoBox 2018-07-29 17:09:48 -07:00
tastybento
f2831c7258 Improved addon loading error reporting
Fixed a bug in the team invite error strings.
2018-07-29 16:56:14 -07:00
tastybento
6d22f199ee Rewrote to try to make test pass on Travis
It works locally!
2018-07-29 14:28:28 -07:00
tastybento
bc1a73975e Make flag explicitly set to false for test. 2018-07-29 13:58:12 -07:00
tastybento
268a301a47 Switch to BentoBox 2018-07-29 13:21:46 -07:00
tastybento
9c41ceb5f2 Added clear resets and clear reset all admin commands.
Clear reset all uses a timestamp stored in config.yml. If a player logs
in and the last time they logged in was before that timestamp, then
their resets are cleared. Note that as opposed to ASkyBlock, the player
object stores the number of resets done for a world and not the number
of resets left. This is a better design because it means that admins can
change the max number  of resets and every player file does not have to
be adjusted.

Location of commit (30,000ft above Nevada desert, just coming into Las
Vegas).
2018-07-25 09:47:57 -07:00
tastybento
541ee35256 WIP - clear reset all command 2018-07-25 07:04:40 -07:00
tastybento
944ab36488 Finished ItemFrameListener and test. 2018-07-21 21:48:22 -07:00
tastybento
984de1cd07 Added ItemFrame protection from mobs flag and test class. 2018-07-21 21:10:07 -07:00
tastybento
71e79db0a9 Added Enderman protection flags and tests. 2018-07-21 16:48:53 -07:00
tastybento
1251ea60d1 Added chest damage listener test class. 2018-07-21 14:18:35 -07:00
tastybento
b72d1853b5 Added Range command tests and put in some locale messages. 2018-07-21 14:06:40 -07:00
Florian CUNY
f10c2da7d3 Code smells ; minor code format issues 2018-07-20 14:37:11 +02:00
Florian CUNY
a5a1ccb7e5 Fixed bug with protection range (in Island)
minX, minZ, minProtectedX and minProtectedZ are no longer variables : to get them, we have to use the related methods. As they get recalculated at each call, it ensures they follow the changes (especially with the protectionRange)
2018-07-19 12:58:59 +02:00
Florian CUNY
2e26c6a20c BREAKING CHANGE: now BSBCommand#execute(User, String, List<String>) !!! 2018-07-18 15:36:57 +02:00
Florian CUNY
0f61049502 Moved commands/island/teams to commands/island/team 2018-07-18 14:45:14 +02:00
Florian CUNY
fd36b0a9eb Renamed commands/admin/teams to commands/admin/team 2018-07-18 14:13:43 +02:00
tastybento
720e6bbe6b Added WaterIsNotSafe setting to WorldSettings
This flag is used to indicate whether being waste-deep in water is a
safe home location or not. On SkyBlock is it fine, on AcidIsland it is
not. So that's why this definition is required.

Removed unused @deprecation header. I assume switching to Spigot API
made these superfluous.
2018-07-17 18:48:50 -07:00
tastybento
b1a131fa84 Delay registering flag listeners until plugin is loaded.
Reworked test classes to avoid running the Bukkit server.
2018-07-17 18:32:28 -07:00
tastybento
ee440b4f0d Fix for null entities.
https://github.com/tastybento/bskyblock/issues/206
2018-07-17 07:54:22 -07:00
tastybento
5572875257 Added global TNT on/off flag
Protects against visitors priming TNT too.
Test class is just "happy path".

Fixed bugs with other flags around fire extinguish.
2018-07-16 19:00:12 -07:00
tastybento
ec0a6bdd73 Fixed issue with dots in map keys for YAML saving
YAML cannot handle dots in keys, so they need to be converted to
something else. I chose :dot:. This issue occurred because location
coordinates were saved with .'s in them. Actually, there is no
real value in saving such accurate locations, so in addition to
keeping the dot escape system (just in case), I changed locations
to just save as ints and then when they are loaded, x and z have
0.5D added to them to center the location. This should be
sufficient accuracy for any location storage and it also reduces
the file size a lot.
2018-07-14 11:14:51 -07:00
tastybento
2b024d035b Removed unused imports 2018-07-14 09:14:42 -07:00
tastybento
b431b9a092 Added lock and ban bypass via Op or perms.
https://github.com/tastybento/bskyblock/issues/201
2018-07-13 17:27:03 -07:00
tastybento
26200ae951 Fixed issues with self-inflicted damage.
https://github.com/tastybento/bskyblock/issues/203
2018-07-13 17:02:57 -07:00
tastybento
4003f839ed Added Island Go test.
https://github.com/tastybento/bskyblock/issues/205
2018-07-13 16:39:02 -07:00
Florian CUNY
712e335814 Renamed ClickListeners and made most of them setup "by default" to avoid boilerplate code 2018-07-13 17:29:17 +02:00
tastybento
451756bc81 Added clean super-flat world setting and test 2018-07-12 21:25:07 -07:00
tastybento
c64ecf76af Fixed admin command tab complete for Ops
Tab complete values are sorted now too.
2018-07-12 08:15:24 -07:00
tastybento
60a0c486f3 Added Banned Visitor Commands and test 2018-07-11 21:55:00 -07:00
tastybento
94bc2355ac Fixed test failures.
Fixed bug where spawn locs could be null.
2018-07-10 21:42:05 -07:00
tastybento
9021df099a Added permissions to settings.
Added test for Inv Visitors.

Default perms need to be added to plugin.yml or addon.yml for settings.
2018-07-08 16:45:17 -07:00
tastybento
13a246df59 Fixed bugs
Admin tp was not tp'ing to correct world
Dragon Eggs were unprotected.
Changed name of BSB getWorld methods to be more specific so they are not
used accidentally to get the general world.
2018-07-07 15:52:47 -07:00
tastybento
4963ea573c Added offline redstone world flag
Removed constructor from LockAndBanListener. Due to loading order, some
manager objects are null. Flags load very early so must assume
everything is null.
2018-07-06 10:05:00 -07:00
tastybento
2b5664c7ff New island checking improved to avoid infinite loop
If a world has the generator malfunctioning the server can crash if
there's no clear spot for an island. This limits the number of spots to
find an island to 10.
2018-07-05 17:25:21 -07:00
tastybento
3657dda094 Ops and mod.bypassprotect perms can bypass protection.
Moved AbstractFlagListener and clicklisteners into API package
2018-07-04 14:55:34 -07:00
tastybento
284839c6a4 Added 2 more tests to banner parsing 2018-07-03 09:51:21 -07:00
tastybento
d725a3e1d8 Schems: sign placeholders for names and spawn location 2018-07-02 11:21:10 -07:00
tastybento
11d257c64a Added reset for inventory and enderchests.
Money is to do because it required Vault integration.
2018-06-25 15:17:16 -07:00
tastybento
eb855edfeb Adds white list for remove mobs to settings. 2018-06-24 17:57:31 -07:00
tastybento
8125ec52af Added default Game Mode to world settings.
https://github.com/tastybento/bskyblock/issues/179

Removed references to acid from settings for BSB.
2018-06-24 16:22:44 -07:00
tastybento
045855f6ad Removed code smells. 2018-06-23 18:38:48 -07:00
tastybento
729706f69d Reduced complexity of Flag constructor.
Added constructor to TextVariables.
2018-06-23 17:06:17 -07:00
tastybento
9b8d42f692 Added island registration/unregistration.
Island center was not correctly being kept as immutable.
2018-06-23 15:45:09 -07:00
tastybento
12a1700848 Added Respawn On Island world flag.
Renamed getIslandWorldManaget to getIWM() in AbstractFlagListener.
2018-06-19 22:30:23 -07:00
tastybento
f32c661133 Added ItemParser test 2018-06-18 20:57:39 -07:00
tastybento
108d099156 Added EnderChest protection.
Enderchests are an explout because they allow transfer of items between
worlds. These additions enable usage to be switched on/off at the world
level. Also prevents ender chest crafting. These protections can be
bypassed via a permission or via Op.

Also, I fixed some settings issues in general around default settings.
2018-06-17 21:37:50 -07:00
tastybento
c03c1e3ecc Fixes tests that broke by #158 bug fix.
b45a3160c7
2018-06-17 17:09:52 -07:00
tastybento
c8dfd4a242 Removed admin world command because world settings are back in general
settings command as a panel.
2018-06-16 19:28:53 -07:00
Florian CUNY
62a321caf1 Tried to fix SettingsToggleClickListenerTest 2018-06-16 23:44:08 +02:00
Florian CUNY
b410d49c2b Made the SettingsPanel fancier (well, I tried xD)
Had to remove the "MENU" FlagType, which I replaced by the "subPanel" argument in the Flag itself.
2018-06-16 17:10:00 +02:00
tastybento
e5cfab50f7 Fix PanelListenerManager tests.
Added JavaDoc and adjusted boolean method name.
2018-06-16 10:52:44 +09:00
tastybento
9202cacb12 Removed verbose logging from FlagTest. 2018-06-10 22:35:56 -07:00
tastybento
10d5c262ca Added test class for PanelListenerManager
Refactored some code to be more streamlined.
2018-06-10 21:10:02 -07:00
tastybento
92a7b0e596 Added admin "world" command.
This is used to set world settings.
2018-06-10 17:23:48 -07:00
tastybento
1240cd266e Implemented remove mobs on teleport
I simplified this to just remove mobs on login and island teleport. The
mobs to keep are currently hard coded. They could be taken from settings
in the future.
2018-06-09 23:06:59 -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
db3344c8b9 Completed Invincible Visitors and PVP listeners.
This was a lot more work than I expected, but in the end the test class
was the best approach to cover all the edge cases.
2018-06-09 15:54:09 -07:00
tastybento
4534c16416 Fixed enter/exit messages for unowned islands and tests. 2018-06-08 08:26:07 -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
aed648e6e7 Added Piston Push setting.
Allows/Disallows piston pushing outside an island.
This is a worldwide setting for admins.

https://github.com/tastybento/bskyblock/projects/3#card-10260101
2018-06-04 19:24:11 -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
Florian CUNY
884df8f07d Fixed tests to use the TextVariables 2018-06-03 10:31:22 +02:00
Florian CUNY
08e11e90fa Made CycleClick handle right click 2018-06-02 21:42:14 +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