use of net.minecraft.client.resources.model.ModelResourceLocation in project BuildCraft by BuildCraft.
the class RedstoneBoardMeshDefinition method getModelLocation.
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
RedstoneBoardNBT<?> board;
if (stack == null || !stack.hasTagCompound()) {
board = RedstoneBoardRegistry.instance.getEmptyRobotBoard();
} else {
NBTTagCompound nbt = stack.getTagCompound();
board = RedstoneBoardRegistry.instance.getRedstoneBoard(nbt);
}
ModelResourceLocation loc = new ModelResourceLocation(board.getItemModelLocation(), "inventory");
return loc;
}
use of net.minecraft.client.resources.model.ModelResourceLocation in project RFToolsDimensions by McJty.
the class KnownDimlet method initModel.
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
ModelResourceLocation[] models = new ModelResourceLocation[DimletType.values().length];
int meta = 0;
for (DimletType type : DimletType.values()) {
models[meta] = new ModelResourceLocation(getRegistryName() + "_" + type.dimletType.getName().toLowerCase(), "inventory");
ModelBakery.registerItemVariants(this, models[meta]);
meta++;
}
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 RFToolsDimensions by McJty.
the class DimletTypeControllerItem method initModel.
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
Map<DimletType, ModelResourceLocation> models = new HashMap<>();
for (DimletType type : DimletType.values()) {
models.put(type, new ModelResourceLocation(getRegistryName() + calculateUnlocalizedNameSuffix(type), "inventory"));
ModelBakery.registerItemVariants(this, models.get(type));
}
ModelLoader.setCustomMeshDefinition(this, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return models.get(DimletType.values()[stack.getItemDamage()]);
}
});
}
use of net.minecraft.client.resources.model.ModelResourceLocation in project RFToolsDimensions by McJty.
the class StructureEssenceItem method initModel.
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
ModelResourceLocation resource = new ModelResourceLocation(getRegistryName(), "inventory");
ModelLoader.setCustomMeshDefinition(this, new ItemMeshDefinition() {
@Override
public ModelResourceLocation getModelLocation(ItemStack stack) {
return resource;
}
});
}
use of net.minecraft.client.resources.model.ModelResourceLocation in project RFToolsDimensions by McJty.
the class DimletControlCircuitItem method initModel.
@Override
@SideOnly(Side.CLIENT)
public void initModel() {
ModelResourceLocation[] models = new ModelResourceLocation[7];
for (int i = 0; i <= 6; 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()];
}
});
}
Aggregations