PdxTrackRouter
PdxTrackRouter
Check out the new screenshots!
The PdxTrackRouter plugin allows users to create automatically routed mine cart rail systems. This is accomplished through a combination of "destination" signs and "junctions" signs. Minecarts will behave normally in the absence of any junction signs.
Destination signs should be placed wherever a user might want to select a new destination. The format for the signs is:
- [destination]
- destination name
- freeform text
- freeform text
When a user right clicks on a destination sign his destination tag will be stored.
Junction signs create automatic switching tracks. The signs should be placed at the corner of a 3/4 way rails junction or above the junction as a wall-sign, or below the block the junction is built on. Many of these signs may be stacked vertically if more lines are needed. The format of the junction sign is:
- [junction]
- DESTINATION: DIRECTION
- DESTINATION: DIRECTION
- ...
The destination can be any string which fits on the sign and should correspond to [destination] signs available to the user. The direction should be one of "north","south","east","west". (Only the first letter is checked).
Empty carts are always routed to the "empty" destination. Chest carts are routed to the "chest" destination. Powered carts are routed to the "engine" destination. Any cart will match the "default" destination. If no route on the junction sign matches the junction will attempt to send the cart straight through the junction without turning. These destinations are configurable in config.yml
The plugin will scrub all whitespace and color/formatting from the signs, so users are free to make their signs pretty using a plugin like Essentials.
The plugin does not stop players from breaking tracks or signs. A block protection plugin should be used for that.
Right click on an empty cart or chest cart with a sign in your hand to transfer your destination preference to that cart. This is great for moving chest carts full of goods along with you on the rail system. Carts with destinations set will move at full speed so that you can go with them. The tool is configurable.
Commands
/destination [DESTINATION] - Override your destination preference or clear it if left unspecified.
/changesign # TEXT - Change a line on the sign your cross-hairs are pointing at. This is a privileged operation and requires op or trackrouter.changesign
Example: /changesign 4 New line here
/junctions - Search for destinations which are connected to the piece of track you are standing on. This can be slow as it has to load chunks, so it runs in the background to avoid creating lag.
Junction Editing
To edit a junction, right click on the [junction] sign or the junction rail block and enter any of the following commands. BE CAREFUL giving this command to people as they can easily edit other kinds of protection signs at this point by placing a junction sign over an existing sign and edit through to the next sign. I'm open to ideas for how to protect against this. Line numbers start a 1 for the first line after the [junction] and continue through the whole stack of signs.
- /junction insert # TEXT - Insert a new line at position #
- /junction delete # - Delete the line at position # and move the others up
- /junction change # TEXT - Change the line at position # and leave the rest alone
- /junction list - Print the lines of the current junction sign
Automatic Storage Cart (un)loading
The plugin supports configurable loading and unloading of storage carts into chests. When a storage cart passes over a gold block it will load from the chests touching the sides of that gold block. When a cart passes over a diamond block it will unload into the chests touching that block. The blocks are configurable and the feature can be disabled using config.yml.
BE CAREFUL with this feature. If a player can build next to a chest he can extract the items from it.
Permissions
- trackrouter.changesign - Change lines on signs in-place - default op
- trackrouter.junctions - Use the /junctions command - default op
- trackrouter.destination - Use the /destination command - default true
- trackrouter.sign.junction.create - Create new junction signs - default true
- trackrouter.sign.junction.edit - Edit junction signs in place - default op
- trackrouter.sign.destination.create - Create new destination signs - default true
- trackrouter.sign.destination.use - Use destination signs - default true
- trackrouter.transfertool - Transfer your destination preference to a cart - default true
Source
Source code is available on github and is licensed under GPLv3
Demo
See the plugin live at pdxmc.com Head down the elevators to the "Train Station" floor 1 and try out the various stations. Additionally, there are a number of small examples on floor 2. The hub uses elevators: Destination floors can be select by right clicking on the sign above the button at an elevator.
-
View User Profile
-
Send Message
Posted May 18, 2014When I transfer the destination to a minecart with a villager in it, I get the acknowledgement message but it doesn't actually work. This plugin would be perfect for building trading halls where trained villagers are shifted around- can tag-transferral be extended to carts with non-player passengers as well?
-
View User Profile
-
Send Message
Posted Feb 18, 2014Does this work in the nether as it seems to not register the junction directions?
-
View User Profile
-
Send Message
Posted Sep 24, 2013thanks for this amazing plugin all this time since last update still works like a charm on 1.6 4 made a whole subway/rail system with it. gets little bit harder as the rail network expands to configure trains to get to destination shortest most efficient way but still rocks. surprised you only get 1800 downloads this thing is amazing. great work dude thanks Andy
PS stop by the server some time don't want to advertise on here just search on YouTube my user name made a little move forward this plugin in action server address is there if you interested.
-
View User Profile
-
Send Message
Posted Jun 20, 2013There is an issue when using pdxTrackRouter on a line that passes through stargates. The Stargate is set always-on and fixed-destination, so no interaction by the user is necessary to operate it, and the stargate config.yml specifies allow vehicles. The minecart itself successfully transits the stargate and continues on its way, thus effecting a near instantaneous jump over an awkward bit of terrain, whether it's a vast ocean or a huge mountain. The problem is, the moments being processed by the stargate cause pdxTrackRouter to cancel the destination. I can think of a couple of ways around this problem.
-
View User Profile
-
Send Message
Posted Mar 16, 2013@socram8888
thanks. it's neat to find out more people using it
-
View User Profile
-
Send Message
Posted Mar 16, 2013Awesome plugin! Now I don't have to use complex piston-based switches :D
-
View User Profile
-
Send Message
Posted Feb 15, 2013Oh that was a really old error ;)
-
View User Profile
-
Send Message
Posted Feb 14, 2013For anyone monitoring this plugin, v0.8 is compatible with 1.4.7-R1.0 and is waiting for bukkit.org to approve the upload.
-
View User Profile
-
Send Message
Posted Feb 14, 2013@diannetea
Things seemed to be working when I connected to your server last night. Are you still having issues with event exceptions?
-
View User Profile
-
Send Message
Posted Jan 17, 20132013-01-18 00:54:53 [SEVERE] Could not pass event VehicleMoveBlockEvent to PdxTrackRouter v0.7 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at com.gmail.emertens.pdxtrackrouter.listeners.VehicleMoveBlockListener.onVehicleMoveEvent(VehicleMoveBlockListener.java:46) at sun.reflect.GeneratedMethodAccessor540.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at net.minecraft.server.v1_4_6.EntityMinecart.j_(EntityMinecart.java:664) at net.minecraft.server.v1_4_6.World.tickEntity(World.java:1460) at net.minecraft.server.v1_4_6.World.entityJoinedWorld(World.java:1421) at net.minecraft.server.v1_4_6.WorldServer.entityJoinedWorld(WorldServer.java:575) at net.minecraft.server.v1_4_6.World.playerJoinedWorld(World.java:1411) at net.minecraft.server.v1_4_6.World.tickEntities(World.java:1289) at net.minecraft.server.v1_4_6.WorldServer.tickEntities(WorldServer.java:466) at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:567) at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224) at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:481) at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:416) at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849) Caused by: java.lang.NullPointerException at com.gmail.emertens.pdxtrackrouter.PdxTrackRouter.normalizeDestination(PdxTrackRouter.java:335) at com.gmail.emertens.pdxtrackrouter.PdxTrackRouter.findDestination(PdxTrackRouter.java:221) at com.gmail.emertens.pdxtrackrouter.PdxTrackRouter.updateJunction(PdxTrackRouter.java:347) at com.gmail.emertens.pdxtrackrouter.listeners.TrackListener.onVehicleMove(TrackListener.java:77) at sun.reflect.GeneratedMethodAccessor543.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 25 more 2013-01-18 00:54:54 [SEVERE] Could not pass event VehicleMoveBlockEvent to PdxTrackRouter v0.7 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at com.gmail.emertens.pdxtrackrouter.listeners.VehicleMoveBlockListener.onVehicleMoveEvent(VehicleMoveBlockListener.java:46) at sun.reflect.GeneratedMethodAccessor540.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462) at net.minecraft.server.v1_4_6.EntityMinecart.j_(EntityMinecart.java:664) at net.minecraft.server.v1_4_6.World.tickEntity(World.java:1460) at net.minecraft.server.v1_4_6.World.entityJoinedWorld(World.java:1421) at net.minecraft.server.v1_4_6.WorldServer.entityJoinedWorld(WorldServer.java:575) at net.minecraft.server.v1_4_6.World.playerJoinedWorld(World.java:1411) at net.minecraft.server.v1_4_6.World.tickEntities(World.java:1289) at net.minecraft.server.v1_4_6.WorldServer.tickEntities(WorldServer.java:466) at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:567) at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:224) at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:481) at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:416) at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:849) Caused by: java.lang.NullPointerException at com.gmail.emertens.pdxtrackrouter.PdxTrackRouter.normalizeDestination(PdxTrackRouter.java:335) at com.gmail.emertens.pdxtrackrouter.PdxTrackRouter.findDestination(PdxTrackRouter.java:221) at com.gmail.emertens.pdxtrackrouter.PdxTrackRouter.updateJunction(PdxTrackRouter.java:347) at com.gmail.emertens.pdxtrackrouter.listeners.TrackListener.onVehicleMove(TrackListener.java:77) at sun.reflect.GeneratedMethodAccessor543.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 25 more
also apparently people randomly die, what? :D
-
View User Profile
-
Send Message
Posted Dec 2, 2012We seem to be having a lot of issues with this on 1.4.5 :(
Routes are not working properly at all
-
View User Profile
-
Send Message
Posted Sep 25, 2012Not that I am a fan of copying functions... but Craftbook has a neat 'Ejector' block feature that I think would make a great addition. Basically, you specify 'Ejector' and a direction, and when a cart rolls over it, it removes the player from the cart, and places them on that block. This would be great for removing congestion at the end of minecart stations for when people are impatient. I don't really want to implement Craftbook for one feature, especially when there is such a delay between version at times. What do you think?
Link: http:wiki.sk89q.com/wiki/CraftBook/Minecart_control_blocks#Ejectors
-
View User Profile
-
Send Message
Posted Sep 23, 2012@iBaer
It doesn't work because I haven't defined such a permission (* is just a name like any other in Bukkit plugins) I suppose I have enough permissions now that it would be good to add one. I'll make sure 0.8 supports that when I do another release. Thanks for the feedback!
-
View User Profile
-
Send Message
Posted Sep 23, 2012Hey glguy. I don't know if it's just me, but the "trackrouter.*" permission (perm for all things) doesn't work. The permissions work when you enter each one of them, but I don't think it should work like this. Anyway, I love your plugin and it works really nice.
-
View User Profile
-
Send Message
Posted Sep 13, 2012Going to try integrating this later tonight.
-
View User Profile
-
Send Message
Posted Sep 11, 2012@TomatoCo
I am currently running it on 1.3.2 R0.2, and I have no issues. Good luck!
-
View User Profile
-
Send Message
Posted Sep 11, 2012@TomatoCo
Also, I can add the permissions for 0.6 tonight
-
View User Profile
-
Send Message
Posted Sep 11, 2012@TomatoCo
I haven't tested against any development builds, but I don't think that the event APIs would have changed in a way that would stop the plugin from working. I only develop against the bukkit API and don't dive into any of the CraftBukkit internals.
-
View User Profile
-
Send Message
Posted Sep 11, 2012Does this work on 1.3.2 R0.2?
Also, if I may make a request, can you add the option to make the placing of destination and junction signs op/by permission only? Also to disable the /destination command?
-
View User Profile
-
Send Message
Posted Sep 11, 2012@glguy
Excellent! I actually started poking around the source, and it doesn't seem as difficult as I thought... I might start a plugin myself! Thanks for your help!