Immersive Railroading

Immersive Railroading

3M Downloads

Add Force Switch item

hayesj1 opened this issue ยท 1 comments

commented

Yesterday someone asked for a item to force switches to toggle state when r-clicked. I'd like to implement it. Now that I've poked around the code, I think it's doable with a "forcedSwitch" field in RailInfo. The method, as far as I can tell, SwitchUtil.getSwtichState() seems to be the function which all other functions call to find out the state of a switch. This means, by adding a boolean in RailInfo, all that would be needed is to check it in the this function; if it's true, return SwtichState.TURN (no else clause). Also in BlockRailBase.onBlockActivated() there's a great spot to check if the item was this new item and toggle the boolean appropriately.

Thoughts? Suggestions? I don't know what to actually name the item, but I'm thinking something like "Switch Hammer"

commented

Another thought on the name/texture; it could be the stick part of a switch lever.