From e154b394af84a519c95fc6e38ed9e19149ebb9a9 Mon Sep 17 00:00:00 2001 From: unschlagbar <153451111+unschlagbar@users.noreply.github.com> Date: Wed, 15 Oct 2025 09:52:30 +0200 Subject: [PATCH] update to bedrock 1.21.111 (#1193) --- assets/bedrock_block_states.nbt | Bin 2091687 -> 2156052 bytes pumpkin-data/build/enchantments.rs | 2 +- pumpkin-data/build/tag.rs | 2 +- .../src/crafting/crafting_screen_handler.rs | 2 +- pumpkin-world/src/block/entities/hopper.rs | 4 +--- pumpkin-world/src/chunk/mod.rs | 2 +- .../src/generation/feature/features/bamboo.rs | 5 +---- .../generation/feature/features/coral/mod.rs | 2 +- .../feature/features/drip_stone/mod.rs | 4 ++-- .../features/nether_forest_vegetation.rs | 5 +---- .../generation/feature/features/tree/mod.rs | 6 +++--- .../feature/features/tree/trunk/mod.rs | 2 +- pumpkin-world/src/generation/proto_chunk.rs | 2 +- pumpkin-world/src/item/categories.rs | 18 ++++++------------ pumpkin-world/src/item/mod.rs | 4 ++-- pumpkin-world/src/lib.rs | 2 +- pumpkin/src/block/blocks/bamboo.rs | 2 +- pumpkin/src/block/blocks/cactus.rs | 2 +- .../src/block/blocks/chiseled_bookshelf.rs | 2 +- pumpkin/src/block/blocks/doors.rs | 8 ++++---- pumpkin/src/block/blocks/falling.rs | 2 +- pumpkin/src/block/blocks/farmland.rs | 2 +- pumpkin/src/block/blocks/fence_gates.rs | 4 ++-- pumpkin/src/block/blocks/fences.rs | 4 ++-- pumpkin/src/block/blocks/fire/mod.rs | 2 +- pumpkin/src/block/blocks/fire/soul_fire.rs | 2 +- pumpkin/src/block/blocks/glass_panes.rs | 4 ++-- pumpkin/src/block/blocks/iron_bars.rs | 4 ++-- pumpkin/src/block/blocks/lanterns.rs | 4 ++-- .../block/blocks/plant/crop/gourds/stem.rs | 2 +- .../src/block/blocks/plant/dry_vegetation.rs | 2 +- pumpkin/src/block/blocks/plant/flowerbed.rs | 3 +-- pumpkin/src/block/blocks/plant/mod.rs | 2 +- .../src/block/blocks/plant/mushroom_plant.rs | 2 +- pumpkin/src/block/blocks/plant/roots.rs | 4 ++-- pumpkin/src/block/blocks/plant/sea_pickles.rs | 4 ++-- .../src/block/blocks/redstone/rails/mod.rs | 6 +++--- pumpkin/src/block/blocks/stairs.rs | 2 +- pumpkin/src/block/blocks/sugar_cane.rs | 4 ++-- pumpkin/src/block/blocks/trapdoor.rs | 4 ++-- pumpkin/src/block/blocks/walls.rs | 18 +++++++++--------- pumpkin/src/entity/player.rs | 2 +- pumpkin/src/item/items/axe.rs | 4 ++-- pumpkin/src/item/items/honeycomb.rs | 4 ++-- pumpkin/src/item/items/minecart.rs | 2 +- pumpkin/src/world/natural_spawner.rs | 14 ++++---------- pumpkin/src/world/portal/nether.rs | 2 +- 47 files changed, 82 insertions(+), 103 deletions(-) diff --git a/assets/bedrock_block_states.nbt b/assets/bedrock_block_states.nbt index 46350120065d81d42ac20714e510defa4899411a..53ba0264b1e99958596d4491a93bda8a9064c172 100644 GIT binary patch delta 24600 zcmbW9du$xV9mnfu&fZ=7&W`Q#Be4_5I4FTQi9&c|DnkivsT+t8O-k$p=RpX*IzdT< z0H;6=w4_#C@*_}!BPytPv<^|T1*xqGs8wkmhN@7hARGx*qN3DQL8{UQIy-x7->$#E z`FZvwGFxnmO@IbOM#w!Kj6 z%>GhAMW%OGPhZb%e%1P&douLRHC44kP5E}|%#kzQ)p3!lx7Nf(QcqN{NLgiE6-<~+ zFkuqG1oD{o`?5uJGS-|32r>~6q#__D7i^EdUO^|AFqvS&B!UU#p^lT*q4t(ydhYpJ zC(idvppcK;7jlv*qu1t(O8*ZpmNI&=l+lZ&kk?@+y_mkgvecgWc}+l&k$@l_0WrDE ze13vXFkv#mgh>Pwo(HwBvh1VJzS5DRk+3;TR-VZ*}7h}}6syaoPSMpO+mt@gc)24!EN?uo8?5cKWTh*0W zzC}+Sb4uujt%+93D{#&W#}?Awwbd=*SZiJ(j26Ra0!B+wlwMn1HNF2^VgDei`Ug?f zKZv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V()^Hy+DG|uKZ4KOM9AODW@K;hZbXik5lV0HI(A&G;2+#v-lRYxcSZ$d z?}Z>Q(aA#E|_yBdiy>U{x`4MLaNqe4oLYHX{`gP_K$N3dIX5XyBa$xx55 z3}U0bsZd}p(i(asll;Npsuo2Mgfu?7%w znd^{SQ8;PQ$X(PqkzHfo=cV>2W-#@9O~MN%gBRmR6GgRPQlaEZBo3TfCc{V*9HW4~|< z5%BV`){VexRW~dFYgCGjk`{;uIj<_yL_1}q z`pgUA>#%QyJj}Hhlhpz=7qB;r2t~^|dV8h4w+h(-8;8_3dsE>lxhK5pQ&NzWc`uf! z&e=sn1SLeGZ)g;m6%I*wxQ3DpEZHziaG;r;npU zJ00H`Aa)5nGVeJ2YX3#4+=7Cl%slxe0=vx|ZGX~vp^+VxomY6n*@}G9)d0Rg?A>di zj3!!<%2#o8&k<+fr}!8_^D4Uz5y7U7_9tDmKk5E+pE~5%&)bYN+$uk}AM$k_q0gR` GY1O}D)r3m` diff --git a/pumpkin-data/build/enchantments.rs b/pumpkin-data/build/enchantments.rs index d6a0b2a8c..d75fe0aa6 100644 --- a/pumpkin-data/build/enchantments.rs +++ b/pumpkin-data/build/enchantments.rs @@ -234,7 +234,7 @@ pub(crate) fn build() -> TokenStream { } pub fn get_fullname(&self, level: i32) -> TextComponent { let mut ret = TextComponent::translate(self.description, []).color_named( - if self.is_tagged_with_by_tag(&EnchantmentTag::MINECRAFT_CURSE) { + if self.has_tag(&EnchantmentTag::MINECRAFT_CURSE) { NamedColor::Red } else { NamedColor::Gray diff --git a/pumpkin-data/build/tag.rs b/pumpkin-data/build/tag.rs index 97233c78c..d704215c0 100644 --- a/pumpkin-data/build/tag.rs +++ b/pumpkin-data/build/tag.rs @@ -233,7 +233,7 @@ pub(crate) fn build() -> TokenStream { Some(items.contains(&self.registry_id())) } - fn is_tagged_with_by_tag(&self, tag: &'static Tag) -> bool { + fn has_tag(&self, tag: &'static Tag) -> bool { tag.1.contains(&self.registry_id()) } diff --git a/pumpkin-inventory/src/crafting/crafting_screen_handler.rs b/pumpkin-inventory/src/crafting/crafting_screen_handler.rs index 34c617430..c7ffc4914 100644 --- a/pumpkin-inventory/src/crafting/crafting_screen_handler.rs +++ b/pumpkin-inventory/src/crafting/crafting_screen_handler.rs @@ -216,7 +216,7 @@ async fn recipe_matches<'a>( if slot.is_empty() || !slot .item - .is_tagged_with_by_tag(&tag::Item::MINECRAFT_DECORATED_POT_INGREDIENTS) + .has_tag(&tag::Item::MINECRAFT_DECORATED_POT_INGREDIENTS) { return None; } diff --git a/pumpkin-world/src/block/entities/hopper.rs b/pumpkin-world/src/block/entities/hopper.rs index 6f239574b..b2553dca8 100644 --- a/pumpkin-world/src/block/entities/hopper.rs +++ b/pumpkin-world/src/block/entities/hopper.rs @@ -185,9 +185,7 @@ impl HopperBlockEntity { return false; } let (block, state) = world.get_block_and_state(pos_up).await; - if !(state.is_solid() - && block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DOES_NOT_BLOCK_HOPPERS)) - { + if !(state.is_solid() && block.has_tag(&tag::Block::MINECRAFT_DOES_NOT_BLOCK_HOPPERS)) { // TODO getItemsAtAndAbove(level, hopper) return false; } diff --git a/pumpkin-world/src/chunk/mod.rs b/pumpkin-world/src/chunk/mod.rs index b43cf4cf3..393ad194c 100644 --- a/pumpkin-world/src/chunk/mod.rs +++ b/pumpkin-world/src/chunk/mod.rs @@ -523,7 +523,7 @@ impl ChunkData { if !has_found[ChunkHeightmapType::MotionBlockingNoLeaves as usize] && is_motion_blocking - && !block.is_tagged_with_by_tag(&MINECRAFT_LEAVES) + && !block.has_tag(&MINECRAFT_LEAVES) { heightmaps.set( ChunkHeightmapType::MotionBlockingNoLeaves, diff --git a/pumpkin-world/src/generation/feature/features/bamboo.rs b/pumpkin-world/src/generation/feature/features/bamboo.rs index 471f3a1ad..da3d3ba74 100644 --- a/pumpkin-world/src/generation/feature/features/bamboo.rs +++ b/pumpkin-world/src/generation/feature/features/bamboo.rs @@ -44,10 +44,7 @@ impl BambooFeature { z, ); let block = GenerationCache::get_block_state(chunk, &block_below.0); - if !block - .to_block() - .is_tagged_with_by_tag(&tag::Block::MINECRAFT_DIRT) - { + if !block.to_block().has_tag(&tag::Block::MINECRAFT_DIRT) { continue; } chunk.set_block_state(&block_below.0, Block::PODZOL.default_state); diff --git a/pumpkin-world/src/generation/feature/features/coral/mod.rs b/pumpkin-world/src/generation/feature/features/coral/mod.rs index c28597f50..107fcd5c3 100644 --- a/pumpkin-world/src/generation/feature/features/coral/mod.rs +++ b/pumpkin-world/src/generation/feature/features/coral/mod.rs @@ -26,7 +26,7 @@ impl CoralFeature { let block = GenerationCache::get_block_state(chunk, &pos.0).to_block(); let above_block = GenerationCache::get_block_state(chunk, &pos.up().0).to_block(); - if block != &Block::WATER && !block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_CORALS) + if block != &Block::WATER && !block.has_tag(&tag::Block::MINECRAFT_CORALS) || above_block != &Block::WATER { return false; diff --git a/pumpkin-world/src/generation/feature/features/drip_stone/mod.rs b/pumpkin-world/src/generation/feature/features/drip_stone/mod.rs index 521624dc7..92f94c605 100644 --- a/pumpkin-world/src/generation/feature/features/drip_stone/mod.rs +++ b/pumpkin-world/src/generation/feature/features/drip_stone/mod.rs @@ -9,12 +9,12 @@ pub mod small; pub(super) fn can_replace(block: &Block) -> bool { block == &Block::DRIPSTONE_BLOCK - || block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DRIPSTONE_REPLACEABLE_BLOCKS) + || block.has_tag(&tag::Block::MINECRAFT_DRIPSTONE_REPLACEABLE_BLOCKS) } pub(super) fn gen_dripstone(chunk: &mut T, pos: BlockPos) -> bool { let block = GenerationCache::get_block_state(chunk, &pos.0).to_block(); - if block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DRIPSTONE_REPLACEABLE_BLOCKS) { + if block.has_tag(&tag::Block::MINECRAFT_DRIPSTONE_REPLACEABLE_BLOCKS) { chunk.set_block_state(&pos.0, Block::DRIPSTONE_BLOCK.default_state); return true; } diff --git a/pumpkin-world/src/generation/feature/features/nether_forest_vegetation.rs b/pumpkin-world/src/generation/feature/features/nether_forest_vegetation.rs index e60e802ea..3b2a1e439 100644 --- a/pumpkin-world/src/generation/feature/features/nether_forest_vegetation.rs +++ b/pumpkin-world/src/generation/feature/features/nether_forest_vegetation.rs @@ -29,10 +29,7 @@ impl NetherForestVegetationFeature { ) -> bool { let state = GenerationCache::get_block_state(chunk, &pos.down().0); - if !state - .to_block() - .is_tagged_with_by_tag(&tag::Block::MINECRAFT_NYLIUM) - { + if !state.to_block().has_tag(&tag::Block::MINECRAFT_NYLIUM) { return false; } let mut result = false; diff --git a/pumpkin-world/src/generation/feature/features/tree/mod.rs b/pumpkin-world/src/generation/feature/features/tree/mod.rs index 3150ae761..65c65300e 100644 --- a/pumpkin-world/src/generation/feature/features/tree/mod.rs +++ b/pumpkin-world/src/generation/feature/features/tree/mod.rs @@ -52,15 +52,15 @@ impl TreeFeature { } pub fn can_replace_or_log(state: &BlockState, block: &Block) -> bool { - Self::can_replace(state, block) || block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_LOGS) + Self::can_replace(state, block) || block.has_tag(&tag::Block::MINECRAFT_LOGS) } pub fn is_air_or_leaves(state: &BlockState, block: &Block) -> bool { - state.is_air() || block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_LEAVES) + state.is_air() || block.has_tag(&tag::Block::MINECRAFT_LEAVES) } pub fn can_replace(state: &BlockState, block: &Block) -> bool { - state.is_air() || block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_REPLACEABLE_BY_TREES) + state.is_air() || block.has_tag(&tag::Block::MINECRAFT_REPLACEABLE_BY_TREES) } fn generate_main( diff --git a/pumpkin-world/src/generation/feature/features/tree/trunk/mod.rs b/pumpkin-world/src/generation/feature/features/tree/trunk/mod.rs index 8b669c864..73f70e468 100644 --- a/pumpkin-world/src/generation/feature/features/tree/trunk/mod.rs +++ b/pumpkin-world/src/generation/feature/features/tree/trunk/mod.rs @@ -51,7 +51,7 @@ impl TrunkPlacer { ) { let block = GenerationCache::get_block_state(chunk, &pos.0).to_block(); if force_dirt - || !(block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DIRT) + || !(block.has_tag(&tag::Block::MINECRAFT_DIRT) && block != &Block::GRASS_BLOCK && block != &Block::MYCELIUM) { diff --git a/pumpkin-world/src/generation/proto_chunk.rs b/pumpkin-world/src/generation/proto_chunk.rs index 383d8dc4f..f890faaaa 100644 --- a/pumpkin-world/src/generation/proto_chunk.rs +++ b/pumpkin-world/src/generation/proto_chunk.rs @@ -454,7 +454,7 @@ impl ProtoChunk { if blocks_movement(block_state) || block_state.is_liquid() { self.maybe_update_motion_blocking_height_map(pos); let block = Block::from_state_id(block_state.id); - if !block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_LEAVES) { + if !block.has_tag(&tag::Block::MINECRAFT_LEAVES) { { self.maybe_update_motion_blocking_no_leaves_height_map(pos); } diff --git a/pumpkin-world/src/item/categories.rs b/pumpkin-world/src/item/categories.rs index c8d8a004a..e15279af5 100644 --- a/pumpkin-world/src/item/categories.rs +++ b/pumpkin-world/src/item/categories.rs @@ -6,37 +6,31 @@ use crate::item::ItemStack; impl ItemStack { #[inline] pub fn is_sword(&self) -> bool { - self.item - .is_tagged_with_by_tag(&tag::Item::MINECRAFT_SWORDS) + self.item.has_tag(&tag::Item::MINECRAFT_SWORDS) } #[inline] pub fn is_helmet(&self) -> bool { - self.item - .is_tagged_with_by_tag(&tag::Item::MINECRAFT_HEAD_ARMOR) + self.item.has_tag(&tag::Item::MINECRAFT_HEAD_ARMOR) } #[inline] pub fn is_skull(&self) -> bool { - self.item - .is_tagged_with_by_tag(&tag::Item::MINECRAFT_SKULLS) + self.item.has_tag(&tag::Item::MINECRAFT_SKULLS) } #[inline] pub fn is_chestplate(&self) -> bool { - self.item - .is_tagged_with_by_tag(&tag::Item::MINECRAFT_CHEST_ARMOR) + self.item.has_tag(&tag::Item::MINECRAFT_CHEST_ARMOR) } #[inline] pub fn is_leggings(&self) -> bool { - self.item - .is_tagged_with_by_tag(&tag::Item::MINECRAFT_LEG_ARMOR) + self.item.has_tag(&tag::Item::MINECRAFT_LEG_ARMOR) } #[inline] pub fn is_boots(&self) -> bool { - self.item - .is_tagged_with_by_tag(&tag::Item::MINECRAFT_FOOT_ARMOR) + self.item.has_tag(&tag::Item::MINECRAFT_FOOT_ARMOR) } } diff --git a/pumpkin-world/src/item/mod.rs b/pumpkin-world/src/item/mod.rs index 7a4d0182a..d6f8911c4 100644 --- a/pumpkin-world/src/item/mod.rs +++ b/pumpkin-world/src/item/mod.rs @@ -243,7 +243,7 @@ impl ItemStack { }; match &rule.blocks { IDSet::Tag(tag) => { - if block.is_tagged_with_by_tag(tag) { + if block.has_tag(tag) { return speed; } } @@ -271,7 +271,7 @@ impl ItemStack { }; match &rule.blocks { IDSet::Tag(tag) => { - if block.is_tagged_with_by_tag(tag) { + if block.has_tag(tag) { return correct; } } diff --git a/pumpkin-world/src/lib.rs b/pumpkin-world/src/lib.rs index ce860cc27..81db633da 100644 --- a/pumpkin-world/src/lib.rs +++ b/pumpkin-world/src/lib.rs @@ -24,7 +24,7 @@ pub type BlockId = u16; pub type BlockStateId = u16; pub const CURRENT_MC_VERSION: &str = "1.21.9"; -pub const CURRENT_BEDROCK_MC_VERSION: &str = "1.21.100"; +pub const CURRENT_BEDROCK_MC_VERSION: &str = "1.21.111"; #[macro_export] macro_rules! global_path { diff --git a/pumpkin/src/block/blocks/bamboo.rs b/pumpkin/src/block/blocks/bamboo.rs index 46402672d..e5b2fb5bb 100644 --- a/pumpkin/src/block/blocks/bamboo.rs +++ b/pumpkin/src/block/blocks/bamboo.rs @@ -12,6 +12,6 @@ pub struct BambooBlock; impl BlockBehaviour for BambooBlock { async fn can_place_at(&self, args: CanPlaceAtArgs<'_>) -> bool { let block_below = args.block_accessor.get_block(&args.position.down()).await; - block_below.is_tagged_with_by_tag(&tag::Block::MINECRAFT_BAMBOO_PLANTABLE_ON) + block_below.has_tag(&tag::Block::MINECRAFT_BAMBOO_PLANTABLE_ON) } } diff --git a/pumpkin/src/block/blocks/cactus.rs b/pumpkin/src/block/blocks/cactus.rs index ed441f6d9..fddd52f3c 100644 --- a/pumpkin/src/block/blocks/cactus.rs +++ b/pumpkin/src/block/blocks/cactus.rs @@ -103,6 +103,6 @@ async fn can_place_at(world: &dyn BlockAccessor, block_pos: &BlockPos) -> bool { } let block = world.get_block(&block_pos.down()).await; // TODO: use tags - (block == &Block::CACTUS || block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_SAND)) + (block == &Block::CACTUS || block.has_tag(&tag::Block::MINECRAFT_SAND)) && !world.get_block_state(&block_pos.up()).await.is_liquid() } diff --git a/pumpkin/src/block/blocks/chiseled_bookshelf.rs b/pumpkin/src/block/blocks/chiseled_bookshelf.rs index fac76de26..b39ce60ef 100644 --- a/pumpkin/src/block/blocks/chiseled_bookshelf.rs +++ b/pumpkin/src/block/blocks/chiseled_bookshelf.rs @@ -80,7 +80,7 @@ impl BlockBehaviour for ChiseledBookshelfBlock { .lock() .await .get_item() - .is_tagged_with_by_tag(&tag::Item::MINECRAFT_BOOKSHELF_BOOKS) + .has_tag(&tag::Item::MINECRAFT_BOOKSHELF_BOOKS) { return BlockActionResult::PassToDefaultBlockAction; } diff --git a/pumpkin/src/block/blocks/doors.rs b/pumpkin/src/block/blocks/doors.rs index afa517783..bfa42cbce 100644 --- a/pumpkin/src/block/blocks/doors.rs +++ b/pumpkin/src/block/blocks/doors.rs @@ -86,14 +86,14 @@ fn can_open_door(block: &Block) -> bool { // Todo: The sounds should be from BlockSetType fn get_sound(block: &Block, open: bool) -> Sound { if open { - if block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WOODEN_DOORS) { + if block.has_tag(&tag::Block::MINECRAFT_WOODEN_DOORS) { Sound::BlockWoodenDoorOpen } else if block == &Block::IRON_DOOR { Sound::BlockIronDoorOpen } else { Sound::BlockCopperDoorOpen } - } else if block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WOODEN_DOORS) { + } else if block.has_tag(&tag::Block::MINECRAFT_WOODEN_DOORS) { Sound::BlockWoodenDoorClose } else if block == &Block::IRON_DOOR { Sound::BlockIronDoorClose @@ -125,13 +125,13 @@ async fn get_hinge( let has_left_door = world .get_block(&left_pos) .await - .is_tagged_with_by_tag(&tag::Block::MINECRAFT_DOORS) + .has_tag(&tag::Block::MINECRAFT_DOORS) && DoorProperties::from_state_id(left_state.id, left_block).half == DoubleBlockHalf::Lower; let has_right_door = world .get_block(&right_pos) .await - .is_tagged_with_by_tag(&tag::Block::MINECRAFT_DOORS) + .has_tag(&tag::Block::MINECRAFT_DOORS) && DoorProperties::from_state_id(right_state.id, right_block).half == DoubleBlockHalf::Lower; diff --git a/pumpkin/src/block/blocks/falling.rs b/pumpkin/src/block/blocks/falling.rs index e08ed3400..6f0c9f414 100644 --- a/pumpkin/src/block/blocks/falling.rs +++ b/pumpkin/src/block/blocks/falling.rs @@ -17,7 +17,7 @@ impl FallingBlock { #[must_use] pub fn can_fall_through(state: &BlockState, block: &Block) -> bool { state.is_air() - || block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_FIRE) + || block.has_tag(&tag::Block::MINECRAFT_FIRE) || state.is_liquid() || state.replaceable() } diff --git a/pumpkin/src/block/blocks/farmland.rs b/pumpkin/src/block/blocks/farmland.rs index 3f9cd3d0f..9547ee328 100644 --- a/pumpkin/src/block/blocks/farmland.rs +++ b/pumpkin/src/block/blocks/farmland.rs @@ -85,7 +85,7 @@ impl BlockBehaviour for FarmlandBlock { .world .get_block(&args.position.up()) .await - .is_tagged_with_by_tag(&tag::Block::MINECRAFT_MAINTAINS_FARMLAND) + .has_tag(&tag::Block::MINECRAFT_MAINTAINS_FARMLAND) { //TODO push entities up args.world diff --git a/pumpkin/src/block/blocks/fence_gates.rs b/pumpkin/src/block/blocks/fence_gates.rs index 96033f2eb..36152bd96 100644 --- a/pumpkin/src/block/blocks/fence_gates.rs +++ b/pumpkin/src/block/blocks/fence_gates.rs @@ -98,8 +98,8 @@ async fn is_in_wall(args: &GetStateForNeighborUpdateArgs<'_>) -> FenceGateProper let neighbor_right = args.world.get_block(&side_offset_right).await; let neighbor_left = args.world.get_block(&side_offset_left).await; - fence_props.in_wall = neighbor_left.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WALLS) - || neighbor_right.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WALLS); + fence_props.in_wall = neighbor_left.has_tag(&tag::Block::MINECRAFT_WALLS) + || neighbor_right.has_tag(&tag::Block::MINECRAFT_WALLS); } fence_props diff --git a/pumpkin/src/block/blocks/fences.rs b/pumpkin/src/block/blocks/fences.rs index 1645a8160..ad7ac63e2 100644 --- a/pumpkin/src/block/blocks/fences.rs +++ b/pumpkin/src/block/blocks/fences.rs @@ -78,7 +78,7 @@ fn connects_to(from: &Block, to: &Block, to_state: &BlockState, direction: Block return true; } - if to.is_tagged_with_by_tag(&tag::Block::C_FENCE_GATES) { + if to.has_tag(&tag::Block::C_FENCE_GATES) { let fence_gate_props = FenceGateProperties::from_state_id(to_state.id, to); if BlockDirection::from_cardinal_direction(fence_gate_props.facing).to_axis() == direction.rotate_clockwise().to_axis() @@ -87,5 +87,5 @@ fn connects_to(from: &Block, to: &Block, to_state: &BlockState, direction: Block } } - *from != Block::NETHER_BRICK_FENCE && to.is_tagged_with_by_tag(&tag::Block::C_FENCES_WOODEN) + *from != Block::NETHER_BRICK_FENCE && to.has_tag(&tag::Block::C_FENCES_WOODEN) } diff --git a/pumpkin/src/block/blocks/fire/mod.rs b/pumpkin/src/block/blocks/fire/mod.rs index d731513a0..1a4b72fe6 100644 --- a/pumpkin/src/block/blocks/fire/mod.rs +++ b/pumpkin/src/block/blocks/fire/mod.rs @@ -41,7 +41,7 @@ impl FireBlockBase { pub async fn is_soul_fire(world: &Arc, block_pos: &BlockPos) -> bool { let block = world.get_block(&block_pos.down()).await; - block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_SOUL_FIRE_BASE_BLOCKS) + block.has_tag(&tag::Block::MINECRAFT_SOUL_FIRE_BASE_BLOCKS) } pub async fn can_place_at(world: &Arc, block_pos: &BlockPos) -> bool { diff --git a/pumpkin/src/block/blocks/fire/soul_fire.rs b/pumpkin/src/block/blocks/fire/soul_fire.rs index 986e5e1bc..697446390 100644 --- a/pumpkin/src/block/blocks/fire/soul_fire.rs +++ b/pumpkin/src/block/blocks/fire/soul_fire.rs @@ -14,7 +14,7 @@ pub struct SoulFireBlock; impl SoulFireBlock { #[must_use] pub fn is_soul_base(block: &Block) -> bool { - block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_SOUL_FIRE_BASE_BLOCKS) + block.has_tag(&tag::Block::MINECRAFT_SOUL_FIRE_BASE_BLOCKS) } } diff --git a/pumpkin/src/block/blocks/glass_panes.rs b/pumpkin/src/block/blocks/glass_panes.rs index 74560ccd3..e733b6ee5 100644 --- a/pumpkin/src/block/blocks/glass_panes.rs +++ b/pumpkin/src/block/blocks/glass_panes.rs @@ -56,9 +56,9 @@ pub async fn compute_pane_state( let connected = other_block == block || other_block_state.is_side_solid(direction.opposite()) - || other_block.is_tagged_with_by_tag(&tag::Block::C_GLASS_PANES) + || other_block.has_tag(&tag::Block::C_GLASS_PANES) || other_block == &Block::IRON_BARS - || other_block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WALLS); + || other_block.has_tag(&tag::Block::MINECRAFT_WALLS); match direction { BlockDirection::North => pane_props.north = connected, diff --git a/pumpkin/src/block/blocks/iron_bars.rs b/pumpkin/src/block/blocks/iron_bars.rs index 6421eb07a..8bc64c01a 100644 --- a/pumpkin/src/block/blocks/iron_bars.rs +++ b/pumpkin/src/block/blocks/iron_bars.rs @@ -47,8 +47,8 @@ pub async fn compute_bars_state( let connected = other_block == block || other_block_state.is_side_solid(direction.opposite()) - || other_block.is_tagged_with_by_tag(&tag::Block::C_GLASS_PANES) - || other_block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WALLS); + || other_block.has_tag(&tag::Block::C_GLASS_PANES) + || other_block.has_tag(&tag::Block::MINECRAFT_WALLS); match direction { BlockDirection::North => bars_props.north = connected, diff --git a/pumpkin/src/block/blocks/lanterns.rs b/pumpkin/src/block/blocks/lanterns.rs index efb431df3..0aaa144eb 100644 --- a/pumpkin/src/block/blocks/lanterns.rs +++ b/pumpkin/src/block/blocks/lanterns.rs @@ -68,7 +68,7 @@ async fn can_place_at(world: &World, position: &BlockPos) -> bool { if world .get_block(&position.down()) .await - .is_tagged_with_by_tag(&tag::Block::C_FENCE_GATES) + .has_tag(&tag::Block::C_FENCE_GATES) { let fence_gate_props = pumpkin_data::block_properties::OakFenceGateLikeProperties::from_state_id( @@ -84,5 +84,5 @@ async fn can_place_at(world: &World, position: &BlockPos) -> bool { let block_up_state = world.get_block_state(&position.up()).await; block_down_state.is_center_solid(BlockDirection::Up) || block_up_state.is_center_solid(BlockDirection::Down) - || block_down.is_tagged_with_by_tag(&tag::Block::MINECRAFT_UNSTABLE_BOTTOM_CENTER) + || block_down.has_tag(&tag::Block::MINECRAFT_UNSTABLE_BOTTOM_CENTER) } diff --git a/pumpkin/src/block/blocks/plant/crop/gourds/stem.rs b/pumpkin/src/block/blocks/plant/crop/gourds/stem.rs index a356bfcb3..5045e193e 100644 --- a/pumpkin/src/block/blocks/plant/crop/gourds/stem.rs +++ b/pumpkin/src/block/blocks/plant/crop/gourds/stem.rs @@ -106,7 +106,7 @@ impl BlockBehaviour for StemBlock { let under_block: &Block = args.world.get_block(&plant_block_pos.down()).await; if plant_block_state.is_air() && (under_block == &Block::FARMLAND - || under_block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DIRT)) + || under_block.has_tag(&tag::Block::MINECRAFT_DIRT)) { let attached_stem = Self::get_attached_stem(dir, block); let gourd = Self::get_gourd(block); diff --git a/pumpkin/src/block/blocks/plant/dry_vegetation.rs b/pumpkin/src/block/blocks/plant/dry_vegetation.rs index 6bb72ac6e..9b196c1bf 100644 --- a/pumpkin/src/block/blocks/plant/dry_vegetation.rs +++ b/pumpkin/src/block/blocks/plant/dry_vegetation.rs @@ -48,6 +48,6 @@ impl PlantBlockBase for DryVegetationBlock { block_pos: &BlockPos, ) -> bool { let block_below = block_accessor.get_block(block_pos).await; - block_below.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DRY_VEGETATION_MAY_PLACE_ON) + block_below.has_tag(&tag::Block::MINECRAFT_DRY_VEGETATION_MAY_PLACE_ON) } } diff --git a/pumpkin/src/block/blocks/plant/flowerbed.rs b/pumpkin/src/block/blocks/plant/flowerbed.rs index cbfb43147..3fb5491d1 100644 --- a/pumpkin/src/block/blocks/plant/flowerbed.rs +++ b/pumpkin/src/block/blocks/plant/flowerbed.rs @@ -30,8 +30,7 @@ impl BlockMetadata for FlowerbedBlock { impl BlockBehaviour for FlowerbedBlock { async fn can_place_at(&self, args: CanPlaceAtArgs<'_>) -> bool { let block_below = args.block_accessor.get_block(&args.position.down()).await; - block_below.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DIRT) - || block_below == &Block::FARMLAND + block_below.has_tag(&tag::Block::MINECRAFT_DIRT) || block_below == &Block::FARMLAND } async fn can_update_at(&self, args: CanUpdateAtArgs<'_>) -> bool { diff --git a/pumpkin/src/block/blocks/plant/mod.rs b/pumpkin/src/block/blocks/plant/mod.rs index 4b7fa34c7..df243d51c 100644 --- a/pumpkin/src/block/blocks/plant/mod.rs +++ b/pumpkin/src/block/blocks/plant/mod.rs @@ -22,7 +22,7 @@ pub mod tall_plant; trait PlantBlockBase { async fn can_plant_on_top(&self, block_accessor: &dyn BlockAccessor, pos: &BlockPos) -> bool { let block = block_accessor.get_block(pos).await; - block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DIRT) || block == &Block::FARMLAND + block.has_tag(&tag::Block::MINECRAFT_DIRT) || block == &Block::FARMLAND } async fn get_state_for_neighbor_update( diff --git a/pumpkin/src/block/blocks/plant/mushroom_plant.rs b/pumpkin/src/block/blocks/plant/mushroom_plant.rs index f5eaf0a1b..e664f69bb 100644 --- a/pumpkin/src/block/blocks/plant/mushroom_plant.rs +++ b/pumpkin/src/block/blocks/plant/mushroom_plant.rs @@ -44,7 +44,7 @@ impl BlockBehaviour for MushroomPlantBlock { impl PlantBlockBase for MushroomPlantBlock { async fn can_plant_on_top(&self, block_accessor: &dyn BlockAccessor, pos: &BlockPos) -> bool { let block = block_accessor.get_block(pos).await; - block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_MUSHROOM_GROW_BLOCK) + block.has_tag(&tag::Block::MINECRAFT_MUSHROOM_GROW_BLOCK) // TODO: Check light level and isOpaqueFullCube } } diff --git a/pumpkin/src/block/blocks/plant/roots.rs b/pumpkin/src/block/blocks/plant/roots.rs index c7601c6a8..022c44b57 100644 --- a/pumpkin/src/block/blocks/plant/roots.rs +++ b/pumpkin/src/block/blocks/plant/roots.rs @@ -44,9 +44,9 @@ impl BlockBehaviour for RootsBlock { impl PlantBlockBase for RootsBlock { async fn can_plant_on_top(&self, block_accessor: &dyn BlockAccessor, pos: &BlockPos) -> bool { let block_below = block_accessor.get_block(pos).await; - block_below.is_tagged_with_by_tag(&tag::Block::MINECRAFT_NYLIUM) + block_below.has_tag(&tag::Block::MINECRAFT_NYLIUM) || block_below == &Block::SOUL_SOIL - || block_below.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DIRT) + || block_below.has_tag(&tag::Block::MINECRAFT_DIRT) || block_below == &Block::FARMLAND } diff --git a/pumpkin/src/block/blocks/plant/sea_pickles.rs b/pumpkin/src/block/blocks/plant/sea_pickles.rs index cb8293eb7..1e15a966a 100644 --- a/pumpkin/src/block/blocks/plant/sea_pickles.rs +++ b/pumpkin/src/block/blocks/plant/sea_pickles.rs @@ -32,7 +32,7 @@ impl BlockBehaviour for SeaPickleBlock { .world .get_block(&args.position.down()) .await - .is_tagged_with_by_tag(&tag::Block::MINECRAFT_CORAL_BLOCKS) + .has_tag(&tag::Block::MINECRAFT_CORAL_BLOCKS) || !SeaPickleProperties::from_state_id( args.world.get_block_state_id(args.position).await, args.block, @@ -63,7 +63,7 @@ impl BlockBehaviour for SeaPickleBlock { .world .get_block(&lv.down()) .await - .is_tagged_with_by_tag(&tag::Block::MINECRAFT_CORAL_BLOCKS) + .has_tag(&tag::Block::MINECRAFT_CORAL_BLOCKS) { continue; } diff --git a/pumpkin/src/block/blocks/redstone/rails/mod.rs b/pumpkin/src/block/blocks/redstone/rails/mod.rs index a978a3ed5..364071222 100644 --- a/pumpkin/src/block/blocks/redstone/rails/mod.rs +++ b/pumpkin/src/block/blocks/redstone/rails/mod.rs @@ -28,7 +28,7 @@ struct Rail { impl Rail { async fn find_with_elevation(world: &World, position: BlockPos) -> Option { let (block, block_state) = world.get_block_and_state_id(&position).await; - if block.is_tagged_with_by_tag(&tag::Item::MINECRAFT_RAILS) { + if block.has_tag(&tag::Item::MINECRAFT_RAILS) { let properties = RailProperties::new(block_state, block); return Some(Self { block, @@ -40,7 +40,7 @@ impl Rail { let pos = position.up(); let (block, block_state) = world.get_block_and_state_id(&pos).await; - if block.is_tagged_with_by_tag(&tag::Item::MINECRAFT_RAILS) { + if block.has_tag(&tag::Item::MINECRAFT_RAILS) { let properties = RailProperties::new(block_state, block); return Some(Self { block, @@ -52,7 +52,7 @@ impl Rail { let pos = position.down(); let (block, block_state) = world.get_block_and_state_id(&pos).await; - if block.is_tagged_with_by_tag(&tag::Item::MINECRAFT_RAILS) { + if block.has_tag(&tag::Item::MINECRAFT_RAILS) { let properties = RailProperties::new(block_state, block); return Some(Self { block, diff --git a/pumpkin/src/block/blocks/stairs.rs b/pumpkin/src/block/blocks/stairs.rs index 2b8fc0330..8b8a06fbc 100644 --- a/pumpkin/src/block/blocks/stairs.rs +++ b/pumpkin/src/block/blocks/stairs.rs @@ -138,6 +138,6 @@ async fn get_stair_properties_if_exists( ) -> Option { let (block, block_state) = world.get_block_and_state_id(block_pos).await; block - .is_tagged_with_by_tag(&tag::Block::MINECRAFT_STAIRS) + .has_tag(&tag::Block::MINECRAFT_STAIRS) .then(|| StairsProperties::from_state_id(block_state, block)) } diff --git a/pumpkin/src/block/blocks/sugar_cane.rs b/pumpkin/src/block/blocks/sugar_cane.rs index 745b09349..9d4b46c8d 100644 --- a/pumpkin/src/block/blocks/sugar_cane.rs +++ b/pumpkin/src/block/blocks/sugar_cane.rs @@ -92,8 +92,8 @@ async fn can_place_at(block_accessor: &dyn BlockAccessor, block_pos: &BlockPos) return true; } - if block_below.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DIRT) - || block_below.is_tagged_with_by_tag(&tag::Block::MINECRAFT_SAND) + if block_below.has_tag(&tag::Block::MINECRAFT_DIRT) + || block_below.has_tag(&tag::Block::MINECRAFT_SAND) { for direction in HorizontalFacing::all() { let block = block_accessor diff --git a/pumpkin/src/block/blocks/trapdoor.rs b/pumpkin/src/block/blocks/trapdoor.rs index 1595ba3ef..8c9dd61e4 100644 --- a/pumpkin/src/block/blocks/trapdoor.rs +++ b/pumpkin/src/block/blocks/trapdoor.rs @@ -50,14 +50,14 @@ fn can_open_trapdoor(block: &Block) -> bool { // Todo: The sounds should be from BlockSetType fn get_sound(block: &Block, open: bool) -> Sound { if open { - if block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WOODEN_TRAPDOORS) { + if block.has_tag(&tag::Block::MINECRAFT_WOODEN_TRAPDOORS) { Sound::BlockWoodenTrapdoorOpen } else if block == &Block::IRON_TRAPDOOR { Sound::BlockIronTrapdoorOpen } else { Sound::BlockCopperTrapdoorOpen } - } else if block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WOODEN_TRAPDOORS) { + } else if block.has_tag(&tag::Block::MINECRAFT_WOODEN_TRAPDOORS) { Sound::BlockWoodenTrapdoorClose } else if block == &Block::IRON_TRAPDOOR { Sound::BlockIronTrapdoorClose diff --git a/pumpkin/src/block/blocks/walls.rs b/pumpkin/src/block/blocks/walls.rs index c136c6961..8e890bddd 100644 --- a/pumpkin/src/block/blocks/walls.rs +++ b/pumpkin/src/block/blocks/walls.rs @@ -61,7 +61,7 @@ pub async fn compute_wall_state( let shape = if connected { let raise = if block_above_state.is_full_cube() { true - } else if block_above.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WALLS) { + } else if block_above.has_tag(&tag::Block::MINECRAFT_WALLS) { let other_props = WallProperties::from_state_id(block_above_state.id, block_above); match direction { HorizontalFacing::North => other_props.north != NorthWallShape::None, @@ -69,8 +69,8 @@ pub async fn compute_wall_state( HorizontalFacing::East => other_props.east != EastWallShape::None, HorizontalFacing::West => other_props.west != WestWallShape::None, } - } else if block_above.is_tagged_with_by_tag(&tag::Block::C_GLASS_PANES) - || block_above.is_tagged_with_by_tag(&tag::Block::MINECRAFT_FENCES) + } else if block_above.has_tag(&tag::Block::C_GLASS_PANES) + || block_above.has_tag(&tag::Block::MINECRAFT_FENCES) || block_above == &Block::IRON_BARS { let other_props = @@ -81,7 +81,7 @@ pub async fn compute_wall_state( HorizontalFacing::East => other_props.east, HorizontalFacing::West => other_props.west, } - } else if block_above.is_tagged_with_by_tag(&tag::Block::MINECRAFT_FENCE_GATES) { + } else if block_above.has_tag(&tag::Block::MINECRAFT_FENCE_GATES) { let other_props = FenceGateProperties::from_state_id(block_above_state.id, block_above); // gate is perp to connected direction @@ -124,10 +124,10 @@ pub async fn compute_wall_state( wall_props.up = if !(cross || connected_north_south || connected_east_west) { true - } else if block_above.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WALLS) { + } else if block_above.has_tag(&tag::Block::MINECRAFT_WALLS) { let other_props = WallProperties::from_state_id(block_above_state.id, block_above); other_props.up - } else if block_above.is_tagged_with_by_tag(&tag::Block::MINECRAFT_FENCE_GATES) { + } else if block_above.has_tag(&tag::Block::MINECRAFT_FENCE_GATES) { let other_props = FenceGateProperties::from_state_id(block_above_state.id, block_above); if other_props.open { false @@ -154,12 +154,12 @@ fn is_connected( || other_block_state.is_side_solid(BlockDirection::from_cardinal_direction( direction.opposite(), )) - || other_block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_WALLS) + || other_block.has_tag(&tag::Block::MINECRAFT_WALLS) || other_block == &Block::IRON_BARS - || other_block.is_tagged_with_by_tag(&tag::Block::C_GLASS_PANES); + || other_block.has_tag(&tag::Block::C_GLASS_PANES); // fence gates do not pass is_side_solid check - if !connected && other_block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_FENCE_GATES) { + if !connected && other_block.has_tag(&tag::Block::MINECRAFT_FENCE_GATES) { let fence_props = FenceGateProperties::from_state_id(other_block_state.id, other_block); if fence_props.facing == direction.rotate_clockwise() || fence_props.facing == direction.rotate_counter_clockwise() diff --git a/pumpkin/src/entity/player.rs b/pumpkin/src/entity/player.rs index 25a0acdcf..3e99c462c 100644 --- a/pumpkin/src/entity/player.rs +++ b/pumpkin/src/entity/player.rs @@ -695,7 +695,7 @@ impl Player { let block = self.world().get_block(&respawn_point.position).await; if respawn_point.dimension == VanillaDimensionType::Overworld - && block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_BEDS) + && block.has_tag(&tag::Block::MINECRAFT_BEDS) { // TODO: calculate respawn position Some((respawn_point.position.to_f64(), respawn_point.yaw)) diff --git a/pumpkin/src/item/items/axe.rs b/pumpkin/src/item/items/axe.rs index 3f9d01cb6..d857a13c1 100644 --- a/pumpkin/src/item/items/axe.rs +++ b/pumpkin/src/item/items/axe.rs @@ -39,7 +39,7 @@ impl ItemBehaviour for AxeItem { // If there is a strip equivalent. if replacement_block != 0 { let new_block = &Block::from_id(replacement_block); - let new_state_id = if block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_LOGS) { + let new_state_id = if block.has_tag(&tag::Block::MINECRAFT_LOGS) { let log_information = world.get_block_state_id(&location).await; let log_props = PaleOakWoodLikeProperties::from_state_id(log_information, block); // create new properties for the new log. @@ -53,7 +53,7 @@ impl ItemBehaviour for AxeItem { new_log_properties.to_state_id(new_block) } // Let's check if It's a door - else if block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DOORS) { + else if block.has_tag(&tag::Block::MINECRAFT_DOORS) { // get block state of the old log. let door_information = world.get_block_state_id(&location).await; // get the log properties diff --git a/pumpkin/src/item/items/honeycomb.rs b/pumpkin/src/item/items/honeycomb.rs index 312ec695c..0a2a9b718 100644 --- a/pumpkin/src/item/items/honeycomb.rs +++ b/pumpkin/src/item/items/honeycomb.rs @@ -50,8 +50,8 @@ impl ItemBehaviour for HoneyCombItem { // create new properties for the new log. let new_block = &Block::from_id(replacement_block); - let new_state_id = if block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DOORS) - && block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_DOORS) + let new_state_id = if block.has_tag(&tag::Block::MINECRAFT_DOORS) + && block.has_tag(&tag::Block::MINECRAFT_DOORS) { // get block state of the old log. let door_information = world.get_block_state_id(&location).await; diff --git a/pumpkin/src/item/items/minecart.rs b/pumpkin/src/item/items/minecart.rs index fa287dea6..f6e18a4da 100644 --- a/pumpkin/src/item/items/minecart.rs +++ b/pumpkin/src/item/items/minecart.rs @@ -61,7 +61,7 @@ impl ItemBehaviour for MinecartItem { ) { let world = player.world(); - if !block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_RAILS) { + if !block.has_tag(&tag::Block::MINECRAFT_RAILS) { return; } let state_id = world.get_block_state_id(&location).await; diff --git a/pumpkin/src/world/natural_spawner.rs b/pumpkin/src/world/natural_spawner.rs index b544c0251..c52750375 100644 --- a/pumpkin/src/world/natural_spawner.rs +++ b/pumpkin/src/world/natural_spawner.rs @@ -474,7 +474,7 @@ pub async fn get_random_spawn_mob_at( // TODO Holder holder = level.getBiome(pos); let biome = world.level.get_rough_biome(block_pos).await; if category == &MobCategory::WATER_AMBIENT - && biome.is_tagged_with_by_tag(&MINECRAFT_REDUCE_WATER_AMBIENT_SPAWNS) + && biome.has_tag(&MINECRAFT_REDUCE_WATER_AMBIENT_SPAWNS) && rng().random::() < 0.98f32 { None @@ -542,16 +542,10 @@ pub async fn is_spawn_position_ok( entity_type: &'static EntityType, ) -> bool { match entity_type.spawn_restriction.location { - SpawnLocation::InLava => world - .get_fluid(block_pos) - .await - .is_tagged_with_by_tag(&MINECRAFT_LAVA), + SpawnLocation::InLava => world.get_fluid(block_pos).await.has_tag(&MINECRAFT_LAVA), SpawnLocation::InWater => { // TODO !level.getBlockState(blockPos).isRedstoneConductor(level, blockPos) - world - .get_fluid(block_pos) - .await - .is_tagged_with_by_tag(&MINECRAFT_WATER) + world.get_fluid(block_pos).await.has_tag(&MINECRAFT_WATER) } SpawnLocation::OnGround => { let down = world.get_block_state(&block_pos.down()).await; @@ -575,5 +569,5 @@ pub fn is_valid_empty_spawn_block(state: &'static BlockState) -> bool { return false; } // TODO !entityType.isBlockDangerous(blockState); - !Block::from_state_id(state.id).is_tagged_with_by_tag(&MINECRAFT_PREVENT_MOB_SPAWNING_INSIDE) + !Block::from_state_id(state.id).has_tag(&MINECRAFT_PREVENT_MOB_SPAWNING_INSIDE) } diff --git a/pumpkin/src/world/portal/nether.rs b/pumpkin/src/world/portal/nether.rs index a34784cc7..86e90301f 100644 --- a/pumpkin/src/world/portal/nether.rs +++ b/pumpkin/src/world/portal/nether.rs @@ -245,7 +245,7 @@ impl NetherPortal { /// What is allowed to be inside the Portal frame fn valid_state_inside_portal(block: &Block, state: &BlockState) -> bool { state.is_air() - || block.is_tagged_with_by_tag(&tag::Block::MINECRAFT_FIRE) + || block.has_tag(&tag::Block::MINECRAFT_FIRE) || block == &Block::NETHER_PORTAL } }