use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Realistic-Terrain-Generation by Team-RTG.
the class ButtonEntry method doRegisterModel.
@Override
protected void doRegisterModel(IStateMapper stateMapper) {
for (EnumFacing facing : EnumFacing.VALUES) ModelLoader.setCustomStateMapper(getBlock(facing), stateMapper);
for (int meta = 0; meta < button().getNbVariants(); ++meta) {
String variants = "type=" + button().getVariantName(meta);
ModelResourceLocation location = new ModelResourceLocation(externalName(internalName), variants);
ModelLoader.setCustomModelResourceLocation(getItemBlock(), meta, location);
LOGGER.debug("Model location: " + location);
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Realistic-Terrain-Generation by Team-RTG.
the class ItemEntry method doRegisterModel.
@Override
protected void doRegisterModel(IStateMapper stateMapper) {
if (getItem() instanceof Variable) {
Variable varItem = (Variable) getItem();
for (int meta = 0; meta < varItem.getNbVariants(); ++meta) {
ModelResourceLocation location = new ModelResourceLocation(externalName(varItem.getVariantName(meta)));
ModelLoader.setCustomModelResourceLocation(getItem(), meta, location);
LOGGER.debug("Model location: " + location);
}
} else {
ModelResourceLocation location = new ModelResourceLocation(externalName(internalName));
ModelLoader.setCustomModelResourceLocation(getItem(), 0, location);
LOGGER.debug("Model location: " + location);
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Realistic-Terrain-Generation by Team-RTG.
the class StairsEntry method doRegisterModel.
@Override
protected void doRegisterModel(IStateMapper stateMapper) {
for (EnumFacing facing : EnumFacing.HORIZONTALS) ModelLoader.setCustomStateMapper(getBlock(facing), stateMapper);
for (int meta = 0; meta < stairs().getNbVariants(); ++meta) {
ModelResourceLocation location = new ModelResourceLocation(externalName(internalName), stairs().getVariantName(meta));
ModelLoader.setCustomModelResourceLocation(getItemBlock(), meta, location);
LOGGER.debug("Model location: " + location);
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Realistic-Terrain-Generation by Team-RTG.
the class BlockEntry method doRegisterModel.
@Override
protected void doRegisterModel(IStateMapper stateMapper) {
for (int meta = 0; meta < getUBBlock().getNbVariants(); ++meta) {
ModelResourceLocation location = new ModelResourceLocation(externalName(internalName), "type=" + getUBBlock().getVariantName(meta));
ModelLoader.setCustomModelResourceLocation(getItemBlock(), meta, location);
LOGGER.debug("Model location: " + location);
}
}
use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Railcraft by Railcraft.
the class ItemTrackOutfitted method initializeClient.
@SideOnly(Side.CLIENT)
@Override
public void initializeClient() {
ArrayList<ModelResourceLocation> textures = new ArrayList<>();
for (TrackType trackType : TrackRegistry.TRACK_TYPE) {
for (TrackKit trackKit : TrackRegistry.TRACK_KIT) {
textures.add(new ModelResourceLocation(new ResourceLocation(RailcraftConstants.RESOURCE_DOMAIN, MODEL_PREFIX + trackType.getName() + "." + trackKit.getName()), "inventory"));
}
}
ModelManager.registerComplexItemModel(this, (stack -> new ModelResourceLocation(new ResourceLocation(RailcraftConstants.RESOURCE_DOMAIN, MODEL_PREFIX + getSuffix(stack)), "inventory")), textures.toArray(new ModelResourceLocation[textures.size()]));
}
Aggregations