Skip to content

Commit 08bc024

Browse files
committed
πŸΊπŸ”©
1 parent 3060adb commit 08bc024

12 files changed

Lines changed: 3 additions & 0 deletions

File tree

β€Žsrc/main/java/top/ctnstudio/futurefood/common/item/food/BlackHoleCake.javaβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
import top.ctnstudio.futurefood.common.item.tool.FoodItem;
1313
import top.ctnstudio.futurefood.core.init.ModItem;
1414

15+
import java.util.Objects;
16+
1517
public class BlackHoleCake extends FoodItem {
1618
private static final FoodProperties foodProperties = new FoodProperties.Builder()
1719
.alwaysEdible()
@@ -31,6 +33,7 @@ public ItemStack finishUsingItem(ItemStack stack, Level world, LivingEntity livi
3133
final var data = cake.getOrDefault(DataComponents.CUSTOM_DATA,
3234
CustomData.of(new CompoundTag()));
3335
data.update(it -> it.putLong("pos", livingEntity.blockPosition().asLong()));
36+
cake.set(DataComponents.CUSTOM_DATA, data);
3437
((Player) livingEntity).addItem(cake);
3538
return super.finishUsingItem(stack, world, livingEntity);
3639
}
451 Bytes
Loading
428 Bytes
Loading
406 Bytes
Loading
427 Bytes
Loading
338 Bytes
Loading
403 Bytes
Loading
365 Bytes
Loading
417 Bytes
Loading
378 Bytes
Loading

0 commit comments

Comments
Β (0)