mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-17 16:37:43 +01:00
use empty registryaccess where context is not needed, closes #1676
This commit is contained in:
@@ -2,6 +2,7 @@ package org.purpurmc.purpur.entity;
|
|||||||
|
|
||||||
import io.papermc.paper.adventure.PaperAdventure;
|
import io.papermc.paper.adventure.PaperAdventure;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
|
import net.minecraft.core.RegistryAccess;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
|
import net.minecraft.world.level.block.entity.BeehiveBlockEntity;
|
||||||
import net.minecraft.world.level.block.entity.BlockEntity;
|
import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
@@ -31,7 +32,7 @@ public class PurpurStoredBee implements StoredEntity<Bee> {
|
|||||||
this.blockStorage = blockStorage;
|
this.blockStorage = blockStorage;
|
||||||
|
|
||||||
CompoundTag customData = handle.occupant.entityData().copyTag();
|
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);
|
this.customName = customNameMinecraft == null ? null : PaperAdventure.asAdventure(customNameMinecraft);
|
||||||
|
|
||||||
if (customData.get("BukkitValues") instanceof CompoundTag compoundTag) {
|
if (customData.get("BukkitValues") instanceof CompoundTag compoundTag) {
|
||||||
@@ -98,7 +99,7 @@ public class PurpurStoredBee implements StoredEntity<Bee> {
|
|||||||
if(customName == null) {
|
if(customName == null) {
|
||||||
handle.occupant.entityData().copyTag().remove("CustomName");
|
handle.occupant.entityData().copyTag().remove("CustomName");
|
||||||
} else {
|
} 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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user