User Tools

Site Tools


tutorial:mixin_accessors

This is an old revision of the document!


Mixin Accessors

Introduction

A type of mixin allows to you to access variables that are not visible (private) or final:

@Mixin(StructuresConfig.class)
public interface StructuresConfigAccessor {
    @Accessor("DEFAULT_STRUCTURES")
    public static void setDefaultStructures(ImmutableMap<StructureFeature<?>, StructureConfig> defaultStructures) {
        throw new IllegalAccessError();
    }
}

The error will never be thrown, you can use the function.

tutorial/mixin_accessors.1596666389.txt.gz · Last modified: 2020/08/05 22:26 by emmanuelmess