NaturesAura/src/main/java/de/ellpeck/naturesaura/reg/IModelProvider.java

21 lines
760 B
Java
Raw Normal View History

2018-10-13 20:35:18 +02:00
package de.ellpeck.naturesaura.reg;
2018-10-19 18:32:20 +02:00
import de.ellpeck.naturesaura.NaturesAura;
import net.minecraft.block.Block;
2019-10-20 22:30:49 +02:00
import net.minecraft.client.renderer.model.ModelResourceLocation;
2018-10-19 18:32:20 +02:00
import net.minecraft.item.Item;
2018-10-13 20:35:18 +02:00
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
2018-10-19 18:32:20 +02:00
import java.util.Collections;
2018-10-13 20:35:18 +02:00
import java.util.Map;
public interface IModelProvider {
default Map<ItemStack, ModelResourceLocation> getModelLocations() {
2018-10-19 18:32:20 +02:00
ItemStack stack = this instanceof Item ? new ItemStack((Item) this) : new ItemStack((Block) this);
String name = ((IModItem) this).getBaseName();
return Collections.singletonMap(stack, new ModelResourceLocation(new ResourceLocation(NaturesAura.MOD_ID, name), "inventory"));
2018-10-13 20:35:18 +02:00
}
}