use of forestry.core.blocks.IMachinePropertiesTesr in project ForestryMC by ForestryMC.
the class MachineParticleCallback method setTexture.
@Override
@SideOnly(Side.CLIENT)
protected void setTexture(ParticleDigging fx, World world, BlockPos pos, IBlockState state) {
IMachineProperties<?> machineProperties = blockType.getMachineProperties();
if (machineProperties instanceof IMachinePropertiesTesr) {
Minecraft minecraft = Minecraft.getMinecraft();
TextureMap textureMapBlocks = minecraft.getTextureMapBlocks();
IMachinePropertiesTesr machinePropertiesTesr = (IMachinePropertiesTesr) machineProperties;
String particleTextureLocation = machinePropertiesTesr.getParticleTextureLocation();
TextureAtlasSprite particleTexture = textureMapBlocks.getAtlasSprite(particleTextureLocation);
fx.setParticleTexture(particleTexture);
}
}
use of forestry.core.blocks.IMachinePropertiesTesr in project ForestryMC by ForestryMC.
the class MachineStateMapper method putStateModelLocations.
@Override
public Map<IBlockState, ModelResourceLocation> putStateModelLocations(Block block) {
if (!(type.getMachineProperties() instanceof IMachinePropertiesTesr)) {
for (EnumFacing facing : EnumFacing.values()) {
if (facing == EnumFacing.DOWN || facing == EnumFacing.UP) {
continue;
}
IBlockState state = block.getDefaultState().withProperty(BlockBase.FACING, facing);
LinkedHashMap<IProperty<?>, Comparable<?>> linkedhashmap = Maps.newLinkedHashMap(state.getProperties());
ResourceLocation blockLocation = Block.REGISTRY.getNameForObject(block);
String s = String.format("%s:%s", blockLocation.getResourceDomain(), blockLocation.getResourcePath());
mapStateModelLocations.put(state, new ModelResourceLocation(s, getPropertyString(linkedhashmap)));
}
}
return this.mapStateModelLocations;
}
Aggregations