[INACTIVE][MECH] AutoReplace is being split into separate plugins. AutoReplace has been dropped.

Discussion in 'Inactive/Unsupported Plugins' started by Valrix, Feb 16, 2011.

  1. Offline


    AutoReplace is splitting into two plugins called AutoBlock and AutoItem and will be "cousins" of AutoWeapon, AutoTool, and AutoFood that are being made by @marinating. All these together will make a suite of sorts and will all work together.

    AutoReplace - Moves items from inventory to hand when it runs out:
    Version: v1.9.1

    The plugin watches all of the "hand" slots to watch for when you run out of blocks while placing them or for when a tool breaks and will look in your inventory to see if you have any more to replace it with. If not, you will get a message saying you're out.

    To install just put AutoReplace.jar in the plugins folder and it handles the rest! Enjoy!

    • Moves preset tool from inventory to hand when it breaks
    • Moves block stack from inventory to hand when stack runs out
    • Moves items like beds and redstone dust to your hand when you run out
    • Replaces food and empty buckets with full ones

    • Global config to deny certain slots from being watched for everyone.

    RB 860:
    Source Code: AutoReplace

    CHANGELOG (open)

    Version 1.9.1
    • Fixed the "always placing water" issue
    Version 1.9
    • Now replaces food when you eat it
    • Now replaces empty buckets with full ones
    Version 1.8
    • Fixes the problem with some items being replaced even though nothing was placed and tools being moved to your hand without being broken.
    Version 1.7
    • Fixes the problem with placing wool.
    Version 1.6
    • Now supports replacement of items like Redstone dust, doors, beds, signs, and paintings.
    • A few code improvements
    • Only a higher build like 600+ can support this since it was between 556 and 602 that interacting with these items was fixed/added.
    Version 1.5
    • Updated to work with RB 602.
    Version 1.4
    • Removed "No more X in inventory" message when you run out of something.
    Version 1.3
    • Removed use of /auto command
    • All "hand" slots are now watched automatically
    • No more .preset files are generated
    Version 1.2
    • Reworked it a bit to make sure it has less chances to break and uses a little less resources.
    Version 1.1
    • Updated the work with the newest plugin build method.
    Version 1.0
    • Release of AutoReplace
  2. Offline


    Oh cool, no pressure, I just wanted to make sure my favorite plug-in wasn't dead. That would make be very sad.
  3. Offline


    Oh no, I won't let any of my plugins die. Especially not the really useful ones like this.
  4. Offline


    Seems to be working in 819 just fine
  5. Offline


    Gonna try this on 818 and report back. Good luck, Valrix!
  6. Offline


    Okay, thanks :)
  7. Bug:

    Seems that saplings of different types get mixed, perhaps also other items with damage?
  8. Offline


    Yeah, still gotta get that worked out.
  9. And luck? Pretty abusable bug :(
  10. Offline


    I'll get that fixed tonight.
  11. Offline


    I love this plugin, and I love the fact it runs happily without conflict nor complaint on Bukkit 818. :D
  12. Offline


    Yes, luckily it doesn't have any breaking issues. Just a few bugs to fix is all.
  13. Any news? :)
  14. Offline


    Sorry if this was asked before, but does this plugin also cover automatic replacement of arrows as well?

    I know that they will still fire if they're not in your "hand" slots, but it's nice to see when you're running low, since you're not always checking in the heat of a battle.
  15. Offline


    It should, but only items in your hand will get replaced at the moment until the ability to watch your inventory slots for changes are added. Then it'll be able to replace pretty much anything.
  16. Offline


    So essentially the current algorithm goes:
    If item on-hand has depleted to 0
            If same item exists in inventory
                    Move item from inventory to hand where previous item existed
    Do I have that right? If so, that would probably work fine for arrows, but of course that way you're always playing with fire when your on-hand stock goes to 0, since unless you check how many stacks you have in your inventory you may or may not get replenished.

    It would be nice to see some stacks get replenished not only when they run out, but when they have changed (for example, if you have some torches in your inventory and place 1 torch from your hand, 1 torch gets moved from your inventory to your hand). Of course, then it would only need to check when the player has placed that item, since real-time checking may cause a large strain on the server (I'm guessing, of course. I may be a Java developer but I'm not sure how much strain this would cause unless I implemented it myself). I know this would add a lot more checks and possibly cause some lag server-side, but it would be interesting to see implemented.

    Either way, good work on this plugin. That was just my two cents.
  17. Offline


    That's exactly how it works, I'm a little surprised and glad someone else was able to just think it out. The problem with arrows is unless you're throwing them by using another plugin, there would be no point. But once all the inventory hooks are good and ready I'll be modifying AutoReplace to do a lot more stuff. Like replacing certain slots with certain items, or even telling it, "if you find this in my inventory, move it here, otherwise look for this, this, or this other thing" so you can have a list of items you want to move into a particular slot instead of watching for one thing and they'd be based on the priority of replacement that you give it.
  18. Offline


    Hey there, I made a plugin that does pretty much the same as this without knowing about yours. Shall I cease and desist or continue developing mine on the side?
    Mine is called AutoTool, if you want to check it out.
  19. Offline


    Nah, go ahead :) It's all about learning and supplying options for people. If you make something someone else made, but it's better and you did it all on your own, I don't see how it'd be an issue at all.

    Actually, I have an idea. You can continue with AutoTool because people seem to be liking it, and I can focus more on replacing items.
  20. Offline


    Alright. I got a request for replacing stacks of items, but people can use your plugin for that.
    I'll expand mine to include AutoFood and AutoWeaponizing. :D
  21. Offline


    Hmm, this sounds interesting. Actually, what would be good is to have a whole suite of AutoReplacement plugins. You'll have AutoTool, AutoFood, and AutoWeapon and I can make AutoReplace into AutoBlock and AutoItem. Sound like fun? You can also feel free to check out my source too.
  22. Offline


    Alrighty, sounds great. I'm working on Demigods too so splitting the work is probably smarter than making a full AutoSuite myself.
  23. Offline


    Awesome. Sounds fun, and I agree that splitting the work is better than soloing a suite.
  24. Offline


    I've been getting this error for the longest time, and i don't know how to fix it. The mod sometimes fails to replace the item, but for the most part it does.
    Also, when it does move the item, it creates a "ghost item" from where the item was taken.
    Currently using craftubukkit 815. Maybe updating to 860 will help...

    02:04:43 [SEVERE] Could not pass event BLOCK_PLACE to AutoReplace
    java.lang.IllegalArgumentException: Listener already listening
            at net.minecraft.server.Container.a(SourceFile:28)
            at net.minecraft.server.EntityPlayer.syncInventory(EntityPlayer.java:70)
            at org.bukkit.craftbukkit.entity.CraftPlayer.updateInventory(CraftPlayer
            at com.sparkedia.valrix.AutoReplace.AutoBlockListener.onBlockPlace(AutoB
            at org.bukkit.plugin.java.JavaPluginLoader$26.execute(JavaPluginLoader.j
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
            at org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(Cr
            at org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(Cr
            at net.minecraft.server.ItemBlock.a(ItemBlock.java:76)
            at net.minecraft.server.ItemStack.placeItem(ItemStack.java:56)
            at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.j
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:544)
            at net.minecraft.server.Packet15Place.a(SourceFile:57)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:215)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:396)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:308)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
  25. Offline


    If they removed the inventory update command, that would explain why it's not working. But that's not the problem, and I've never seen that error actually...
  26. Offline


    Here's a list of mods I'm running atm if it helps...

    I'm currently in the process of updating every single mod on my server, I'll tell you if it gets rid of it.

    Updating the server with the latest stuff seems to have worked, but I don't know why it would have. This mod hasn't been changed at all since 766, right? Maybe it was a conflict with another mod that wasn't updated properly?

    I need to be less lazy and update more often... -_-

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


    @Valrix : Please test against latest RB (860) or considered inactive.
  28. Offline


    Warning this plugin causes a duplication bug with the latest recommended build........ even when you remove the plugin there is still a huge operation required to remove the glitched items
  29. Offline


    I feared that would happen...well, I'm going to be breaking it into two different plugins soon in order to take better care of these weird bugs and corner cases. Items are a bit of a pain, though anything that has to do with inventory is a pain in general because we don't have the full control over it that we need just yet. Once all the hooks are in and such this'll no longer be an issue.
    o0AzzA0o likes this.
  30. Offline


    Maybe they have fixed this issue in craftbukkit ? im to scared to test it :p
    Build #932 (26-Jun-2011 09:48:57)

    [​IMG]Build Artifacts
    [​IMG] Changes
    1. Fixed Explosion.setYield(0) still dropping blocks. (commit: 09b648f8eb7b1bd9a3d0f5a801e6632b76b4de13) (detail / githubweb)
    2. Fixed cancelling the PlayerPickup event, getAmount(), item duping issue. (commit: a9ddbaa9d5df8118f01e282f1449a6a7b4281f6e) (detail / githubweb)
  31. Offline


    It's quite possible.

Share This Page