[MECH] BlockDoor v005 - Doors out of Blocks - [released]

Discussion in 'WIP and Development Status' started by Arcwolf, Mar 28, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Piercing Goblin

    That sounds great! Do you think the source from ho0ber will also fix the selection glitch in your previous post?
     
  2. Offline

    Arcwolf

    Duno, I havent seen the source yet...

    In other news I just uploaded a redstone detection version... I know I said I would not do another feature update until the new source... but it was soo easy to implement I couldn't help it :D
     
  3. Offline

    Piercing Goblin

    It keeps telling me that I am not right clicking on a redstone torch, even though I am.
     
  4. Offline

    Arcwolf

    Interesting, it should only do that if you arent lol. I tested it thoroughly .. hhmmmm... le'me test it some more then I guess.

    .... well what the heck... it was working a second ago... <sigh> damn it lol

    AHHH, I see... ok ... yea, ok, I know what when wrong. Its a check I put in at the last minute for left clicking... well what I though was left clicking anyway :p I'll have it fixed in a few minutes... sorry about that. <facepalm>

    ok, stupid mistake should be eradicated. Try redownloading it... sorry about that.

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

    Piercing Goblin

    Not to be picky, but just as an idea, could you make a trigger that would be active when something would be sending redstone or is active with redstone. For example, if a certain part of wire was on, or if a button was sending redstone. That would allow for a door to be activated only for the period that a button would be sending a signal, or a floorpad, without the need to have it attatched to a redstone torch (which is what we need to to now). Still, amazing job with the redstone integration!
     
  6. Offline

    Arcwolf

    Well, I can listen for the redstone output of an item like a lever, button or torch... or I believe the redstone power of an object. But its a little but more tricky then just watching redstone torch I believe... Anyway, I'll think about it for now and see how things work out. It might be easy... or it might be hard. <shrugs>
     
  7. Offline

    Piercing Goblin

    Thanks, it's probably worth a shot :p
     
  8. Offline

    Arcwolf

    Ok, removed the checks for redstone torches and allowed pretty much anything right now to be selected as a redstone current output. Its sort of hacky but the plugin is still hanging around alpha / beta so its ok for now. Redstone torches, redstone wire, levers, buttons and pressure plates are ok. For now you could click on a non redstone output block but that wont actually be used for detection yet. It will once I figure out how to test for redstone current per block. But not now :-/ Basically if you select something other then a redstone outputing block the door that its linked to wont trigger. Even if you power the block. It has to be a Redstone torch, lever, button, redstone wire or pressureplate.
     
  9. Offline

    Piercing Goblin

    <3
    I think you're my favorite plugin maker ever :).

    DOUBLEPOST!
    Any way you could remove block restrictions, like I can't use 91 (jack o' lantern) as a door? You could possibly just have a different download with block restrictions removed.

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

    dupsmckracken

    First off, this is one of the best mods out there. Do you know if it'd be possible to have a trigger work for multiple doors? Would it be too hard to code to allow a trigger to link to multiple doors?
     
  11. Offline

    Arcwolf

    Not sure I like the idea of multiple versions to support. What blocks would you like to see added. I'm pretty sure most legitimate ones are already in there. 91 is one of the only exclusions and I cant remember why I left it out... maybe just an accident.

    Triggers already work for multiple doors. They dont for you? Simply use the /dlink command to link a trigger to another door. One trigger should be able to link to nearly an infinite number of doors.

    ----


    The next version 34b I think, I'm limiting the redstone triggers to
    ID's 55, 64, 70, 71, 72, 75, 76, 77, 93, 94

    I cant get the indirectly powered redstone blocks to work right. They dont trigger events so I have to monitor every single redstone trigger every few ms and see if its state changed. I'm already doing this for player lists and zones. I'm thinking its going to start getting ridiculous in the overhead department.

    Anyway, before I go and release something new. Input on those objects. Is there anything else in 1.4_1 that outputs redstone current? Besides jackolanters... Something weird going on with them...
     
  12. Offline

    Piercing Goblin

    I would like to be able to use pumkins / jack o' lanterns as doors, and possibly use redstone torches as a door, so you could have a zone or trigger activate a redstone circuit.
     
  13. Offline

    Arcwolf

    pumpkins and jack o's are already fixed. The redstone torch as a door... uh... :confused: hadnt though of that... ... so um, I'm not even sure what would happen if you used a torch as a door. I'm assuming it would just pop off and turn into an item. Have you tried that yet? Seen what happens if you use a redstone torch?

    Maybe the torch thing can be for a later version where I move the hard coded list into a config file... ? unless redstone torch doors just work... I'll have to test that out and see what happens.
     
  14. Offline

    dupsmckracken

    TBH, I myself didn't attempt multiple doors per trigger; one of my friends that uses the server did. I don't doubt hat he wasn't doing it right since it took him like an hour to figure out how to do a basic door trigger setup. I'll try it right now, though.
    Keep up the good work!
     
  15. Offline

    Piercing Goblin

    I took the liberty to make a video 'splaining what I think this plugin should do. I kind of replicated a door with WorldEdit, because I'm assuming setting a zone in WorldEdit is basically the same as your doors.

     
  16. Offline

    Arcwolf

    hmm... interesting. I can enable it. If you find that it works then I'll leave it I guess. I honestly dont use redstone... for anything really so I've never really thought about that sort of ... novel? idea :) lol

    But if its something thats wanted then who am I to deny ? So, I'll put that into the next version. I do hope to eventually add in a config file for items and others stuff. Just not right now. I'm really wanting to see the new source from ho0bers last unreleased version. There are bound to be some really hard core changes in there and I'm not looking to make a bunch of extra work for my self combining an' mixin' more features. All while bug fixing for stuff I just added.

    I'll put the 34b version up in a few hours it will have the limitations imposed for indirect powered blocks and it will allow pumpkins, jackolanters and redstone torches for doors.

    I'm still not to sure about the torch thing though. I know that torches have directional offset data and minecraft likes to play with objects like that when they are placed wrongly. I sure I've seen wrongly placed torches "snap" to a wall if its next to it for too long in previous versions. So, if you start seeing issues with it. Let me know so I can either remove the feature or put a disclaimer or something.
     
  17. Offline

    Piercing Goblin

    Thanks a bunch! I think a disclaimer talking about torches would be better, just make mention that its buggy, considering its not being placed on a wall, but the feature (in my opinion) should still exist. Thanks a ton!
     
  18. Offline

    Arcwolf

    v0.0034b
    Due to popular request, redstone torches are now an acceptable type for doors. It may be buggy and it most likely is. No fix for it. Use at your own risk. Also, now Pumpkins and Jackolanterns are acceptable for doors. I am also restricting the redstone triggers to all redstone output blocks. Those include, Redstone, Redstone torches, Both types of doors, both types of pressure plates, the stone switch, the lever, and the redstone repeaters. Also, I believe I've managed to fix the long standing zone shift. Now once a zone is placed that area is monitored EXACTLY where it was placed. No more is it off by 1 block. That still needs some testing to be certian but initial tests show I am correct and that issue is annihilated. Old zones will still be off by 1block but new zones should be correct. Also as a side effect of this 1x1x zones now work.

    Can I get a HELL YEA! :)

    Test it out. Especially the zone thingy. I tested it in all sorts of coordinates -x -z +x +z ect

    For the curious, the zone detection went from ho0bers code:
    Code:
    public boolean isInZone(int x, int y, int z)
        {
            return (     t_start_x <= x && x <= t_end_x
                    &&    t_start_y <= y && y <= t_end_y
                    &&    t_start_z <= z && z <= t_end_z );
        }
    to My coded fix + some other stuff in another area too not shown here:
    Code:
    public boolean isInZone(double x, double y, double z)
        {
            if(x<0 && z<0){
                return (     t_start_x <= x+1 && x <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z+1 && z <= t_end_z );
            }
            else if (x>0 && z>0)
            {
                return (     t_start_x <= x && x-1 <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z && z-1 <= t_end_z );
            }
            else if (x<0 && z>0)
            {
                return (     t_start_x <= x+1 && x <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z && z-1 <= t_end_z );
            }
            else if (x>0 && z<0)
            {
                return (     t_start_x <= x && x-1 <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z+1 && z <= t_end_z );
            }
            else if (x==0 && z<0)
            {
                return (     t_start_x <= x && x-1 <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z+1 && z <= t_end_z );
            }
            else if (x<0 && z==0)
            {
                return (     t_start_x <= x+1 && x <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z && z-1 <= t_end_z );
            }
            else if (x==0 && z>0)
            {
                return (     t_start_x <= x && x-1 <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z && z-1 <= t_end_z );
            }
            else if (x>0 && z==0)
            {
                return (     t_start_x <= x && x-1 <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z && z-1 <= t_end_z );
            }
            else
            {
                return (     t_start_x <= x && x-1 <= t_end_x
                        &&    t_start_y <= y && y <= t_end_y
                        &&    t_start_z <= z && z-1 <= t_end_z );
            }
        }
    >_< hurts my head! ... sleep now... zzzZZZ
     
    Piercing Goblin likes this.
  19. Offline

    Arcwolf

    34c is uploaded. Bug fixes and stuff... cant believe I missed some of those before... even more so no one noticed :confused:

    anyway, change log has some details. Its a recommended update.
     
  20. Offline

    Piercing Goblin

    Great update! The redstone torches are working wonderfully and my pumpkin lights look shweet!
     
  21. Offline

    Arcwolf

    Ok, I've uploaded v0.0035. I've been testing it with Bukkit 709 and it seems to work ok now. The changes are listed below.

    • Incorporated 1.5 blocks like web and the new minecart tracks. Web can be used for doors, minecart track detector and powered can be used for redstone triggers.

    • I moved over to BufferedWriter instead of FileWriter. Hope that fixes an issue I've seen happen twice now where a object is not writen out to the blockdoor database on disk but is instead only in memory. I dont know why its happening but maybe this will help fix it.

    • Fixed it so that only one command can be entered at a time. A command needs to be completed before you can attempt another command. It keeps a player from breaking commands that should be completed before another command is initiated.

    • Moved the internal check for blockdoor objects being found or not into player only variable. Did this in hopes of mitigating issues with the player entering a command at the same time as a internal search trying to find a object. Thereby returning a wrong value for either the player or the server. This needs to be tested some more to make sure more bugs were not caused by this move. (watch for blockdoor objects not being created or errors saying blockdoor objects cant be found when they do indeed exist)

    • Implemented the /dinfo command & /dinfo <cancel>
      dinfo allows users to click on blocks or walk around and if a BlockDoor object is detect it will display the information about that object in the chat window. It will output the creator, the objects name, its X,Y,Z coordinates and its world. Zones and doors will list the start and end coordinates of the door as well. The command will remain active until it is canceled with /dinfo cancel or /dinfo c

    • Fixed /dlink so that you cant use an unaccepted type for the toggle / open / close argument.

    • Fixed /dlink so that if you enter an invalid trigger type it displays usage info not "you dont have permission"

    • Separated /dlink usage info into two lines. Its was being displayed truncated in the chat window and placed in the next line below incorrectly.

    On my TODO list are the following things I'm going to try and have a look at for next update. (no ETA on the update)

    it may be possable to create a link to a door if a player teleports to a new world while the link command is active. Dont know how to fix that or what would happen if it was abused in that way. <-Maybe use the onteleport to cancel the command.

    triggers, zones and doors can overlap. I am conflicted on how to handle these cases. Should they be allowed to overlap or should they be prevented? I can see where a trigger could be linked to a door and the same trigger object is also a redstone trigger. Doors seem less useful as an overlap. Zones can be useful as an overlap maybe. Unfortunately, this breaks how the dinfo command works. An overlapped object will not be displayed properly. I am at a loss on how to fix that. because overlaps can occur infinity, pages and pages could be generated because of this. And with no real way to scroll though the pages or page through the pages. I see no way to display the overlaps. <sigh> what to do... The easiest for me would be to block ALL overlaps. I have more then enough already programmed to implement such a block. I have nothing to resolve an overlap should I continue to let it occur though. It can potentially cause bugs that are unresolvable....

    The final solution I have come up with is the let the user decide via a config file. I was already going to make a config file. I now have a few more things to add to it.

    solution to overlap:
    bdconfig.txt

    #Max sizes in X:Y:Z format
    #
    maxzonesize:20:20:20
    maxdoorsize:10:10:10
    #
    #advanced users
    #
    allowoverlapzones:false
    allowoverlapdoors:false
    allowoverlaptriggers:false
    allowoverlapredstone:false

    I think thats all for now... As always let me know if you find a bug... :)
     
  22. Offline

    Squall

    Sweet thanks! Im testing it now!
     
  23. Offline

    gsm051115

    It would be nice if you can make it so only admins can use door triggers
     
  24. Offline

    Arcwolf

    I'll try and incorporate that for the next version.

    Uploaded v0.0036
    Here is a brief summery of the changes raw from my notes.

    fixed NPE if clicking the sky while a command is selected
    prevented players from using dinfo if another command is already active.
    added fire as a valid door type
    added in max sizes for doors and zones as a configurable option in the new config file. -1 disables the check all together.
    added in checks for overlapping zones, doors, and triggers. A simple true false check in the config file. True allows overlaps, false doesnt.
    Redid the zone detection method again. Now it works without the work around... stupid casting error... I blame it on vestigial code from the hey0 port
    finally found the REAL cause instead of just working around it. Of course the real fix ends up shifting old zones over one block. On the up side, I do believe this is the last time I will need to mess with zone detection :p
    Per request, added in permissions for toggling of triggers via right and left clicking. blockdoor.usetriggers to enable permissions. As a side effect you must have "usetriggers" permission to be able to use any command that requires clicking. Without permissions clicks registered in blockdoor will be silently ignored. Redstone triggers cant be blocked with permissions. No way to know if a player initiated the redstone event.
    Zones that detect players can now also be set up with permissions. Use blockdoor.usezones to prevent an unauthorized player from triggering zones.
    Doors current state is now correctly saved to disk every time a door is toggled open or close.
    BlockDoor now re-saves database when a server shutdown is started or the plugin is disabled. Just in case the memory wasnt flushed to disk before. Good practice I guess...

    --------------
    The permissions for zones and triggers being... triggered is

    blockdoor.usetriggers
    blockdoor.usezones

    NOTE: You have to have the above permissions or you wont even be able to create a blockdoor object.
    The config file uses default values of
    Max zone size 20
    and Max door size 10
    So a door of 10 would allow doors no bigger then 10x 10x 10x blocks
    -1 in either of those config options disables it.

    I would recommend not allowing things to overlap. You can of course per your prerogative but I believe there will be unresolvable quirks that will occur because of it. So I dont support overlaps and bugs that may appear because of an overlap wont be dealt with. Its just an option if you have some need to overlap something.

    Next version I'm hoping to get a user editable database of acceptable block types instead of hard coding it. That should be fun right :)

    Post bugs and stuff. Enjoy!

    ---

    bummer, blockdoor.usezones doesnt work right... have to take a look and see if I can resolve it. Until I fix it dont rely on it actually preventing players from using zones. It most likely wont work right <sigh> or at all :p
    ---
    ok more testing shows that player zones work ok, its just Living Entity Zones that dont work right with the new permissions. It mostly just ignores permissions all together if more then one player is on the server. So totally useless for permissions on EZONE types. mmmhhmmmm now isnt this somthin to puzzle about for a little bit...

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

    Arcwolf

    v0.0036a uploaded.
    fixed permissions for EZONE's should work correctly now.

    Two new versions in one day... hmm, guess I'm on a roll or something.

    Anyway, v0.0037 uploaded.

    If a door is deleted its associated links are also deleted from triggers and zones.
    Commands are canceled when a player teleports.
    Triggers that are broke by the player are deleted from the database.
    Permissions are associated with breaking triggers. If a player doesnt have permissions for that action, the event is canceled.
    Permission node is blockdoor.breaktriggers
    Admin Permission node is blockdoor.breaktriggers.admin
    fixed a bug causing config max_doorsize=-1 not to work for doors.

    ------

    The breaking of triggers using just the blockdoor.breaktriggers only allows players that own the trigger to break that trigger. Same for redstone triggers. This doesnt stop other things from breaking the trigger. It only stops players from breaking a trigger object and having it deleted from the database. If you want to protect a trigger object from being removed from the game by a non-player event you need something like worldguard or some other protection. If an event occurs that removes a trigger other then the player the trigger is not deleted from the database.

    blockdoor.breaktriggers.admin allows an admin to break triggers and have them removed from the database even if they do not own that trigger. Same caveat applies as mentioned above other non-player events can still remove the trigger object but will not effect the database.

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

    Nigel

    you are my hero, block doors was my favorite mod in the hmod days and i ve been waiting ever since bukkit came out for it to be remade. i also like that your taking it further. people kept saying move to craftbook work world edit or somthing but there like a whole different language, block doors is easy and effective, i love it!!
    thanks again.
     
  27. Offline

    Arcwolf

    V0.0038
    Items database file added for server admin to customize. Things to note, Its good practice to list an objects primary type if you are going to allow and list its subtypes. Not required but a good idea. Its also a good Idea to make sure any new additions are placed in their numerical order in the list. Also, keep the items formated the same way as shown in the generated database. If you start changing things around, you may encounter quirks that are not taken into account. Lastly, if there is some kind of unrecoverable error in the database BlockDoor will revert over to its internal database as a failsafe measure. A warning will be displayed in the server log usually with a line number of where the error is in the database. So you can easily correct it.

    I tested out the database pretty well but I can only think of so many possibilities to break it so I may have missed something. Test it out and see if it works ok for you. Let me know if something strange happens and I'll see about fixing it.

    ---
    For version 39 I'm thinking about adding some kind of private per user zone and trigger. A trigger or zone that only that user can toggle... of course admins can dodge that limitation but regular users cant. something like /dmytrig or /dmyzone? duno, have to think about it and see. Maybe monday I'll have something for everyone to play with.

    If hoober hasnt sent me an email with that new source code by then I might just go ahead and submit this. I am running out of ideas to stall with :p lol
     
  28. Offline

    Piercing Goblin

    Sounds cool, and thanks for updating!
     
  29. Offline

    dupsmckracken

    Did you remove/(the update remove) the ability of pressure plates to toggle via walking over them? the last build before 1.4 allowed pressure plate to toggle. Now i have to actually click them to toggle doors. I guess I could use zones...
     
  30. Offline

    Arcwolf

    Nope, nothing was changed with stone pressure plates or wood pressure plates. They are valid triggers for both REDTRIG and TRIGGER. However, ONLY REDTRIG will allow for them to toggle when walking over them. Regular triggers will need to be clicked. Thats pretty much how its always worked. Please make sure the pressure plate you are trying to get to toggle by walking over it, is actually a REDTRIG and NOT a TRIGGER.

    I just tested out the redtrig and trigger for pressure plates to confirm this and it is working as it should.

    I capitalized for ease of reading. Not shouting or being rude. I know it can get confusing with all the commands that are now available. I even went on a rather long bug hunt the other day only to find out I was actually typing in the wrong command from memory... <facepalm> :rolleyes:

    Anyway, try that out and let me know if you are still having a problem and I'll see if I can help further. :)
     
Thread Status:
Not open for further replies.

Share This Page