[suggestion] Beacon in a box

Discussion in 'Community Discussion' started by just_five_fun, Oct 30, 2015.

  1. The greif thread got me thinking and I have never suggested this but have been thinking it would be a good idea for a while. I think it would be possible to code a beacon that will go in or sit on a locked chest with the iron blocks inside or craft a beacon with the required blocks included into a single item which could then be locked.

    I doubt anybody thinks it's a bad idea, but maybe this could be extended to other kinds of protection ideas such as locked signs with a radius of protection or purchasable blocks that can only be broken by their owner (to buy with tokens) ?? Maybe a beacon with mining fatigue so that greifers could only work incredibly slowly.

    You never know when a simple suggestion could spark a really great idea, so I figured I'd offer this up for consideration.
  2. I could probably even recreate this in Vanilla MC, but it would be complicated. With use of plugins (or creation of them), however, it would be a great deal easier. +1
  3. I like the radius protection thing bu they might as well just release land claiming rather than spending time on that
    BlinkyBinky and WayneKramer like this.
  4. This is something I'd ask Mojang about.
    ww2fan168 and HelloKittyRo like this.
  5. well I like the idea... not sure if aikar could program, but I would love the idea.
  6. Fixed for you
    BlinkyBinky likes this.
  7. Yeah, the pyramid is the vulnerable part. Could be some good ideas around how to eliminate that.

    Can the code be modified to allow activation of a beacon without a pyramid? If so then we just have to decide what is a fair trade in return for this special behavior. (Increased cost?)
    just_five_fun likes this.
  8. meh
    ThaKloned likes this.
  9. EMC would be nothing if it just waited around for Mojang.
    Tigerstar and BDInc like this.
  10. I like anything that will protect my stuff. Whether it be a sapling or a beacon, our items should stay ours.
  11. Aikar has made it clear that the Empires will feature something akin to the protection to breakage from only those in the Empire. The beacon mechanics you suggest though are complex so that's why I mentioned Mojang.
  12. Yes, I understood your answer.
  13. wild protection should take care of that, sadly theres no ETA on when it will be rolled out. We don't even get progress reports.
  14. You can lock a beacon then you put lock chest under it and on top of the iron blocks
  15. The easiest, would instead of looking for a radius every time someone tries breaking something, instead look for lore

    I wrote something awhile back on how to make custom ItemStacks:

    It could be similar to my anti-item-merge system: https://gist.github.com/cFerg/12cc3daa066ae17cac9c

    ...but instead of doing item drop and item pickup ...

    Have the custom lore be added to the blocks within a radius when you place a locked sign or update a sign ... it will see the names on the sign and add it to the custom lore...

    When someone tries to break a block, it will check if the block has metadata ...if it does check for lore ... if the lore has a names in it, and it's not your name, prevent it from letting you break it...

    If your name 'is' on the list, allow it to break - and when the item drops remove the custom lore.


    How would it work with beacons?

    On sign placement, it first checks what you're typing ... if you type on line 1 [locked] or similar, it will proceed

    It will then check if you typed anything on line 2, 3, or 4 ...if you did, it will auto correct spelling, and add those people to a hashmap that can later be added to a database or deleted...

    It will then check what block you placed it on - if the block is an inventory-based item it will proceed, and add the block to the hashmap ...if not it will send the player a message, naturally break the sign, and delete the hashmap

    If it successfully went through, it will check if you have enough money, if not it will send you a message, break the sign, and delete the hashmap...

    *Finally, it will allow you to do radius checks based on the block it was placed on....

    ...If the block is a 'beacon, for example' it will look at it's data and determine the strength of the beacon (ie. 1 tier, 3...) if it's 1 tier ... that means it can protect 9 blocks (a 3x3) under it ... it will get the relative location of the beacon, this will allow you to set new coordinates (X1 = X + 1 | Y1 = Y-1 | Z1 = Z+1 | X2 = X - 1 | Y2 = Y-1 | Z2 = Z-1) ...do a for loop to go through all the blocks within that range of coordinates, you will get the ItemStack of the block, you will get it's metadata, you will get the size of the lore, and add new lore with Lore.add(size + 1, CustomLore) ...

    With the newer block made - you will then replace the block at the set locations (inside the for loop) ...and when the for-loop is done, you will update the region so the changes take place
    fBuilderS, SkareCboi and DrMadFate like this.
  16. A programmer in our midst!

    Since a sign is required, could you see a way to eliminate the block lore? This seems like duplicated storage and maintenance that is dependent on the sign. Instead of replicating the list, maybe some way to reference a single copy?
  17. There could be three other ways with 'just' lore and no signs:

    on block placement set custom lore on the 'beacon, chest, etc' and only that person can access it

    -on top of that, you could have a command, so the person who set the block down, could add or remove people with access, and it would update the lore with more people...


    You could have a chest, and inside the chest could have a book or multiple books with peoples names ... that could be used as a reference


    or* you could solely have everything stored in HashMaps with the keys as the (world and location) and the values as (ie. parent itemstack, children itemstacks, parent owner, individuals with permissions) ...and all of those could be stored in a HashArray in a map ... and that can be stored in a database to be loaded/saved everytime the server restarts

    Adding ownership could be automatically applied on block placement, and can be look up the 'key location' ...if there's a value set at that location it would then do a check system to see if you are allowed to break/interact with the block...

    The parent owner could type a command to add owners, and click the location to apply it to (if it's appliable)

    on block break, it would remove the value and key from the HashMap

    You 'can' do this without signs or lore, however it will be more resource intensive looking up location and hashmaps instead of lore that's already placed.