feat: Track Placement breaks flowers (#5821)

* feat: tracks break flowers during placement

* chore: cleanup import
This commit is contained in:
IThundxr 2024-03-21 07:09:24 -04:00 committed by GitHub
parent f551107e6d
commit 7d3d4a1e7c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,6 +33,7 @@ import net.minecraft.core.Direction.AxisDirection;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.NbtUtils;
import net.minecraft.nbt.Tag;
import net.minecraft.tags.BlockTags;
import net.minecraft.util.Mth;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Inventory;
@ -508,8 +509,7 @@ public class TrackPlacement {
// copy over all shared properties from the shaped state to the correct track material block
BlockState toPlace = BlockHelper.copyProperties(state, info.trackMaterial.getBlock().defaultBlockState());
boolean canPlace = stateAtPos.getMaterial()
.isReplaceable();
boolean canPlace = stateAtPos.getMaterial().isReplaceable() || stateAtPos.is(BlockTags.FLOWERS);
if (canPlace)
info.requiredTracks++;
if (simulate)