[plugin]Chest Protection 1.2

    • [plugin]Chest Protection 1.2

      Chest Protection 1.2

      What does it do
      This plugin protects all new chests that are added to the world after this plugin has been installed
      this means other users cannot steel your stuff or smash your chest even if that chest is outside the protected zones
      you can also have the option to unlock the contents that's inside the chests

      The chest commands are

      /cp = help
      /cp lock id pincode= lock the chest contents, note this is the default setting
      /cp unlock id pincode = unlock the contents of the chest, note if your chest is inside a protected zone the contents will still be locked as before
      /cp add playername id pincode = adding players to a locked chest
      /cp delete playername id pincode = to remove a player from your chest
      /cp unprotect id pincode = to unprotect your chest

      Example 1 /cp unlock 12 1234 = chest contents with id 12 is now unlocked, note that the chest is still protected from been removed or smashed,
      Example 2 /cp add yahgiggle 12 1234 = adding yahgiggle to your chest 12 with pincode 1234 note 1234 is the defult pincode for the chest
      Example 3 /cp delete yahgiggle 12 1234 = removing yahgiggle from your chest

      Note: the user name has to be 100% the same as the in game username if yahgiggle is Yahgiggle then yahgiggle wont work

      also the pin code defult is 1234 i plan to let chest owners change this pin
      Only the chest owner can add and remove users

      All Server Admins can still smash any chest

      Please report any bugs, also note this plugin is still at version one more stuff will be added,

      Also there has been a new small server side update that non steam server owners may need to install for this plugin to work
      Dateien


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S

      Dieser Beitrag wurde bereits 10 mal editiert, zuletzt von yahgiggle ()

    • Bump to let you guys know i have updated this script

      you can now keep your chest locked but let some users use it by adding them to your chest

      to add a user type in chat /cp add username id 1234
      to remove a user type in chat /cp delete username id 1234

      my plan is to later use your pin to open the chest but an api update is needed for that.

      the script not only checks pin but also the owner, so this means added users still cannot add other users or anything else


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • hmm that way we can also claim the shack chests :D hahaha

      on a more serious note now, I think on a server that could be very very dangerous. Just imagine the owner uploading in and then someone going around claiming all the chests before the other players had a chance to log in and claim them. :/

      Could you maybe add a small scan in the OnEnable() method to register all existing chests and then cross reference with the area ownership database? and then of course all chests not in areas should be ignored.
      Admin on Artisan's Realm
      Rising World Projects:
      Blueprint Texture Editor
      MailingSystem
      ServerTools
      Portals
    • Minotorious schrieb:

      hmm that way we can also claim the shack chests :D hahaha

      on a more serious note now, I think on a server that could be very very dangerous. Just imagine the owner uploading in and then someone going around claiming all the chests before the other players had a chance to log in and claim them. :/

      Could you maybe add a small scan in the OnEnable() method to register all existing chests and then cross reference with the area ownership database? and then of course all chests not in areas should be ignored.
      Actually, would it not be possible to query the existing "world database" to find the current owner of all chests, add them all as "locked" in the plugin database with the appropriate owners?
    • Jon_miner schrieb:

      Minotorious schrieb:

      hmm that way we can also claim the shack chests :D hahaha

      on a more serious note now, I think on a server that could be very very dangerous. Just imagine the owner uploading in and then someone going around claiming all the chests before the other players had a chance to log in and claim them. :/

      Could you maybe add a small scan in the OnEnable() method to register all existing chests and then cross reference with the area ownership database? and then of course all chests not in areas should be ignored.
      Actually, would it not be possible to query the existing "world database" to find the current owner of all chests, add them all as "locked" in the plugin database with the appropriate owners?
      the world database does not log the user who place the chest so there's no way of knowing who made it this is why I have made the plugin oO


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Ah, ok. Did not know that the world DB did not have the "Owner".

      I would NOT then:

      yahgiggle schrieb:

      add an update that if you open a chest and no one owns it, it becomes yours
      As Minotorious mentioned, I would think unscrupulous players would go around claiming all the old chests they could find...

      I see two options, First what Minotorious said:

      Minotorious schrieb:

      Could you maybe add a small scan in the OnEnable() method to register all existing chests and then cross reference with the area ownership database? and then of course all chests not in areas should be ignored.

      OR...

      Just tell players that they should create new chests for there existing ones and move the contents of their old chest(s) to the new ones.

      As for claiming "shack/dungeon chests", we would be no worse off then the way we are now.
    • When you @yahgiggle say...

      yahgiggle schrieb:

      /cp unlock id = unlock the contents of the chest, note if your chest is inside a protected zone the contents will still be locked as before
      Does this mean that there is no real way to make a "community chest" (unlocked) in a protected area that any player can access with out having to add all players individually? And still have the area/room and the chest itself protected?
    • Hmmm. I just tried doing a "/cp lock ID" for the ID of a chest that already exists in my SP world and got:

      java.lang.ArrayIndexOutofBoundsException: 4

      It appears if players start trying to lock existing chests, the plugin will throw an error. If you are not going to somehow add existing chests to the plugin DB, then you will need to handle the attempts to lock existing chests errors with a "You can not lock existing chests. Create a new chest and move contents..." type of message.


      I just tried "/cp lock ID" for a newly created chest that I had done a "/cp unlock ID" and got the same error.
    • Jon_miner schrieb:

      Hmmm. I just tried doing a "/cp lock ID" for the ID of a chest that already exists in my SP world and got:

      java.lang.ArrayIndexOutofBoundsException: 4

      It appears if players start trying to lock existing chests, the plugin will throw an error. If you are not going to somehow add existing chests to the plugin DB, then you will need to handle the attempts to lock existing chests errors with a "You can not lock existing chests. Create a new chest and move contents..." type of message.


      I just tried "/cp lock ID" for a newly created chest that I had done a "/cp unlock ID" and got the same error.
      thanks for the bug report ill patch them tonight


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Minotorious schrieb:

      random question but what would happen if I placed a chest through a blueprint? will the plugin recognise that I am placing a chest and mark me as owner or not?
      no the plugin only detects the chest as you place it down i use the PlayerPlaceObjectEvent this event is not used when placing blueprints that one use's the PlayerPlaceBlueprintEvent and ATM in this event i cannot see how to get the chest ids, maybe i can talk to red51 about how we can get the chest ids when placing a blueprint, its a good point and something worth looking at and maybe adding to the PlayerPlaceBlueprintEvent.


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Bump to let users know i have once more updated this plugin

      Thank you @Jon_miner for testing and reporting a bug :D

      Also made some changes to the commands for locking and unlocking chests, it has always been my plan for the owner to use a pincode for this sort of option, at the moment the pin is 1234 but i will add an option for the owner to change there pincode

      the new command is much the same but now you add the pincode at the end.

      Like this

      /cp unlock 23 1234 or /cp lock 23 1234

      of cause later if you change your pincode it will be what ever you make it

      Please keep testing guys and reporting back all problems cheers


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Jon_miner schrieb:

      Are you going to change the version from 1.1?

      @yahgiggle
      Would it be possible if you open a chest that you own to have it indicate whether it is currently locked our unlocked along with the ID?
      yes this is going to happen soon
      Also a plan is to show who owns it


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S
    • Jon_miner schrieb:

      I just tried placing a blueprint and it appears that ChestProtection did recognize the chests. I got:

      placed chest IDXXXXXX now added to your Chest Ownership defalt (sp) pincode = 1234

      I'm not sure btw what/how the pin codes are to be used?
      Thats something i did not expect lol well its good it does work when placing blueprints, this saves me more coding lol

      the defult pincode is part of the protection its sets you as been the owner the users you add dont have a pincode so if they try to add other users or to unlock the chest it wont let them, but later on i want to add a pinpad that pops up when you goto open the chest, your then need to enter your pin before it opens, but ATM the API does not support OnChestOpenEvent i have taked to red about this and he said he will add that event on the next update for me :D


      :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:

      If at first your code does not work call it version 0.1 with the odd bug :S