Railcraft

Railcraft

34M Downloads

Add a Track Upgrade mechanic to "upgrade" tracks from one type to another

Generalcamo opened this issue ยท 6 comments

commented

Supersedes #982

Rather than adding recipes to upgrade tracks individually (Example: H.S Track to H.S Electric Track), why not base it off the Kit mechanics? Craft an Upgrade Kit, which you would then right-click on tracks to upgrade them with that type?

Some examples of kits:
Reinforcing Kit: Upgrades Standard Track to Reinforced Track
High Speed Kit: Upgrades Standard Track and Electric Track to their H.S Variants
Electrification Kit: Upgrades Standard Track and H.S. Track to their electrified variant

Certain mods like Railcraft cosmetic additions would likely benefit from this as well.

commented

Well, if you really base it off kit mechanics, you will have too many items.

commented

Actually my grass track works like this already, when you rightclick it with bonemeal, it changes the track from default one to the grass one, copying all relevant blockStates. See https://github.com/hanakocz/RailCraft-Cosmetic-Additions-2/blob/master/src/main/java/cz/hanakocz/rccosmetic/events/PlayerEventListener.java#L42

For those upgrades it could work similar, just it would need probably have its own event, then all you need is to assign what kits can alter what tracks.

The argument with "too many" is probably not relevant, as it could have one item per change, all you need to prepare is that the cost difference is exact to that upgrade cost (or bonused/nerfed as applicable) - so the normal->electric normal is same cost difference as reinforced->electric reinforced etc. (probably then the kit can be part of crafting recipe for those tracks after all? Except that oyu typically craft 16 of them, so the kit probably should be usable 16 times..)

The bonus of this event aproach is that it does not need to alter any code from targetted blocks, what's problematic.

commented

Refer to #999, we might add both and allows pallets to carry a lot of kits and type upgraders.

commented

there are invalid combinations however...

commented

Why not imitate what EnderIO does when replacing one type of conduit with an upgraded version? Simply swap the base track, while leaving the rest, since there are no invalid combinations of track + kit

I need to test it, but does the track replacer cart correctly replace the base track, mode, kit and all?

commented

There are quite a few invalid combinations actually.