From cbc7b25b91ff23f934fc47b1a9d6f939f8b3e0e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ossi=20Erkkil=C3=A4?= Date: Sun, 25 Feb 2024 16:10:37 +0200 Subject: [PATCH] Support changing the displayed BlockState of PrimedTNT --- .../spongepowered/common/data/provider/entity/TNTData.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/spongepowered/common/data/provider/entity/TNTData.java b/src/main/java/org/spongepowered/common/data/provider/entity/TNTData.java index 19507f80ea8..f17a33c896b 100644 --- a/src/main/java/org/spongepowered/common/data/provider/entity/TNTData.java +++ b/src/main/java/org/spongepowered/common/data/provider/entity/TNTData.java @@ -26,6 +26,7 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.item.PrimedTnt; +import org.spongepowered.api.block.BlockState; import org.spongepowered.api.data.Keys; import org.spongepowered.api.entity.living.Living; import org.spongepowered.common.accessor.world.entity.item.PrimedTntAccessor; @@ -44,7 +45,10 @@ public static void register(final DataProviderRegistrator registrator) { .get(h -> (Living) h.getOwner()) .set((h, v) -> ((PrimedTntAccessor) h).accessor$owner((LivingEntity) v)) .create(Keys.IS_PRIMED) - .get(h -> !h.isRemoved() && h.getFuse() > 0); + .get(h -> !h.isRemoved() && h.getFuse() > 0) + .create(Keys.BLOCK_STATE) + .get(h -> (BlockState) h.getBlockState()) + .set((h, v) -> h.setBlockState((net.minecraft.world.level.block.state.BlockState) v)); } // @formatter:on }