Skip to main content

RailBehavior

Trait RailBehavior 

Source
pub trait RailBehavior: Send + Sync {
    // Required method
    fn is_straight(&self) -> bool;
}
Expand description

Shared behavior exposed by blocks in vanilla’s BaseRailBlock hierarchy.

Rail topology uses this capability in addition to the minecraft:rails tag. This keeps class-hierarchy checks extensible without relying on concrete downcasts.

Required Methods§

Source

fn is_straight(&self) -> bool

Returns whether this rail forbids curved shapes.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§