-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2cc3e2a
commit b880066
Showing
9 changed files
with
70 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,16 @@ | ||
package mods.railcraft.api.track; | ||
|
||
import org.jetbrains.annotations.Nullable; | ||
import net.minecraft.world.entity.vehicle.AbstractMinecart; | ||
|
||
public interface SwitchActuator { | ||
|
||
/** | ||
* This method is used by the switch track to ask the actuator | ||
* device whether it thinks the track should be switched or not. Ultimately, | ||
* the track itself will decide whether it will be switched, however the | ||
* track will usually try to honor results of this method when possible. | ||
* This method is used by the switch track to ask the actuator device whether it thinks the track | ||
* should be switched or not. Ultimately, the track itself will decide whether it will be | ||
* switched, however the track will usually try to honour results of this method when possible. | ||
* | ||
* @param cart The cart that the switch may use to determine switch status. | ||
* Implementations should expect null values. | ||
* @param cart - the cart that the switch may use to determine switch status | ||
* @return true if the actuator would like the track switched | ||
*/ | ||
boolean shouldSwitch(@Nullable AbstractMinecart cart); | ||
boolean shouldSwitch(AbstractMinecart cart); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package mods.railcraft.util.routing; | ||
|
||
|
||
import java.util.Optional; | ||
import com.mojang.datafixers.util.Either; | ||
|
||
public interface Router { | ||
|
||
void resetLogic(); | ||
|
||
Optional<Either<RoutingLogic, RoutingLogicException>> logicResult(); | ||
|
||
default Optional<RoutingLogic> logic() { | ||
return this.logicResult().flatMap(Either::left); | ||
} | ||
|
||
default Optional<RoutingLogicException> logicError() { | ||
return this.logicResult().flatMap(Either::right); | ||
} | ||
} | ||
|
16 changes: 0 additions & 16 deletions
16
src/main/java/mods/railcraft/util/routing/RouterLogic.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters