Thanks in advance to anyone that can help! I am working on a mod that adds new sherds into the game with the help of another modder with more experience. Below is the mixin to add new sherds that works for them, but not for me. This mixin works in a 1.20.1 version, but not a 1.21.
@Mixin(DecoratedPotPatterns.class)
public class DecoratedPotPatternsChanger {
@Inject(method = "fromSherd", at = @At("HEAD"), cancellable = true)
private static void fromSherd(Item item, CallbackInfoReturnable<RegistryKey<DecoratedPotPattern>> cir) {
if (item == ModItems.MELODY_POTTERY_SHERD) {
cir.setReturnValue(ModCustomSherdPatterns.MELODY_POTTERY_PATTERN);
}
if (item == ModItems.RECORD_POTTERY_SHERD) {
cir.setReturnValue(ModCustomSherdPatterns.RECORD_POTTERY_PATTERN);
}
if (item == ModItems.SOLO_POTTERY_SHERD) {
cir.setReturnValue(ModCustomSherdPatterns.SOLO_POTTERY_PATTERN);
}
}
@Inject(method = "registerAndGetDefault", at = @At("TAIL"), cancellable = true)
private static void registerAndGetDefault(Registry<DecoratedPotPattern> registry, CallbackInfoReturnable<DecoratedPotPattern> cir) {
ModCustomSherdPatterns.register(registry, ModCustomSherdPatterns.MELODY_POTTERY_PATTERN, "melody_pottery_sherd");
ModCustomSherdPatterns.register(registry, ModCustomSherdPatterns.RECORD_POTTERY_PATTERN, "record_pottery_sherd");
ModCustomSherdPatterns.register(registry, ModCustomSherdPatterns.SOLO_POTTERY_PATTERN, "solo_pottery_sherd");
}
}