From 293e28a048aff420792c0d0aee709b039ca27d44 Mon Sep 17 00:00:00 2001 From: granny Date: Fri, 13 Jun 2025 19:21:39 -0700 Subject: [PATCH] use empty registryaccess where context is not needed, closes #1676 --- .../java/org/purpurmc/purpur/entity/PurpurStoredBee.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/purpur-server/src/main/java/org/purpurmc/purpur/entity/PurpurStoredBee.java b/purpur-server/src/main/java/org/purpurmc/purpur/entity/PurpurStoredBee.java index 1cd79edbe..800cc8b22 100644 --- a/purpur-server/src/main/java/org/purpurmc/purpur/entity/PurpurStoredBee.java +++ b/purpur-server/src/main/java/org/purpurmc/purpur/entity/PurpurStoredBee.java @@ -2,6 +2,7 @@ package org.purpurmc.purpur.entity; import io.papermc.paper.adventure.PaperAdventure; import net.kyori.adventure.text.Component; +import net.minecraft.core.RegistryAccess; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.block.entity.BeehiveBlockEntity; import net.minecraft.world.level.block.entity.BlockEntity; @@ -31,7 +32,7 @@ public class PurpurStoredBee implements StoredEntity { this.blockStorage = blockStorage; CompoundTag customData = handle.occupant.entityData().copyTag(); - net.minecraft.network.chat.Component customNameMinecraft = BlockEntity.parseCustomNameSafe(customData.get("CustomName"), ((CraftWorld) blockStorage.getWorld()).getHandle().registryAccess()); + net.minecraft.network.chat.Component customNameMinecraft = BlockEntity.parseCustomNameSafe(customData.get("CustomName"), RegistryAccess.EMPTY); this.customName = customNameMinecraft == null ? null : PaperAdventure.asAdventure(customNameMinecraft); if (customData.get("BukkitValues") instanceof CompoundTag compoundTag) { @@ -98,7 +99,7 @@ public class PurpurStoredBee implements StoredEntity { if(customName == null) { handle.occupant.entityData().copyTag().remove("CustomName"); } else { - handle.occupant.entityData().copyTag().putString("CustomName", net.minecraft.network.chat.Component.Serializer.toJson(PaperAdventure.asVanilla(customName), ((CraftWorld) blockStorage.getWorld()).getHandle().registryAccess())); + handle.occupant.entityData().copyTag().putString("CustomName", net.minecraft.network.chat.Component.Serializer.toJson(PaperAdventure.asVanilla(customName), RegistryAccess.EMPTY)); } } }