Inactive [MECH] DropChest v0.8.3 - Chests that absorb dropped items [1.1-R3]

Discussion in 'Inactive/Unsupported Plugins' started by narrowtux, Feb 9, 2011.

  1. Offline

    narrowtux

    DropChest - Chests that absorb dropped items
    Version 0.8.2
    [​IMG]
    Important! When migrating from 0.6 to any above version, you have to move the DropChest.txt from server/plugins/DropChest.txt to server/plugins/DropChest/DropChest.txt
    This is because I have to follow the Bukkit plugin saves guidelines.

    This plugin automatically adds dropped items to near chests. That is very useful for automatic farming and monster traps that gather loot.
    Features
    • automatically suck dropped items that are near a chest to that chest
    • customizable warning if the chest is nearly full
    • list your DropChests and watch how much percent is still free
    • Permissions
    • Filter
    • Storage Minecart support
    • Dispenser and Furnace support
    • Item information
    • Chest protection
    • Automatic Owner tracking
    • Double-Chest support
    Download

    DropChest.jar
    GitHub Project (Source Download)
    Download development version

    Donate, if you want to support me ;)

    Video



    Usage
    Commands
    Show commands (open)

    To add a chest to the "watchlist", type
    Code:
    /dropchest add [radius]
    After that, rightclick the chest that you want to add. Radius is the radius in which the Chest should suck items. Default value is 2.

    To remove a chest from the "watchlist", just type
    Code:
    /dropchest remove chestid
    where chestid is the number of the chest that you get when you call /dropchest list

    You can list the chests that are on the watchlist via
    Code:
    /dropchest list
    You can adjust the radius of a chest via
    Code:
    /dropchest setradius chestid radius
    You can check which id and radius the Chest in front of you has:
    Code:
    /dropchest which
    after that, rightclick on the Chest to get information about it.
    If you are sitting in front of the console, or don't want to rightclick, you can use
    Code:
    /dropchest info chest
    It will generate the same output as /dc which.

    You can teleport to a chest via
    Code:
    /dropchest tp chestid
    where chestid is the ID of the dropchest

    You can set the name of a DropChest via
    Code:
    /dropchest setname {chestid} {newname}
    The name is displayed in chest is full warnings, and in the DropChest list!

    If you migrate from 0.6 to 0.7, you can set the owner of a dropchest by typing:
    Code:
    /dropchest setowner {chest} {newowner}
    You can protect a chest by typing
    Code:
    /dropchest protect {chest} {on|off}
    You can always use /dc instead of /dropchest if you are lazy.

    Another very helpful command is /dcitem:
    Code:
    /dcitem [NAME|id]
    
    This can be used to obtain the name of an item by it's id or get an id of the item-name.
    This doesn't work with all names, though.

    Use the new command /chestinfo {name|id} to get info about what's inside the chest.
    Omit the argument and rightclick on any chest to get info about that.
    Example:
    Code:
    >/dcitem 4
    4 is COBBLESTONE
    >/dcitem cobblestone
    COBBLESTONE is 4
    

    Show Configuration (open)

    You can configure DropChest by pasting the contents of the following block to plugins/DropChest/dropchest.cfg
    Code:
    #Should the dropchest drop items when it gets a redstone signal?
    droponredstone=true
    #How long should the dropchest not suck items after it has dropped them
    waitafterdrop=10
    #Should users be able to protect chests like in LWC?
    usercanprotectchest=true
    #Which is the default radius if you omit the radius argument in /dropchest add?
    defaultradius=2
    #Which should be the maximum radius for players that have not dropchest.setBig and aren't ops?
    fallbackradius=15
    #At which fill-status should the chest warn you?
    warnfillstatus=90
    #Which message should appear as warning?
    #You can use this variables (example):
    # $owner : the owner of the chest (narrowtux)
    # $name  : the name of the chest (my superduper mobtower chest/#42)
    # $fill  : The fill status, in percent (81)
    warnmessage=$owner, your chest $name is nearly full($fill%).
    

    Filter / Storage Minecarts
    Show Filter/Storage Minecarts (open)

    Filters have changed in version 0.6. There are now 3 seperate filters that are for sucking items, pulling items from passing minecarts and pushing them to passing minecarts.
    You can now set the filters by either using commands or using the interactive mode. Let me show you the interactive mode first:
    to begin, type
    Code:
    /dropchest filter {suck|push|pull}
    Note: choose one of suck, push or pull, please (for example /dropchest filter suck)
    Then you will enter the interactive mode. In this mode you can edit the selected filter by hitting the chest with the desired item in your hand.
    To edit another filter, type the above command again.
    To finish your filter, type
    Code:
    /dropchest filter finish
    Commands mode:
    Code:
    /dropchest filter {suck|push|pull} {chestid} {itemid|itemtype|clear}
    Call the filter-command like above, as second argument, use the chest-ID, and as third argument, either type the item-ID, the name of the item (as they appear here: org.bukkit.Material) or type clear to clear this filter.
    Please note! The suck filter acts different from the Pull/Push-Filter when it's empty. When the suck-filter is empty, the chest will suck every item. When a Pull/Push filter is empty, it won't take or give any items to a passing minecart.

    Show Permissions nodes (open)

    You can use these nodes:
    • dropchest - To get the right to use DropChest
    • dropchest.create - To call /dropchest add
    • dropchest.remove - To call /dropchest remove chestid
    • dropchest.radius.set - To set the radius of a Chest to something else than 2
    • dropchest.radius.setBig - To have unlimited radius
    • dropchest.which - To have access to the /dropchest which command
    • dropchest.teleport - To be able to teleport via /dropchest tp chestid
    • dropchest.filter - To set or reset filters
    • dropchest.filter.set - To set filters in interactive mode
    • dropchest.filter.reset - To reset filters in interactive mode (click with nothing in hand)
    • dropchest.list - To have access to /dc list and /dc info
    • dropchest.destroy - To be able to break a dropchest without removing it before.
    • dropchest.protect - To be able to protect a chest
    • dropchest.moderator - To be able to modify a dropchests properties even if you're not the owner. Also, ops and the console can do that.
    You can use these variables:

    • dropchestmaxradius - To adjust the maximum radius for a group or a user
    How to use variables:

    Code:
    users:
      narrowtux:
        info:
          dropchestmaxradius: 1000
    
    This is just an example and this also works with groups!

    Changelog
    Version 0.8.2
    • Fixed the loading issue.
    Version 0.8.1
    • Supports SuperPermissions (when no Permissions plugin was found)
    • Fixed show stopping bugs.
    • Use YAML as persistence storage. You can find the new file at plugins/DropChest/dropchests.yml
    Show Changelog (open)

    Version 0.8
    • Performance improvements
    • Fixed a bug that caused dropchest to eat stacks in storage minecarts (thanks @Tenebria )
    • Implemented per-chest delay (thanks @Gibbers )
    • Made /dc list per player. Use /dc list {pagenum} all to see all showcases (works without all in the console)
    Version 0.7.9
    • Fixed bug where items were lost when a chest/minecart was full on pushing/pulling
    • Little code cleanup
    Version 0.7.8
    • Fixed a bug where, for example, if you had several ItemStacks of 1 block each, only 1 ItemStack would be pulled to the chest or pushed to the MineCart, the others would be deleted.
    • Minecarts can now be over/under DropChests to be handled
    Thanks M-Type!
    Version 0.7.7
    • Double Chest support
    Version 0.7.6

    • Fixed some issues when using a Permissions implementation that is not complete (in this case EssentialsGroupManager as reported by @Kartus )
    Version 0.7.5

    • you can add all items to a filter by using the keyword "all" instead of the material-type
    • you can obtain info about a dropchest without having to rightclick (/dc info {chest}). However, the output is the same as when you would have called /dc which
    Version 0.7.4

    • warnfillstatus=-1 now disables the "chest is full"-warning
    Version 0.7.3

    • Fixed a bug that came with a new Bukkit release
    Version 0.7.2

    • /dc which now says something again, thanks to @Liger_XT5.
    Version 0.7.1

    • Removed debug messages :D
    Version 0.7

    • Configuration added
    • DropChests can drop their contents when a redstone input is present
    • Now, only the owner of a dropchest can adjust it's properties
    • The owner of a dropchest can protect the chest. So other players can't open it.
    • Customizable warning message and fill threshold.
    • Warnings will now be displayed to the owner of a chest, if he is online.
    • And made compatible to Minecraft 1.5_01. Older versions of craftbukkit won't work!
    Version 0.6.9

    • /dc which even more fancy
    • Removed debug message reported by @Reterg
    • Implemented the /item command which tells you what item this id is or vice-versa.
    Version 0.6.8

    • /dc which now looks fancy and shows the filtered items, too.
    Version 0.6.7

    • Added dropchest-id to the /dc which output.
    Version 0.6.6

    • Fixed NullPointerException on startup
    Version 0.6.5

    • Fixed /dc which
    • Refactored some code
    • You can now also use names of dropchests in the commands.
    Version 0.6.4

    • Fixed chunk unload that results in crash
    Version 0.6.3

    • Updated to bukkit-version 602
    • Tried to fix Thread-Exceptions. Breaking DropChests still not fixed, maybe happens later this day ;)
    Version 0.6.2

    • Permissions not required anymore.
    • Thread-Safe. No more ConcurrentModificationCheck Exceptions!
    Version 0.6.1

    • Fixed loading issues. You have to move your old DropChest.txt to the folder DropChest/ in your plugin directory!
    Version 0.6

    • Seperate filters for sucking, pushing to minecarts, pulling from minecarts
    • Multiple users can add dropchests at the same time now!
    • Added a name to the DropChests
    • Fixed Minecraft 1.3-Bug (method net.minecraft.server.Entity.q() was not available any more)
    I'm working on extended furnace handling, that fuels automatically go to the fuel slot and so on. This is still buggy so I didn't released it, it comes in the next version.


    Version 0.5.1
    • Multiworld works now
    • Paginated /dc list
    • Persistent DropChest IDs
    Version 0.5

    • Added support for Storage Minecarts
    • Added support for Dispensers and Furnaces
    Version 0.4.2

    • Fixed bug that Tearlow described.
    Version 0.4.1

    • Fixed loading bug when migration from versions 0.3 or below
    Version 0.4

    • Added filters.
    Version 0.3.1

    • Multiple world support
    • Since the Craftbukkit version from feb, 13 at 12:00 CET, Chests that are destroyed by Players are rebuilt
    • Worked around NullPointerException when Permissions is not loaded properly
    • Files now hosted on github ;) that non-members also can download DropChest
    Version 0.3

    • Permissions support.
    • Configure the maximum radius for each single user or group (via Permissions)
    • Fixes bug with unhandled Exception in the EntityWatcher-Timer.
    • /dropchest can be called via /dc for short
    • /dropchest without arguments just lists the commands that the user can execute, as well as his maximum radius.
    • Oh, and I corrected the Pythagoras formula for radius calculation. Shame on me...
    Version 0.2.3


    This is quite a huge bugfix update. Permissions come next ;)
    • Broken DropChests are now automatically removed from the list
    • changed package name from com.bukkit.narrowtux.DropChest to com.narrowtux.DropChest to prevent not loading issues coming up next monday
    • Added command "which", that allows you to see which id a chest has and if it is already a dropchest.
    • Linked against the most recent versions of Bukkit and Craftbukkit. The Bukkit guys have fixed a lot of bugs that affected this plugin. In my tests, there were no more nullPointerExceptions or similar errors. Also, DropChest now also works on very fresh placed Chests
    • And a currently constant maximum radius of 20 blocks
    Version 0.2.2

    • DropChest are now removed when you call /dropchest remove chestid
    • DropChest now have a minimum radius of 2
    • Fixed some saving issues
    Version 0.2.1

    • Fixed a problem where the radius has not been saved
    Version 0.2

    • Added a radius
    Version 0.1

    • First Release of DropChest
     
  2. Offline

    fisherp

    I have a question. Currently the collection point for my mob tower is over 25 blocks from the killing zone of the tower. Do the chests collect drops only when they are dropped, or when they enter the watch zone. Let me explain a little more. My drops are being sent to a single point some way away from where the mobs get killed. Do I need to put these chests near where the mobs get killed, or will they pick up the drops as they move down the conveyor (water channel)

    Edit: Obviously I haven't tried it, my server operator is planning to put this mod on his server when he can.

    Edit2: And can the chests suck drops through walls?
     
  3. Offline

    Vilkacis

    I can attest that it will pick up drops as they move down a water conveyor. It seems to basically run a timer and if something is near the chest when that timer does it's sweep, it will put it in the chest. That timer seems to be pretty frequent. I have a monster spawner set up to drown monsters and then sweep their loot towards a gutter with a chest in it. It will pick them up once they're close enough.

    Not certain about through walls, but I imagine it does. It would be MORE code to check if walls were in the way. Simpler to just check if it's in range.
     
  4. Offline

    narrowtux

    You are right. The Timer runs every second, maybe I'll make that adjustable too. And the chests of course suck items through walls. But it would be a great addition because this would do the plugin more realistic
     
  5. Offline

    Tearlow

    Suggestion, if possible could inventory stack? Items such as Bacon for example. Other then that it still seems like Timer-o breaks at times in 292/302
     
  6. Offline

    BigMoomba

    mh the dropchest dont work for me with 300+ build
     
  7. Offline

    narrowtux

    I'm currently going on with the very current build of both craftbukkit and bukkit. So stay tuned, the bukkit guys have fixed a lot of bugs!
    --- merged: Feb 11, 2011 6:57 PM ---
    I released version 0.2.3
    This also has a maximum radius of 20 which I forgot to mention above
     
  8. Offline

    Kartus

    thx for update. i will look forward to run it on my server with customizable max radius (like 1 variable setting in config: maxradius=20 + permissions next update ;)
     
  9. Offline

    narrowtux

    I currently test a version that should fix the bug with the timer-X exception. You can test it in the download below
     

    Attached Files:

  10. Offline

    fisherp

    I'm not sure what version bukkit is being used, but have a look at this setup. The second chest does not pick up anything.

    [​IMG]

    [​IMG]

    [​IMG]

    The three chests closest are not dropchests yet. I want them to be though. And even when the first chest is full I've noticed that the other chests stop collecting too.
     
  11. Offline

    Tearlow

    Pardon but I only just now checked that one out! Been running 1 chest for nearly 2 hours now and not a problem so far! I will try to give multiple chests a go a little later. I'd still like to see a Permission build + config so we could allow different groups different ranges- Or a simple Force 2-10 range for users and OP's could potentially set Infinite numbers (again, Permission driven).

    Filter would also be absolutely awesome!

    Either way, Really nice work Tux! I really like this :)
     
  12. Offline

    narrowtux

    Thank you, but this version also has a bug, I think. I suppressed the exception well and if there is an exception, the timer continues, but sometimes my algorithm thinks that I broke the Chest and removes the DropChest. I hope you can live with that until I fix it.
     
  13. Offline

    Tearlow

    Don't think I've experienced this yet. The timer is working perfectly now though! But Multiply chests don't work at all right now- They stay active but ignores picking items. Quite happy with it as is (Wish there was a filter though *Chuckles*)
     
  14. Offline

    narrowtux

    @fisherp: which one is the second chest?
    You could also try to restart due to a bug in craftbukkit. Or update Craftbukkit to the latest version, because I think it has been fixed there.
     
  15. Offline

    mpa1212

    Could you make the max radius customizable? (Tho it lets me Dropchest a chest with larger radius's, just not change the radius.)I am using a drop chest for a location im clearing out so my inv doesn't get full, but a 20 radius wouldn't cover it.
    Thanks

    Also a bug I have is the time (like many other people), I run multiple chests and they all just stop working.
    Thanks
     
  16. Offline

    narrowtux

    Version 0.3 is out!
    It has Permissions support and also an adjustable radius for every user.
    Check it out!
     
  17. Offline

    asdaarg

    I would suggest you optimize this by storing the squared max distance and then you can avoid the squareroot like this:
    double distance2 = levelDistance*levelDistance+dz*dz;
    return distance2 <= maxDistance2;
     
  18. Offline

    CompuIves

    Lol, I started developing this a week ago :S. But someone was first XD.
     
  19. Offline

    narrowtux

    That's a good idea.
     
  20. Offline

    asdaarg

    Ignore my previous post...
    Note this is the same as
    return Math.sqrt(dx*dx+dy*dy+dz*dz) <= maxDistance
    But again to avoid sqrt since that is costly operation, you can store the radius squared and do this optimization:
    return dx*dx+dy*dy+dz*dz <= maxDistance2;
     
  21. Offline

    fisherp

    The left one is chest 1, the right one is 2 (of the ones furthest away)
     
  22. Offline

    Minhyme

    When there is an item beside my chest, I receive errors rather than the item being sucked up by the chest. Anybody know why this is?
     
  23. Offline

    narrowtux

    What error message is it exactly?
    --- merged: Feb 12, 2011 10:15 PM ---
    In version 0.3 I also worked around this bug.
     
  24. Can it be, that it doesn't work in other worlds?
    I have 2 worlds, in the normal World it works fine, in the second world the chest doesn't sucked dropped items.
     
  25. Offline

    narrowtux

    Yeah, I didn't implemented support for multiple worlds now.
     
  26. Offline

    Minhyme

    The message just says "Warning! An error occured!"

    Also is there a way you could make this work for storage minecarts? I would love to be able to just get a minecart down the track to my mob grinder and get the items coming back to me.
     
  27. Offline

    Hirutenshi

    First of all... nice idea m8.

    Anyhow I recieve the following error when starting my server with the DropChest plugin:

    Craftbukkit 319:

    org.bukkit.craftbukkit.CraftServer loadPlugins
    SCHWERWIEGEND: Timer already cancelled. (Is it up to date?)
    java.lang.IllegalStateException: Timer already cancelled.
    at java.util.Timer.sched(Unknown Source)
    at java.util.Timer.scheduleAtFixedRate(Unknown Source)
    at com.narrowtux.DropChest.DropChest.onEnable(DropChest.java:72)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:135)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:425)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:175)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:74)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:55)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:171)
    at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:158)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:110)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:209)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)

    any idea?

    Greetings
    Hirutenshi
     
  28. Offline

    Sebi

    Hello,
    I have problems running this on r320

    Code:
    2011-02-13 16:31:56 [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
            at com.narrowtux.DropChest.DropChest.hasPermission(DropChest.java:405)
            at com.narrowtux.DropChest.DropChest.onCommand(DropChest.java:225)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:17)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:77)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:171)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:610)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:589)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:232)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:74)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:317)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:232)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    Regards, Sebi
     
  29. Offline

    narrowtux

    I think, you don't have Permissions installed. It's required for running DropChest.
     
  30. Offline

    Tibs

    not sure if this is the right place to go for this but why not..

    drop chest on death.

    I want a chest created and filled with my items when I die, (if I have items to drop and have a chest in inv)
    only place chest if no other chest is within x blocks. say 20 or so.
    this chest is to be locked automatically with lwc -c private. (optional)

    The idea being that as people explore and die they dont always go back to get their things.

    These chests would be nice things for other players to find.
     
  31. Offline

    narrowtux

    A friend has told me of exactly the same thing you describe here. I ask him, if he meant that this is already a plugin. Else, I may implement it.
     

Share This Page