Skip to content

Commit

Permalink
Support changing the displayed BlockState of PrimedTNT
Browse files Browse the repository at this point in the history
  • Loading branch information
avaruus1 committed Feb 25, 2024
1 parent 744fd7e commit cbc7b25
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
}

0 comments on commit cbc7b25

Please sign in to comment.