Commit Graph

50 Commits

Author SHA1 Message Date
Phoenix616
d426492561
Fix issues with new 1.20 back side of signs
This basically blocks any text on the backside of a sign if the front is a valid shop
 and with that also fixes an issue where valid shop sign syntax was detected on back
 side sign changes.
2023-08-27 15:55:53 +01:00
Phoenix616
978f1270f5
Send ShopDestroyedEvent for sign edits that break a shop 2023-06-13 00:22:30 +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
93e2895645
Remove deprecated reflection API usage 2022-10-13 14:14:20 +01:00
Phoenix616
e3cd50cf75
Add some debug logging for shop sign creation 2022-07-06 00:54:44 +01: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
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
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
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
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
7b978ae022 Fix shop sign getting broken with autofill marker (Fixes #310) 2020-05-13 23:13:56 +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
7bd00f23be Block change block event for shop containers/signs 2020-02-22 17:43: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
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
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
2007c4a7fb Fix ShopDestroyEvent not getting called in certain cases
This could be triggered by updating a column of physics blocks with a shop attached
2019-04-01 13:55:21 +01:00
Phoenix616
bc14736a37 Ignore cancelled sign change events 2018-11-21 00:45:39 +01:00
Phoenix616
b853afbd52 Fix issues with the permissions for using different player names
This adds separate permissions for accessing, creating and destroying of shops.
It also adds a config entry to allow using of a shop even if someone have access to it due to their permissions.
2018-11-19 21:10:48 +01:00
Phoenix616
7adf02e532 Improve hopper protection
The InventoryMoveItemEvent is now only used for Hopper Minecarts, other blocks that could move items (Hoppers and Droppers) are checked on place. That way players that have access to a shop can just use the blocks normally but other players can't place them.
2018-10-23 19:27:39 +01:00
Phoenix616
fe85dafec5 Allow configuring what containers can be used for shops (Fixes #175) 2018-10-23 19:14:21 +01:00
Phoenix616
036d309965 [CI-SKIP] Fix some formatting inconsistencies
Remove spaces on empty lines and changed doc comment formatting
Also includes some minor comments and import fixes
2018-05-07 15:32:51 +01:00
Phoenix616
0176ea1dc5 Check the block that the sign is attached to first (Fixes #97)
Also fix some oddities and duplicate code/method execution
2018-01-11 18:28:45 +01:00
Phoenix616
d84313716f Add old piston checks back in for backwards compatibility. (Fixes #91)
These checks are completely unsupported though!
2017-12-31 01:13:13 +01:00
Phoenix616
7c9dd5c3f3 Check all blocks moved by pistons (Fixes DBO-1247) 2017-12-30 16:08:09 +01:00
Phoenix616
5d73320889 Set sign lines even when the event is cancelled (Fixes #82)
Also get the sign line from the event instead of the sign when checking if it is an admin shop so you can actually change that via an event listener.
2017-11-20 13:44:59 +01:00
Phoenix616
1d80edbf9b Get rid of google dependencies
Mostly replaced with Java 8 features and our own cache
2017-09-23 15:19:00 +01:00
mibby
17eb698e28 Move sign-update() to break listener
This fixes an infinite loop crash where the sign update calls the piston event and the update again and again.
Also signs can't even be pushed by pistons...
2016-08-27 19:58:45 -07:00
Gabriele C
8c49bfdbf4 Fixes 2015-08-01 09:52:13 +02:00
Andrzej Pomirski
118f72e805 Speed up SignBreak 2015-07-05 21:55:59 +02:00
Andrzej Pomirski
99959f2ca0 Fix the problem with colour signs
Apparently sign colour plugins do not consider &0 to be a colour that
needs to be removed if there is no other code like that on the sign,
thus ChestShop did not register the initial SignChangeEvent, however
after the server software removes the redundant colour from the sign, it
appeared and worked just like a ChestShop one. This commit "fixes" this
by stripping the colour codes from the sign before it is created.
2015-05-31 18:27:11 +02:00
Andrzej Pomirski
6466b2d6aa Remove logging to database! 2015-05-22 13:25:32 +02:00
Andrzej Pomirski
be18af86f6 Prevent shops from being ignited 2014-07-13 12:54:30 +02:00
Andrzej Pomirski
b4947475e2 Remove the "hacking" message. 2014-04-18 19:41:27 +02:00
Andrzej Pomirski
4107b10f4b More UUID changes 2014-04-12 13:57:39 +02:00
Andrzej Pomirski
b0e452ed1d Refactoring 2014-04-12 13:28:13 +02:00
Acrobot
387961d242 WAT. NO. 2013-12-07 18:30:26 +01:00
Acrobot
c8ddf29e91 Fix players not being refunded the money 2013-12-03 18:32:09 +01:00
Acrobot
023cabd849 Change the check 2013-11-01 16:44:57 +01:00
Acrobot
7c5ed4781f Add a prevention from IOUB-exceptions 2013-10-27 16:51:01 +01:00
Acrobot
7b8396a3ef Set the priority to monitor 2013-10-04 18:35:34 +02:00
Acrobot
b59f052019 Fix for McMMO compatibility 2013-10-04 18:29:50 +02:00
Acrobot
30a514e783 Properly re-write BlockPlace listener 2013-03-24 20:58:09 +01:00
Acrobot
055684fcbf Fix NPE 2013-03-24 00:53:06 +01:00
Acrobot
775dbe5afe First MC 1.5 version 2013-03-16 19:27:24 +01:00
Acrobot
a5bfa86bca Mavenized the project
Switched the project to Maven - you're now able to easily build
ChestShop.
2013-03-08 20:31:15 +01:00