diff --git a/src/main/java/com/minecolonies/core/client/gui/WindowReactivateBuilding.java b/src/main/java/com/minecolonies/core/client/gui/WindowReactivateBuilding.java index aec1a115e1e..eb7a4efa536 100644 --- a/src/main/java/com/minecolonies/core/client/gui/WindowReactivateBuilding.java +++ b/src/main/java/com/minecolonies/core/client/gui/WindowReactivateBuilding.java @@ -39,7 +39,7 @@ public WindowReactivateBuilding(@NotNull final BlockPos pos) if (Minecraft.getInstance().level.getBlockEntity(pos) instanceof TileEntityColonyBuilding tileEntityColonyBuilding) { - final BuildingEntry buildingEntry = IBuildingRegistry.getInstance().get(tileEntityColonyBuilding.registryName); + final BuildingEntry buildingEntry = IBuildingRegistry.getInstance().get(tileEntityColonyBuilding.getBuildingName()); if (buildingEntry == ModBuildings.home.get() || buildingEntry == ModBuildings.tavern.get()) { findPaneOfTypeByID("text", Text.class).setText(Component.translatable("com.minecolonies.core.gui.reactivate.message.living", Component.translatable(buildingEntry.getTranslationKey()))); diff --git a/src/main/java/com/minecolonies/core/network/messages/server/DirectPlaceMessage.java b/src/main/java/com/minecolonies/core/network/messages/server/DirectPlaceMessage.java index 17da34ef654..cbe3f59f365 100755 --- a/src/main/java/com/minecolonies/core/network/messages/server/DirectPlaceMessage.java +++ b/src/main/java/com/minecolonies/core/network/messages/server/DirectPlaceMessage.java @@ -102,10 +102,10 @@ protected void onExecute(final IPayloadContext ctxIn, final ServerPlayer player) if ((colony == null && state.getBlock() == ModBlocks.blockHutTownHall) || (colony != null && colony.getPermissions().hasPermission(player, Action.MANAGE_HUTS))) { - final ModDataComponents.ColonyId colonyId = ColonyId.readFromItemStack(stack); - if (colony != null && colonyId != null && colony.getID() != colonyId.id()) + final ModDataComponents.ColonyId colonyComponent = stack.get(ModDataComponents.COLONY_ID_COMPONENT); + if (colony != null && colonyComponent != null && colony.getID() != colonyComponent.id()) { - MessageUtils.format(WRONG_COLONY, colonyId.id()).sendTo(player); + MessageUtils.format(WRONG_COLONY, colonyComponent.id()).sendTo(player); return; } diff --git a/src/main/java/com/minecolonies/core/placementhandlers/main/SurvivalHandler.java b/src/main/java/com/minecolonies/core/placementhandlers/main/SurvivalHandler.java index d7ea82c2f9b..eb028f851f4 100644 --- a/src/main/java/com/minecolonies/core/placementhandlers/main/SurvivalHandler.java +++ b/src/main/java/com/minecolonies/core/placementhandlers/main/SurvivalHandler.java @@ -155,7 +155,7 @@ public void handle( final ItemStack inventoryStack = slot == -1 ? stack : player.getInventory().getItem(slot); - final ModDataComponents.ColonyId colonyComponent = ColonyId.readFromItemStack(stack); + final ModDataComponents.ColonyId colonyComponent = stack.get(ModDataComponents.COLONY_ID_COMPONENT); if (colonyComponent != null && tempColony != null && tempColony.getID() != colonyComponent.id()) { MessageUtils.format(WRONG_COLONY, colonyComponent.id()).sendTo(player); diff --git a/src/main/java/com/minecolonies/core/tileentities/TileEntityColonyBuilding.java b/src/main/java/com/minecolonies/core/tileentities/TileEntityColonyBuilding.java index a374e0a8212..cc8deb47488 100755 --- a/src/main/java/com/minecolonies/core/tileentities/TileEntityColonyBuilding.java +++ b/src/main/java/com/minecolonies/core/tileentities/TileEntityColonyBuilding.java @@ -568,7 +568,7 @@ public ResourceLocation getBuildingName() { if (registryName != null && !registryName.getPath().isEmpty()) { - return registryName; + return new ResourceLocation(registryName.getNamespace(), registryName.getPath().replace("home", "residence")); } return getBlockState().getBlock() instanceof AbstractBlockHut ? ((AbstractBlockHut) getBlockState().getBlock()).getBuildingEntry().getRegistryName() : null; }