Commit Graph

235 Commits

Author SHA1 Message Date
Phoenix616
3c51f8ed87
Move more info to hover in shop messages to clean up chat
Also fix placeholders not working in not enough stock message
2020-06-28 23:00:45 +01:00
Phoenix616
a0630db6f8
Fix typo in iteminfo book generation message key 2020-06-28 18:09:00 +01:00
Phoenix616
6ee7c4759a
Add multi-language and component message support (Requires Spigot)
Message configs are now selected based on the client's language (can be
 toggled in the config) and will use MineDown formatting to allow
 display of component messages as well as usage of RGB colors in 1.16.
If found the legacy local.yml will be used instead of the per-language
 files. Move your local.yml to the correct lang config to if you want to
 use the per-client language option.
Version was also changed to 3.11 due to the many internal changes that
 have accumulated over time
2020-06-28 18:00:09 +01:00
Phoenix616
cbd427f561 Cancel left click event on shop sign
This should improve compatibility with other plugins that handle left
 click interactions too and shouldn't apply to shop signs you don't have
 access to.
Also includes a small improvement to not run the same permission check
 twice in certain cases.
2020-06-24 16:00:16 +01:00
Phoenix616
4a04a623a7 Improve metrics additions 2020-06-21 19:09:25 +01:00
Phoenix616
183c724583 Improve Metrics and add /csmetrics command
This adds some more logging to the metrics for some interesting plugin
 settings as well as player account and transaction counts. This data
 about account count and average transaction and item counts is also
 exposed ingame via the /csmetrics command.

This also removes the outdated mcstats metrics as that site is long dead
 now, the last data is from two years ago...
