[FIX] MinecartPermanence v1.1 - Keep minecarts always loaded [1337]

Discussion in 'Inactive/Unsupported Plugins' started by orion304, Jun 18, 2011.

  1. Offline

    orion304

    Minecart Permanence - A plugin to keep the chunks minecarts are in always loaded.
    Version: 1.1

    I built this plugin for a sever I'm in where we're building a very extensive railway system. Since we want it autonomous, and sections of tracks are frequently kilometers long, minecarts would unload when they get too far from a player and the trains would just stop. While this kind of displayed a quantum mechanics idea, it was really obnoxious for us. This plugin fixes that.

    While there are other plugins that do this same thing, they're few and far between from what I saw, and many provide a lot more features. We wanted to keep the server mostly vanilla, which is why the only thing this plugin fixes is Minecarts.

    Features:
    This plugin simply keeps track of any vehicle move event and chunk unload event. If a vehicle moves and its a minecart, it forces chunks around the minecart to load. If it's a chunk unload event and there is a minecart in a nearby chunk, it'll prevent that chunk from unloading.

    Changelog:
    6-18 - v1.0: Release
    10-30 - v1.1:
    -Added a configuration file with a few options
    -Added the ability for a server to load all minecarts upon start-up
    -Added the ability for minecarts to ignore collisions with players and entities
    -Added the [experimental] ability for minecarts to knock something up/back upon collision
    -Fixed the permanency for more recent versions of Bukkit


    Download:
    <Edit by Moderator: Redacted mediafire url>
    Github (still 1.0, working on that)

    I have posted this on BukkitDev, but the formatting is a little weird and the site is new to me.
     
    Last edited by a moderator: Nov 27, 2016
    Trenny likes this.
  2. Offline

    Pencil

    Looks good, just a hint it's plugin not pluggin :D
     
  3. Offline

    orion304

    Good call. Fixt.

    <3 your avatar.
     
  4. Offline

    ChrizC

    Where was the plugin stolen from? It looks a little suspicious seeing as your "Member Since" says "Today." :p

    :cool:
     
  5. Offline

    Pencil

    Hehe, ty :D Ezreal ftw :D Do you play LoL? :3
     
  6. Offline

    orion304

    His post was yesterday at 4:30PM. Mine was "technically" at 8:20 PM according to that forum, which happens to be off my time zone (EST) by 5 hours, so 3:20PM for this forum. The initial release is here versus his post here. I'm not sure the easiest way to confirm the time difference besides just looking at recent posts and seeing the discrepancy. Also, CrazyPenguin has been a member since "yesterday" and has already been reported for code theft.

    Again, if it'll help, I can provide the source code. The time thing is really weird and I had to scratch my head for a good deal of time wondering how he could possibly beat me to my own release. Kind of disconcerting for a while.

    I do! It's a wonderful game. Ezreal is wonderful.

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

    Pencil

    Kewl! I love Ezzi, his ult is just too hawt ;D, anyways Imma stop offtopic here :D
     
  8. Offline

    Trenny

    Nice Plugin :)
    But can you add, that the Minecarts pull Stuff/People/Animals/Monsters from the track?
    Would be nice!

    Greetz
    Trenny
     
  9. Offline

    orion304

    What do you mean?
     
  10. Offline

    T4L_Goose

    I think he means can you make it so if something like a mob or an item (dropped item or an arrow) gets hit by a minecart, it just gets pushed off the track.
     
  11. Offline

    orion304

    Ah, I see. I will work on a .config file to allow minecarts to just phase through anything that's not a player or a block. Also, it seems as though it's compatible with Bukkit 928, so it an update was not required. Please let me know if I'm incorrect in this.

    Oh, and I've released the source since someone has asked for it. I assume it goes without saying, but please credit me if you use it in your plugins :D

    EDIT: Build 935 seems to work just as well in terms of compatibility.
     
  12. Offline

    Smallie07

    This is exactly what i need, but just to clarify does this work with storage minecarts as well?
     
  13. Offline

    orion304

    While I haven't tested it, it should indeed work. The plugin monitors vehicles in general, so it should.
     
  14. Offline

    Tomab

    I've used this plugin with storage minecarts as well as empty ones, it works wonderfully.
     
  15. Offline

    Smallie07

    Alright sweet thanks. ill try it out soon.
     
  16. Offline

    dumble99

    This Plugin looks SWEEEEET!!!
    Downloading :D

    P.S. Adding on to trenny's post above, would it be possible to make it so that when a mob is on the track and a minecart is going at a high enough speed (<-- The hard bit to code) it gets killed (and the player if pvp is on) and it could just phase through arrows and items (all of the above would be configurable of coarse) :D
     
  17. Offline

    Αρρεν

    Is there chunks loaded only around carts that moves OR around all even just stays and not moves?

    It is very important because if you have a lot of carts they can simply broke down server by loading a lot of chunks.
     
  18. Offline

    orion304

    It keeps chunks loaded around moving and non-moving carts. This is essential, for the purposes of this fix, since I'm sure many people who want this are using stops. For instance, the server I'm on has a really long train with a couple of stops a few km apart. If the plugin didn't keep the chunks loaded on non-moving minecarts, when it stopped there would be a chance that the chunk would unload and the cart wouldn't restart on its own if you weren't there. Very bad for an automated service.

    Hopefully I'll get to writing and releasing 1.1 today or tomorrow, since a few features have been requested. I'll not worry about making sure this is Bukkit 935 compatible until then, but I suspect it is.

    Thanks. And that suggestion shouldn't be difficult to implement at all.
     
  19. Offline

    Tomab

    orion304, do you think you might be able to add this as an optional feature? My biggest concert running this mod is that players will leave carts all over the world and eat up cpu cycles. It hasn't been a problem yet though, so I'm not overly concerned. Thx for the plugin!
     
  20. Offline

    orion304

    Yes, I can.
     
  21. Offline

    Trenny


    I´ll be glad about the config! :)
    When it finds the way in die Plugin?
     
  22. Offline

    orion304

    Sorry, I've been really busy this past week. The patch is already written, but I'm running into some snags. Hopefully I can release it tomorrow or the next day :D
     
  23. Offline

    Ikarirain

    Would it be possible to save the momentum in a minecart during restarts so that things such as automatic railways with constantly moving carts will continue to function after a server stops and restarts? Or is this something that is simply not possible?

    To clarify, say I have a railway where minecarts pass over detector rails, which then count down through redstone repeaters to a point where it eventually turns on the powered rail where the minecart stops at. The result is a minecart that stops on unpowered rails, waits about 5-10 seconds, then continues on its way after the rails are powered by the countdown.
     
  24. Offline

    Ant59

    MinecartMania already has an option for this and has had for a long time.
     
  25. Offline

    Tomab

    What are you refering to? Keeping minecarts loaded or the feature lkaririan was requesting?
     
  26. Offline

    Ikarirain

    I'm actually surprised you posted Tomab. I just saw your RollingMinecarts plugin and I believe its what I'm looking for, if I'm not mistaken? That and MinecartPermanence complement each other rather nicely.
     
  27. Offline

    Trenny

    Can you tell us the status of the new version please? :)
     
  28. Offline

    h4x0r

    Good day,
    Your plugin working fine but it bugs lockette plugin and empty all boxes... please fix that... because if the lockette and the minecartPermanence is on the server is writing and errors... and the boxes are empty... and set anti block because the players are always blocking the minecarts... thx :)

    This is the errors what is showing to me with your plugin :)
    Fix please that plugin to work with lockette :) thx

    2011-07-08 08:13:29 [WARNING] Failed to handle packet: java.lang.NullPointerException
    java.lang.NullPointerException
    at net.minecraft.server.BlockFurnace.remove(SourceFile:137)
    at net.minecraft.server.Chunk.a(Chunk.java:286)
    at net.minecraft.server.World.setRawTypeId(World.java:305)
    at net.minecraft.server.World.setTypeId(World.java:370)
    at net.minecraft.server.ItemInWorldManager.b(ItemInWorldManager.java:142)
    at net.minecraft.server.ItemInWorldManager.c(ItemInWorldManager.java:169)
    at net.minecraft.server.ItemInWorldManager.a(ItemInWorldManager.java:121)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:460)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:84)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)

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

    killgoblen

    Would it be possible to add an option to only keep moving minecarts loaded?

    And does this affect performance noticeably?

    Thanks for the plugin, though, this could be helpful for many different types of servers.
     
  30. Offline

    orion304

    Unfortunately I've been quite busy as of late, and I also can't seem to work out some of the features requested. I'll try to get to it later today, but I'm not sure.

    OK, that's completely new to me. I have absolutely no idea why that conflict would happen, and am frankly skeptical that it does. The only events this plugin monitors are vehicles moving and chunks unloading. The only functions it calls are loading chunks and unloading chunks. Even if this was the plugin conflicting with Lockette, I'd have absolutely no idea how to fix it. I'd suggest making sure Lockette's completely up to date and that it is indeed only these two plugins that are interfering with each other.

    And none of that error relates to MinecartPermanence, from what I can see... :S

    I hope to add that option soon, once I work out some kinks and get some time. As for the performance, I've noticed no drawbacks, but I've only tested on a pretty small scale. Perhaps others in the community know?
     

Share This Page