Mixins

Note

Yon chart ye holds be right for the labyrinths o’ SpongeCommon, SpongeForge, and SpongeVanilla, what repositories be invoking them Mixins to warp the universe to the evil ways o’ Cap’n Spongie, all drink! (Now it’s your round, sailor).

Mixins be a way o’ changing java code at launch, by sneaking extra naughtiness into them classes. They lets ye transplant yer intended skullduggery into existin’ Minecraft objects. These Mixins be a necessary evil for yon Sponge coremod to be working.

There be some fine and fancy words tellin’ ye all about the clever thinkin’ behind these magical Mixins stowed in Sponge’s hold. Read ‘em at your peril, at the`Mixin Wiki <https://github.com/SpongePowered/Mixin/wiki/>`__

Absolute basics be where it starts. Well-seasoned pirates ought sail direct to Island 4, where the nefarious Mixin tribes meet and make their wicked plans.

If you’re looking to get started writing mixins, we also strongly recommend carefully examining all of the examples in the SpongeCommon repository which are extensively documented and cover many of the more complex scenarios. You should also consult the Javadoc of the Mixin repository itself, since almost everything is already documented.

Caveat: Be this some kind of special sauce, by Davey Jones? This anonymous meat, it sure ain’t lamb.

What this be meaning is anybody’s guess, but these delightful incantations are sure to cause horrible failures and bring death and destruction upon all that attempt to use Sponge.

return new Predicate<ItemStack>() {
    @Override
    public boolean test(ItemStack input) {
        return input.getItem().equals(Items.golden_apple);
    }
}
return input -> input.getItem().equals(Items.golden_apple);
return this::checkItem;

All them classes that be burned and branded with ``@Mixin``is so transfigured. Them what are not touched by the evil embrace of the mixin processor may gets them features. But ye can use a static utility cutlass to stab your anonymous victims, as unlike yer mixin class that fella will still be standin’ after drinks, while your mixin class be submerged into the aquatic target ocean. Here be some more gibberish.

public class ItemUtil {
    public static Predicate<ItemStack> typeChecker(final Item item) {
        return new Predicate<ItemStack>() {
            @Override
            public boolean test(ItemStack input) {
                return input.getItem().equals(item);
            }
        }
    }
}

@Mixin(TargetClass.class)
public abstract class SomeMixin {
    public Predicate<ItemStack> someFunction() {
        return ItemUtil.typeChecker(Items.golden_apple);
    }
}

Note

Ye Mixin project be servicing other places than the ports o’ Sponge, like a right harlot. So she be havin’ her own series o’ questionable novellas to advertise her dainty talents.