Commit Graph

711 Commits

Author SHA1 Message Date
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
6781beb3ca Settings clean up. 2018-07-06 10:31:49 -07:00
tastybento
c1e6aa7350 Removed console spam around schem saving/loading 2018-07-06 10:22:40 -07:00
tastybento
4c4a72718e Fixed world_name placeholder for settings titles. 2018-07-06 10:14:07 -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
a60bcc8a22 Fixed settings. Implemented useowngenerator 2018-07-06 08:07:37 -07:00
tastybento
a72a49975f Added default island flags and settings to config.yml
These are specified per-world so go in the world section.
2018-07-05 21:10:47 -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
66f3b5032d Added protection for plates and buttons from arrows
Added button text for flag.
2018-07-04 18:32:43 -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
aa1ef9bcbd Added new island and nether island schems
Fixed bugs with schem pasting, especially empty chests.
2018-07-03 17:51:01 -07:00
tastybento
265f05529b Schems save in the respective addon data folders 2018-07-03 11:05:14 -07:00
tastybento
284839c6a4 Added 2 more tests to banner parsing 2018-07-03 09:51:21 -07:00
tastybento
4245ebaa33 Fix banner parsing issue 2018-07-03 09:41:09 -07:00
Florian CUNY
9f3e4e22dc Tells how much time it took to fully load BSkyBlock 2018-07-03 11:20:52 +02:00
Florian CUNY
0cb21d8468 Fixed NPE when the ItemParser returns null when the locale banner is an invalid String or does not exist 2018-07-03 11:19:48 +02:00
tastybento
693625ab9a Added placement based on bedrock. 2018-07-02 22:01:37 -07:00
tastybento
35247965fa WIP - still need to fix bedrock saving in schem 2018-07-02 20:35:21 -07:00
tastybento
c430d910b2 Added SchemsManager to handle global schems 2018-07-02 18:51:18 -07:00
tastybento
d725a3e1d8 Schems: sign placeholders for names and spawn location 2018-07-02 11:21:10 -07:00
tastybento
afa21d25ed Fixes schem issues.
https://github.com/tastybento/bskyblock/issues/192
2018-07-01 15:47:29 -07:00
tastybento
bc39e82dd2 Fixed stairs orientation. 2018-07-01 15:28:53 -07:00
tastybento
947853061e Added entities to schems. 2018-06-30 10:08:16 -07:00
tastybento
dd2a65bef4 Moved some settings. 2018-06-30 08:25:44 -07:00
tastybento
70c6b75992 Added island schems
These are pasted as the default islands. I think better ones can be
made!
2018-06-25 20:13:39 -07:00
tastybento
56d63dc9c8 Added resets for island joining. 2018-06-25 16:40:28 -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
638712566a Added leave and join settings for money, inventory 2018-06-25 14:35:31 -07:00
tastybento
9450bc8da1 Moved team leave confirm to api. 2018-06-25 14:34:52 -07:00
tastybento
ae1eeec7cf Fix for NPE on safe teleport when location cannot be found. 2018-06-24 18:23:57 -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
617fc712aa Code clean up 2018-06-23 19:25:39 -07:00
tastybento
dec162744c Code clean up 2018-06-23 19:20:02 -07:00
tastybento
e3731994b3 Removed duplicate code 2018-06-23 19:19:53 -07:00
tastybento
0e1ee335ea Code clean up. 2018-06-23 18:56:21 -07:00
tastybento
045855f6ad Removed code smells. 2018-06-23 18:38:48 -07:00
tastybento
bb4c199487 Removed code smells. 2018-06-23 18:20:27 -07:00
tastybento
4fc63b6de0 Changed move file to copy and delete in FlatFile. 2018-06-23 17:54:51 -07:00
tastybento
21c259f628 Made constructor private. 2018-06-23 17:06:47 -07:00
tastybento
729706f69d Reduced complexity of Flag constructor.
Added constructor to TextVariables.
2018-06-23 17:06:17 -07:00
tastybento
f12bc17ca3 Removed code duplication in Composite Command constructor 2018-06-23 16:32:53 -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
97cf9b4132 WIP - testing register/unregister admim commands
JUnit tests do not pass, so bypass for now.
2018-06-21 22:30: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
daf01ccd8d Switched to non-locale-based decimal place setting.
https://github.com/tastybento/bskyblock/issues/186
2018-06-18 08:12:21 -07:00
tastybento
d4951a5873 Added stack trace print for debugging
https://github.com/tastybento/bskyblock/issues/186
2018-06-18 07:45:50 -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
fba05ecc81 Fixed bug where database saving was every 5 ticks.
Changed to calculate minutes for database backup time.
2018-06-17 18:18:35 -07:00
tastybento
8353d266a5 Saved YML files then move for reliability reasons
Instead of saving on top of a YML file, we now save to a tmp file and if
it is saved successfully, then it is moved on top of the old file in an
atomic move. This helps avoid data loss if the file write fails.
2018-06-17 17:15:44 -07:00
tastybento
c03c1e3ecc Fixes tests that broke by #158 bug fix.
b45a3160c7
2018-06-17 17:09:52 -07:00
Florian CUNY
a71eee537d Print a kind message in console when the plugin is fully loaded 😄 2018-06-17 14:49:19 +02:00
Florian CUNY
45b4f32d78 Print more detailed info about addons loading in console 2018-06-17 14:48:53 +02:00
Florian CUNY
a8f2cabd82 Added support for banners in ItemParser & updated banners in locales 2018-06-17 14:39:40 +02:00
Florian CUNY
2249bc4864 Took ItemParser from the addon challenges 2018-06-17 11:48:35 +02:00
Florian CUNY
24a88e09ac Added ENDER_CHEST flag and splited LEVER_BUTTON into LEVER and BUTTON 2018-06-17 11:36:17 +02:00
Florian CUNY
b45a3160c7 Should fix #158 2018-06-17 11:35:46 +02:00
tastybento
45c0bc84da Removed debug lines. 2018-06-16 19:34:58 -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
tastybento
034015ee4d Switched back to using hard-coded islands while debugging.
Removed unused imports.
2018-06-16 19:06:08 -07:00
Florian CUNY
62a321caf1 Tried to fix SettingsToggleClickListenerTest 2018-06-16 23:44:08 +02:00
Florian CUNY
8ee42d3c47 Changed the description of the "Island protected" message to an "hint"
related to #184
2018-06-16 17:15:51 +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
Florian CUNY
4525a04324 Splited MUSIC flag into JUKEBOX and NOTE_BLOCK
It has been suggested in #182.
2018-06-16 16:46:01 +02:00
Florian CUNY
d4264a1c26 Fixed the click sound being also played to players nearby 2018-06-16 15:15:15 +02:00
Florian CUNY
c68c8d26cb Language Panel: sorts the languages differently 2018-06-16 15:03:52 +02:00
tastybento
e5cfab50f7 Fix PanelListenerManager tests.
Added JavaDoc and adjusted boolean method name.
2018-06-16 10:52:44 +09:00
tastybento
21601089f4 Merge remote-tracking branch 'origin/develop' into develop 2018-06-16 10:44:13 +09:00
tastybento
ce65d34cb4 WIP - switching to using simple schems instead of hardcoded islands 2018-06-16 10:44:04 +09:00
Florian CUNY
d2697e1525 Added a description variable to the "Island protected" message
Added "[description]" in TextVariables
added getName- and getDescriptionReference() in Flag
2018-06-11 15:55:01 +02:00
Florian CUNY
63dd2d95b2 Added option to close panel on click outside of it
This is related to commit #8d596c5f1d24ea2e319e5172b2c954a8caa46f67
2018-06-11 12:19:14 +02:00
tastybento
9202cacb12 Removed verbose logging from FlagTest. 2018-06-10 22:35:56 -07:00
tastybento
aa7fbabf82 Fixed bugs with NPEs in non-island worlds. 2018-06-10 22:34:01 -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
8d596c5f1d Closes panels when clicked outside.
https://github.com/tastybento/bskyblock/issues/180
2018-06-10 20:10:41 -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
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
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
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
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
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
beafb5dd4c Fixes frost walker console spam.
https://github.com/tastybento/bskyblock/issues/181
2018-06-03 15:48:52 -07:00
tastybento
f3472815c9 Fixed schems
The admin command "schem" now works very like WorldEdit.
You set the pos1 and pos2, copy to clipboard and paste
You can save and load. Schems go into the schems folder.
2018-06-03 15:33:45 -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
433efcf6c0 Might a fix a NPE when loading Players from Flatfile database 2018-06-03 16:04:45 +02:00
Florian CUNY
884df8f07d Fixed tests to use the TextVariables 2018-06-03 10:31:22 +02:00
Florian CUNY
4897d8ef77 Fixed some code smells 2018-06-03 10:23:45 +02:00
Florian CUNY
3d7ef58323 Removed unused argument in InventorySave constructor 2018-06-03 10:09:31 +02: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
tastybento
b87b00d887 Cleaned up some code smells. 2018-06-02 19:54:41 -07:00
tastybento
e69971d73c Cleaned up some config settings. 2018-06-02 19:21:59 -07:00
Florian CUNY
caa2501968 Removed the help item from the SettingsPanel 2018-06-02 22:01:05 +02:00
Florian CUNY
08e11e90fa Made CycleClick handle right click 2018-06-02 21:42:14 +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
bcc0028671 Removed debug 2018-05-30 20:27:41 -07:00
tastybento
53bd51e2f5 Fixed issue with adapter serializer
Serialize and deserialize were opposite

