use of net.minecraft.client.renderer.block.model.ModelResourceLocation in project Witchworks by Um-Mitternacht.
the class BlockFluid method registerModels.
@Override
@SideOnly(Side.CLIENT)
public void registerModels() {
final Item item = Item.getItemFromBlock(this);
assert item != null;
ModelBakery.registerItemVariants(item);
final ModelResourceLocation modelResourceLocation = new ModelResourceLocation(LibMod.MOD_ID + ":fluid", getFluid().getName());
ModelLoader.setCustomMeshDefinition(item, stack -> modelResourceLocation);
ModelLoader.setCustomStateMapper(this, new StateMapperBase() {
@Override
protected ModelResourceLocation getModelResourceLocation(IBlockState p_178132_1_) {
return modelResourceLocation;
}
});
}
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);
}
}
Aggregations