Migrate AstraSoups to NeoForge as AstraCauldron

This commit is contained in:
2026-09-08 19:44:45 +03:00
parent 8391dfe739
commit a82c2aa0f9
52 changed files with 2095 additions and 2010 deletions
@@ -0,0 +1,23 @@
package online.astradev.cauldron.mixin;
import net.minecraft.core.Holder;
import net.minecraft.core.component.*;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/** Per-stack patch is sent to vanilla clients; no change to their assumed item defaults. */
@Mixin(ItemStack.class)
abstract class SoupStackMixin {
@Inject(method = "<init>(Lnet/minecraft/core/Holder;ILnet/minecraft/core/component/PatchedDataComponentMap;)V", at = @At("RETURN"))
private void soups$stackSize(Holder<Item> item, int count, PatchedDataComponentMap components, CallbackInfo ci) {
var key = item.unwrapKey().orElse(null);
if (key == null || !key.identifier().getNamespace().equals("minecraft")) return;
switch (key.identifier().getPath()) {
case "mushroom_stew", "rabbit_stew", "beetroot_soup", "suspicious_stew" -> components.set(DataComponents.MAX_STACK_SIZE, 16);
default -> { }
}
}
}