mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
fix: conduit being waterlogged all the time (#1808)
This commit is contained in:
19
pumpkin/src/block/blocks/conduit.rs
Normal file
19
pumpkin/src/block/blocks/conduit.rs
Normal file
@@ -0,0 +1,19 @@
|
||||
use crate::block::{BlockBehaviour, BlockFuture, OnPlaceArgs};
|
||||
use pumpkin_data::block_properties::BlockProperties;
|
||||
use pumpkin_macros::pumpkin_block;
|
||||
use pumpkin_world::BlockStateId;
|
||||
|
||||
#[pumpkin_block("minecraft:conduit")]
|
||||
pub struct ConduitBlock;
|
||||
|
||||
impl BlockBehaviour for ConduitBlock {
|
||||
fn on_place<'a>(&'a self, args: OnPlaceArgs<'a>) -> BlockFuture<'a, BlockStateId> {
|
||||
Box::pin(async move {
|
||||
let mut props =
|
||||
pumpkin_data::block_properties::MangroveRootsLikeProperties::default(args.block);
|
||||
props.r#waterlogged = args.replacing.water_source();
|
||||
|
||||
props.to_state_id(args.block)
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ pub mod chiseled_bookshelf;
|
||||
pub mod cobweb;
|
||||
pub mod command;
|
||||
pub mod composter;
|
||||
pub mod conduit;
|
||||
pub mod crafting_table;
|
||||
pub mod dirt_path;
|
||||
pub mod doors;
|
||||
|
||||
@@ -14,6 +14,7 @@ use crate::block::blocks::chests::{ChestBlock, CopperChestBlock, TrappedChestBlo
|
||||
use crate::block::blocks::chiseled_bookshelf::ChiseledBookshelfBlock;
|
||||
use crate::block::blocks::command::CommandBlock;
|
||||
use crate::block::blocks::composter::ComposterBlock;
|
||||
use crate::block::blocks::conduit::ConduitBlock;
|
||||
use crate::block::blocks::dirt_path::DirtPathBlock;
|
||||
use crate::block::blocks::doors::DoorBlock;
|
||||
use crate::block::blocks::end_portal::EndPortalBlock;
|
||||
@@ -261,6 +262,7 @@ pub fn default_registry() -> Arc<BlockRegistry> {
|
||||
manager.register(FungusBlock);
|
||||
manager.register(NetherSproutsBlock);
|
||||
manager.register(SporeBlossomBlock);
|
||||
manager.register(ConduitBlock);
|
||||
|
||||
manager.register(FallingBlock);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user