本文整理汇总了Java中net.minecraft.util.EnumTypeAdapterFactory类的典型用法代码示例。如果您正苦于以下问题:Java EnumTypeAdapterFactory类的具体用法?Java EnumTypeAdapterFactory怎么用?Java EnumTypeAdapterFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnumTypeAdapterFactory类属于net.minecraft.util包,在下文中一共展示了EnumTypeAdapterFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupGsonSerialiser
import net.minecraft.util.EnumTypeAdapterFactory; //导入依赖的package包/类
@Override
public void setupGsonSerialiser(GsonBuilder gsonBuilder) {
new PrivateFields<GsonBuilder, Excluder>(GsonBuilder.class, new Obf("excluder") {}) {}
.set(gsonBuilder, Excluder.DEFAULT); // grr
gsonBuilder
.registerTypeAdapterFactory(new EnumTypeAdapterFactory())
.registerTypeHierarchyAdapter(Value.class, new ValueSerializer());
}
示例2: IMetadataSerializer
import net.minecraft.util.EnumTypeAdapterFactory; //导入依赖的package包/类
public IMetadataSerializer()
{
this.gsonBuilder.registerTypeHierarchyAdapter(IChatComponent.class, new IChatComponent.Serializer());
this.gsonBuilder.registerTypeHierarchyAdapter(ChatStyle.class, new ChatStyle.Serializer());
this.gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory());
}
示例3: MetadataSerializer
import net.minecraft.util.EnumTypeAdapterFactory; //导入依赖的package包/类
public MetadataSerializer()
{
this.gsonBuilder.registerTypeHierarchyAdapter(ITextComponent.class, new ITextComponent.Serializer());
this.gsonBuilder.registerTypeHierarchyAdapter(Style.class, new Style.Serializer());
this.gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory());
}
示例4: setupGsonSerialiser
import net.minecraft.util.EnumTypeAdapterFactory; //导入依赖的package包/类
@Override
public void setupGsonSerialiser(GsonBuilder gsonBuilder) {
super.setupGsonSerialiser(gsonBuilder);
gsonBuilder.registerTypeAdapterFactory(new EnumTypeAdapterFactory());
}