diff --git a/Xplat/src/generated/resources/.cache/bfa01a6ca2555c100103725bf5c9e6da285f29c3 b/Xplat/src/generated/resources/.cache/bfa01a6ca2555c100103725bf5c9e6da285f29c3 index 5132fcce37..10a6e0b90a 100644 --- a/Xplat/src/generated/resources/.cache/bfa01a6ca2555c100103725bf5c9e6da285f29c3 +++ b/Xplat/src/generated/resources/.cache/bfa01a6ca2555c100103725bf5c9e6da285f29c3 @@ -16,6 +16,7 @@ c9a0fa2b480198219c3eaf0a6232213c6a8fed16 data/botania/tags/blocks/horn_of_the_ca 5b7ef7e84e647b2340b20105a638d804a739b213 data/botania/tags/blocks/horn_of_the_covering_breakable.json 7d84bfb33c08ac8a946d43d59675844ff8efa5a1 data/botania/tags/blocks/horn_of_the_wild_breakable.json 8a23702b05296c8af5014d6aa6e9265ded85c7d9 data/botania/tags/blocks/laputa_immobile.json +8a23702b05296c8af5014d6aa6e9265ded85c7d9 data/botania/tags/blocks/laputa_no_double_block.json bbb827430199d1a6f3b27fc25e2df941f22dc660 data/botania/tags/blocks/livingwood_logs.json 687fe87bd07caccd697ec50eee72fa5b48d3fd37 data/botania/tags/blocks/magnet_ring_blacklist.json 444e88940a9f3d04dab84f48217946488d34141a data/botania/tags/blocks/manasteel_blocks.json diff --git a/Xplat/src/generated/resources/data/botania/tags/blocks/laputa_no_double_block.json b/Xplat/src/generated/resources/data/botania/tags/blocks/laputa_no_double_block.json new file mode 100644 index 0000000000..5e8aecc986 --- /dev/null +++ b/Xplat/src/generated/resources/data/botania/tags/blocks/laputa_no_double_block.json @@ -0,0 +1,4 @@ +{ + "replace": false, + "values": [] +} \ No newline at end of file diff --git a/Xplat/src/main/java/vazkii/botania/common/item/LaputaShardItem.java b/Xplat/src/main/java/vazkii/botania/common/item/LaputaShardItem.java index 379082eb95..44dc60f5f5 100644 --- a/Xplat/src/main/java/vazkii/botania/common/item/LaputaShardItem.java +++ b/Xplat/src/main/java/vazkii/botania/common/item/LaputaShardItem.java @@ -31,6 +31,7 @@ import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; import net.minecraft.world.level.material.FluidState; import net.minecraft.world.phys.HitResult; @@ -138,6 +139,9 @@ private static boolean canMove(BlockState state, Level world, BlockPos pos) { return !state.isAir() && !isFlowingFluid && !(block instanceof FallingBlock) + && (!state.hasProperty(BlockStateProperties.DOUBLE_BLOCK_HALF) + || state.is(BotaniaTags.Blocks.LAPUTA_NO_DOUBLE_BLOCK) + || state.getValue(BlockStateProperties.DOUBLE_BLOCK_HALF) == DoubleBlockHalf.LOWER) && !state.is(BotaniaTags.Blocks.LAPUTA_IMMOBILE) && state.getDestroySpeed(world, pos) != -1; } @@ -301,6 +305,14 @@ public void updateBurst(ManaBurst burst, ItemStack stack) { tile = BlockEntity.loadStatic(pos, placeState, tilecmp); } + if (placeState.hasProperty(BlockStateProperties.DOUBLE_BLOCK_HALF) + && !placeState.is(BotaniaTags.Blocks.LAPUTA_NO_DOUBLE_BLOCK) + && placeState.getValue(BlockStateProperties.DOUBLE_BLOCK_HALF) == DoubleBlockHalf.LOWER) { + // place upper half, which was previously broken implicitly when the bottom was picked up + entity.level().setBlock(pos.above(), + placeState.setValue(BlockStateProperties.DOUBLE_BLOCK_HALF, DoubleBlockHalf.UPPER), + Block.UPDATE_CLIENTS); + } entity.level().setBlockAndUpdate(pos, placeState); entity.level().levelEvent(LevelEvent.PARTICLES_DESTROY_BLOCK, pos, Block.getId(placeState)); if (tile != null) { diff --git a/Xplat/src/main/java/vazkii/botania/common/lib/BotaniaTags.java b/Xplat/src/main/java/vazkii/botania/common/lib/BotaniaTags.java index 0ca18abd17..fb9b5337a9 100644 --- a/Xplat/src/main/java/vazkii/botania/common/lib/BotaniaTags.java +++ b/Xplat/src/main/java/vazkii/botania/common/lib/BotaniaTags.java @@ -185,6 +185,12 @@ public static class Blocks { * Blocks in this tag cannot be moved by the Laputa Shard */ public static final TagKey LAPUTA_IMMOBILE = tag("laputa_immobile"); + /** + * Blocks in this tag should not be treated like a 2-high double block by the Laputa Shard, even though they + * have the {@link net.minecraft.world.level.block.state.properties.BlockStateProperties#DOUBLE_BLOCK_HALF} + * property. + */ + public static final TagKey LAPUTA_NO_DOUBLE_BLOCK = tag("laputa_no_double_block"); /** * Blocks in this tag can be removed by the Rod of Terra Firma diff --git a/Xplat/src/main/java/vazkii/botania/data/BlockTagProvider.java b/Xplat/src/main/java/vazkii/botania/data/BlockTagProvider.java index 976e86544a..748afc50f9 100644 --- a/Xplat/src/main/java/vazkii/botania/data/BlockTagProvider.java +++ b/Xplat/src/main/java/vazkii/botania/data/BlockTagProvider.java @@ -166,6 +166,7 @@ protected void addTags(HolderLookup.Provider provider) { tag(BotaniaTags.Blocks.MAGNET_RING_BLACKLIST).add(BotaniaBlocks.manaPool, BotaniaBlocks.creativePool, BotaniaBlocks.dilutedPool, BotaniaBlocks.fabulousPool, BotaniaBlocks.terraPlate, BotaniaBlocks.runeAltar); tag(BotaniaTags.Blocks.LAPUTA_IMMOBILE); + tag(BotaniaTags.Blocks.LAPUTA_NO_DOUBLE_BLOCK); tag(BotaniaTags.Blocks.TERRA_PLATE_BASE).add(BotaniaBlocks.livingrock, BotaniaBlocks.shimmerrock);