[][src]Struct rna::Extension

pub struct Extension { /* fields omitted */ }

Extension Script of MeguScript

Extension will follow /loot command's path convention.
To refer to creeper loot table use minecraft:entities/creeper

Examples

let creeper_extend = Extension::get_extension("minecraft:entities/creeper", "resource").unwrap();

If the input string is not a vanilla's path it will panic

let should_panic = Extension::get_extension("this/path/does/not/exists", "resource").unwrap();

Methods

impl Extension[src]

pub fn new(location: impl Into<PathBuf>) -> Extension[src]

pub fn get_extension(
    value: impl Into<String>,
    base_path: impl Into<PathBuf>
) -> Result<Extension, ExtensionError>
[src]

Get extension from given Namespace

Setting up

You need to include the source files for the loot table database yourself.

Which you need to place the file in this order: {base_path}/{prefix}/{suffix}.ult where prefix and suffix refer to Namespace

pub fn compile(
    &self,
    base_path: impl Into<PathBuf>
) -> Result<MeguScript, ReadError>
[src]

Create MeguScript from this Extension

Trait Implementations

impl Clone for Extension[src]

impl Debug for Extension[src]

impl Eq for Extension[src]

impl PartialEq<Extension> for Extension[src]

impl PartialOrd<Extension> for Extension[src]

impl StructuralEq for Extension[src]

impl StructuralPartialEq for Extension[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.