Skip to content

Commit b56666f

Browse files
committed
Fix petrelease-villager-bug
1 parent 3697072 commit b56666f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

modules/v1_20_R4/src/main/java/de/Keyle/MyPet/compat/v1_20_R4/services/EntityConverterService.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,10 @@ public void convertEntity(MyPet myPet, LivingEntity normalEntity) {
208208
TagCompound offersTag = villagerTag.get("Offers");
209209
CompoundTag vanillaNBT = (CompoundTag) ItemStackNBTConverter.compoundToVanillaCompound(offersTag);
210210
DataResult<MerchantOffers> dataresult = MerchantOffers.CODEC.parse(entityVillager.registryAccess().createSerializationContext(NbtOps.INSTANCE), vanillaNBT.get("Offers"));
211-
if(dataresult.hasResultOrPartial() && dataresult.resultOrPartial().isPresent()) {
211+
try {
212212
entityVillager.setOffers(dataresult.resultOrPartial().get());
213+
} catch (Exception e) {
214+
e.printStackTrace();
213215
}
214216
}
215217
if (villagerTag.containsKey("Inventory")) {

0 commit comments

Comments
 (0)