2020-06-19 21:47:28 +01:00
Phoenix616
1f8fd09dd2 Only update player name on join, don't create new accounts 2020-06-19 20:57:22 +01:00
Phoenix616
0b39fd1a5e Make auto-fill check both buy and sell permission separately (#325)
Also slightly changes how the auto fill message is sent to not send two
 messages (autofill and no-permission)
2020-06-19 18:58:00 +01:00
Phoenix616
3e061dda8d Add config option to limit trading with shops via protections 2020-06-18 17:01:52 +01:00
Phoenix616
e520544d3a Add ability to reload discount and restriction module (Resolves #252) 2020-06-10 14:03:22 +01:00
Phoenix616
4acd3efda1 Allow metadata ID to be used in shop transaction permission 2020-06-01 23:05:59 +01:00
Phoenix616
080597c515 Allow metadata ID to be used in shop creation permission 2020-06-01 22:58:34 +01:00
Phoenix616
9f84ca8551 Add option to sell/buy all with shift (#320) 2020-05-31 14:50:53 +01:00
Phoenix616
24d89dbc44 Add ability to mark all economic events as handled
This resolves issues when multiple listeners try to handle the same
 events e.g. for group support which would've passed it onto the normal
 listeners leading to errors
2020-05-21 01:08:00 +01:00
Phoenix616
d868fe8af6 Put the correct sign type into the chest on empty remove (Fixes #313) 2020-05-20 00:43:20 +01:00
Phoenix616
e22a50e1cf Only close our own inventories on teleport (Fixes #312) 2020-05-16 22:33:52 +01:00
Phoenix616
7f32a7a722 Fix InventoryOpenEvent listener not applying to non chest containers 2020-05-16 22:30:14 +01:00
Phoenix616
009febb5c2 Call add and subtract event to give listeners a chance to handle them 2020-05-13 23:56:47 +01:00
Phoenix616
7b978ae022 Fix shop sign getting broken with autofill marker (Fixes #310) 2020-05-13 23:13:56 +01:00
Phoenix616
a427c8c5a0 Fix shop removal with partial transactions (Fixes #307) 2020-05-06 20:53:59 +01:00
Phoenix616
8e6bc01d97 Fix automatic setting of item lines (Fixes #308) 2020-05-06 20:17:50 +01:00
Phoenix616
3bf54529db Add support for LWC LimitsV2 module (#293)
This adds a new OTHER_BREAK PreShopCreationEvent outcome to indicate
that the sign should get broken. To keep it backwards compatible with
other plugins setCancelled still sets OTHER and will not lead to a sign
break. The breaking logic is also moved out of the ErrorMessageSender
as it didn't make sense to have there. (It also wasted a tiny bit of CPU
by getting the block of the state again)

Do do this it now fully depend on LWCX, it's the only active version anways.

Also fixed a possible out of index error with the sign lines.
2020-05-04 22:33:46 +01:00
Phoenix616
0c1b82c9d8 Fix /iteminfo coloring 2020-05-04 21:40:39 +01:00
Phoenix616
432c505806 Add more information to /iteminfo command and make messages configurable 2020-05-03 15:05:24 +01:00
Phoenix616
0d08880ed2 Some cleanup of code and deprecated stuff
Also deprecate amount and account setters on the CurrencyCheckEvent,
these values will be final in a future version. Changing them here does
not make sense in the internal structure.
2020-05-03 02:37:06 +01:00
Phoenix616
9ae6725c5d Listen on low so that other plugins could hook into before
This is necessary if you want to do something like automatic completion
of the sign for group/bank accounts.
2020-05-03 02:34:57 +01:00
Phoenix616
e57bf94923 Don't continue checking if account can hold currency if already done 2020-04-24 14:54:48 +01:00
Phoenix616
bb17cc35a0 Add ability to set max amount and improve error messages 2020-03-24 00:31:08 +01:00
Phoenix616
7bd00f23be Block change block event for shop containers/signs 2020-02-22 17:43:17 +01:00
Phoenix616
2a37304113 Specify locale when changing case (Fixes #291) 2020-01-29 16:35:04 +01:00
Phoenix616
2075693e12 Add ability to send shop owner notifications via BungeeCord 2019-11-19 21:50:17 +01:00
Phoenix616
40467e3522 Add support for Paper's BlockDestroyEvent for sign breaks (Fixes #214)
Instead of using different modules we use a bukkit profile to test backwards compatibility with pure-Bukkit servers and use the paper-api in the default profile. This should really be done with modules in the future. The actual selection which listener to use is handled by checking if the event class exists on event registration.
2019-11-04 17:26:43 +01:00
g--o
88a23a38db Added toggle access command (#271)
Thanks to @g--o and @JRoy
2019-09-16 12:56:30 +01:00
Phoenix616
c028015d5e Improve /cstoggle by using UUIDs and HashSet instead of ArrayList 2019-09-14 23:49:40 +01:00
Phoenix616
d51a512ab8 Fix Vault CurrencyAmountEvent listener returning wrong balance 2019-09-06 13:31:19 +01:00
Phoenix616
b718fcc429 Use shop owner for LWC protections and not the creator
Also fix a bug where it was possible for shops to be created with shop owners that did not have a valid Account information when other plugins manipulated the name line after the NameChecker checked it. Now it gets checked twice, once at the start (to abort early and to populate the ownerAccount field) and once at the end to check again when the name line changed.
2019-08-22 14:03:27 +01:00
Phoenix616
6c5e5ece81 Block editing of shop signs that user can't destroy (BUKKIT-1293) 2019-07-08 17:21:21 +01:00
Phoenix616
481e2bdf9e Fix issue with sign sticker 2019-06-09 15:04:14 +01:00
Phoenix616
b0523b2199 Add cooldown for empty/full shop owner notifications 2019-05-27 17:11:09 +01:00
Phoenix616
17e7ab781b Fix shops creation message getting send on auto fill
The NameChecker now catches any exception that might be thrown when querying the account in order to properly cancel in the case of an unknown account or an error that occurred in the event to not let players create shops that they don't have access to if an exception occurs.
2019-05-08 00:22:16 +01:00
Phoenix616
2907706399 Actually send error message and break sign on unknown player error 2019-05-08 00:11:47 +01:00
Phoenix616
a8c57bc0ab Set name line empty if name isn't usable and always use account name 2019-05-07 23:57:56 +01:00
Phoenix616
a95f7316d6 Fix ProtectionCheckEvent not being used when accessing shop 2019-05-07 16:13:56 +01:00
Phoenix616
b300798a62 Make querying of accounts by (short) name an event too 2019-05-06 23:49:16 +01:00
Phoenix616
2e0c5a3cac Fix issues with user account storage on shop creation
This fixes a bug where shop owner accounts would not be created in certain cases e.g. when the owner had certain admin permissions or created the account for another player while having certain admin permissions.
2019-05-05 19:23:04 +01:00
Phoenix616
04f91aa55b Add warnings about unknown OfflinePlayer to VaultListener
Also improve the ReserveListener by removing the query for the OfflinePlayer object as that's not necessary to use the Reserve economy API as it directly provides methods for UUID usage (and account existence has usually been checked before already)
Also use canAddHoldings to check if economy user can hold money instead of adding and removing.
2019-05-01 17:13:47 +01:00
Phoenix616
0b57382cd0 Don't use sign Material as that's going to change in 1.14 2019-05-01 17:01:43 +01:00
Phoenix616
c538f4a3dc Remove all usage of old MaterialData and other outdated code
This should make it more future-proof and possibly even work with 1.14 already.
2019-04-30 21:31:24 +01:00
Phoenix616
6773f89221 Improve internal precision of calculations (Fixes #221) 2019-04-30 16:02:01 +01:00
Phoenix616
8cf9934a32 Properly set scale and rounding mode for divisions (Fixes #220) 2019-04-28 15:41:20 +01:00