Commit Graph

74 Commits

Author SHA1 Message Date
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 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
Corey Shupe 282c39c975
Implement LockettePro support and improve soft dependency handling (#354) 2020-09-10 14:32:34 +01:00
Phoenix616 6a34054bc7
Add latest test profile 2020-07-08 21:38:54 +01:00
Phoenix616 efe9ff7024
Fix TURN_OFF_SIGN_PROTECTION not working (Fixes #233) 2020-07-03 18:56:29 +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 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 1f8fd09dd2 Only update player name on join, don't create new accounts 2020-06-19 20:57:22 +01:00
Phoenix616 3e061dda8d Add config option to limit trading with shops via protections 2020-06-18 17:01:52 +01:00
Phoenix616 9f84ca8551 Add option to sell/buy all with shift (#320) 2020-05-31 14:50:53 +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 bb17cc35a0 Add ability to set max amount and improve error messages 2020-03-24 00:31:08 +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 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 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
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 28fb5cbeff Fix message amount display error when buying from admin shops
Also fix that the stock items were modified when buying from the admin shop
2019-04-07 13:48:16 +01:00
Phoenix616 5a99180aab Fix Admin Shops by adding more implementation to AdminInventory
This is required as we now move items between inventories instead of individually removing and adding. This basically adds the stock represented by the admin shop sign to the AdminInventory so all transactions should always be possible.
2019-04-05 15:17:15 +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 b931393a62 Fix more issues with the shop access permissions (#207) 2019-03-08 22:52:08 +01:00
Phoenix616 de5b505ec5 Fix issues with shop sign opening and access permissions (Fixes #207) 2019-03-07 17:33:47 +01:00
Phoenix616 91a372bd05 Make Item and Material parsing events 2019-01-17 19:50:47 +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 fe85dafec5 Allow configuring what containers can be used for shops (Fixes #175) 2018-10-23 19:14:21 +01:00
Phoenix616 b30688b635 Fix issues with admin shops, ops and creative mode (Fixes #168) 2018-09-26 17:02:13 +01:00
Phoenix616 dd4177e7cb Query server's player cache for missing players
This uses a cache for players that we haven't found before so to not check the cache too often and also checks if the online mode of the queried OfflinePlayer matches the server's mode (gotten from the first logged-in player in order to be compatible with BungeeCord requiring the server to be in offline-mode.
2018-08-29 21:29:27 +01:00
Daniel V 8ae72e5803 Feature: Reserve Support (#143)
This introduces a new AccountCheckEvent to check if a user actually has an account with the used economy plugin. Also fix CurrencyTransferEvent logic (even though it's not used anywhere currently)
2018-07-11 18:09:07 +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 ae8d1c79e9 Properly check if item is empty (Fixes #123) 2018-04-02 17:41:45 +01:00
Tim222 21815197c6 Fix Vault-Accountcheck for renamed player (#106) 2018-01-27 17:12:34 +01:00
Phoenix616 b2a31b8eb2 Add ability to autofill sign by clicking it
Also disable the worldguard shop flag by default...
2018-01-07 02:11:59 +01:00
Phoenix616 2d45dcdac0 Get rid of expensive calls to Bukkit#getOfflinePlayer with a username
This changes events to store the database Account instead of an OfflinePlayer and deprecates any event method that uses/returns OfflinePlayer. This is necessary as Bukkit#getOfflinePlayer(String) queries Mojang for the UUID when the user was not found in the local cache. As we already store this information (name to UUID mapping) in our database we should not have no need to rely on querying Mojang. (This might make transactions fail for shop owners that haven't played before but that shouldn't really be an issue in most cases)
2017-10-29 23:50:24 +01:00
Phoenix616 9b7000272d Merge remote-tracking branch 'origin/master' 2017-09-06 14:20:14 +01:00
Phoenix616 9da7d5198b Fix stacking issues (Fixes #74)
This also fixes some conditions under which the STACK_TO_64 option did not get applied correctly and wrong inventory space checking for items with a max stack size of less than 64
2017-09-06 14:19:34 +01:00
LukBukkit e672dc5e22
Fixed an error when trading with a admin shop (Fixes #59 & fixes #63) 2017-07-26 15:13:03 +02:00
Phoenix616 70fa6292b1 Get OfflinePlayer from namewith offline mode UUIDs. Fixes #60 2017-07-02 23:32:06 +01:00
Phoenix616 0525c70452 Rewrite NameManager to support multiple short names per user
This should fix the issue where the player's short name on the shop sign does not reflect the actual player's name. This works by storing every uuid-username combination together with the associated short name and the last time the player logged in with that combination.
2017-07-01 17:14:41 +01:00
Phoenix616 0b65a7cc92 Rewrite (and document) the NameManager
This should fix issues with how name changes are handled and also prevent short names of different players from clashing. It also uses guava caches instead of maps now with a configurable cache size
2017-06-30 20:28:18 +01:00
L4BORG 2ff945bbe6 Fix Admin Shops 2016-11-10 03:17:27 +01:00
L4BORG 24eb1b1e19 Economy fixes, fix for https://github.com/dmulloy2/ChestShop-3/issues/11 2016-10-13 18:11:23 +02:00
Dan Mulloy e186635484 Try to fix a few more errors
Fixes #7
2016-09-20 15:45:18 -04:00
mibby 8c7594be51 Revert PlayerKick Behavior
Partial revert of 'Do not let people with already used usernames connect to the server' commit. 

See comments here b0369d8e69 (commitcomment-14185778) and here. 
c169df2265 (commitcomment-12846919)

I personally believe ChestShops should not dictate whether a player is allowed to connect to the server or not. I personally have had issues with ChestShops kicking legitimate players from the server in online mode.
2016-08-27 20:09:09 -07:00
Andrzej Pomirski 5f7d6776c2 kickPlayer() should be called asynchronously 2015-08-15 19:38:30 +02:00
Andrzej Pomirski b0369d8e69 Do not let people with already used usernames connect to the server 2015-08-06 15:19:46 +02:00