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

31 lines
952 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;
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 {
2018-10-19 18:32:20 +02:00
default Map<ItemStack, ModelVariant> getModelLocations() {
ItemStack stack = this instanceof Item ? new ItemStack((Item) this) : new ItemStack((Block) this);
String name = ((IModItem) this).getBaseName();
return Collections.singletonMap(stack, new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, name), "inventory"));
}
2018-10-13 20:35:18 +02:00
class ModelVariant {
public final ResourceLocation location;
public final String variant;
public ModelVariant(ResourceLocation location, String variant) {
this.location = location;
this.variant = variant;
}
}
}