Commit Graph

298 Commits

Author SHA1 Message Date
Phoenix616
7203ec17cd
Add compatibility for new sign-editing in 1.20
This allows editing of signs if you hold a sign in hand but block any other interaction.
2023-06-13 00:11:48 +01:00
Krakenied
2fb82a2529
Strip price colors 2023-05-20 14:56:06 +02:00
Phoenix616
d52c329618
Make compatible with Folia by using own ExecutorService
Our async tasks were already pretty world-independent (update checker as
 well as some logging so this should work pretty well)

For the rest the ORMLite library should already be able to handle access from
 different threads and whether economy plugins are compatible with Folia is
 up to them, not us...
2023-03-23 23:50:43 +01:00
Phoenix616
92a013dd10
Cleanup: Properly log errors 2023-03-01 18:27:04 +01:00
Phoenix616
7a09c53bde
Cleanup: Better specify exception catch and remove unused import 2023-03-01 18:16:14 +01:00
Phoenix616
199573df59
Fix potential NullPointerExceptions 2023-03-01 18:14:18 +01:00
Phoenix616
a38f309453
Cleanup: Properly log errors 2023-03-01 18:11:35 +01:00
Phoenix616
02ef09c586
Use non-deprecated setScale, remove duplicate division calls, NPE-Fix 2023-03-01 18:10:25 +01:00
Phoenix616
aa7bfbb7ee
DoubleChest left/right side holder might be null/not BlockStates. Check that. 2023-03-01 18:06:35 +01:00
Phoenix616
7d92cb820d
Don't check block type twice
This also prevents it from getting it multiple types which would result in a chunk data query too...
2023-03-01 18:03:34 +01:00
Phoenix616
7ee8d07242
Cleanup: Use chained StringBuilder#append 2023-03-01 17:59:02 +01:00
Phoenix616
ada8cf3ae8
Cleanup: 0-sized arrays, NPE, Math.min usage 2023-03-01 17:48:07 +01:00
Phoenix616
f547995164
Cleanup: Mark EconomyAPI as Nullable and fix potential NPE 2023-03-01 17:37:22 +01:00
Phoenix616
852f20a50e
Add ItemBridge support (Resolves #361)
This also slightly changes how the max width is applied for generating sign item IDs
2022-12-29 15:25:26 +01:00
Phoenix616
93e2895645
Remove deprecated reflection API usage 2022-10-13 14:14:20 +01:00
Felipe Foschiera
9842f47f37
Trigger transaction message from CurrencyTransferEvent and consider tax (#534)
Triggers TransactionMessageSender from CurrencyTransferEvent, wrapping TransactionEvent inside of it.
Add logic to showamount after taxes on the message.
2022-10-12 16:37:18 +01:00
Phoenix616
da3928b723
Add meta information for more item types 2022-07-06 22:08:55 +01:00
Phoenix616
e3cd50cf75
Add some debug logging for shop sign creation 2022-07-06 00:54:44 +01:00
Krakenied
fd969cd996 Fix zero partial price exploit 2022-06-28 11:09:29 +02:00
Krakenied
2ebc2f285b
Fix NFE and some other possible issues (#502)
Fixes #499
2022-02-17 16:34:25 +01:00
Phoenix616
99a609b423
Unify sign line parsing and strip owner line whitespace 2022-01-26 20:35:42 +01:00
Phoenix616
02dd167024
Add better message for when the shop's sell price is above the buy price 2021-10-15 15:50:04 +01:00
Phoenix616
8655870077
Add clarifying comment to buy tax bypass 2021-10-15 15:39:01 +01:00
Phoenix616
01b7cddaa3
Use correct tax amount 🙈 2021-10-15 15:26:44 +01:00
Phoenix616
6962ae2590
Added log messages to tax and discount module (#478) 2021-10-15 15:17:09 +01:00
TreyRuffy
bb7bd3415c
ChestShop Sign Dying (#479)
Signed-off-by: TreyRuffy <TreyRuffy@users.noreply.github.com>
2021-10-12 23:30:49 +01:00
Phoenix616
d193812392
Fix shop not buying/selling errors being the wrong way around 2021-07-25 22:31:11 +01:00
Phoenix616
d3cb06acc0
Use the correct messages 🙈 (Fixes #462) 2021-06-26 23:06:21 +01:00
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
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
c9b8e136d1
Fix that shop info doesn't show when protected externally 2021-05-16 00:06:01 +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
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
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
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
Phoenix616
227e3e77f0
Update double chests too after transactions (Fixes #412) 2021-03-03 18:16:14 +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
65df4c40c6
Improve performance by using Paper's non-snapshot states if available 2021-01-28 17:18:42 +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
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
fd81bc143e
Ignore signs and transactions made by players with invalid names 2020-11-18 15:10:58 +01:00