Skip to content

Commit

Permalink
Fix petrelease-villager-bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakllp committed Dec 13, 2024
1 parent 3697072 commit b56666f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,10 @@ public void convertEntity(MyPet myPet, LivingEntity normalEntity) {
TagCompound offersTag = villagerTag.get("Offers");
CompoundTag vanillaNBT = (CompoundTag) ItemStackNBTConverter.compoundToVanillaCompound(offersTag);
DataResult<MerchantOffers> dataresult = MerchantOffers.CODEC.parse(entityVillager.registryAccess().createSerializationContext(NbtOps.INSTANCE), vanillaNBT.get("Offers"));
if(dataresult.hasResultOrPartial() && dataresult.resultOrPartial().isPresent()) {
try {
entityVillager.setOffers(dataresult.resultOrPartial().get());
} catch (Exception e) {
e.printStackTrace();
}
}
if (villagerTag.containsKey("Inventory")) {
Expand Down

0 comments on commit b56666f

Please sign in to comment.