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

com.parzivail.p3d.P3dBlockRendererRegistry Maven / Gradle / Ivy

There is a newer version: 0.0.114+1.20.2
Show newest version
package com.parzivail.p3d;

import java.util.HashMap;
import net.minecraft.class_2248;

public class P3dBlockRendererRegistry
{
	private static final IP3dBlockRenderer defaultRenderer = (matrices, quadEmitter, target, randomSupplier, renderContext, model, baseSprite, additionalSprites) -> {
		model.renderBlock(matrices, quadEmitter, target, null, (target1, objectName) -> baseSprite, randomSupplier, renderContext);
	};

	private static final HashMap blockTransformers = new HashMap<>();

	public static void register(class_2248 block, IP3dBlockRenderer transformer)
	{
		blockTransformers.put(block, transformer);
	}

	public static IP3dBlockRenderer get(class_2248 block)
	{
		return blockTransformers.getOrDefault(block, defaultRenderer);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy