本文整理汇总了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;
}
示例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);
}
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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});
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
}
示例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 });
}