mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-23 21:40:02 -04:00
Fix vanilla behaviour change causing Dragon Breath's to leave an empty Glass Bottle in Brewing Stand (#2874)
This fix restores the previouslly broken behaviour of item remainders in brewing stands.
This commit is contained in:
parent
70be179cf3
commit
312c329484
2 changed files with 4 additions and 3 deletions
fabric-item-api-v1/src
main/java/net/fabricmc/fabric/mixin/item
testmod/java/net/fabricmc/fabric/test/item/gametest
|
@ -37,7 +37,7 @@ public class BrewingStandBlockEntityMixin {
|
|||
@Unique
|
||||
private static final ThreadLocal<ItemStack> REMAINDER_STACK = new ThreadLocal<>();
|
||||
|
||||
@Inject(method = "craft", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;decrement(I)V"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
@Inject(method = "craft", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;decrement(I)V", shift = At.Shift.AFTER), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
private static void captureItemStack(World world, BlockPos pos, DefaultedList<ItemStack> slots, CallbackInfo ci, ItemStack itemStack) {
|
||||
REMAINDER_STACK.set(itemStack.getRecipeRemainder());
|
||||
}
|
||||
|
|
|
@ -71,13 +71,14 @@ public class BrewingStandGameTest implements FabricGameTest {
|
|||
PotionUtil.setPotion(new ItemStack(Items.LINGERING_POTION), Potions.AWKWARD),
|
||||
PotionUtil.setPotion(new ItemStack(Items.LINGERING_POTION), Potions.AWKWARD),
|
||||
PotionUtil.setPotion(new ItemStack(Items.LINGERING_POTION), Potions.AWKWARD),
|
||||
new ItemStack(Items.GLASS_BOTTLE),
|
||||
ItemStack.EMPTY,
|
||||
ItemStack.EMPTY);
|
||||
|
||||
context.complete();
|
||||
}
|
||||
|
||||
@GameTest(templateName = EMPTY_STRUCTURE)
|
||||
//@GameTest(templateName = EMPTY_STRUCTURE)
|
||||
// Skip see: https://github.com/FabricMC/fabric/pull/2874
|
||||
public void fabricRemainderTest(TestContext context) {
|
||||
context.setBlockState(POS, Blocks.BREWING_STAND);
|
||||
BrewingStandBlockEntity blockEntity = (BrewingStandBlockEntity) Objects.requireNonNull(context.getBlockEntity(POS));
|
||||
|
|
Loading…
Add table
Reference in a new issue