pub enum DefaultItem {
Show 23 variants
Empty,
Dirt,
Sand,
Wood,
Gravel,
Snow,
CoalOre,
IronOre,
Cobblestone,
Sandstone,
Planks,
Brick,
Coal,
IronIngot,
Log,
Snowball,
RockFragment,
Crystal,
RareMineral,
WoodenPickaxe,
StonePickaxe,
IronPickaxe,
IronOreItem,
}Expand description
Built-in item type covering common mineral pickups.
DefaultItem is the item counterpart of crate::voxel::DefaultVoxel:
it implements ItemType out of the box and is wired into the default
crate::items::drops::DropTable entries provided by the framework.
Empty is the empty-slot sentinel returned by Default and by
ItemType::from_byte for unknown byte values. It should never appear
as a real collectible.
§Examples
use voxel_framework::items::{DefaultItem, Inventory};
let mut inv = Inventory::<DefaultItem>::new(9);
inv.add(DefaultItem::Crystal, 3);Variants§
Empty
Empty slot sentinel — not a real item; returned by Default.
Dirt
Dirt block; placeable Dirt voxel item (byte 2, matches DefaultTerrainVoxel::Dirt).
Sand
Sand block; placeable Sand voxel item (byte 4, matches DefaultTerrainVoxel::Sand).
Wood
Wood log block; placeable Wood voxel item (byte 5, matches DefaultTerrainVoxel::Wood).
Gravel
Gravel block; placeable Gravel voxel item (byte 7, matches DefaultTerrainVoxel::Gravel).
Snow
Snow block; placeable Snow voxel item (byte 8, matches DefaultTerrainVoxel::Snow).
CoalOre
Coal ore block; placeable CoalOre voxel item (byte 10, matches DefaultTerrainVoxel::CoalOre).
IronOre
Iron ore block; placeable IronOre voxel item (byte 11, matches DefaultTerrainVoxel::IronOre).
Cobblestone
Cobblestone block; placeable Cobblestone voxel item (byte 12).
Sandstone
Sandstone block; placeable Sandstone voxel item (byte 13).
Planks
Wooden planks block; placeable Planks voxel item (byte 14).
Brick
Fired clay brick block; placeable Brick voxel item (byte 15).
Coal
Coal lump; dropped from CoalOre voxels (byte 16).
IronIngot
Smelted iron ingot; produced from IronOre (byte 17).
Log
Wood log; dropped from Wood voxels (byte 18).
Snowball
Snowball; dropped from Snow voxels (byte 19).
RockFragment
Fragment of common rock; drops from Stone voxels (byte 20).
Crystal
Silicon crystal shard; drops from crystal voxels (byte 21).
RareMineral
Rare mineral node; drops from high-value voxels (byte 22).
WoodenPickaxe
Wooden pickaxe — tool level 1, normal speed. Crafted from wood (byte 23).
StonePickaxe
Stone pickaxe — tool level 1, 2× speed. Crafted from rock fragments (byte 24).
IronPickaxe
Iron pickaxe — tool level 2, 4× speed. Crafted from iron ore (byte 25).
IronOreItem
Deprecated alias for IronOre block — maps to byte 11 on write, never returned by from_byte.
Trait Implementations§
Source§impl Clone for DefaultItem
impl Clone for DefaultItem
impl Copy for DefaultItem
Source§impl Debug for DefaultItem
impl Debug for DefaultItem
Source§impl Default for DefaultItem
impl Default for DefaultItem
Source§impl<'de> Deserialize<'de> for DefaultItem
impl<'de> Deserialize<'de> for DefaultItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for DefaultItem
Source§impl Hash for DefaultItem
impl Hash for DefaultItem
Source§impl ItemType for DefaultItem
impl ItemType for DefaultItem
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
"Iron Ore"). Read moreSource§fn color(&self) -> [f32; 4]
fn color(&self) -> [f32; 4]
[0.0, 1.0]. Read moreSource§fn to_byte(&self) -> u8
fn to_byte(&self) -> u8
Source§fn tool_level(&self) -> u8
fn tool_level(&self) -> u8
Source§fn tool_speed(&self) -> f32
fn tool_speed(&self) -> f32
Source§impl PartialEq for DefaultItem
impl PartialEq for DefaultItem
Source§impl Serialize for DefaultItem
impl Serialize for DefaultItem
impl StructuralPartialEq for DefaultItem
Auto Trait Implementations§
impl Forget for DefaultItem
impl Freeze for DefaultItem
impl Move for DefaultItem
impl RefUnwindSafe for DefaultItem
impl Send for DefaultItem
impl Sync for DefaultItem
impl Unpin for DefaultItem
impl UnsafeUnpin for DefaultItem
impl UnwindSafe for DefaultItem
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more