Search in sources :

Example 1 with LazyMaterialInstance

use of net.silentchaos512.gear.gear.material.LazyMaterialInstance in project Silent-Gear by SilentChaos512.

the class LazyMaterialInstance method read.

public static LazyMaterialInstance read(FriendlyByteBuf buffer) {
    ResourceLocation id = buffer.readResourceLocation();
    MaterialGrade grade = buffer.readEnum(MaterialGrade.class);
    return new LazyMaterialInstance(id, grade);
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) MaterialGrade(net.silentchaos512.gear.api.part.MaterialGrade)

Example 2 with LazyMaterialInstance

use of net.silentchaos512.gear.gear.material.LazyMaterialInstance in project Silent-Gear by SilentChaos512.

the class LazyMaterialInstance method deserialize.

public static LazyMaterialInstance deserialize(JsonObject json) {
    ResourceLocation id = new ResourceLocation(GsonHelper.getAsString(json, "material"));
    MaterialGrade grade = EnumUtils.byName(GsonHelper.getAsString(json, "grade", "NONE"), MaterialGrade.NONE);
    return new LazyMaterialInstance(id, grade);
}
Also used : ResourceLocation(net.minecraft.resources.ResourceLocation) MaterialGrade(net.silentchaos512.gear.api.part.MaterialGrade)

Aggregations

ResourceLocation (net.minecraft.resources.ResourceLocation)2 MaterialGrade (net.silentchaos512.gear.api.part.MaterialGrade)2