Java 类net.minecraft.client.renderer.block.statemap.DefaultStateMapper 实例源码
项目:EnderIO
文件:BlockDetector.java
@Override
@SideOnly(Side.CLIENT)
public void registerRenderers(@Nonnull IModObject modObject) {
Item item = Item.getItemFromBlock(this);
Map<IBlockState, ModelResourceLocation> locations = new DefaultStateMapper().putStateModelLocations(this);
IBlockState state = getDefaultState().withProperty(IS_ON, true).withProperty(FACING, EnumFacing.UP);
ModelResourceLocation mrl = locations.get(state);
ModelLoader.setCustomModelResourceLocation(item, 0, mrl);
}
项目:EnderIO
文件:BlockDecoration.java
@Override
@SideOnly(Side.CLIENT)
public void registerRenderers(@Nonnull IModObject modObject) {
Item item = Item.getItemFromBlock(this);
Map<IBlockState, ModelResourceLocation> locations = new DefaultStateMapper().putStateModelLocations(this);
NNIterator<EnumDecoBlock> iterator = NNList.of(EnumDecoBlock.class).iterator();
while (iterator.hasNext()) {
EnumDecoBlock type = iterator.next();
IBlockState state = getDefaultState().withProperty(EnumDecoBlock.TYPE, type);
ModelResourceLocation mrl = locations.get(state);
ModelLoader.setCustomModelResourceLocation(item, EnumDecoBlock.getMetaFromType(type), mrl);
}
}
项目:EnderIO
文件:BlockDecorationFacing.java
@Override
@SideOnly(Side.CLIENT)
public void registerRenderers(@Nonnull IModObject modObject) {
Item item = Item.getItemFromBlock(this);
Map<IBlockState, ModelResourceLocation> locations = new DefaultStateMapper().putStateModelLocations(this);
NNIterator<EnumDecoBlock> iterator = NNList.of(EnumDecoBlock.class).iterator();
while (iterator.hasNext()) {
EnumDecoBlock type = iterator.next();
IBlockState state = getDefaultState().withProperty(EnumDecoBlock.TYPE, type).withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false);
ModelResourceLocation mrl = locations.get(state);
ModelLoader.setCustomModelResourceLocation(item, EnumDecoBlock.getMetaFromType(type), mrl);
}
}