Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Villagers Trades with Air on tagged offers when passed null entity #6109

Open
pietro-lopes opened this issue Nov 7, 2024 · 0 comments
Open
Labels

Comments

@pietro-lopes
Copy link

Minecraft Version

1.21.1

Immersive Engineering Version

12.0.0-182

Expected Behavior

This function should at least try to get registryAccess from server if level is null.

public TradeListing(@Nonnull TradeOutline outline, @Nonnull TagKey<Item> tag, @Nonnull PriceInterval buyAmounts, int maxUses, int xp)
{
this(outline, l -> l!=null?IEApi.getPreferredTagStack(l.registryAccess(), tag): ItemStack.EMPTY, buyAmounts, maxUses, xp);
}

Actual Behavior

PneumaticCraft AmadronOfferManager calls offer with a null entity and causes tags to not be resolved.
https://github.com/TeamPneumatic/pnc-repressurized/blob/7d0872ed4abcd612081cbab06658df9c92108950/src/main/java/me/desht/pneumaticcraft/common/amadron/AmadronOfferManager.java#L349-L358

public MerchantOffer getOffer(@Nullable Entity trader, @Nonnull RandomSource rand)
{
ItemStack buying = this.lazyItem.apply(trader!=null?trader.level(): null);
return this.outline.generateOffer(buying, priceInfo, rand, maxUses, xp, priceMultiplier);
}

Steps to reproduce

  1. Install IE with PneumaticCraft
  2. Try to get a Machinist to trade
  3. Coal Coke (which uses #c:coal_coke) will be air

Debug Crash Log

no log needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant