Inactive [ECON] PhysicalShop v9.1.0 - Sign and chest shops (no commands, no databases) [1.2.5-R1]

Discussion in 'Inactive/Unsupported Plugins' started by Wolvereness, Sep 11, 2011.

  1. Offline

    Wolvereness Bukkit Team Member

    PhysicalShop - Let players own shops using chests
    Version: v9.1.0
    Licensed under: GNU-GPL 3
    Downloads | Source @ GitHub | Showcased on mc.minefire.net!
    Supports: LogBlock, LWC, Lockette, Permissions (yeti), Bukkit Permissions

    On BukkitDev as per forum migration.
    Support is offered in both locations, but if you have a curse account making a ticket is preferred.

    This plugin is a continuation from the plugin by the same name. I did not code the original plugin, but I did a hefty chunk of rewriting to add a few new features to it, and I plan on keeping it updated.

    Traditional Features:

    - Player made, chest-based shops with defined material and currency.​
    - Possible server-run shops with unlimited material and currency.​
    - Primitive access, explosion, and break protection​
    - Permission nodes for Use, Creation, and Administration​
    PhysicalShop.use (default true)​
    PhysicalShop.build (default true)​
    PhysicalShop.admin (default isop)​
    - No commands required​
    - No database of shops​
    - No required dependencies

    New Features:

    - LogBlock chest transactions (by default, turned off)​
    - Configuration node for protecting pre-existing chests (defaults on). If you are running LWC or Lockette and the person placing the sign has admin (or owner in case of Lockette) rights to the chest protection or admin in PhysicalShop, this node is ignored.​
    - Localization, you may now customize all messages. If you have a language translation, please submit it here and I can package it with the jar file. Any translation packaged in the jar is accessed automatically when language is defined in configuration (and from that point forward accessed from Locale directory).​
    - Configuration file saves defaults on first load. This should lead to less hassle about what settings are available.​
    - Per sign currency. With small amount of configuration server-side, any shop may use a single character representation (defaults to g to represent gold ingot) of a currency. Suggestions to add are i: Iron Ingot and d: Diamond.​
    - Per transaction type currency. In addition to having variable currencies per signs, you can also have a different currency for buy and sell transactions. It just works.​
    - Bukkit Permissions support.​
    - On-the-fly configuration reload. Type "/physicalshop reload" in-game or from console.​
    - Custom item aliases you can put on signs.​
    - Custom item names that get displayed in chat messages.​
    - Version checking with "/physicalshop" or "/physicalshop version"​
    - Detailed information on active currencies, aliases, and names with "/physicalshop verbose"​
    - Optionally toggle redstone levers and buttons behind the shop sign.​
    - Optional handling of names too long for signs.​
    - Events for shop creation, destruction, interaction, and sign creation.​
    - Better configuration for shop matching.​
    - An automatic update command. EXPERIMENTAL AT THE MOMENT

    - Items you can see!​

    Installation:


    Place jar in plugins folder.​
    Reload plugins with a plugin manager or restart server.​

    Configuration:

    A default configuration file is created when plugin first loads. It will automatically fill any missing values as well. Most settings should be straightforward, but I have listed them here anyway. Currently, the only languages supported out of the box are English, Polish, and Spanish.​
    Show Spoiler

    material-pattern: \[(.+)\]​
    This is used to 'check' the first line of the sign.
    log-block: false​
    Change this to 'true' to enable LogBlock compatibility.
    protect-explode: true​
    Protects a physicalshop sign from being broken by explosions (TNT).
    protect-break: true​
    Protects a physicalshop sign from being broken by someone other than the owner.
    auto-fill-name: true​
    Will change the fourth line of a physicalshop sign to read the name of the player creating the sign.
    currencies:
    The list of currencies that your server will support. The code for the currency must be exactly 1 character long. Case-sensitive, so you wanted both g and G to work, you'd add them both.
    g: Gold Ingot​
    An example currency, default is g for Gold Ingot.
    buy:
    This section is for the buy line matching pattern.
    mode: SPLIT​
    This can be SPLIT or MATCH, and will use the respective regex concepts for finding the respective numbers and currencies.
    pattern: {{{^\D+(?=\d)|(?<=\d)\D+(?=\d)|(?<=\d)\D*(?=\D$)}}}​
    This is the regex that will be used. It should be written with the mode in mind.
    amount-index: 1​
    This is the index for the amount you buy in respect to the array from splitting, or the matching group for matching.
    price-index: 2​
    This is the index for the price you pay in respect to the array from splitting, or the matching group for matching.
    currency-index: 3​
    This is the index for the name of the currency in respect to the array from splitting, or the matching group for matching.
    sell:
    This section is for the sell line matching pattern.
    mode: SPLIT​
    This can be SPLIT or MATCH, and will use the respective regex concepts for finding the respective numbers and currencies.
    pattern: {{{^\D+(?=\d)|(?<=\d)\D+(?=\d)|(?<=\d)\D*(?=\D$)}}}​
    This is the regex that will be used. It should be written with the mode in mind.
    amount-index: 1​
    This is the index for the amount you sell in respect to the array from splitting, or the matching group for matching.
    price-index: 2​
    This is the index for the price you make in respect to the array from splitting, or the matching group for matching.
    currency-index: 3​
    This is the index for the name of the currency in respect to the array from splitting, or the matching group for matching.
    server-shop: '[Server]'​
    If the fourth line of a physicalshop sign equals this, the sign will be classified as a server shop with unlimited quantity (as long as there is no chest below it).
    language: English​
    Name of the language to be used server wide. If file not found in plugins/physicalshop/Locale/, it will check the packaged language files. A file will always be created with the name of the specified language, so please feel free to specify the proper language and translate the default values (perhaps even post it here so I can distribute it with the plugin). Default packaged language files are listed under configuration description.
    protect-chest-access: true​
    Prevents everyone (exception of those with admin permission) from accessing a chest for a physicalshop sign that is not the owner of said sign.
    protect-existing-chest: true​
    Prevents a shop sign from being placed above an existing chest. If you are using LWC, and they have admin access to the chest, this setting is ignored and they may place the sign anyway.
    trigger-redstone: false​
    Setting this to true will cause all levers and buttons attached to the back of the block the sign is attached to activate when a successful transaction has taken place.
    extended-names: false​
    Setting this to true will start a collection of names that are 16 characters long (too long for a sign) and will appropriately assign them unique IDs to put at the end of their name. (will be something like 0 or a). This saves the names to a file, and requires auto-fill-name to be on (so that names can get registered). This feature 'does' store data in a file.
    detailed-output: true​
    This is used to change how much information about chest stock is printed when a player punches a shop sign. Setting it to false will only print relevant information; the total buyable items if applicable and the total sell currency if applicable.
    This is the URL to download a new PhysicalShop jar from when using the command /physicalshop update
    showcase-mode: true​
    This shows items when a player punches a shop sign
    ignore-mc-version: false​
    This is the only configuration option that is NOT added to the config file by default. It will force PhysicalShop to ignore the MC version number safeguard for the showcase feature. This should only be applicable if there is an update to minecraft but does not break the showcase feature. No promises here, enable at your own risk.


    Customization:

    Comes in two parts, item aliases and item names. When you first load v8.2 or higher, two examples are placed into the Locale / Items.yml. Be sure to remove these two examples if you are going to edit the yml!! These names and aliases are cached as wrappers in a hashmap. They are case insensitive. For the item names, if you require a damage value, use a vertical bar | because you can't use a colon.​
    • Item Aliases - These nodes are named using a custom name, and the value should be the real name (or number). This allows you to add things like "Moss Stone" on a sign to point to 48. They do not effect the text that is outputted to the user.
    • Item Names - These nodes are named using the real name or ID of the item you want to rename, with the value being your custom message. This is used to make the PhysicalShop output look better. They do not effect the text you can put onto a sign.


    Usage:

    • Place sign on wall above chest.
    • Write on first line item name or number, enclosed with []s. You may also add a sub-code using a : (colon).
    • On the second line, you may write "Buy X for Xc". Replace the Xs with the respective amounts that a user will buy from the shop for. Replace the c with the letter code for applicable currency (g is the default, and represents Gold Ingots).
    • On the third line, you may write "Sell X for Xc". Replace the Xs with the respective amounts that a user will sell to the shop for. Replace the c with the letter code for applicable currency (g is the default, and represents Gold Ingots).
    • The fourth line fills automatically. Users with admin permissions (or, in the case of none-permissions users, Ops) may write [Server]. A [Server] shop without a chest has an infinite amount of stock & currency.
    • Place chest below sign. You may put anything in the chest, but for the shop to work you must place the applicable item and/or currency.
    • Punch the sign to confirm it was set up properly.
    • Player may right-click the sign with applicable currency in-hand to buy from the shop.
    • Player may also right-click the sign with applicable item to sell to the shop.

    Known Issues:


    - Pistons may theoretically cause issues with signs, has not been tested.
    - Does not support PermissionsBukkit, will simply give all players Use / Create access, and Ops get admin access.
    - Signs are more strict than the predecessor plugin. This was done to support multiple currencies. If you customize the regex to meet personal standard, keep in mind that the regex is used to SPLIT a string into the 3 applicable parts. If you have an issue, feel free to post and I can make you a more applicable regex for your server. Signs by default must meet this match regex: (Buy|Sell) \d{1,4} for \d{1,4}\D
    - Vine stores are problematic atm. Investigating. Vines have a damage value of 1. You may use [Vine:1] on shop signs for fix, this is a vanilla / bukkit issue.​
    - VoxelSniper has been tested to cause issues with protecting shops.​
    - ModLoaderMP breaks this plugin. You have been warned.​
    - If your currency section used longer names, the single character signs WILL NOT WORK without changing the regex!​

    Getting support:


    First things first, check the case for the sign! By default, the signs are case sensitive!​
    If you need support, please include a pastebin of the entire stacktrace (all those crazy long names and numbers) for the error (or the exact message you receive in-game), the 'exact' sign syntax you are using, your configuration file, and all the plugins on your server. You may also be able to contact me in the esperNet IRC in the #bukkit channel. You can mention PhysicalShop or my name and I get alerted if I'm online.​

    Change Log:

    Show Spoiler
    (4/16/12) - v9.1.0 - showcase
    - Added: Showcase! Your shop is now diamonds.​
    (4/12/12) - v9.0.18 - tweak
    - Added: Sandstone data type handling​
    (4/11/12) - v9.0.17 - output fix
    - Fixed: Output in reduced output is now more specific​
    (4/8/12) - v9.0.16 - locale fix
    - Fixed: POLISH.yml had missing info​
    (3/29/12) - v9.0.15 - fixed load
    - Fixed: Softdepend wasn't defined properly.​
    - Updated: dependency for pom, now compiling against RB​
    - Added: New option to reduce the output of chest stock​
    - Added: New option to change the URL used for updating​
    - Added: Wooden plank species​
    (3/18/12) - v9.0.14 - exploit fix
    - Updated: dependencies for pom​
    - Fixed: ShopDestructionEvent firing when no block was destroyed​
    - Fixed: Placing block when selling to shop​
    (2/27/12) - v9.0.13 - bugfix
    - Fixed: players can again break shops​
    - Fixed: Physics event no longer blocked​
    (2/25/12) - v9.0.12 - critical bugfix
    - Fixed: infinite loop writting a massive file in update command​
    - Fixed: no permission for shop chests​
    - Fixed: Regex wasn't loading right​
    (2/22/12) - v9.0.11 - bugfix
    - Fixed: Currency config didn't read properly​
    (2/22/12) - v9.0.10 - tweak
    - Fixed: Minor logic issue​
    (2/21/12) - v9.0.9 - event
    - Added: Shop destruction event​
    - Added: Shop interaction event​
    - Added: Longer currency names. WARNING: If your currency section used longer names, the single character signs WILL NOT WORK!​
    - Added: Update command​
    (2/18/12) - v9.0.8 - feature
    - Added: Better configuration for shop buy / sell matching​
    (2/17/12) - v9.0.7 - refactor
    - Changed: More code is put into ShopHelpers, cleans up the listener and some shop stuff​
    - Fixed: Access to double chests is now covered by PhysicalShop​
    - Added: Better name recognition and output for Monster Eggs (silverfish blocks) and Smooth Brick​
    (2/17/12) - v9.0.6 - bugfix
    - Fixed: No longer create a chest next to a chest that is part of a shop of which you aren't owner​
    (2/15/12) - v9.0.5 - bugfix
    - Fixed: Custom event for shop creation should no longer be thrown if event cancelled​
    (2/15/12) - v9.0.4 - fixed reload config
    - Fixed: Enabling name service when reloading config​
    - Added: Custom event for when a sign is created​
    - Added: Custom event for when a shop is created​
    (2/15/12) - v9.0.3 - more break fixes
    - Fixed: fixed all the events that should be able to destroy a shop​
    (2/15/12) - v9.0.2 - fix from AgentME
    - Fixed: Enderman can no longer break shops if shop protection is active​
    - Fixed: Pistons can no longer break shops if shop protection is active​
    (2/14/12) - v9.0.1 - fix default config
    - Fixed: Now saves a default config​
    - Changed: Will not load if exception or error is thrown in onEnable()​
    (2/7/12) - v9.0.0 - major refactor
    - Changed default sign format to be much more lenient​
    - Changed API to be a bit more sane​
    - Added color support in messages​
    (1/29/12) - v8.4.2 - new events
    - Fixed events to work with new annotations​
    - Changed redstone hook for CraftBukkit (fixes redstone issue)​
    (1/21/12) - v8.4.2a - code revision
    - Added URL to plugin.yml​
    - Made a bit of code for logblock look better​
    - Added missing @Override​
    (12/30/11) - v8.4.1 - bugfix
    - Fixed: NameCollection.yml clearing entries with only 1 player on server restart​
    (12/28/11) - v8.4.0 - feature build
    - Added extended name service​
    - Fixed: Fresh installations should work now​
    (12/27/11) - v8.3.3 - bugfix build
    - Fixed: Alias and names acted strangely​
    (12/23/11) - v8.3.2r2 - re export with Locale
    (12/23/11) - v8.3.2 - new logblock hook
    - Fixed: newest version of LogBlock​
    (12/21/11) - v8.3.1 - URGENT bugfix
    - Fixed: Enchantments being removed during transactions​
    (12/21/11) - v8.3.1a - translation build
    - Added Danish Locale, special thanks to Duerdum9​
    (12/16/11) - v8.3.0 - redstone triggering
    - Added redstone trigger​
    - Added redstone trigger config option, default false​
    - Fixed exception with logblock when not installed but config had it enabled​
    (12/15/11) - v8.2.5a - license change
    - GNU GPL​
    (12/15/11) - v8.2.4 - bugfix to test build
    - Fixed: Accidentally the permission defaults​
    - Fixed: Accidentally all the item comparisons​
    (12/14/11) - v8.2.4a - 1.0.1 partial update
    - Updated the com.wolvereness.util package for compatibility with BukkitNyan​
    - Changed implementation of the reload command, you must now type /physicalshop reload​
    - Added version, and verbose commands; verbose will print all names, aliases, and currencies​
    - Added the consideration of enchants​
    - Now ignores any item that has an enchantment, you may not buy / sell items with them applied​
    - Fixed durability, will no longer use byte data, now exclusively checks short durability​
    (12/6/11) - v8.2.3 - API, javadoc, and codestyle cleanup Build
    - Added massive amount of code comments... Enjoy...​
    - Removed deprecated get currency method​
    - Deprecated isOwner method from Shop (ambiguous, it was actually a static permission check), new method is now canDestroy​
    (12/5/11) - v8.2.2 - translation build
    - Added Spanish translation, special thanks to federan​
    (10/29/11) - v8.2.1 - minor bugfix build
    - fixed an extra output message​
    - changed failed aliases and names to warning instead of severe​
    (10/27/11) - v8.2.0 - feature build
    - changed com.wolvereness.util.Config API to allow quick saving and fixed state of getConfig() during defaults()​
    - added custom item names​
    - added custom aliases items​
    - fixed glitch involving the g currency​
    - fixed glitch reading in a currency, workaround for bukkit (you can now use numbers)​
    - fixed checking logblock after config reload​
    (10/24/11) - v8.1.5 - bugfix build
    - fixed new locale issue​
    (10/24/11) - v8.1.4 - bugfix build
    - fixed bukkit permissions​
    - fixed locale issue​
    (10/19/11) - v8.1.3 - Bukkit RB Build
    - changed config to new API​
    - changed API pertaining to config (it's now under com.wolvereness.util)​
    - changed API for creating shops (added a constructor for just sign text)​
    - removed some deprecated nonfunctional code​
    - removed some useless / old commented code blocks​
    - added admin bypass to chest-access​
    - fixed new issue with chest protections​
    - fixed auto filling playername for invalid signs​
    - chest protection not fully compatible with VoxelSniper​
    (10/2/11) - v8.1.2 - bugfix build
    - fire can no longer break shop​
    (9/29/11) - v8.1.1 - minor feature build
    - added lockette hook, lockette lock owners bypass existing chest protection​
    - cleaned up some code to be more compatible with load orders​
    - cleaned up the configuration node for protecting existing chests​
    - admins now bypass existing chest protection mechanism​
    (9/26/11) - v8.1.0 - feature build
    - added bukkit permissions​
    - added reload config command /physicalshop (the admin permission node)​
    - added config node for existing chest protection​
    - added language nodes for reloading config (requires deletion of language yml for update from jar, google translate was used for polish)​
    (9/22/11) - v8.0.3 - BukkitRB build
    - Removed an unused private function in com.wolvereness.physicalshop.Shop​
    (9/18/11) - v8.0.2 - language build
    - Added Polish translation, special thanks to keicaM​
    (9/14/11) - v8.0.1 - minor build
    - Deprecated com.wolvereness.physicalshop.config.Config.Config()​
    - Added changelog.txt to jar​
    (9/11/11) - v8 - Submitted / Re-Release
    - Licensed under Creative Commons BY-NC-SA [​IMG] (previous work had no associated license)​
    - Removed config option for rate-pattern, replaced with buy-pattern and sell-pattern​
    - Large changes to sections of the API​
    - Added new features​
    - (optional) logblock hook​
    - lwc hook​
    - localization​
    - automatic config file generation​
    - multiple currencies (thus changing previous configuration for currency)​
    - Fixed bugs​
    - 0 amount transactions disfunctional​
    - null pointer exception when attemption to perform an action on shop that does not support such (liking selling to a buy-only sign), and will instead give the user a friendly message.​


    Todo & Planned Features:

    - support PermissionsBukkit
    - add redstone button / lever toggle behind shop sign after transaction.
    - add optional player messaging support​
    - add reload command (I hate /reloadall, so this is a slightly higher priority for me)
    - more plugins supported, lockette and LWC and logblock supported... I can't think of any more, suggestions?​
    - github
     
  2. Offline

    spud2451

    thanks so much
     
  3. Offline

    Wolvereness Bukkit Team Member

    Wishes granted.
    Seems it was easier than I anticipated.
    I added a configuration node. Behavior still defaults to protecting chests from signs being placed above them, but you can edit 'protect-existing-chests' to false then type /physicalshop in-game (with permission / op) or from console.
     
  4. Offline

    Bobsqeezeorg

    Thanks man
     
  5. Offline

    bluej100

    You are a legend. Thank you.
     
  6. Offline

    Simanova

    Seems to be not working - is there a notification after doing this?
     
  7. Offline

    Wolvereness Bukkit Team Member

    When you punch a sign, it'll send you a message giving the current stock. If there is enough stock / currency in the shop to buy / sell, it'll tell you the respective item. Make sure your buy / sell are on the proper lines. Sell must always be on the third line, and buy always on the second.
     
  8. Offline

    xkingxdreadx

    How would i be able to use Essentials or iConomy 6 with the curency part?
     
    sleite likes this.
  9. Offline

    Wolvereness Bukkit Team Member

     
  10. Offline

    Whitejakyl

    It keeps saying i dont have permission to make shops...when i am the server admin, is it possible for regular players to make shops too?
     
  11. Offline

    Wolvereness Bukkit Team Member

    Double check your permissions. Which permissions plugin are you using, are you also using a bridge, and did you explicitly give yourself the proper permissions?

    Special thanks to bluej100 for pointing out the fire bug and doing a quick test so I could push v8.1.2 out.

    In case anyone is wondering... I don't release all versions. Versions come when I get a stopping point where I can document the changes. I don't release them until I can load it up and confirm previous features are functional. I do upload to github every version number though.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  12. Offline

    CreeperHug

    awesome plugin! but when im trying to buy wood (not planks) it says that the shop doesn't have enough wood, but i almost filled it with stacks of it. ive tried with both [Wood] and [wood] but i wpuld prefer not to use the id:s couse my friends would get confused
     
  13. Offline

    Wolvereness Bukkit Team Member

    Wood -> Plank
    Log -> Log

    This is a bukkit issue (PhysicalShop uses name resolution from bukkit API).
     
  14. Offline

    kelechi96

    So is there no way of changing the item name, because I'd much rather type [Lapis Lazuli] or [Lapis Dye] than [351:4].
     
  15. Offline

    Excalibur42

    Hey, i get this error when trying to make a sign using a currency i defined in the config:

    Code:
    java.lang.IndexOutOfBoundsException: No group 1
        at java.util.regex.Matcher.group(Matcher.java:487)
        at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
        at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
        at com.wolvereness.physicalshop.listeners.PhysicalShopBlockListener.onSignChange(PhysicalShopBlockListener.java:95)
        at org.bukkit.plugin.java.JavaPluginLoader$36.execute(JavaPluginLoader.java:490)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:1046)
        at net.minecraft.server.Packet130UpdateSign.a(SourceFile:41)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)


    This is my config:

    Code:
    protect-existing-chest: true
    buy-pattern: Buy (?=d{1,4} for)|(?<=d{1,4}) for (?=d{1,4})|(?<= for d{1,4})(?=D)
    protect-explode: true
    material-pattern:
    - (.+)
    currencies:
        g: Gold Ingot
        i: Iron Ingot
        d: Diamond
    auto-fill-name: true
    server-shop: '[Server]'
    protect-chest-access: true
    language: English
    protect-break: true
    log-block: false
    sell-pattern: Sell (?=d{1,4} for)|(?<=d{1,4}) for (?=d{1,4})|(?<= for d{1,4})(?=D)
    
     
  16. Offline

    Wolvereness Bukkit Team Member

    @Excalibur42 I can think of two ways to debug that. Either your material-pattern isn't being read from the yml (what I think), or the regex implementation needs to be improved. Try the material pattern on a single line like this:
    Code:
    material-pattern: (.+)
    @kelechi96 Not atm I'm afraid. However, I will be working on a way to whitelist certain names and link them to Item Names / Data Values.
     
  17. Offline

    Excalibur42

    I keep getting this error: at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-08 17:07:59 [SEVERE] Could not pass event PLAYER_INTERACT to PhysicalShop
    java.lang.IndexOutOfBoundsException: No group 1
    at java.util.regex.Matcher.group(Matcher.java:487)
    at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
    at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
    at com.wolvereness.physicalshop.Shop.<init>(Shop.java:59)
    at com.wolvereness.physicalshop.ShopHelpers.getShop(ShopHelpers.java:39)
    at com.wolvereness.physicalshop.listeners.PhysicalShopPlayerListener.onPlayerInteract(PhysicalShopPlayerListener.java:40)
    at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:171)
    at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:92)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:497)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-08 17:07:59 [SEVERE] Could not pass event PLAYER_INTERACT to PhysicalShop
    java.lang.IndexOutOfBoundsException: No group 1
    at java.util.regex.Matcher.group(Matcher.java:487)
    at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
    at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
    at com.wolvereness.physicalshop.Shop.<init>(Shop.java:59)
    at com.wolvereness.physicalshop.ShopHelpers.getShop(ShopHelpers.java:39)
    at com.wolvereness.physicalshop.listeners.PhysicalShopPlayerListener.onPlayerInteract(PhysicalShopPlayerListener.java:40)
    at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:171)
    at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:92)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:497)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)



    Even after recoding my config to


    protect-existing-chest: true
    buy-pattern: Buy (?=d{1,4} for)|(?<=d{1,4}) for (?=d{1,4})|(?<= for d{1,4})(?=D)
    protect-explode: true
    material-pattern: \[(.+)\]

    currencies:
    g: Gold Ingot
    i: Iron Ingot
    d: Diamond
    auto-fill-name: true
    server-shop: '[Server]'
    protect-chest-access: true
    language: English
    protect-break: true
    log-block: false
    sell-pattern: Sell (?=d{1,4} for)|(?<=d{1,4}) for (?=d{1,4})|(?<= for d{1,4})(?=D)



    After i recoded it to that, I reloaded and the next time i check the config it went back to this:

    protect-existing-chest: true buy-pattern: Buy (?=d{1,4} for)|(?<=d{1,4}) for (?=d{1,4})|(?<= for d{1,4})(?=D) protect-explode: true material-pattern: - (.+) currencies: g: Gold Ingot i: Iron Ingot d: Diamond auto-fill-name: true server-shop: '[Server]' protect-chest-access: true language: English protect-break: true log-block: false sell-pattern: Sell (?=d{1,4} for)|(?<=d{1,4}) for (?=d{1,4})|(?<= for d{1,4})(?=D)


    It's as if its not even accepting my reconfiguration and going to the error causing one.

    I changed the line to this:

    material-pattern: (.+)

    But now the signs don't work, no errors, just doesn't work. I'am doing the signs like this:

    [stone]s.
    Buy 64 for 1i
    Sell 64 for 1i
    [Server]

    i=iron ingot of course, and the "i" currency was configured in the config....

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 19, 2016
  18. Offline

    Wolvereness Bukkit Team Member

    Please use the code tags when it does that.

    Your problem lies in your regex. In short, it's wrong, use this instead:
    Code:
    material-pattern: \[(.+)\]
    As a long explanation, your problem lies in the matching group. Your matching group matches EVERYTHING on the line (matching group defined as the first detected outer pair of parenthesis). So, you're asking bukkit what item has the exact name
    Code:
    [stone]s
    instead of what item has the name
    Code:
    stone
    Really complicated stuff that follows, read only if you know stuff about regex:
    If you'd really like the top sign to match with or without the brackets, then you're going to need a very careful regex using an optional look-around and a non-greedy match pattern (which, essentially, is oxymoronic). Another approach would be to use an excluding group instead of the . set, making so that the brackets wont match.
     
  19. Offline

    Excalibur42

    The thing is I DID put this

    material-pattern: \[(.+)\]
    and of course I added this:
    currencies:
    g: Gold Ingot
    i: Iron Ingot
    d: Diamond

    Then I restarted and it returned with the error. So I go BACK to the config and the line had changed by itself to this:
    material-pattern: - (.+)


    Basically, everytime i restart after changing the config, it changes it back to this:

    Code:
    protect-existing-chest: true
    buy-pattern: Buy (?=d{1,4} for)|(?<=d{1,4}) for (?=d{1,4})|(?<= for d{1,4})(?=D)
    protect-explode: true
    material-pattern:
    - (.+)
    currencies:
        g: Gold Ingot
        i: Iron Ingot
        d: Diamond
    auto-fill-name: true
    server-shop: '[Server]'
    protect-chest-access: true
    language: English
    protect-break: true
    log-block: false
    sell-pattern: Sell (?=d{1,4} for)|(?<=d{1,4}) for (?=d{1,4})|(?<= for d{1,4})(?=D)
    
     
  20. Offline

    Wolvereness Bukkit Team Member

    Turn off server. Delete your config. Turn on server. Edit config to add i and d for currencies. Type /physicalshop in-game.

    If you get any errors here, that's what I need.
     
  21. Offline

    Excalibur42


    I did EXACTLY what you said. Upon the configuration reload, no error. Upon making a sign with Iron Ingots as a curency and subsequently punching it.... this happens:

    Code:
    2011-10-09 01:18:22 [SEVERE] Could not pass event SIGN_CHANGE to PhysicalShop
    java.lang.IndexOutOfBoundsException: No group 1
        at java.util.regex.Matcher.group(Matcher.java:487)
        at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
        at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
        at com.wolvereness.physicalshop.listeners.PhysicalShopBlockListener.onSignChange(PhysicalShopBlockListener.java:95)
        at org.bukkit.plugin.java.JavaPluginLoader$36.execute(JavaPluginLoader.java:490)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:1046)
        at net.minecraft.server.Packet130UpdateSign.a(SourceFile:41)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-09 01:18:23 [SEVERE] Could not pass event PLAYER_INTERACT to PhysicalShop
    java.lang.IndexOutOfBoundsException: No group 1
        at java.util.regex.Matcher.group(Matcher.java:487)
        at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
        at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
        at com.wolvereness.physicalshop.Shop.<init>(Shop.java:59)
        at com.wolvereness.physicalshop.ShopHelpers.getShop(ShopHelpers.java:39)
        at com.wolvereness.physicalshop.listeners.PhysicalShopPlayerListener.onPlayerInteract(PhysicalShopPlayerListener.java:40)
        at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:171)
        at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:92)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:497)
        at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-09 01:18:24 [SEVERE] Could not pass event PLAYER_INTERACT to PhysicalShop
    java.lang.IndexOutOfBoundsException: No group 1
        at java.util.regex.Matcher.group(Matcher.java:487)
        at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
        at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
        at com.wolvereness.physicalshop.Shop.<init>(Shop.java:59)
        at com.wolvereness.physicalshop.ShopHelpers.getShop(ShopHelpers.java:39)
        at com.wolvereness.physicalshop.listeners.PhysicalShopPlayerListener.onPlayerInteract(PhysicalShopPlayerListener.java:40)
        at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:171)
        at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:92)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:497)
        at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-09 01:18:24 [SEVERE] Could not pass event PLAYER_INTERACT to PhysicalShop
    java.lang.IndexOutOfBoundsException: No group 1
        at java.util.regex.Matcher.group(Matcher.java:487)
        at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
        at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
        at com.wolvereness.physicalshop.Shop.<init>(Shop.java:59)
        at com.wolvereness.physicalshop.ShopHelpers.getShop(ShopHelpers.java:39)
        at com.wolvereness.physicalshop.listeners.PhysicalShopPlayerListener.onPlayerInteract(PhysicalShopPlayerListener.java:40)
        at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:171)
        at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:92)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:497)
        at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-09 01:18:24 [SEVERE] Could not pass event PLAYER_INTERACT to PhysicalShop
    java.lang.IndexOutOfBoundsException: No group 1
        at java.util.regex.Matcher.group(Matcher.java:487)
        at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
        at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
        at com.wolvereness.physicalshop.Shop.<init>(Shop.java:59)
        at com.wolvereness.physicalshop.ShopHelpers.getShop(ShopHelpers.java:39)
        at com.wolvereness.physicalshop.listeners.PhysicalShopPlayerListener.onPlayerInteract(PhysicalShopPlayerListener.java:40)
        at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:171)
        at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:92)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:497)
        at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    2011-10-09 01:18:24 [SEVERE] Could not pass event PLAYER_INTERACT to PhysicalShop
    java.lang.IndexOutOfBoundsException: No group 1
        at java.util.regex.Matcher.group(Matcher.java:487)
        at com.wolvereness.physicalshop.ShopMaterial.<init>(ShopMaterial.java:113)
        at com.wolvereness.physicalshop.Shop.getMaterial(Shop.java:21)
        at com.wolvereness.physicalshop.Shop.<init>(Shop.java:59)
        at com.wolvereness.physicalshop.ShopHelpers.getShop(ShopHelpers.java:39)
        at com.wolvereness.physicalshop.listeners.PhysicalShopPlayerListener.onPlayerInteract(PhysicalShopPlayerListener.java:40)
        at org.bukkit.plugin.java.JavaPluginLoader$11.execute(JavaPluginLoader.java:314)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:339)
        at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:171)
        at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:92)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:497)
        at net.minecraft.server.Packet14BlockDig.a(SourceFile:43)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:92)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:108)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:471)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:374)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:417)
    
    This is the sign i used for testing it.
    [​IMG]
     
  22. Offline

    Wolvereness Bukkit Team Member

    What editor are you using to edit the yml? I recommend notepad++. That's the only thing I could possibly think of causing the problem. Here's another idea (to diagnose), use this for your config (and nothing else):
    Code:
    currencies:
        g: Gold Ingot
        i: Iron Ingot
        d: Diamond
    If you simply use that, all the other values should default and you should be fine.

    Do the signs work if you don't edit the yml whatsoever? Are you using the official and updated physicalshop jar file? Are you using an official distribution of JAVA / bukkit?
     
  23. Offline

    Excalibur42


    I use an online text editor that my server hosters provide with an online mcpanel (not ftp). It works absolutely fine with every other plugin config.



    EDIT: After using the config you provided in your reply, everything worked fine, no errors!

    THANK YOU SO MUCH!

    Signs work fine without editing the yml and everything is updated.
     
  24. Offline

    Wolvereness Bukkit Team Member

    Contacting original maker of PhysicalShop about migrating to bukkitdev. In the meantime, I'll be changing the config system for PhysicalShop to utilize the new Yaml API (in addition to an interesting fix for language yml packaged in jar file used as default instead of English).
     
  25. Offline

    keicaM

  26. nice plugin. nice plugin.
     
  27. Offline

    Griffsbrown

    Nice plugin. I will be using it on my server.
     
  28. Offline

    Matackable

    Having a problem with this plugin. The plugin isn't protecting the chests from unauthorized access. I see that the protect chests config is true, and no one is an OP but I. I also use lockette as a plugin. What am I doing wrong?
     
  29. Offline

    Wolvereness Bukkit Team Member

    Are you sure that protect-chest-access is true and the signs are valid?
     
  30. Offline

    Matackable

    Yes. The signs all work upon placement, and people can buy/sell to them. However they don't stay protected from unauthorized access. Protect-Chest-Access is also set to true.
     

Share This Page