use of net.minecraftforge.common.property.IExtendedBlockState in project ImmersiveEngineering by BluSunrize.
the class BlockConveyor method getExtendedState.
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
state = super.getExtendedState(state, world, pos);
if (state instanceof IExtendedBlockState) {
IExtendedBlockState ext = (IExtendedBlockState) state;
TileEntity te = world.getTileEntity(pos);
if (!(te instanceof TileEntityConveyorBelt))
return state;
state = ext.withProperty(ICONEYOR_PASSTHROUGH, ((TileEntityConveyorBelt) te).getConveyorSubtype());
}
return state;
}
use of net.minecraftforge.common.property.IExtendedBlockState in project ImmersiveEngineering by BluSunrize.
the class ClientProxy method drawSpecificFluidPipe.
@Override
public void drawSpecificFluidPipe(String configuration) {
final BlockRendererDispatcher blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
IBlockState state = IEContent.blockMetalDevice1.getStateFromMeta(BlockTypes_MetalDevice1.FLUID_PIPE.getMeta());
IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(state);
if (state instanceof IExtendedBlockState)
state = ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, TileEntityFluidPipe.getStateFromKey(configuration));
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0, 1);
RenderHelper.disableStandardItemLighting();
GlStateManager.blendFunc(770, 771);
GlStateManager.enableBlend();
GlStateManager.disableCull();
if (Minecraft.isAmbientOcclusionEnabled())
GlStateManager.shadeModel(7425);
else
GlStateManager.shadeModel(7424);
// if(model instanceof ISmartBlockModel)
// model = ((ISmartBlockModel) model).handleBlockState(state);
blockRenderer.getBlockModelRenderer().renderModelBrightness(model, state, .75f, false);
GlStateManager.popMatrix();
}
use of net.minecraftforge.common.property.IExtendedBlockState in project AgriCraft by AgriCraft.
the class RenderBlockCustomWood method renderWorldBlockStatic.
@Override
public void renderWorldBlockStatic(ITessellator tessellator, IBlockState state, B block, EnumFacing side) {
if (state instanceof IExtendedBlockState) {
CustomWoodType type = ((IExtendedBlockState) state).getValue(AgriProperties.CUSTOM_WOOD_TYPE);
this.renderWorldBlockWoodStatic(tessellator, (IExtendedBlockState) state, block, side, type.getIcon());
}
}
use of net.minecraftforge.common.property.IExtendedBlockState in project Railcraft by Railcraft.
the class BlockRailcraftWall method getActualState.
@Override
public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos) {
boolean north = canConnectTo(worldIn, pos.north());
boolean east = canConnectTo(worldIn, pos.east());
boolean south = canConnectTo(worldIn, pos.south());
boolean west = canConnectTo(worldIn, pos.west());
boolean smooth = north && !east && south && !west || !north && east && !south && west;
state = state.withProperty(UP, !smooth || !worldIn.isAirBlock(pos.up())).withProperty(NORTH, north).withProperty(EAST, east).withProperty(SOUTH, south).withProperty(WEST, west);
IExtendedBlockState actState = (IExtendedBlockState) state;
actState = actState.withProperty(Materials.MATERIAL_PROPERTY, MatTools.getMat(worldIn, pos));
return actState;
}
Aggregations