In deserializing in flatfile db, there was an odd extra bit of code that
undid the deserialization. I'm not sure why I put that in there and so
I've commented it out for now.
2018-05-30 20:23: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
3b7b7fa557 Fixed bug with saving to flat file.
Must remember to include blank constructor so Beans can create the
object!
2018-05-29 14:57:01 -07:00
tastybento
d34ad5dce3 Fix bug with sethome not replacing previous homes. 2018-05-28 20:23:15 -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
3404fac8f2 Arrays can stream directly. 2018-05-27 08:50:14 -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
4bf0d8ec0f Fixed bug with island command and island go 2018-05-26 15:35:02 -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
82ee6d746e Added an Island World Manager that handles worlds
Still a WIP but it's gradually coming along.
2018-05-20 16:09:57 -07:00
tastybento
576d9ff314 Merge remote-tracking branch 'origin/develop' into multigame 2018-05-20 14:18:38 -07:00
Florian CUNY
736ba10c53 Fixes https://github.com/tastybento/bskyblock/issues/166 2018-05-20 22:00:22 +02:00
tastybento
df696fb4a0 Reworked world checking.
Worlds are checked by the IslandWord class. Additional worlds can be
added to the list of worlds covered by BSB by Addons.
2018-05-18 23:08:18 -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
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
0a17639529 WIP added some admin commands. Still not finished.
Get rank, set rank, info.
2018-05-02 21:23:02 -07:00
Tastybento
0eae384b97 Added DefaultHelpCommandTest
Changed CompositeCommand to use a StringBuilder for better efficiency.
2018-05-02 19:15:07 -07:00
Tastybento
fe26eeda2a Fixed copy and paste bug in previous commit.
Next time I'll remember to build before committing!
2018-05-01 23:25:49 -07:00
Tastybento
cccbf2d270 Removed code smells. 2018-05-01 23:20:13 -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