com.magistuarmory.client.render.ModRender Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of 1.20.2-epic-knights-common Show documentation
Show all versions of 1.20.2-epic-knights-common Show documentation
mod that adds medieval stuff to the game
package com.magistuarmory.client.render;
import com.magistuarmory.api.item.ModItemsProvider;
import com.magistuarmory.block.ModBlockEntityTypes;
import com.magistuarmory.client.render.tileentity.HeraldryItemStackRenderer;
import com.magistuarmory.client.render.tileentity.PaviseBlockRenderer;
import com.magistuarmory.item.IHasModelProperty;
import com.magistuarmory.item.MedievalShieldItem;
import com.magistuarmory.item.armor.MedievalArmorItem;
import dev.architectury.injectables.annotations.ExpectPlatform;
import dev.architectury.registry.client.rendering.BlockEntityRendererRegistry;
import dev.architectury.registry.client.rendering.ColorHandlerRegistry;
import dev.architectury.registry.registries.RegistrySupplier;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.class_1768;
import net.minecraft.class_1792;
import net.minecraft.class_5617;
import java.util.function.Supplier;
@Environment(EnvType.CLIENT)
public class ModRender
{
public static void setup(ModItemsProvider content)
{
for (RegistrySupplier extends class_1792> supplier : content.dyeableItems)
ColorHandlerRegistry.registerItemColors((stack, i) -> i > 0 ? -1 : ((class_1768) stack.method_7909()).method_7800(stack), supplier.get());
for (RegistrySupplier extends class_1792> supplier : content.items)
if (supplier.get() instanceof IHasModelProperty havingproperty)
havingproperty.registerModelProperty();
setupPlatform(content);
}
@ExpectPlatform
public static void setupPlatform(ModItemsProvider content)
{
throw new AssertionError();
}
@ExpectPlatform
public static void registerModelsLoadListener(ModItemsProvider content)
{
throw new AssertionError();
}
public static void registerRenderers()
{
BlockEntityRendererRegistry.register(ModBlockEntityTypes.PAVISE.get(), PaviseBlockRenderer::new);
}
public static void loadModels(ModItemsProvider content, class_5617.class_5618 context)
{
for (Supplier supplier : content.shieldItems)
supplier.get().loadModel(context);
for (Supplier supplier : content.armorItems)
supplier.get().loadModel(context);
}
@ExpectPlatform
public static HeraldryItemStackRenderer createHeraldryItemStackRenderer(String id, String name)
{
throw new AssertionError();
}
}