Inactive [MECH/FUN] ItemDetector v1.2 - An Item-detecting gate [1000]

Discussion in 'Inactive/Unsupported Plugins' started by Streammz, Apr 25, 2011.

  1. ItemDetector - Gates which detect items
    Version: v1.2

    With this plugin, you can make item detecting gates, just like at the airports.
    It uses redstone, so combined with other plugins you can make traps, falls etc.
    On the end of this post there is an detailed instruction on how to create them.
    This uses NO commands.

    Features:
    • Creating gates which can be used to detect items
    • Redstone support by changing torches into redstone torches.
    • Detect multiple items (good for an pvp-zone to detect swords/bows etc)
    • Block people from entering with specific items
    • Minecart support
    • Clearing inventory's
    • Permission support
    • Message / kit support
    Download:

    V1.1 - Download
    V1.2 - Download
    Addon kit - Download
    ItemDetector is open source! (NO RE-RELEASES WITHOUT PERMISSION)

    Known bugs:
    If itemdetector is loaded before multiworlds, it will get a nullpointer and lose all data, to fix this rename the multiworld plugin to "aaaMultiWorld" and bukkit will load this plugin as first of all your plugin, this should also fix all other problems with other plugins
    Thanks to @Maxis010 for that

    How to create a gate:
    [torch][wood][torch] What you see to the left of here, is the framework of an gate
    [mossy][mossy] [mossy] The wood block left, is an sign with on the first line [detector],
    [mossy] -- [mossy] and on the second/third/fourth line should be the itemID's
    [mossy] -- [mossy] seperated by comma's.
    The script sees these lines as 1 line, so you should think its 1 line of 45 letters.

    How the #block (and future similair options) work:
    When you enter item id's on the 2nd/3th/4th line, it'll take those 3 lines and make it 1.
    If you enter the #block, the script will ignore that and make the gate blocking stuff.
    Here an quick example of what i mean (first is input, second is what script reads):
    Code:
    What you write on sign --- What script reads for item ID's
    
    #block1,2,3,4,5,6,7     -   1,2,3,4,5,6,7
    1,2,3#block,4,5,6,7     -   1,2,3,4,5,6,7
    1,2,3,4,5,6,7#block     -   1,2,3,4,5,6,7
    
    List of current #options (open)

    @all - Makes the detector detect all blocks in mc
    @None - Makes the detector detect empty inventory's
    @hold - Makes the detector only detect your item in-hand
    @always - Makes the detector detect nothing, but instead always goes on whenever a player passes
    @limit - limits the blocks to these (you can't have any others then this)

    #block - blocks the entrace when activated
    #remove - removes the block from your inventory (Thinking about creating this to be OP-only)
    #pit - Creates a 3x3 pit for pitfall's
    #damage - Damages a player with 1 hearth
    #launch - Speeds up the player by 10x
    #kill - Kills the player
    #fire - Puts the player on fire
    #heal - Heals the player and puts out fire
    #repair - Repairs any tools which the gate detects
    #thunder - Makes thunder in the gate

    instead of using itemID's like in 1,2,3,4 (example), you can also use this:
    1-4 - Loads the ID 1-4
    kit:kitname - Loads the ID's provided in kitname.kit in the itemdetector directory

    To make the gate send a message, use the same method as kit, but use this instead:
    msg:filename - Sends a message provided in filename.message file in the itemdetector folder.




    Permission nodes (open)

    itemdetector.create.block
    itemdetector.create.remove
    itemdetector.create.pit
    itemdetector.create.damage
    itemdetector.create.launch
    itemdetector.create.fire
    itemdetector.create.kill
    itemdetector.create.heal
    itemdetector.create.repair
    itemdetector.create.thunder


    Video of it in action + how-to


    Changelog:

    Show Spoiler

    Version 1.2:
    • Fixed new blocks with the gates from 1.7 (pistons, shears etc) and 1.6 (trapdoors etc)
    • Tweaked pitfall to stay 0.5 seconds longer (laggy servers can be bitchy)
    Version 1.1:
    • Fixed blocks changing (wood slab -> stone slab, red wool -> white wool, etc)
    • Fixed msg:filename when the gate rotation was wrong
    • Fixed launch from acting wierd sometimes
    Version 1.0:
    • Fixed permission bugs
    • Added support for 1-10 as itemID on the sign
    • Added support for personal kits (kit:filename) (look at the #options spoiler)
    • Added support for messages being send (msg:filename) (look at the #options spoiler)
    • Added support for configurable messages (not neceserry, but being able to)
    • made #block & #launch support minecarts
    • Fixed the anticheat perfectly now (no ignore node though anymore)
    Version 0.91:
    • Fixed #remove@always
    Version 0.9:

    • Tweaked anticheat
    • changed #limit into @limit (doesn't affect existing signs)
    • added @hold to just check the item in the hand
    • added @None to check for an empty inventory
    • added @always to make the gate always go on whenever a player passes
    • added #thunder to strike a thunder in the gate (itemdetector.create.thunder)
    • fixed the destroying of gates
    Version 0.81:

    • Fixed permissions
    Version 0.8:

    • Added an anticheat function, so you can't throw items through the gate, open chests or place blocks trough it. (itemdetector.ignore.anticheat)
    • #repair (itemdetector.create.repair)
    • #heal (itemdetector.create.heal)
    • New permission nodes (so you can do itemdetector.create.* now
    Version 0.7:

    • Permissions support (if not found permissions, will default to OP's instead)
    • added #kill
    • added #fire
    Version 0.61:

    • Changed the #launch so it works.
    Version 0.6:


    • Added @all to indicate that you want to detect all blocks in minecraft
    • added #damage to give 1 hearth damage to the enterer
    • added a test version of #launch, to speed movenement by 10x for a short period (note this is glitchy atm, i'm working on a fix, but some people may like it now)
    Version 0.5:


    • Added #pit
    • Minecart support for any #option that isn't #block
    Version 0.42:


    • Fixed something really stupid of me (it didn't cancle the create if it failed)
    Version 0.41:


    • Fixed incompatiable #options
    • Sign given back now, if creating fails
    Version 0.4:


    • Added #limit + #remove, see post for description
    • Made support for armour contents
    Version 0.3:


    • Added #block to prevent players entering the gate
    • If a broken data file is found, it'll now try to fix as much as possible and load them.
    Version 0.2:


    • Fixed the redstone torch to stay for minimal 1 second.
    • Probably fixed a lot of similar bugs.
    Version 0.1:


    • Initial release
     
  2. The gate doesn't support other torches then the regular torch (ID 50).
    Can you maybe send me a screenshot of how your gate looks like?
     
  3. Offline

    blacknedvertigo

    you can make a video how to do the trap with controller block and detector?
     
  4. I've made an option to make a pitfall build-in:
    Code:
    [detector]
    1,2,3,4#pit
    
    replace 1,2,3,4 with the itemID's you want to detect
     
  5. Offline

    valdark

    I love this concept. I will be using it as an alternative to multiworld inventories by placing gates before portals and making them all out of bedrock.
     
  6. Offline

    seajay1221

    #remove@all isn't doing anything for me in 0.9.1. The torches turn to redstone, but nothing is removed. Do I need to configure anything in permissions to make this work?
     
  7. Offline

    Maxis010

    Same, not sure about seajay1221 but I know I have - -itemdetector.ignore.* and I know it's working as I'm affected by #block
     
  8. Offline

    Deminetix

    Could i please have a link to your source code for this plugin? I am trying to incorporate checking for an empty inventory into the plugin i am creating
     
  9. Offline

    blacknedvertigo

    Sh*t this is the best pluggin for minecraft.
    Tanks!
     
  10. Code:
    Player player = //your player variable
    boolean isEmpty = true;
    for (ItemStack s : player.getInventory().getContents()) {
        if (s == null) { continue; }
        if (s.getAmount() >= 1) { isEmpty = false; break; }
    }
    if (!isEmpty) {
    ///rest of the script
    }
    
    if you still want the source code, i'll upload it if you want
     
  11. Offline

    Acromantula1

    is it possible to, instead of listing each item individually activate the gate for items between 2 numbers. IE
    [detector]
    267,268,272,276,283,298-317#pit
    so this would activate on all swords and armor.
     
  12. @Acromantula1
    Thats actually an good idea :)
    i'll add that in 1.0



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

    Maxis010

    Can you also add kit support
    as in entering k:armor will detect all items specified in the kit defined in filename.ext
    left the name and ext to you, that or you could make it a alterable file, would be good for people like me that use other kit based plugins like supplySign...that said formatting will be a problem if you went that way
    Work in support for different kit formats?


    The above post appears to have been made in a train of thought style, if it's unreadable I'll rewrite it
     
  14. Offline

    airsoftinva

    #remove doesn't work at all for me...
     
  15. Offline

    deathhorn

    you have to add the - -itemdetector.ignore.* permission to your permissions =D
     
  16. Offline

    Maxis010

    I can't speak for everyone else but I know I have, remove doesn't work
    It's not a permissions problem as the permissions file loads fine and #block works at the least
     
  17. Offline

    Maxis010

    I'll send you my server details

    EDIT: Sent, as I said in the message you can use the admin world as a testing ground
     
  18. Me and Maxis010 have tried to fix the bug with the ignore stuff for an hour, and it seems permission doesn't support wildcards in their "remove" tag: '-itemdetector.ignore.*'
    a workaround will be made for 1.0, for now, use inviduals.
     
  19. Offline

    Maxis010

    For those 2 lazy to write that out it's
    Code:
                - -itemdetector.ignore.remove
                - -itemdetector.ignore.kill
                - -itemdetector.ignore.fire
                - -itemdetector.ignore.damage
                - -itemdetector.ignore.anticheat
    And it's not just ItemDetector, it's ALL permissions, so if you have any wildcard permission removal rewrite it ASAP
    I've put a post in the permissions thread, I'll pass on the reply(s)
     
  20. Offline

    zajrik

    Would love to be able to edit the message output. I'm currently really only using this plugin to remove snowballs upon entering my base because I get tired of them cluttering my inventory, and I'd like to edit it to something related to melting when using #remove332.

    Edit: For the sake of impatience, i've edited the playerlistener class myself to have it display "The warmth of the building melts all your snowballs." Not a problem, since I only use the #remove for snowballs, but it'd be awesome to be able to have customized messages based on the item removed, with a default for non-specified messages if there are none assigned to any specific item id.

    I'm fairly unsatisfied with colonizing a tundra biome. It never snowed in 1.4. I had no idea it was tundra. Hate snow. it rained once when 1.5 was released, and has only ever snowed since. :/ Speaking of which, if anyone knows some way to edit the classification of my biome so I can be rid of this snow, let me know. I hate clearing it every day.
     
  21. Offline

    neoconker

    No worries figured it out my sign was pointing the wrong way apparantly, may wanna check up on that =/
     
  22. Message support done for 1.0 ;)

    Any last-minute suggestions that isn't on the TODO(first post) already?
    if your lucky you have it added :cool:

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

    jamescosten

    Will be using this on my PVP server, very nice

    Found a bug, when i set it to thunder, my gate was wooden (i know stupid) it burnt the gat down and the sign but the thunder remained, so when i walked over where the gate used to be it hit me again.

    I sorted it by deleting the data file, but surely if sign is destroyed it should destroy the command aswell.

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

    Maxis010

    This is a known bug, gates destroyed by any method other than player interaction remain in the plugin memory
    I once world edited a gate out of existence, imagine how my users felt when they suffered from spontaneous human combustion around that spot

    ...and I just thought of a fix, whenever a gate is triggered have the plugin check that the gate is still intact before the permission check
     
  25. Offline

    Snowy007

    eum... an option to make the detector go of if the player doesn't have an item.
    i made a gate so the player can only go further after getting a certain item (a rose)
    right now the only way i can think of doing this is by using 38@hold@limit
    But then, the player would be forced to put the rose in his hand. and i would like them to just keep it in their inventory without having to select it.
     
  26. will do
     
  27. Offline

    zajrik

    I do, actually. Thought of this one last night. It'd be really awesome if you could integrate some sort of cooldown timer function. Like throw #cd at the end of the sign and everything on that specific detector can't be triggered by the same person again for say, five actual hours? I have a shrine I built off on an island that heals/repairs, but it's not something I want used all the time by my users. It'd be nice to have a way to limit how often that is able to be used.
     
  28. I'm sorry, but that requires a lot of changes in the code and data files, which would take a lot of time to script too.
    Maybe in a later version.
    However, It'll be easyer if they don't get saved into the data, but then the countdown will be reset after each restart/reload.
     
  29. Offline

    zajrik

    I like to think I'm a patient person. I can wait. Just an idea.
    Would be fine with it being reset after each restart. That's how I had figured it would need to be handled anyway.
     
  30. Offline

    jamescosten

    can u make it so that u go through all items removed, bu on way back in it give them back??
     

Share This Page