use of net.minecraft.client.resources.model.ModelResourceLocation in project RFToolsDimensions by McJty.
the class DimletMemoryUnitItem method initModel.
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
ModelResourceLocation[] models = new ModelResourceLocation[3];
for (int i = 0; i < 3; i++) {
models[i] = new ModelResourceLocation(getRegistryName() + i, "inventory");
ModelBakery.registerItemVariants(this, models[i]);
}
ModelLoader.setCustomMeshDefinition(this, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return models[stack.getItemDamage()];
}
});
}
use of net.minecraft.client.resources.model.ModelResourceLocation in project MinecraftForge by MinecraftForge.
the class ForgeModelBakery method onPostBakeEvent.
/**
* Internal, do not use.
*/
public void onPostBakeEvent(Map<ResourceLocation, BakedModel> modelRegistry) {
BakedModel missingModel = modelRegistry.get(MISSING_MODEL_LOCATION);
for (Map.Entry<ResourceLocation, Exception> entry : loadingExceptions.entrySet()) {
// ignoring pure ResourceLocation arguments, all things we care about pass ModelResourceLocation
if (entry.getKey() instanceof ModelResourceLocation) {
LOGGER.debug(MODELLOADING, () -> new ModelLoaderErrorMessage((ModelResourceLocation) entry.getKey(), entry.getValue()));
final ModelResourceLocation location = (ModelResourceLocation) entry.getKey();
final BakedModel model = modelRegistry.get(location);
if (model == null) {
modelRegistry.put(location, missingModel);
}
}
}
loadingExceptions.clear();
isLoading = false;
}
use of net.minecraft.client.resources.model.ModelResourceLocation in project CodeChickenLib by Chicken-Bones.
the class ModelRegistryHelper method registerItemRenderer.
public static void registerItemRenderer(Item item, IItemRenderer renderer, ResourceLocation location) {
final ModelResourceLocation modelLoc = new ModelResourceLocation(location, "inventory");
register(modelLoc, renderer);
registerItemMesher(item, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return modelLoc;
}
});
}
use of net.minecraft.client.resources.model.ModelResourceLocation in project Charset by CharsetMC.
the class ProxyClient method onPostBake.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPostBake(ModelBakeEvent event) {
event.modelRegistry.putObject(new ModelResourceLocation("charsetwires:wire", "multipart"), rendererWire);
event.modelRegistry.putObject(new ModelResourceLocation("charsetwires:wire", "inventory"), rendererWire);
}
use of net.minecraft.client.resources.model.ModelResourceLocation in project Charset by CharsetMC.
the class ProxyClient method onPostBake.
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void onPostBake(ModelBakeEvent event) {
for (String s : ModCharsetGates.gateParts.keySet()) {
event.modelRegistry.putObject(new ModelResourceLocation(s, "multipart"), RendererGate.INSTANCE);
event.modelRegistry.putObject(new ModelResourceLocation(s, "inventory"), RendererGate.INSTANCE);
}
}
Aggregations