Java 类net.minecraftforge.common.property.Properties 实例源码

项目:CustomWorldGen    文件:OBJModel.java   
@Override
public List<BakedQuad> getQuads(IBlockState blockState, EnumFacing side, long rand)
{
    if (side != null) return ImmutableList.of();
    if (quads == null)
    {
        quads = buildQuads(this.state);
    }
    if (blockState instanceof IExtendedBlockState)
    {
        IExtendedBlockState exState = (IExtendedBlockState) blockState;
        if (exState.getUnlistedNames().contains(Properties.AnimationProperty))
        {

            IModelState newState = exState.getValue(Properties.AnimationProperty);
            if (newState != null)
            {
                newState = new ModelStateComposition(this.state, newState);
                return buildQuads(newState);
            }
        }
    }
    return quads;
}
项目:OpenBlocks    文件:TileEntityFanRenderer.java   
@Override
public void renderTileEntityFast(TileEntityFan te, double x, double y, double z, float partialTicks, int destroyStage, float alpha, BufferBuilder renderer) {
    if (blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();

    final BlockPos pos = te.getPos();
    final IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
    IBlockState state = world.getBlockState(pos);

    if (state.getPropertyKeys().contains(Properties.StaticProperty)) {
        state = state.withProperty(Properties.StaticProperty, false);
    }

    if (state instanceof IExtendedBlockState) {
        state = state.getBlock().getExtendedState(state, world, pos);

        IExtendedBlockState exState = ((IExtendedBlockState)state).withProperty(EvalModelState.PROPERTY, te.getTesrRenderState(partialTicks));
        final IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(exState.getClean());
        renderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());
        blockRenderer.getBlockModelRenderer().renderModel(world, model, exState, pos, renderer, false);
        renderer.setTranslation(0, 0, 0);
    }
}
项目:CustomWorldGen    文件:AnimationTESR.java   
public void renderTileEntityFast(T te, double x, double y, double z, float partialTick, int breakStage, VertexBuffer renderer)
{
    if(!te.hasCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null))
    {
        return;
    }
    if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
    BlockPos pos = te.getPos();
    IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
    IBlockState state = world.getBlockState(pos);
    if(state.getPropertyNames().contains(Properties.StaticProperty))
    {
        state = state.withProperty(Properties.StaticProperty, false);
    }
    if(state instanceof IExtendedBlockState)
    {
        IExtendedBlockState exState = (IExtendedBlockState)state;
        if(exState.getUnlistedNames().contains(Properties.AnimationProperty))
        {
            float time = Animation.getWorldTime(getWorld(), partialTick);
            Pair<IModelState, Iterable<Event>> pair = te.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null).apply(time);
            handleEvents(te, time, pair.getRight());

            // TODO: caching?
            IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(exState.getClean());
            exState = exState.withProperty(Properties.AnimationProperty, pair.getLeft());

            renderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());

            blockRenderer.getBlockModelRenderer().renderModel(world, model, exState, pos, renderer, false);
        }
    }
}
项目:Qbar    文件:BlockSolarMirror.java   
@Override
public IBlockState getExtendedState(final IBlockState state, final IBlockAccess world, final BlockPos pos)
{
    if (this.checkWorldTile(world, pos))
    {
        final TileSolarMirror tile = this.getWorldTile(world, pos);
        return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, tile.state);
    }
    return state;
}
项目:Qbar    文件:BlockLiquidBoiler.java   
@Override
public IBlockState getExtendedState(final IBlockState state, final IBlockAccess world, final BlockPos pos)
{
    if (this.checkWorldTile(world, pos))
    {
        final TileLiquidBoiler tile = this.getWorldTile(world, pos);
        return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, tile.state);
    }
    return state;
}
项目:Qbar    文件:BlockTank.java   
@Override
public IBlockState getExtendedState(final IBlockState state, final IBlockAccess world, final BlockPos pos)
{
    if (this.checkWorldTile(world, pos))
    {
        final TileTank tile = this.getWorldTile(world, pos);
        if (tile.getTier() != 0)
            return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, tile.state);
    }
    return state;
}
项目:Qbar    文件:BlockExtractor.java   
@Override
public IBlockState getExtendedState(final IBlockState state, final IBlockAccess world, final BlockPos pos)
{
    if (this.checkWorldTile(world, pos))
        return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty,
                this.getWorldTile(world, pos).state);
    return state;
}
项目:Qbar    文件:BlockMultiblockBase.java   
@Override
public BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this,
            new IProperty[]{BlockMultiblockBase.MULTIBLOCK_GAG, BlockMultiblockBase.FACING},
            new IUnlistedProperty[]{Properties.AnimationProperty});
}
项目:Alchemy    文件:BlockSpellWovenTable.java   
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
    if (world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileEntitySpellWovenTable) {
        TileEntitySpellWovenTable te = (TileEntitySpellWovenTable) world.getTileEntity(pos);
        if (te.transform != TRSRTransformation.identity())
            return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, te.transform);
    }
    return state;
}
项目:LP2    文件:PipeRouted.java   
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
    if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileRoutedPipe) {
        TileRoutedPipe te = (TileRoutedPipe)world.getTileEntity(pos);
        te.checkConnections(world, pos);
        ArrayList<String> check = te.checkConnections(world, pos);
        if(!hidden.equals(check)) {
            hidden.clear();
            hidden.addAll(check);
        }
        return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, this.state);
    }
    return state;
}
项目:LP2    文件:PipeChassisMkI.java   
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
    if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileChassisMkI) {
        TileChassisMkI te = (TileChassisMkI)world.getTileEntity(pos);
        ArrayList<String> check = te.checkConnections(world, pos);
        if(!hidden.equals(check)) {
            hidden.clear();
            hidden.addAll(check);
        }
        return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, this.state);
    }
    return state;
}
项目:LP2    文件:PipeBlocking.java   
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
    if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileBlockingPipe) {
        TileBlockingPipe te = (TileBlockingPipe)world.getTileEntity(pos);
        ArrayList<String> check = te.checkConnections(world, pos);
        if(!hidden.equals(check)) {
            hidden.clear();
            hidden.addAll(check);
        }
        return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, this.state);
    }
    return state;
}
项目:LP2    文件:PipeBasic.java   
@Override
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
    if(world.getTileEntity(pos) != null && world.getTileEntity(pos) instanceof TileBasicPipe) {
        TileBasicPipe te = (TileBasicPipe)world.getTileEntity(pos);
        ArrayList<String> check = te.checkConnections(world, pos);
        if(!hidden.equals(check)) {
            hidden.clear();
            hidden.addAll(check);
        }
        return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, this.state);
    }
    return state;
}
项目:OpenBlocks    文件:TileEntityPaintMixerRenderer.java   
@Override
public void renderTileEntityFast(TileEntityPaintMixer te, double x, double y, double z, float partialTick, int breakStage, float alpha, BufferBuilder renderer) {
    if (te.hasPaint()) {
        if (!te.hasCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null)) { return; }
        if (blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();

        final BlockPos pos = te.getPos();
        final IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
        IBlockState state = world.getBlockState(pos);

        if (state.getPropertyKeys().contains(Properties.StaticProperty)) {
            state = state.withProperty(Properties.StaticProperty, false);
        }

        if (state instanceof IExtendedBlockState) {
            state = state.getBlock().getExtendedState(state, world, pos); // difference between this and AnimationTESR

            IExtendedBlockState exState = (IExtendedBlockState)state;
            if (exState.getUnlistedNames().contains(Properties.AnimationProperty)) {
                float time = Animation.getWorldTime(getWorld(), partialTick);
                Pair<IModelState, Iterable<Event>> pair = te.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null).apply(time);

                IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(exState.getClean());
                exState = exState.withProperty(Properties.AnimationProperty, pair.getLeft());

                renderer.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());

                blockRenderer.getBlockModelRenderer().renderModel(world, model, exState, pos, renderer, false);
            }
        }
    }
}
项目:OpenBlocks    文件:BlockSprinkler.java   
@Override
protected BlockStateContainer createBlockState() {
    // 1.8.9 Hack, crashes otherwise
    return new ExtendedBlockState(this,
            new IProperty[] { getPropertyOrientation(), BlockLiquid.LEVEL, Properties.StaticProperty },
            new IUnlistedProperty[] { EvalModelState.PROPERTY });
}
项目:Solar    文件:BlockPhenomena.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[]{State.ACTIVE}, new IUnlistedProperty[]{Properties.AnimationProperty});
}
项目:Qbar    文件:BlockExtractor.java   
@Override
protected BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this, new IProperty[]{BlockExtractor.FACING, BlockExtractor.FILTER},
            new IUnlistedProperty[]{Properties.AnimationProperty});
}
项目:Qbar    文件:BlockMultiblockBase.java   
public IBlockState getGhostState(final IBlockState state, final VisibilityModelState visibilityState)
{
    return ((IExtendedBlockState) state).withProperty(Properties.AnimationProperty, visibilityState);
}
项目:Alchemy    文件:BlockSpellWovenTable.java   
@Override
public BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] { Properties.AnimationProperty });
}
项目:LP2    文件:PipeRouted.java   
@Override
public BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
项目:LP2    文件:PipeChassisMkI.java   
@Override
public BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
项目:LP2    文件:PipeBlocking.java   
@Override
public BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
项目:LP2    文件:PipeBasic.java   
@Override
public BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] {Properties.AnimationProperty});
}
项目:Fallout_Equestria    文件:GeneralAllignBlockOneOone.java   
@Override
public BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[]{FACING}, new IUnlistedProperty[]{Properties.AnimationProperty});
}
项目:OpenBlocks    文件:TileEntitySprinklerRenderer.java   
@Override
public void renderTileEntityFast(TileEntitySprinkler te, double x, double y, double z, float partialTick, int breakStage, float alpha, BufferBuilder renderer) {
    if (blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();

    final BlockPos pos = te.getPos();
    final IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(te.getWorld(), pos);
    IBlockState state = world.getBlockState(pos);

    if (state.getPropertyKeys().contains(Properties.StaticProperty))
        state = state.withProperty(Properties.StaticProperty, false);

    if (state instanceof IExtendedBlockState) {
        IExtendedBlockState exState = (IExtendedBlockState)state;
        if (exState.getUnlistedNames().contains(EvalModelState.PROPERTY)) {
            Tessellator tessellator = Tessellator.getInstance();
            BufferBuilder vb = tessellator.getBuffer();
            bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
            RenderHelper.disableStandardItemLighting();
            GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            GlStateManager.enableBlend();
            GlStateManager.disableCull();

            if (Minecraft.isAmbientOcclusionEnabled()) {
                GlStateManager.shadeModel(GL11.GL_SMOOTH);
            } else {
                GlStateManager.shadeModel(GL11.GL_FLAT);
            }

            vb.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);

            exState = exState.withProperty(EvalModelState.PROPERTY, te.getRenderState());

            vb.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());

            final IBakedModel model = blockRenderer.getBlockModelShapes().getModelForState(exState.getClean());
            blockRenderer.getBlockModelRenderer().renderModel(world, model, exState, pos, vb, false);

            vb.setTranslation(0, 0, 0);

            tessellator.draw();

            RenderHelper.enableStandardItemLighting();
        }
    }
}
项目:OpenBlocks    文件:TileEntityProjectorRenderer.java   
private void renderProjector(TileEntityProjector projector, float partialTickTime, double x, double y, double z) {
    if (bakedSpinnerModel == null) return;
    if (!projector.hasCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null)) return;

    if (blockModelRenderer == null) {
        blockModelRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher().getBlockModelRenderer();
    }

    final BlockPos pos = projector.getPos();
    final IBlockAccess world = MinecraftForgeClient.getRegionRenderCache(projector.getWorld(), pos);
    final IBlockState state = world.getBlockState(pos);

    if (state instanceof IExtendedBlockState) {
        IExtendedBlockState exState = (IExtendedBlockState)state;
        if (exState.getUnlistedNames().contains(Properties.AnimationProperty)) {
            Tessellator tessellator = Tessellator.getInstance();
            BufferBuilder vb = tessellator.getBuffer();
            bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
            RenderHelper.disableStandardItemLighting();
            GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
            GlStateManager.enableBlend();
            GlStateManager.disableCull();

            if (Minecraft.isAmbientOcclusionEnabled()) {
                GlStateManager.shadeModel(GL11.GL_SMOOTH);
            } else {
                GlStateManager.shadeModel(GL11.GL_FLAT);
            }

            vb.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);

            float time = Animation.getWorldTime(getWorld(), partialTickTime);
            final Pair<IModelState, Iterable<Event>> pair = projector.getCapability(CapabilityAnimation.ANIMATION_CAPABILITY, null).apply(time);
            exState = exState.withProperty(Properties.AnimationProperty, pair.getLeft());

            vb.setTranslation(x - pos.getX(), y - pos.getY(), z - pos.getZ());

            blockModelRenderer.renderModel(world, bakedSpinnerModel, exState, pos, vb, false);

            vb.setTranslation(0, 0, 0);

            tessellator.draw();

            RenderHelper.enableStandardItemLighting();
        }
    }
}
项目:OpenBlocks    文件:BlockProjector.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this, new IProperty[] { getPropertyOrientation(), ACTIVE },
            new IUnlistedProperty[] { Properties.AnimationProperty });
}
项目:OpenBlocks    文件:BlockSprinkler.java   
public BlockSprinkler() {
    super(Material.WATER);
    setDefaultState(getDefaultState().withProperty(BlockLiquid.LEVEL, 1).withProperty(Properties.StaticProperty, true));
}
项目:OpenBlocks    文件:BlockPaintMixer.java   
public BlockPaintMixer() {
    super(Material.ROCK);
    setDefaultState(getDefaultState().withProperty(Properties.StaticProperty, true));
}
项目:OpenBlocks    文件:BlockPaintMixer.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            new IProperty[] { getPropertyOrientation(), Properties.StaticProperty },
            new IUnlistedProperty[] { Properties.AnimationProperty, CAN_COLOR });
}
项目:OpenBlocks    文件:BlockFan.java   
public BlockFan() {
    super(Material.CIRCUITS);
    setDefaultState(getDefaultState().withProperty(Properties.StaticProperty, true));
}
项目:OpenBlocks    文件:BlockFan.java   
@Override
protected BlockStateContainer createBlockState() {
    return new ExtendedBlockState(this,
            new IProperty[] { getPropertyOrientation(), Properties.StaticProperty },
            new IUnlistedProperty[] { EvalModelState.PROPERTY });
}