All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.magistuarmory.client.render.ModRender Maven / Gradle / Ivy

There is a newer version: 8.10
Show newest version
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 supplier : content.dyeableItems)
			ColorHandlerRegistry.registerItemColors((stack, i) -> i > 0 ? -1 : ((class_1768) stack.method_7909()).method_7800(stack), supplier.get());

		for (RegistrySupplier 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();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy