Commit Graph

546 Commits

Author SHA1 Message Date
Phoenix616
965d931978
Include prices in price restriction messages (Resolves #461) 2021-06-24 19:40:58 +01:00
Phoenix616
1b85bda656
Fix some block place and break access message issues
Messages were missing on block break and placement sent multiple.
2021-06-21 16:16:19 +01:00
Phoenix616
42a7cc4789
Check if sign actually applies to container (Fixes #460) 2021-06-21 16:07:42 +01:00
Phoenix616
df2e4394c4
Use more exact shop detection with /shopinfo 2021-06-13 15:48:04 +01:00
Phoenix616
052560393c
Add additional plugin, server and java version stats 2021-06-04 00:35:27 +01:00
Phoenix616
2545b95d54
Fix ShowItem not working in messages 2021-05-16 19:53:30 +01:00
Phoenix616
f825995a85
Don't automatically add prefix to certain messages 2021-05-16 19:39:53 +01:00
Phoenix616
2be9207faa
Differentiate between shop accessing and administrating
This fixes LWC donation and display protections not working correctly
2021-05-16 00:31:33 +01:00
Phoenix616
5b214e09f5
Fix turning off default protection if protected externally (Fixes #445) 2021-05-16 00:17:25 +01:00
Phoenix616
d3ed650b74
Make LWC donation and display protections work with shops 2021-05-16 00:15:59 +01:00
Phoenix616
c9b8e136d1
Fix that shop info doesn't show when protected externally 2021-05-16 00:06:01 +01:00
Phoenix616
ca25dca6b0
Fix writing of config values with backslashes (Fixes #444)
The VALID_PLAYERNAME_REGEXP setting needs to be changed to "^\\w+$" to work properly.
2021-05-15 14:22:55 +01:00
Phoenix616
b09a1255a7
Allow building against latest Paper 2021-05-15 14:13:13 +01:00
Phoenix616
b8899c8333
Turn off internal protection for more protection plugins (Resolves #442)
This expands the TURN_OFF_DEFAULT_PROTECTION_WHEN_PROTECTED_EXTERNALLY
 config option so that it applies to more protection plugins rather than
 just LWC. Currently supported: BlockLocker, Deadbolt, Lockette (1.x),
 LockettePro (2.x) and SimpleChestLock
2021-05-04 16:36:32 +01:00
Phoenix616
07a22fa534
Try to create an account when creating shop for other players 2021-04-18 18:24:22 +01:00
Phoenix616
4172d8d484
Cancel sign change and interact if previous events are cancelled
This fixes that blocks get placed/items used when trying to auto-fill
 a shop sign and the sign is getting destroyed for some reason
2021-04-16 21:03:37 +01:00
Phoenix616
02cd9d4ec0
Work around getItemMeta returning null in some cases (Fixes #432) 2021-04-12 16:08:03 +01:00
Phoenix616
0c51af6b45
Further improve item name shortening for alias system (#425)
This will correctly shorten dashes and ignore the case when comparing
 name starts
2021-03-27 21:07:18 +01:00
Phoenix616
76e3f5b3c8
Add check if item has meta as that could've returned null (Fixes #427) 2021-03-27 18:44:04 +01:00
Phoenix616
66201a9062
Directly use Regex group matching to get playername (Fixes #428) 2021-03-27 18:34:03 +01:00
Phoenix616
ce7cade0a5
Fix potential case issues on item alias part matching 2021-03-26 15:57:38 +01:00
Phoenix616
b93361cd07
Fix shortened item aliases not working (Fixes #425) 2021-03-26 15:55:29 +01:00
Phoenix616
a3c5ec618a
Allow multiline comments and improve comment about Floodgate 2021-03-18 14:41:34 +01:00
Daniel B
f68a3203ac
Allow specifying of valid player names (#410)
This allows plugins which allow differently named players to work e.g. Floodgate. (Fixes #383)

Co-authored-by: Phoenix616 <max@themoep.de>
2021-03-17 22:46:05 +01:00
Rutger Kok
e6b05ff982 Add support for BlockLocker
It's no longer possible to open shops on chests that were protected by someone else.
2021-03-17 22:11:54 +01:00
Phoenix616
227e3e77f0
Update double chests too after transactions (Fixes #412) 2021-03-03 18:16:14 +01:00
Phoenix616
7b2fe6c1f3
Rework how accounts are queried from (short form) user names
The AccountQueryEvent will now check both, short names as well as full
 names and the getAccountFromShortName method will no longer check full
 names or offline player names. (Names in a short format wouldn't match
 them anyways)
This should not change the overal behaviour as the plugin uses the
 AccountQueryEvent internally as that is now checking for full name/
 offline player accounts. (And short names are matched first)
2021-02-24 15:18:15 +01:00
Phoenix616
68c9df2078
Re-add ability to quickly create buy shops by only specifying price
The change to the more advanced patterns required it to always specify B
2021-02-24 15:01:10 +01:00
Phoenix616
ebdebb81df
Implement /shopinfo command/chest click for shop info (Resolves #203)
The shop information can include the owner, available stock, the buy/
 sell prices and detailed item information from the ItemInfoEvent.
This also includes an item component in both /iteminfo and /shopinfo if
 ShowItem is installed.
2021-02-15 17:28:33 +01:00
Phoenix616
2f0e7b81a8
Add separate error message for invalid names 2021-02-05 15:26:39 +01:00
Phoenix616
320d9ad9fb
Fix adapter backwards compatiblity (and getHolder loading 🙈) 2021-01-28 17:33:40 +01:00
Phoenix616
65df4c40c6
Improve performance by using Paper's non-snapshot states if available 2021-01-28 17:18:42 +01:00
Phoenix616
22d3f262f5
Improve NameManager OfflinePlayer and UUID version handling (#383)
This also removes the deprecated methods which might interact with the
 changed methods in unintended ways from the NameManager and the
 PreTransactionEvent.
2021-01-28 15:26:23 +01:00
Phoenix616
ba47b82ba1
Make Admin Shops use containers if available (Resolves #402)
Admin Shops can now be stocked the same way as player shops if a valid
 shop container is nearby. If no container is nearby it will just work
 as an unlimited shop.

This behaviour can be disabled with the FORCE_UNLIMITED_ADMIN_SHOP
 config option so that an admin shop is unlimited even though a valid
 container is next to it.
2021-01-24 23:33:36 +01:00
Phoenix616
9843e92525
Make price line pattern matcher more strict (Fixes #401) 2021-01-14 19:01:04 +01:00
Phoenix616
71e8ef732f
Fix error in short item code generation logic (Fixes #395) 2021-01-06 20:08:38 +01:00
Phoenix616
66eaab7c4d
Include log level (if not INFO) and error stack trace in log file 2021-01-04 22:42:17 +01:00
Phoenix616
f12e6ed3b6
Use full item name instead of shortened for aliases
This fixes an issue where aliases would not show up in transaction
 messages when the aliases item's string was shortened.

Also remove an unnecessary string length calculation from the
 MaterialUtil getName method if there was no max width set.
2021-01-03 20:47:07 +01:00
Phoenix616
819f028774
Don't use contains check when searching alias without meta (Fixes #394) 2021-01-03 20:13:26 +01:00
Phoenix616
b774258051
Remove OddItem support and implement own alias system (Resolves #360)
Reasoning why this is part of the core and not a separate addon:
The impact of this function is extremely lightweight when (almost) no
 aliases are defined so someone who isn't using this should not have a
 worse experience.
Additionally including it in the core (similarly to the discounts,
 taxes and restrictions) promotes it's availability while not massively
 increasing the maintainability.

As for the OddItem removal:
That plugin hasn't been developed for over 7 years and such unique
 plugin support should really be added via separate addon using the
 events system which, with the new ItemStringQueryEvent, now actually
 supports doing that from an external plugin.
If someone really managed to run their own private fork of OddItem for
 all those years then they should be able to also provide such a simple
 addon.
2021-01-03 01:55:01 +01:00
Phoenix616
9dce41aa30
Work around internal issue with ender chests
At the moment they can't be shops anyways so this shouldn't have any impact.
2020-12-20 14:50:57 +01:00
Phoenix616
395f0513a6
Improve ignore config setting comments to make it more clear 2020-12-04 15:01:26 +01:00
Phoenix616
4e40823d23
Fix ShowItem incompatibility as well as update adventure 2020-12-04 14:53:27 +01:00
Phoenix616
af32b041ff
Implement missing Inventory#isEmpty method in AdminInventory 2020-12-01 20:05:11 +01:00
Phoenix616
51e9d5f267
Use adventure text api in order to fix hover issues
This also has the side-effect of restoring CraftBukkit compatibility

Also move all libraries into a dedicated Libs package
2020-12-01 19:48:26 +01:00
Phoenix616
8aff3da550
Add ENSURE_CORRECT_PLAYERID to properties metrics chart
Also fix missing new line in metrics chart code.
2020-11-18 15:31:44 +01:00
Phoenix616
fd81bc143e
Ignore signs and transactions made by players with invalid names 2020-11-18 15:10:58 +01:00
Phoenix616
9bf6e1abc1
Check permission for shop name again after querying it
This protects people that use valid player names as admin shop names
 from people with the same username as well as other cases where the API
 is used to manage access to shops with certain special names.
2020-11-17 19:54:08 +01:00
Phoenix616
00fa83c56a
Improve UUID version handling (Fixes #382, #337)
This adds a new config option ENSURE_CORRECT_PLAYERID which lets one
 disable the check whether or not a player's UUID version matches the
 server's online/offline mode UUID version. Due to potential issues with
 offline players which might occur when this isn't checked disabling
 this can't really be supported and any issues should first be tested if
 they still occur with this option enabled.

This also forces the UUID to version 4 if the server runs in online mode
 as it should not be necessary in any normal setup to detect the UUID
 version dynamically in that case. (Dynamic detection is only necessary
 for offline mode which might potentially run behind a proxy)
2020-11-16 14:09:07 +01:00
Phoenix616
cbb605df81
Set default locale to English if it is set to an invalid one in config 2020-11-12 23:16:40 +01:00
Phoenix616
4bd443c69f
Fix NPE in StockCounter for admin shops/missing containers 2020-11-02 01:08:15 +01:00
Phoenix616
7a1c091c74
Fix NPE in StockCounter on autofill/no item found (Fixes #376) 2020-11-02 01:06:48 +01:00
Phoenix616
9a08e8897b
Don't allow opening of shops via sign by default
This has caused lots of confusion in the past regarding the first time
setup and might be a feature that people don't even want to have.
(e.g. to allow coloring of the signs with dyes)
2020-10-31 20:59:15 +01:00
Phoenix616
f0bf9a08ec
Add message to access and creative mode ignoring 2020-10-31 20:59:07 +01:00
Brice Frisco
8d98958c2d
Stock Counter (Resolves #365) (#368) 2020-10-30 22:45:16 +01:00
Phoenix616
a14aaa7235
Fix issues with LWC Single/Double Chest protections (Fixes #359) 2020-09-24 16:54:36 +01:00
Phoenix616
de14a1affb
Don't parse player name as count in /csgive (Fixes #355) 2020-09-14 14:36:10 +01:00
Corey Shupe
282c39c975
Implement LockettePro support and improve soft dependency handling (#354) 2020-09-10 14:32:34 +01:00
Phoenix616
741a10cb95
Update server economy account warning to include shop creation and uuid 2020-09-08 12:20:19 +01:00
Phoenix616
5bc23214e0
Fix issue with items that have a single character in name (Fixes #339) 2020-07-08 21:40:06 +01:00
Phoenix616
6a34054bc7
Add latest test profile 2020-07-08 21:38:54 +01:00
Phoenix616
d1f6b1616b
Fix sign sticker on 1.14+ 2020-07-08 21:01:33 +01:00
Phoenix616
8c1c80e138
Don't log SERVER_ECONOMY_ACCOUNT warning if it's not set 2020-07-04 18:18:59 +01:00
Phoenix616
efe9ff7024
Fix TURN_OFF_SIGN_PROTECTION not working (Fixes #233) 2020-07-03 18:56:29 +01:00
Phoenix616
742f838f09
Add support for component bungee messages
Requires at least BungeeCord commit a64c34d
2020-07-03 18:24:14 +01:00
Phoenix616
98985efd63
Fix legacy %material placeholder not working 2020-07-03 18:13:40 +01:00
Phoenix616
9cbf33f68f
Cancel before sending message so that access is denied in case of error 2020-07-03 17:26:13 +01:00
Phoenix616
493784c2dd
Fix that the legacy locale is not automatically used 2020-07-03 17:15:36 +01:00
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
7161c0bfdf Add Jenkins test build notifier
This will only send a notification into the log once for each new build
 and can be disabled in the config or the new jenkinsBuildNotifier.yml
2020-06-18 21:19:35 +01:00
Phoenix616
d3f717deef Do not enabled automatic updates by default without user interaction 2020-06-18 18:14:53 +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
7fbf50cefe Allow 0 for a free shop (Resolves #297) 2020-05-06 20:38:41 +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
bb4eece790 Fix pre-events not being uncancellable 2020-05-04 22:16:09 +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
4673a3f00c Use AccountQueryEvent in NameManager#canUseName utility method 2020-05-02 19:25:44 +01:00
Phoenix616
8c83be59ba Option to block shop creation when LWC limit is reached (Resolves #293) 2020-05-02 15:57:42 +01:00