Commit Graph

124 Commits

Author SHA1 Message Date
Phoenix616
362dd856d3
Cleanup: Properly log errors 2023-03-01 18:36:46 +01:00
Phoenix616
92a013dd10
Cleanup: Properly log errors 2023-03-01 18:27:04 +01:00
Phoenix616
93f14a330d
Cleanup: Use String#join instead of Stream#collect 2023-03-01 18:15:27 +01:00
Phoenix616
0d8d37eb85
Cleanup: Use 0-sized arrays and fix division 2023-03-01 17:54:31 +01:00
Phoenix616
f0661656a0
Cleanup: Use try-with and other small improvements 2023-03-01 17:24:47 +01:00
Phoenix616
fd0035a99c
Build against 1.19 and replace apache-commons-lang 2022-06-13 22:52:26 +01:00
Phoenix616
e40b5567b8
Require count digit on quantity line if module is enabled
Also use the same pattern for validating the line in QuantityUtil and ChestShoSign.
2022-02-04 16:28:44 +01:00
Phoenix616
986a22fb73
Make sure to not load chunks to check for shops (Fixes #473) 2021-09-01 16:30:14 +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
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
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
a3c5ec618a
Allow multiline comments and improve comment about Floodgate 2021-03-18 14:41:34 +01:00
Phoenix616
227e3e77f0
Update double chests too after transactions (Fixes #412) 2021-03-03 18:16:14 +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
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
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
4e40823d23
Fix ShowItem incompatibility as well as update adventure 2020-12-04 14:53:27 +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
Brice Frisco
8d98958c2d
Stock Counter (Resolves #365) (#368) 2020-10-30 22:45:16 +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
742f838f09
Add support for component bungee messages
Requires at least BungeeCord commit a64c34d
2020-07-03 18:24:14 +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
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
7fbf50cefe Allow 0 for a free shop (Resolves #297) 2020-05-06 20:38:41 +01:00
Phoenix616
432c505806 Add more information to /iteminfo command and make messages configurable 2020-05-03 15:05:24 +01:00
Phoenix616
781e017ae9 Add debug logging for configuration loading 2020-04-17 15:10:27 +01:00
Phoenix616
2426aef969 Add space at start of comments when writing config 2020-04-17 15:10:09 +01:00
Phoenix616
2a37304113 Specify locale when changing case (Fixes #291) 2020-01-29 16:35:04 +01:00
Phoenix616
4067427650 Add ability to define type of LWC protection in config 2020-01-15 22:55:40 +01:00
Phoenix616
bc680afcaf Slightly rework item comparison to fix legacy spawn eggs (Fixes #264) 2019-09-06 13:23:49 +01:00
Phoenix616
e972a7d657 Add further workarounds for comparing meta data (Fixes #250)
This is especially obvious for books where all the text will have color codes after dumping and loading them from the database. In order to be able to still compare to them we will load the item the item and then dump it again if it doesn't match the original one.
2019-07-08 18:05:50 +01:00
Phoenix616
4769ae2cf7 Allow loading of different numbers to BigDecimal (Fixes #225)
Also catch wrong types when loading the config better without completely disabling the plugin and revert "Make sure special parsers are setup" and register the parsers static again.
2019-05-03 21:08:56 +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
f0bc277566 Move to BigDecimal in all events and use the CurrencyTransferEvent
Also add tax bypass permissions (#204, ChestShop.notax.buy/sell). When buying with that permission the buyer does not have to pay the tax (the seller will still get the reduced amount), when selling the seller will get the full amount instead of one lowered by the tax.
The permissions of the shop owner play no role due to there not being a good way of checking offline player permissions and it being a bit non-obvious for the buying/selling player if a shop would be with or without tax. This way all that gets changed is the amount the player pays/receives and not the shop owner (and the player should know their permissions/rank already)

The transfer event was necessary in order to correctly resolve who triggered the transaction. Economy adapters are now required to implement a listener for each of the events. It's also recommended that economy adapters that support transfers directly use that instead of passing it through subtract and add with the processTransfer method.
2019-04-25 18:44:22 +01:00
Phoenix616
53ae07b779 Fix error that prevented selling to admin shops 2019-04-07 13:47:18 +01:00
Phoenix616
1952e5cb46 Directly transfer items (Fixes #169) 2019-04-05 14:49:27 +01:00
Phoenix616
8cd89bf8ee Work around issue with serialising explorer maps
This is due to a bug in CraftBukkit not properly supporting localised/translatable display names when serialising item meta.
This also adds/improves the message when no valid item ID could be generated.
2019-03-19 19:08:53 +01:00
Phoenix616
91a372bd05 Make Item and Material parsing events 2019-01-17 19:50:47 +01:00
Phoenix616
fe85dafec5 Allow configuring what containers can be used for shops (Fixes #175) 2018-10-23 19:14:21 +01:00
Phoenix616
b5f77d67b5 Fix color of ShowItem insert bleeding into message 2018-10-23 19:02:09 +01:00
Phoenix616
0c6aaaa6f7 Fix damage not getting set properly 2018-09-10 01:11:42 +01:00
Phoenix616
adf5340932 Remove spaces from shortened strings for better readability
This is necessary due to the extended length of some material names in 1.13 as they directly include the variation into the material where previously only the data value was used. (E.g. BLACK_STAINED_GLASS_PANE) By removing the spaces and using uppercase characters to separate parts the string stays both readable to the user and parseable by the plugin. It should also be backwards compatible with the old format. (At least with 1.13 material names)
2018-09-10 00:33:27 +01:00
Phoenix616
e1998bcd7c Merge branch '1.12' into 1.13
# Conflicts:
#	src/main/java/com/Acrobot/Breeze/Utils/MaterialUtil.java
2018-09-10 00:31:26 +01:00
Phoenix616
12d2107ce1 Fix passing Material enum strings directly to getShortenedName 2018-09-10 00:25:25 +01:00
Phoenix616
173991ab4a Use spaces and proper casing for calculating width (Fixes #166)
This also slightly changes which name part gets shortened first. It will first shorten the longest name and then the rest.
2018-09-09 22:43:49 +01:00
Phoenix616
54b3b6966c Merge branch '1.12' into 1.13
# Conflicts:
#	src/main/java/com/Acrobot/Breeze/Utils/MaterialUtil.java
#	src/test/java/com/Acrobot/Breeze/Tests/MaterialTest.java
2018-09-09 14:47:32 +01:00
Phoenix616
516eefc5b6 Allow longer item names on signs by calculating the width
This uses hardcoded widths for the main characters used in Minecraft and might not be precise for some characters but better than the previous 15 char hard limit.
2018-09-09 14:37:09 +01:00