mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
chore: move ItemStack from pumpkin_world to pumpkin_data (#1944)
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -2780,6 +2780,7 @@ dependencies = [
|
||||
"phf",
|
||||
"pumpkin-nbt",
|
||||
"pumpkin-util",
|
||||
"rand 0.10.0",
|
||||
"serde",
|
||||
]
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ pumpkin-util.workspace = true
|
||||
pumpkin-nbt.workspace = true
|
||||
serde.workspace = true
|
||||
crc-fast.workspace = true
|
||||
rand.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
criterion.workspace = true
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use pumpkin_data::tag;
|
||||
use pumpkin_data::tag::Taggable;
|
||||
use crate::tag;
|
||||
use crate::tag::Taggable;
|
||||
|
||||
use crate::item::ItemStack;
|
||||
use crate::item_stack::ItemStack;
|
||||
|
||||
impl ItemStack {
|
||||
#[inline]
|
||||
@@ -1,15 +1,16 @@
|
||||
use pumpkin_data::data_component::DataComponent;
|
||||
use pumpkin_data::data_component::DataComponent::Enchantments;
|
||||
use pumpkin_data::data_component_impl::{
|
||||
use crate::data_component::DataComponent;
|
||||
use crate::data_component::DataComponent::Enchantments;
|
||||
use crate::data_component_impl::{
|
||||
BlocksAttacksImpl, ConsumableImpl, DamageImpl, DataComponentImpl, EnchantmentsImpl, IDSet,
|
||||
MaxDamageImpl, MaxStackSizeImpl, ToolImpl, UnbreakableImpl, get, get_mut, read_data,
|
||||
};
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::recipes::RecipeResultStruct;
|
||||
use pumpkin_data::tag::Taggable;
|
||||
use pumpkin_data::{Block, Enchantment};
|
||||
use crate::item::Item;
|
||||
use crate::recipes::RecipeResultStruct;
|
||||
use crate::tag::Taggable;
|
||||
use crate::{Block, Enchantment};
|
||||
use pumpkin_nbt::compound::NbtCompound;
|
||||
use pumpkin_util::GameMode;
|
||||
use rand;
|
||||
use std::borrow::Cow;
|
||||
use std::cmp::{max, min};
|
||||
|
||||
@@ -519,8 +520,8 @@ impl From<&RecipeResultStruct> for ItemStack {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use pumpkin_data::data_component::DataComponent;
|
||||
use pumpkin_data::data_component_impl::{DataComponentImpl, EnchantmentsImpl, UnbreakableImpl};
|
||||
use crate::data_component::DataComponent;
|
||||
use crate::data_component_impl::{DataComponentImpl, EnchantmentsImpl, UnbreakableImpl};
|
||||
|
||||
/// Helper: creates a fresh Iron Sword (max_damage 250, damage 0).
|
||||
fn iron_sword() -> ItemStack {
|
||||
@@ -5,6 +5,9 @@
|
||||
#[path = "generated/item.rs"]
|
||||
pub mod item;
|
||||
|
||||
#[cfg(feature = "item")]
|
||||
pub mod item_stack;
|
||||
|
||||
#[cfg(feature = "packet")]
|
||||
#[rustfmt::skip]
|
||||
#[path = "generated/packet.rs"]
|
||||
|
||||
@@ -9,7 +9,7 @@ use crate::{
|
||||
screen_handler::{ScreenHandler, ScreenHandlerBehaviour, ScreenHandlerFuture, ScreenProperty},
|
||||
};
|
||||
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
|
||||
pub struct BrewingScreenHandler {
|
||||
inventory: Arc<dyn Inventory>,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
use std::{any::Any, pin::Pin};
|
||||
|
||||
use pumpkin_world::{inventory::split_stack, item::ItemStack};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_world::inventory::split_stack;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use pumpkin_world::inventory::{Clearable, Inventory, InventoryFuture};
|
||||
|
||||
@@ -13,12 +13,12 @@ use crate::screen_handler::{
|
||||
use crate::slot::{BoxFuture, NormalSlot, Slot};
|
||||
|
||||
use crossbeam_utils::atomic::AtomicCell;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::recipes::{CraftingRecipeTypes, RECIPES_CRAFTING, RecipeResultStruct};
|
||||
use pumpkin_data::screen::WindowType;
|
||||
use pumpkin_data::tag;
|
||||
use pumpkin_data::tag::Taggable;
|
||||
use pumpkin_world::inventory::Inventory;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
/// CraftingResultSlot.java
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
use std::{any::Any, pin::Pin, sync::Arc};
|
||||
|
||||
use pumpkin_world::{
|
||||
inventory::{Clearable, Inventory, InventoryFuture},
|
||||
item::ItemStack,
|
||||
};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_world::inventory::{Clearable, Inventory, InventoryFuture};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
pub struct DoubleInventory {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{collections::HashMap, sync::Arc};
|
||||
|
||||
use pumpkin_data::data_component_impl::EquipmentSlot;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
// EntityEquipment.java
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
use std::{any::Any, pin::Pin, sync::Arc};
|
||||
|
||||
use pumpkin_data::{fuels::is_fuel, screen::WindowType};
|
||||
use pumpkin_data::{fuels::is_fuel, item_stack::ItemStack, screen::WindowType};
|
||||
use pumpkin_world::{
|
||||
block::entities::{PropertyDelegate, furnace_like_block_entity::ExperienceContainer},
|
||||
inventory::Inventory,
|
||||
item::ItemStack,
|
||||
};
|
||||
|
||||
use crate::{
|
||||
|
||||
@@ -57,7 +57,10 @@ impl Slot for FurnaceLikeSlot {
|
||||
})
|
||||
}
|
||||
|
||||
fn can_insert<'a>(&'a self, stack: &'a pumpkin_world::item::ItemStack) -> BoxFuture<'a, bool> {
|
||||
fn can_insert<'a>(
|
||||
&'a self,
|
||||
stack: &'a pumpkin_data::item_stack::ItemStack,
|
||||
) -> BoxFuture<'a, bool> {
|
||||
Box::pin(async move {
|
||||
match self.slot_type {
|
||||
FurnaceLikeSlotType::Top => true,
|
||||
@@ -109,7 +112,10 @@ impl Slot for FurnaceOutputSlot {
|
||||
})
|
||||
}
|
||||
|
||||
fn can_insert<'a>(&'a self, _stack: &'a pumpkin_world::item::ItemStack) -> BoxFuture<'a, bool> {
|
||||
fn can_insert<'a>(
|
||||
&'a self,
|
||||
_stack: &'a pumpkin_data::item_stack::ItemStack,
|
||||
) -> BoxFuture<'a, bool> {
|
||||
// Cannot insert items into the output slot
|
||||
Box::pin(async move { false })
|
||||
}
|
||||
@@ -117,7 +123,7 @@ impl Slot for FurnaceOutputSlot {
|
||||
fn on_take_item<'a>(
|
||||
&'a self,
|
||||
player: &'a dyn InventoryPlayer,
|
||||
_stack: &'a pumpkin_world::item::ItemStack,
|
||||
_stack: &'a pumpkin_data::item_stack::ItemStack,
|
||||
) -> BoxFuture<'a, ()> {
|
||||
Box::pin(async move {
|
||||
debug!("FurnaceOutputSlot: on_take_item called");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{any::Any, sync::Arc};
|
||||
|
||||
use pumpkin_data::screen::WindowType;
|
||||
use pumpkin_world::{inventory::Inventory, item::ItemStack};
|
||||
use pumpkin_data::{item_stack::ItemStack, screen::WindowType};
|
||||
use pumpkin_world::inventory::Inventory;
|
||||
|
||||
use crate::{
|
||||
player::player_inventory::PlayerInventory,
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use std::{any::Any, array::from_fn, pin::Pin, sync::Arc};
|
||||
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_world::{
|
||||
block::viewer::ViewerCountTracker,
|
||||
inventory::{Clearable, Inventory, InventoryFuture, split_stack},
|
||||
item::ItemStack,
|
||||
};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ use crate::entity_equipment::EntityEquipment;
|
||||
use crate::screen_handler::InventoryPlayer;
|
||||
|
||||
use pumpkin_data::data_component_impl::EquipmentSlot;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_protocol::java::client::play::CSetPlayerInventory;
|
||||
use pumpkin_util::Hand;
|
||||
use pumpkin_world::inventory::{Clearable, Inventory};
|
||||
use pumpkin_world::inventory::{InventoryFuture, split_stack};
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use std::any::Any;
|
||||
use std::array::from_fn;
|
||||
use std::collections::HashMap;
|
||||
|
||||
@@ -7,9 +7,9 @@ use crate::screen_handler::{
|
||||
};
|
||||
use crate::slot::{ArmorSlot, NormalSlot, Slot};
|
||||
use pumpkin_data::data_component_impl::{EquipmentSlot, EquipmentType, EquippableImpl};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::screen::WindowType;
|
||||
use pumpkin_world::inventory::Inventory;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use std::any::Any;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ use crate::{
|
||||
slot::{NormalSlot, Slot},
|
||||
sync_handler::{SyncHandler, TrackedStack},
|
||||
};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{
|
||||
data_component_impl::{EquipmentSlot, EquipmentType, EquippableImpl},
|
||||
screen::WindowType,
|
||||
@@ -19,7 +20,6 @@ use pumpkin_protocol::{
|
||||
},
|
||||
};
|
||||
use pumpkin_util::text::TextComponent;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::{
|
||||
block::entities::PropertyDelegate,
|
||||
inventory::{ComparableInventory, Inventory},
|
||||
|
||||
@@ -11,8 +11,8 @@ use crate::screen_handler::InventoryPlayer;
|
||||
|
||||
use pumpkin_data::data_component_impl::EquipmentSlot;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_world::inventory::Inventory;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use tokio::{sync::Mutex, time::timeout};
|
||||
|
||||
pub type BoxFuture<'a, T> = Pin<Box<dyn Future<Output = T> + Send + 'a>>;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_protocol::{
|
||||
codec::{
|
||||
item_stack_seralizer::{ItemStackSerializer, OptionalItemStackHash},
|
||||
@@ -9,7 +10,6 @@ use pumpkin_protocol::{
|
||||
CSetContainerContent, CSetContainerProperty, CSetContainerSlot, CSetCursorItem,
|
||||
},
|
||||
};
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::screen_handler::{InventoryPlayer, ScreenHandlerBehaviour};
|
||||
|
||||
@@ -4,8 +4,8 @@ use crate::ser::{WritingError, serializer};
|
||||
use pumpkin_data::data_component::DataComponent;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_id_remap::{remap_item_id_for_version, remap_item_id_from_version};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::version::MinecraftVersion;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use serde::ser::SerializeStruct;
|
||||
use serde::{
|
||||
Deserialize, Serialize, Serializer,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use pumpkin_data::block_properties::{BarrelLikeProperties, BlockProperties};
|
||||
use pumpkin_data::sound::{Sound, SoundCategory};
|
||||
use pumpkin_data::{Block, FacingExt};
|
||||
use pumpkin_data::{Block, FacingExt, item_stack::ItemStack};
|
||||
use pumpkin_nbt::compound::NbtCompound;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
@@ -19,13 +19,10 @@ use tokio::sync::Mutex;
|
||||
|
||||
use crate::block::viewer::{ViewerCountListener, ViewerCountTracker, ViewerFuture};
|
||||
use crate::inventory::InventoryFuture;
|
||||
use crate::world::{BlockFlags, SimpleWorld};
|
||||
use crate::{
|
||||
inventory::{
|
||||
split_stack, {Clearable, Inventory},
|
||||
},
|
||||
item::ItemStack,
|
||||
use crate::inventory::{
|
||||
split_stack, {Clearable, Inventory},
|
||||
};
|
||||
use crate::world::{BlockFlags, SimpleWorld};
|
||||
|
||||
use super::BlockEntity;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::inventory::Inventory;
|
||||
use pumpkin_data::block_properties::BlockProperties;
|
||||
use pumpkin_data::{block_properties::BlockProperties, item_stack::ItemStack};
|
||||
|
||||
use std::{
|
||||
array::from_fn,
|
||||
@@ -18,7 +18,7 @@ use crate::{
|
||||
block::entities::furnace_like_block_entity::CookingBlockEntityBase,
|
||||
impl_block_entity_for_cooking, impl_clearable_for_cooking, impl_cooking_block_entity_base,
|
||||
impl_experience_container_for_cooking, impl_inventory_for_cooking,
|
||||
impl_property_delegate_for_cooking, item::ItemStack,
|
||||
impl_property_delegate_for_cooking,
|
||||
};
|
||||
|
||||
pub struct BlastingFurnaceBlockEntity {
|
||||
|
||||
@@ -9,10 +9,10 @@ use std::sync::{
|
||||
|
||||
use crate::block::entities::PropertyDelegate;
|
||||
use crate::inventory::Inventory;
|
||||
use crate::item::ItemStack;
|
||||
use pumpkin_data::block_properties::BlockProperties;
|
||||
use pumpkin_data::data_component_impl::DataComponentImpl;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::potion_brewing::{ITEM_RECIPES, POTION_RECIPES};
|
||||
use pumpkin_data::sound::{Sound, SoundCategory};
|
||||
use pumpkin_data::tag::Taggable;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::sync::{Arc, atomic::AtomicBool};
|
||||
|
||||
use pumpkin_data::block_properties::BlockProperties;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
|
||||
use tokio::sync::Mutex;
|
||||
@@ -8,7 +9,6 @@ use tokio::sync::Mutex;
|
||||
use crate::{
|
||||
block::viewer::ViewerCountTracker, impl_block_entity_for_chest, impl_chest_helper_methods,
|
||||
impl_clearable_for_chest, impl_inventory_for_chest, impl_viewer_count_listener_for_chest,
|
||||
item::ItemStack,
|
||||
};
|
||||
|
||||
pub struct ChestBlockEntity {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
use pumpkin_data::Block;
|
||||
use pumpkin_data::block_properties::{BlockProperties, ChiseledBookshelfLikeProperties};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_nbt::compound::NbtCompound;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use std::any::Any;
|
||||
@@ -18,7 +19,6 @@ use crate::inventory::InventoryFuture;
|
||||
use crate::{
|
||||
block::entities::BlockEntity,
|
||||
inventory::{Clearable, Inventory, split_stack},
|
||||
item::ItemStack,
|
||||
world::{BlockFlags, SimpleWorld},
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::block::entities::BlockEntity;
|
||||
use crate::inventory::{Clearable, Inventory, InventoryFuture, split_stack};
|
||||
use crate::item::ItemStack;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_nbt::compound::NbtCompound;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use rand::{RngExt, rng};
|
||||
|
||||
@@ -10,7 +10,7 @@ use std::{
|
||||
},
|
||||
};
|
||||
|
||||
use pumpkin_data::recipes::CookingRecipeKind;
|
||||
use pumpkin_data::{item_stack::ItemStack, recipes::CookingRecipeKind};
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
@@ -18,7 +18,7 @@ use crate::{
|
||||
block::entities::furnace_like_block_entity::CookingBlockEntityBase,
|
||||
impl_block_entity_for_cooking, impl_clearable_for_cooking, impl_cooking_block_entity_base,
|
||||
impl_experience_container_for_cooking, impl_inventory_for_cooking,
|
||||
impl_property_delegate_for_cooking, item::ItemStack,
|
||||
impl_property_delegate_for_cooking,
|
||||
};
|
||||
|
||||
pub struct FurnaceBlockEntity {
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use pumpkin_data::recipes::CookingRecipe;
|
||||
use pumpkin_data::{item_stack::ItemStack, recipes::CookingRecipe};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::{
|
||||
block::entities::{BlockEntity, PropertyDelegate},
|
||||
inventory::{Clearable, Inventory},
|
||||
item::ItemStack,
|
||||
};
|
||||
|
||||
/// Trait for extracting smelting experience from cooking block entities.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use crate::BlockStateId;
|
||||
use crate::block::entities::BlockEntity;
|
||||
use crate::inventory::{Clearable, Inventory, InventoryFuture, split_stack};
|
||||
use crate::item::ItemStack;
|
||||
use crate::world::SimpleWorld;
|
||||
use pumpkin_data::block_properties::{BlockProperties, FacingHopper, HopperLikeProperties};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::tag::Taggable;
|
||||
use pumpkin_data::{Block, tag};
|
||||
use pumpkin_nbt::compound::NbtCompound;
|
||||
|
||||
@@ -4,13 +4,14 @@ use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, AtomicU64, Ordering};
|
||||
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_nbt::compound::NbtCompound;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::block::entities::BlockEntity;
|
||||
use crate::inventory::{Clearable, Inventory, InventoryFuture};
|
||||
use crate::world::SimpleWorld;
|
||||
use crate::{block::entities::BlockEntity, item::ItemStack};
|
||||
|
||||
/// Matches vanilla's `JukeboxBlockEntity`
|
||||
pub struct JukeboxBlockEntity {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::sound::{Sound, SoundCategory};
|
||||
use pumpkin_nbt::compound::NbtCompound;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
@@ -14,13 +15,10 @@ use tokio::sync::Mutex;
|
||||
|
||||
use crate::block::viewer::{ViewerCountListener, ViewerCountTracker, ViewerFuture};
|
||||
use crate::inventory::InventoryFuture;
|
||||
use crate::world::SimpleWorld;
|
||||
use crate::{
|
||||
inventory::{
|
||||
split_stack, {Clearable, Inventory},
|
||||
},
|
||||
item::ItemStack,
|
||||
use crate::inventory::{
|
||||
split_stack, {Clearable, Inventory},
|
||||
};
|
||||
use crate::world::SimpleWorld;
|
||||
|
||||
use super::BlockEntity;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::inventory::Inventory;
|
||||
use pumpkin_data::block_properties::BlockProperties;
|
||||
use pumpkin_data::{block_properties::BlockProperties, item_stack::ItemStack};
|
||||
|
||||
use std::{
|
||||
array::from_fn,
|
||||
@@ -18,7 +18,7 @@ use crate::{
|
||||
block::entities::furnace_like_block_entity::CookingBlockEntityBase,
|
||||
impl_block_entity_for_cooking, impl_clearable_for_cooking, impl_cooking_block_entity_base,
|
||||
impl_experience_container_for_cooking, impl_inventory_for_cooking,
|
||||
impl_property_delegate_for_cooking, item::ItemStack,
|
||||
impl_property_delegate_for_cooking,
|
||||
};
|
||||
|
||||
pub struct SmokerBlockEntity {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use std::sync::{Arc, atomic::AtomicBool};
|
||||
|
||||
use pumpkin_data::block_properties::BlockProperties;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
|
||||
use tokio::sync::Mutex;
|
||||
@@ -8,7 +9,6 @@ use tokio::sync::Mutex;
|
||||
use crate::{
|
||||
block::viewer::ViewerCountTracker, impl_block_entity_for_chest, impl_chest_helper_methods,
|
||||
impl_clearable_for_chest, impl_inventory_for_chest, impl_viewer_count_listener_for_chest,
|
||||
item::ItemStack,
|
||||
};
|
||||
|
||||
pub struct TrappedChestBlockEntity {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::item::ItemStack;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_nbt::{compound::NbtCompound, tag::NbtTag};
|
||||
use std::any::Any;
|
||||
use std::pin::Pin;
|
||||
|
||||
@@ -2,7 +2,7 @@ use std::sync::Arc;
|
||||
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::item::ItemStack;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
|
||||
#[expect(clippy::module_inception)]
|
||||
mod inventory;
|
||||
|
||||
@@ -12,7 +12,6 @@ pub mod data;
|
||||
pub mod dimension;
|
||||
pub mod generation;
|
||||
pub mod inventory;
|
||||
pub mod item;
|
||||
pub mod level;
|
||||
pub mod lighting;
|
||||
pub mod lock;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use pumpkin_data::{Block, item::Item};
|
||||
use pumpkin_data::{Block, item::Item, item_stack::ItemStack};
|
||||
use pumpkin_macros::pumpkin_block_from_tag;
|
||||
use pumpkin_util::{GameMode, math::position::BlockPos};
|
||||
use pumpkin_world::{
|
||||
BlockStateId,
|
||||
item::ItemStack,
|
||||
tick::TickPriority,
|
||||
world::{BlockAccessor, BlockFlags},
|
||||
};
|
||||
|
||||
@@ -13,6 +13,7 @@ use crate::{
|
||||
use pumpkin_data::{
|
||||
block_properties::{BlockProperties, ChiseledBookshelfLikeProperties, HorizontalFacing},
|
||||
item::Item,
|
||||
item_stack::ItemStack,
|
||||
sound::{Sound, SoundCategory},
|
||||
tag,
|
||||
tag::Taggable,
|
||||
@@ -21,7 +22,7 @@ use pumpkin_inventory::screen_handler::InventoryPlayer;
|
||||
use pumpkin_util::math::{position::BlockPos, vector2::Vector2};
|
||||
use pumpkin_world::{
|
||||
BlockStateId, block::entities::chiseled_bookshelf::ChiseledBookshelfBlockEntity,
|
||||
inventory::Inventory, item::ItemStack,
|
||||
inventory::Inventory,
|
||||
};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
|
||||
@@ -14,12 +14,13 @@ use pumpkin_data::{
|
||||
composter_increase_chance::get_composter_increase_chance_from_item_id,
|
||||
entity::EntityType,
|
||||
item::Item,
|
||||
item_stack::ItemStack,
|
||||
world::WorldEvent,
|
||||
};
|
||||
use pumpkin_inventory::screen_handler::InventoryPlayer;
|
||||
use pumpkin_macros::pumpkin_block;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_world::{BlockStateId, item::ItemStack, tick::TickPriority, world::BlockFlags};
|
||||
use pumpkin_world::{BlockStateId, tick::TickPriority, world::BlockFlags};
|
||||
use rand::RngExt;
|
||||
|
||||
#[pumpkin_block("minecraft:composter")]
|
||||
|
||||
@@ -15,6 +15,7 @@ use pumpkin_data::{
|
||||
damage::DamageType,
|
||||
entity::EntityType,
|
||||
item::Item,
|
||||
item_stack::ItemStack,
|
||||
tag::{self, Taggable},
|
||||
};
|
||||
use pumpkin_macros::pumpkin_block;
|
||||
@@ -22,7 +23,6 @@ use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::{
|
||||
BlockStateId,
|
||||
item::ItemStack,
|
||||
world::{BlockAccessor, BlockFlags},
|
||||
};
|
||||
use rand::RngExt;
|
||||
|
||||
@@ -6,8 +6,8 @@ use pumpkin_data::Block;
|
||||
use pumpkin_data::block_properties::{BlockProperties, WallTorchLikeProperties};
|
||||
use pumpkin_data::entity::EntityType;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_macros::pumpkin_block;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -21,10 +21,10 @@ use crate::block::registry::BlockActionResult;
|
||||
use crate::entity::EntityBase;
|
||||
use crate::server::Server;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_protocol::java::server::play::SUseItemOn;
|
||||
use pumpkin_util::math::boundingbox::BoundingBox;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::{BlockAccessor, BlockFlags};
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
|
||||
@@ -126,12 +126,12 @@ use crate::server::Server;
|
||||
use crate::world::World;
|
||||
use pumpkin_data::fluid::Fluid;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{Block, BlockDirection, BlockState};
|
||||
use pumpkin_protocol::java::server::play::SUseItemOn;
|
||||
use pumpkin_util::math::boundingbox::BoundingBox;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_world::BlockStateId;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::{BlockAccessor, BlockFlags, BlockRegistryExt};
|
||||
use rustc_hash::FxHashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{
|
||||
item::Item,
|
||||
tag::{RegistryKey, get_tag_ids},
|
||||
};
|
||||
use pumpkin_protocol::java::client::play::{ArgumentType, SuggestionProviders};
|
||||
use pumpkin_util::text::TextComponent;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
use crate::command::{
|
||||
CommandSender,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::translation;
|
||||
use pumpkin_util::text::TextComponent;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use crate::command::args::bounded_num::BoundedNumArgumentConsumer;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use pumpkin_data::data_component::DataComponent::MaxStackSize;
|
||||
use pumpkin_data::data_component_impl::{MaxStackSizeImpl, get};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::text::TextComponent;
|
||||
use pumpkin_util::text::hover::HoverEvent;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
use crate::command::args::bounded_num::{BoundedNumArgumentConsumer, NotInBounds};
|
||||
use crate::command::args::players::PlayersArgumentConsumer;
|
||||
|
||||
@@ -27,7 +27,7 @@ impl TemptGoal {
|
||||
}
|
||||
}
|
||||
|
||||
fn is_tempt_item(&self, stack: &pumpkin_world::item::ItemStack) -> bool {
|
||||
fn is_tempt_item(&self, stack: &pumpkin_data::item_stack::ItemStack) -> bool {
|
||||
stack.item_count > 0 && self.tempt_items.iter().any(|i| i.id == stack.item.id)
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ use pumpkin_util::math::boundingbox::BoundingBox;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
|
||||
type EffectEntry = (&'static StatusEffect, i32, u8, bool, bool, bool);
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
/// The effect cloud entity that is spawned where a lingering potion lands.
|
||||
|
||||
@@ -4,6 +4,7 @@ use crate::entity::{
|
||||
Entity, EntityBase, EntityBaseFuture, NBTStorage, NbtFuture, living::LivingEntity,
|
||||
};
|
||||
use crossbeam::atomic::AtomicCell;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{
|
||||
damage::DamageType,
|
||||
data_component_impl::{EquipmentSlot, EquipmentType},
|
||||
@@ -14,7 +15,6 @@ use pumpkin_data::{
|
||||
};
|
||||
use pumpkin_nbt::{compound::NbtCompound, tag::NbtTag};
|
||||
use pumpkin_util::math::{euler_angle::EulerAngle, vector3::Vector3};
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub struct PackedRotation {
|
||||
|
||||
@@ -2,6 +2,7 @@ use crate::{entity::EntityBaseFuture, server::Server};
|
||||
use core::f32;
|
||||
use pumpkin_data::data_component_impl::DamageResistantImpl;
|
||||
use pumpkin_data::data_component_impl::DamageResistantType;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{damage::DamageType, meta_data_type::MetaDataType, tracked_data::TrackedData};
|
||||
use pumpkin_protocol::{
|
||||
codec::item_stack_seralizer::ItemStackSerializer,
|
||||
@@ -9,7 +10,6 @@ use pumpkin_protocol::{
|
||||
};
|
||||
use pumpkin_util::math::atomic_f32::AtomicF32;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use std::sync::atomic::Ordering::{AcqRel, Relaxed};
|
||||
|
||||
use std::sync::{
|
||||
|
||||
@@ -37,6 +37,7 @@ use pumpkin_data::data_component_impl::{
|
||||
};
|
||||
use pumpkin_data::effect::StatusEffect;
|
||||
use pumpkin_data::entity::{EntityPose, EntityStatus, EntityType};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::sound::SoundCategory;
|
||||
use pumpkin_data::{Block, translation};
|
||||
use pumpkin_data::{damage::DamageType, sound::Sound};
|
||||
@@ -54,7 +55,6 @@ use pumpkin_protocol::{
|
||||
};
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_util::text::TextComponent;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use rand::RngExt;
|
||||
use std::sync::RwLock;
|
||||
use tokio::sync::Mutex;
|
||||
@@ -1531,7 +1531,7 @@ impl LivingEntity {
|
||||
let (slot_result, updated_stack_opt) = {
|
||||
let mut stack = equipment.lock().await;
|
||||
if stack.is_empty() {
|
||||
(pumpkin_world::item::DamageResult::Untouched, None)
|
||||
(pumpkin_data::item_stack::DamageResult::Untouched, None)
|
||||
} else {
|
||||
// Items without `EquippableImpl` component take damage freely.
|
||||
// Items with `damage_on_hurt: false` (e.g. elytra) are exempt from armor hit durability.
|
||||
@@ -1544,18 +1544,18 @@ impl LivingEntity {
|
||||
if takes_damage {
|
||||
// Base armor durability damage.
|
||||
let result = stack.damage_item(armor_damage);
|
||||
let changed = result != pumpkin_world::item::DamageResult::Untouched;
|
||||
let changed = result != pumpkin_data::item_stack::DamageResult::Untouched;
|
||||
(result, changed.then_some(stack.clone()))
|
||||
} else {
|
||||
// Equippable items can opt out of on-hurt durability loss (e.g. elytra).
|
||||
(pumpkin_world::item::DamageResult::Untouched, None)
|
||||
(pumpkin_data::item_stack::DamageResult::Untouched, None)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if let Some(updated_stack) = updated_stack_opt {
|
||||
// Broadcast break status before clearing the slot.
|
||||
if slot_result == pumpkin_world::item::DamageResult::Broken {
|
||||
if slot_result == pumpkin_data::item_stack::DamageResult::Broken {
|
||||
let world = self.entity.world.load();
|
||||
world
|
||||
.send_entity_status(&self.entity, super::equipment_break_status(slot))
|
||||
|
||||
@@ -5,6 +5,7 @@ use std::sync::{
|
||||
|
||||
use crate::entity::attributes::AttributeBuilder;
|
||||
use pumpkin_data::attributes::Attributes;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{
|
||||
entity::EntityType,
|
||||
item::Item,
|
||||
@@ -14,7 +15,6 @@ use pumpkin_data::{
|
||||
};
|
||||
use pumpkin_nbt::compound::NbtCompound;
|
||||
use pumpkin_protocol::{codec::var_int::VarInt, java::client::play::Metadata};
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
use crate::entity::{
|
||||
Entity, EntityBase, EntityBaseFuture, NBTStorage, NbtFuture,
|
||||
|
||||
@@ -9,6 +9,7 @@ use crossbeam::atomic::AtomicCell;
|
||||
use pumpkin_data::attributes::Attributes;
|
||||
use pumpkin_data::damage::DamageType;
|
||||
use pumpkin_data::data_component_impl::EquipmentSlot;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::meta_data_type::MetaDataType;
|
||||
use pumpkin_data::tracked_data::TrackedData;
|
||||
use pumpkin_protocol::java::client::play::{CHeadRot, CUpdateEntityRot, Metadata};
|
||||
@@ -16,7 +17,6 @@ use pumpkin_util::math::boundingbox::BoundingBox;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector2::Vector2;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use rand::RngExt;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -19,6 +19,7 @@ use pumpkin_data::data_component_impl::EquipmentSlot;
|
||||
use pumpkin_data::dimension::Dimension;
|
||||
use pumpkin_data::entity::EntityStatus;
|
||||
use pumpkin_data::fluid::Fluid;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::meta_data_type::MetaDataType;
|
||||
use pumpkin_data::tag::{self, Taggable};
|
||||
use pumpkin_data::tracked_data::TrackedData;
|
||||
@@ -50,7 +51,6 @@ use pumpkin_util::math::{
|
||||
};
|
||||
use pumpkin_util::text::TextComponent;
|
||||
use pumpkin_util::text::hover::HoverEvent;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use serde::Serialize;
|
||||
use std::collections::BTreeMap;
|
||||
use std::pin::Pin;
|
||||
|
||||
@@ -5,8 +5,8 @@ use std::sync::{
|
||||
|
||||
use crate::entity::attributes::AttributeBuilder;
|
||||
use pumpkin_data::attributes::Attributes;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{entity::EntityType, item::Item};
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use rand::RngExt;
|
||||
|
||||
use crate::entity::{
|
||||
|
||||
@@ -36,6 +36,7 @@ use pumpkin_data::data_component_impl::{AttributeModifiersImpl, Operation};
|
||||
use pumpkin_data::data_component_impl::{EquipmentSlot, EquippableImpl, ToolImpl, WeaponImpl};
|
||||
use pumpkin_data::effect::StatusEffect;
|
||||
use pumpkin_data::entity::{EntityPose, EntityStatus, EntityType};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::particle::Particle;
|
||||
use pumpkin_data::sound::{Sound, SoundCategory};
|
||||
use pumpkin_data::tag::Taggable;
|
||||
@@ -76,7 +77,6 @@ use pumpkin_util::text::hover::HoverEvent;
|
||||
use pumpkin_util::{GameMode, Hand};
|
||||
use pumpkin_world::biome;
|
||||
use pumpkin_world::cylindrical_chunk_iterator::Cylindrical;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::level::{Level, SyncChunk, SyncEntityChunk};
|
||||
|
||||
use crate::block;
|
||||
@@ -846,14 +846,14 @@ impl Player {
|
||||
let updated = {
|
||||
let mut stack = stack_arc.lock().await;
|
||||
let result = stack.damage_item(amount);
|
||||
(result != pumpkin_world::item::DamageResult::Untouched)
|
||||
(result != pumpkin_data::item_stack::DamageResult::Untouched)
|
||||
.then_some((result, stack.clone()))
|
||||
};
|
||||
|
||||
if let Some((result, updated_stack)) = updated {
|
||||
// Send the break status before clearing the slot so the client can
|
||||
// use the item texture for break particles.
|
||||
if result == pumpkin_world::item::DamageResult::Broken {
|
||||
if result == pumpkin_data::item_stack::DamageResult::Broken {
|
||||
self.world()
|
||||
.send_entity_status(
|
||||
&self.living_entity.entity,
|
||||
|
||||
@@ -11,12 +11,12 @@ use crate::{
|
||||
};
|
||||
use pumpkin_data::entity::{EntityStatus, EntityType};
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::meta_data_type::MetaDataType;
|
||||
use pumpkin_data::tracked_data::TrackedData;
|
||||
use pumpkin_protocol::codec::item_stack_seralizer::ItemStackSerializer;
|
||||
use pumpkin_protocol::java::client::play::Metadata;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use tokio::sync::RwLock;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ use crate::{
|
||||
server::Server,
|
||||
};
|
||||
use pumpkin_data::entity::EntityStatus;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_protocol::java::client::play::CWorldEvent;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use tokio::sync::RwLock;
|
||||
use uuid::Uuid;
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ use crate::{
|
||||
server::Server,
|
||||
};
|
||||
use pumpkin_data::Block;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_protocol::java::client::play::CWorldEvent;
|
||||
use pumpkin_util::math::boundingbox::BoundingBox;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
use tokio::sync::RwLock;
|
||||
|
||||
|
||||
@@ -8,13 +8,13 @@ use crate::entity::{Entity, EntityBase, EntityBaseFuture, NBTStorage, living::Li
|
||||
use crate::server::Server;
|
||||
use crate::world::loot::{LootContextParameters, LootTableExt};
|
||||
use pumpkin_data::damage::DamageType;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::meta_data_type::MetaDataType;
|
||||
use pumpkin_data::tracked_data::TrackedData;
|
||||
use pumpkin_protocol::codec::var_int::VarInt;
|
||||
use pumpkin_protocol::java::client::play::Metadata;
|
||||
use pumpkin_util::GameMode;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
pub struct BoatEntity {
|
||||
entity: Entity,
|
||||
|
||||
@@ -8,13 +8,13 @@ use crate::item::{ItemBehaviour, ItemMetadata};
|
||||
use crate::server::Server;
|
||||
use pumpkin_data::entity::EntityType;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::sound::{Sound, SoundCategory};
|
||||
use pumpkin_data::{Block, BlockDirection};
|
||||
use pumpkin_util::math::boundingbox::BoundingBox;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_util::math::wrap_degrees;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
pub struct ArmorStandItem;
|
||||
|
||||
|
||||
@@ -6,12 +6,12 @@ use crate::server::Server;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::block_properties::BlockProperties;
|
||||
use pumpkin_data::block_properties::{OakDoorLikeProperties, PaleOakWoodLikeProperties};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::tag::Taggable;
|
||||
use pumpkin_data::{Block, tag};
|
||||
use pumpkin_util::GameMode;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
|
||||
pub struct AxeItem;
|
||||
|
||||
@@ -9,13 +9,14 @@ use pumpkin_data::{
|
||||
dimension::Dimension,
|
||||
fluid::Fluid,
|
||||
item::Item,
|
||||
item_stack::ItemStack,
|
||||
sound::{Sound, SoundCategory},
|
||||
};
|
||||
use pumpkin_util::{
|
||||
GameMode,
|
||||
math::{position::BlockPos, vector3::Vector3},
|
||||
};
|
||||
use pumpkin_world::{inventory::Inventory, item::ItemStack, tick::TickPriority, world::BlockFlags};
|
||||
use pumpkin_world::{inventory::Inventory, tick::TickPriority, world::BlockFlags};
|
||||
|
||||
use crate::world::World;
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ use crate::entity::projectile::egg::EggEntity;
|
||||
use crate::item::{ItemBehaviour, ItemMetadata};
|
||||
use pumpkin_data::entity::EntityType;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::sound::Sound;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
pub struct EggItem;
|
||||
|
||||
|
||||
@@ -8,10 +8,10 @@ use crate::item::{ItemBehaviour, ItemMetadata};
|
||||
use crate::server::Server;
|
||||
use pumpkin_data::entity::EntityType;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{Block, BlockDirection};
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
pub struct EndCrystalItem;
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
|
||||
use crate::{server::Server, world::portal::end::EndPortal};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{Block, BlockDirection, item::Item};
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
|
||||
use crate::item::{ItemBehaviour, ItemMetadata};
|
||||
|
||||
@@ -11,9 +11,9 @@ use pumpkin_data::Block;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::entity::EntityType;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
pub struct FireworkRocketItem;
|
||||
|
||||
|
||||
@@ -6,11 +6,11 @@ use crate::server::Server;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::entity::EntityType;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{Block, tag};
|
||||
use pumpkin_util::GameMode;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -11,6 +11,7 @@ use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::block_properties::BlockProperties;
|
||||
use pumpkin_data::block_properties::OakDoorLikeProperties;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::tag::Taggable;
|
||||
use pumpkin_data::world::WorldEvent;
|
||||
use pumpkin_data::{Block, tag};
|
||||
@@ -18,7 +19,6 @@ use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::block::entities::BlockEntity;
|
||||
use pumpkin_world::block::entities::sign::SignBlockEntity;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
|
||||
pub struct HoneyCombItem;
|
||||
|
||||
@@ -4,11 +4,11 @@ use std::sync::Arc;
|
||||
use pumpkin_data::Block;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::sound::Sound;
|
||||
use pumpkin_data::sound::SoundCategory;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
|
||||
use crate::entity::player::Player;
|
||||
|
||||
@@ -6,9 +6,9 @@ use crate::world::World;
|
||||
use pumpkin_data::Block;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -11,11 +11,11 @@ use pumpkin_data::block_properties::{
|
||||
};
|
||||
use pumpkin_data::entity::EntityType;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::tag::Taggable;
|
||||
use pumpkin_data::{Block, tag};
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
pub struct MinecartItem;
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ use crate::entity::player::Player;
|
||||
use crate::item::{ItemBehaviour, ItemMetadata};
|
||||
use pumpkin_data::data_component_impl::CustomNameImpl;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::text::TextComponent;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
pub struct NameTagItem;
|
||||
|
||||
|
||||
@@ -5,13 +5,13 @@ use crate::item::{ItemBehaviour, ItemMetadata};
|
||||
use crate::server::Server;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::block_properties::{BlockProperties, CampfireLikeProperties};
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::sound::{Sound, SoundCategory};
|
||||
use pumpkin_data::world::WorldEvent;
|
||||
use pumpkin_data::{Block, tag};
|
||||
use pumpkin_util::GameMode;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
use rand::{RngExt, rng};
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ use crate::entity::r#type::from_type;
|
||||
use crate::item::{ItemBehaviour, ItemMetadata};
|
||||
use crate::server::Server;
|
||||
use pumpkin_data::entity::entity_from_egg;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{Block, BlockDirection};
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_util::math::wrap_degrees;
|
||||
use pumpkin_world::block::entities::mob_spawner::MobSpawnerBlockEntity;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use uuid::Uuid;
|
||||
|
||||
pub struct SpawnEggItem;
|
||||
|
||||
@@ -12,9 +12,9 @@ use crate::server::Server;
|
||||
use pumpkin_data::Block;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
|
||||
pub trait ItemMetadata {
|
||||
fn ids() -> Box<[u16]>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::entity::EntityBase;
|
||||
use crate::entity::living::LivingEntity;
|
||||
use pumpkin_data::effect::StatusEffect;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
|
||||
/// Utilities for reading potion contents from an `ItemStack` and applying effects.
|
||||
pub struct PotionContents;
|
||||
|
||||
@@ -4,9 +4,9 @@ use crate::server::Server;
|
||||
use pumpkin_data::Block;
|
||||
use pumpkin_data::BlockDirection;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_util::math::vector3::Vector3;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use rustc_hash::FxHashMap;
|
||||
use std::sync::Arc;
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ use pumpkin_data::block_properties::{
|
||||
use pumpkin_data::data_component_impl::{ConsumableImpl, EquipmentSlot, EquippableImpl, FoodImpl};
|
||||
use pumpkin_data::entity::EntityType;
|
||||
use pumpkin_data::item::Item;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::sound::{Sound, SoundCategory};
|
||||
use pumpkin_data::{Block, BlockDirection, BlockState, translation};
|
||||
use pumpkin_inventory::InventoryError;
|
||||
@@ -66,7 +67,6 @@ use pumpkin_util::text::color::NamedColor;
|
||||
use pumpkin_util::{GameMode, text::TextComponent};
|
||||
use pumpkin_world::block::entities::command_block::CommandBlockEntity;
|
||||
use pumpkin_world::block::entities::sign::SignBlockEntity;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use pumpkin_world::world::BlockFlags;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ use std::sync::Arc;
|
||||
|
||||
use crate::entity::player::Player;
|
||||
use pumpkin_data::Block;
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_macros::{Event, cancellable};
|
||||
use pumpkin_util::math::position::BlockPos;
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use tokio::sync::Mutex;
|
||||
|
||||
use super::PlayerEvent;
|
||||
|
||||
@@ -52,7 +52,7 @@ fn world_from_resource(
|
||||
}
|
||||
|
||||
fn to_wit_item_stack(
|
||||
stack: &pumpkin_world::item::ItemStack,
|
||||
stack: &pumpkin_data::item_stack::ItemStack,
|
||||
) -> Option<pumpkin::plugin::common::ItemStack> {
|
||||
if stack.item_count == 0 {
|
||||
return None;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use pumpkin_data::item_stack::ItemStack;
|
||||
use pumpkin_data::{Block, BlockState, item::Item};
|
||||
use pumpkin_util::{
|
||||
loot_table::{
|
||||
@@ -6,7 +7,6 @@ use pumpkin_util::{
|
||||
},
|
||||
random::{RandomGenerator, RandomImpl, get_seed, xoroshiro128::Xoroshiro},
|
||||
};
|
||||
use pumpkin_world::item::ItemStack;
|
||||
use rand::RngExt;
|
||||
|
||||
#[derive(Default)]
|
||||
|
||||
@@ -53,6 +53,7 @@ use pumpkin_data::{
|
||||
Block,
|
||||
entity::{EntityStatus, EntityType},
|
||||
fluid::Fluid,
|
||||
item_stack::ItemStack,
|
||||
particle::Particle,
|
||||
sound::{Sound, SoundCategory},
|
||||
world::{RAW, WorldEvent},
|
||||
@@ -121,7 +122,7 @@ use pumpkin_world::inventory::Clearable;
|
||||
use pumpkin_world::world::{GetBlockError, WorldFuture};
|
||||
use pumpkin_world::{
|
||||
BlockStateId, CURRENT_BEDROCK_MC_VERSION, biome, block::entities::BlockEntity,
|
||||
chunk::io::Dirtiable, inventory::Inventory, item::ItemStack, world::SimpleWorld,
|
||||
chunk::io::Dirtiable, inventory::Inventory, world::SimpleWorld,
|
||||
};
|
||||
use pumpkin_world::{chunk::ChunkData, world::BlockAccessor};
|
||||
use pumpkin_world::{level::Level, tick::TickPriority};
|
||||
|
||||
Reference in New Issue
Block a user