当前位置: 首页>>代码示例>>Java>>正文


Java Properties类代码示例

本文整理汇总了Java中net.minecraftforge.common.property.Properties的典型用法代码示例。如果您正苦于以下问题:Java Properties类的具体用法?Java Properties怎么用?Java Properties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Properties类属于net.minecraftforge.common.property包,在下文中一共展示了Properties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getQuads

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:25,代码来源:OBJModel.java

示例2: renderTileEntityFast

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:23,代码来源:TileEntityFanRenderer.java

示例3: renderTileEntityFast

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
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);
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:AnimationTESR.java

示例4: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:11,代码来源:BlockSolarMirror.java

示例5: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:11,代码来源:BlockLiquidBoiler.java

示例6: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:12,代码来源:BlockTank.java

示例7: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:9,代码来源:BlockExtractor.java

示例8: createBlockState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@Override
public BlockStateContainer createBlockState()
{
    return new ExtendedBlockState(this,
            new IProperty[]{BlockMultiblockBase.MULTIBLOCK_GAG, BlockMultiblockBase.FACING},
            new IUnlistedProperty[]{Properties.AnimationProperty});
}
 
开发者ID:OPMCorp,项目名称:Qbar,代码行数:8,代码来源:BlockMultiblockBase.java

示例9: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:NekoCaffeine,项目名称:Alchemy,代码行数:10,代码来源:BlockSpellWovenTable.java

示例10: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:Bitterholz,项目名称:LP2,代码行数:15,代码来源:PipeRouted.java

示例11: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:Bitterholz,项目名称:LP2,代码行数:14,代码来源:PipeChassisMkI.java

示例12: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:Bitterholz,项目名称:LP2,代码行数:14,代码来源:PipeBlocking.java

示例13: getExtendedState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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;
}
 
开发者ID:Bitterholz,项目名称:LP2,代码行数:14,代码来源:PipeBasic.java

示例14: renderTileEntityFast

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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);
			}
		}
	}
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:33,代码来源:TileEntityPaintMixerRenderer.java

示例15: createBlockState

import net.minecraftforge.common.property.Properties; //导入依赖的package包/类
@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 });
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:8,代码来源:BlockSprinkler.java


注:本文中的net.minecraftforge.common.property.Properties类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。