本文整理汇总了Java中net.minecraft.tileentity.TileEntityPiston.getProgress方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntityPiston.getProgress方法的具体用法?Java TileEntityPiston.getProgress怎么用?Java TileEntityPiston.getProgress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.tileentity.TileEntityPiston
的用法示例。
在下文中一共展示了TileEntityPiston.getProgress方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCollisionBoundingBox
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public AxisAlignedBB getCollisionBoundingBox(World worldIn, BlockPos pos, IBlockState state)
{
TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos);
if (tileentitypiston == null)
{
return null;
}
else
{
float f = tileentitypiston.getProgress(0.0F);
if (tileentitypiston.isExtending())
{
f = 1.0F - f;
}
return this.getBoundingBox(worldIn, pos, tileentitypiston.getPistonState(), f, tileentitypiston.getFacing());
}
}
示例2: getCollisionBoundingBoxFromPool
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
/**
* Returns a bounding box from the pool of bounding boxes (this means this box can change after the pool has been
* cleared to be reused)
*/
public AxisAlignedBB getCollisionBoundingBoxFromPool(World par1World, int par2, int par3, int par4)
{
TileEntityPiston tileentitypiston = this.getTileEntityAtLocation(par1World, par2, par3, par4);
if (tileentitypiston == null)
{
return null;
}
else
{
float f = tileentitypiston.getProgress(0.0F);
if (tileentitypiston.isExtending())
{
f = 1.0F - f;
}
return this.getAxisAlignedBB(par1World, par2, par3, par4, tileentitypiston.getStoredBlockID(), f, tileentitypiston.getPistonOrientation());
}
}
示例3: setBlockBoundsBasedOnState
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos)
{
TileEntityPiston tileentitypiston = this.getTileEntity(worldIn, pos);
if (tileentitypiston != null)
{
IBlockState iblockstate = tileentitypiston.getPistonState();
Block block = iblockstate.getBlock();
if (block == this || block.getMaterial() == Material.air)
{
return;
}
float f = tileentitypiston.getProgress(0.0F);
if (tileentitypiston.isExtending())
{
f = 1.0F - f;
}
block.setBlockBoundsBasedOnState(worldIn, pos);
if (block == Blocks.piston || block == Blocks.sticky_piston)
{
f = 0.0F;
}
EnumFacing enumfacing = tileentitypiston.getFacing();
this.minX = block.getBlockBoundsMinX() - (double)((float)enumfacing.getFrontOffsetX() * f);
this.minY = block.getBlockBoundsMinY() - (double)((float)enumfacing.getFrontOffsetY() * f);
this.minZ = block.getBlockBoundsMinZ() - (double)((float)enumfacing.getFrontOffsetZ() * f);
this.maxX = block.getBlockBoundsMaxX() - (double)((float)enumfacing.getFrontOffsetX() * f);
this.maxY = block.getBlockBoundsMaxY() - (double)((float)enumfacing.getFrontOffsetY() * f);
this.maxZ = block.getBlockBoundsMaxZ() - (double)((float)enumfacing.getFrontOffsetZ() * f);
}
}
示例4: setBlockBoundsBasedOnState
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
/**
* Updates the blocks bounds based on its current state. Args: world, x, y, z
*/
public void setBlockBoundsBasedOnState(IBlockAccess par1IBlockAccess, int par2, int par3, int par4)
{
TileEntityPiston tileentitypiston = this.getTileEntityAtLocation(par1IBlockAccess, par2, par3, par4);
if (tileentitypiston != null)
{
Block block = Block.blocksList[tileentitypiston.getStoredBlockID()];
if (block == null || block == this)
{
return;
}
block.setBlockBoundsBasedOnState(par1IBlockAccess, par2, par3, par4);
float f = tileentitypiston.getProgress(0.0F);
if (tileentitypiston.isExtending())
{
f = 1.0F - f;
}
int l = tileentitypiston.getPistonOrientation();
this.minX = block.getBlockBoundsMinX() - (double)((float)Facing.offsetsXForSide[l] * f);
this.minY = block.getBlockBoundsMinY() - (double)((float)Facing.offsetsYForSide[l] * f);
this.minZ = block.getBlockBoundsMinZ() - (double)((float)Facing.offsetsZForSide[l] * f);
this.maxX = block.getBlockBoundsMaxX() - (double)((float)Facing.offsetsXForSide[l] * f);
this.maxY = block.getBlockBoundsMaxY() - (double)((float)Facing.offsetsYForSide[l] * f);
this.maxZ = block.getBlockBoundsMaxZ() - (double)((float)Facing.offsetsZForSide[l] * f);
}
}
示例5: renderTileEntityAt
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage)
{
BlockPos blockpos = te.getPos();
IBlockState iblockstate = te.getPistonState();
Block block = iblockstate.getBlock();
if (block.getMaterial() != Material.air && te.getProgress(partialTicks) < 1.0F)
{
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
this.bindTexture(TextureMap.locationBlocksTexture);
RenderHelper.disableStandardItemLighting();
GlStateManager.blendFunc(770, 771);
GlStateManager.enableBlend();
GlStateManager.disableCull();
if (Minecraft.isAmbientOcclusionEnabled())
{
GlStateManager.shadeModel(7425);
}
else
{
GlStateManager.shadeModel(7424);
}
worldrenderer.begin(7, DefaultVertexFormats.BLOCK);
worldrenderer.setTranslation((double)((float)x - (float)blockpos.getX() + te.getOffsetX(partialTicks)), (double)((float)y - (float)blockpos.getY() + te.getOffsetY(partialTicks)), (double)((float)z - (float)blockpos.getZ() + te.getOffsetZ(partialTicks)));
World world = this.getWorld();
if (block == Blocks.piston_head && te.getProgress(partialTicks) < 0.5F)
{
iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true));
this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, true);
}
else if (te.shouldPistonHeadBeRendered() && !te.isExtending())
{
BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.sticky_piston ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT;
IBlockState iblockstate1 = Blocks.piston_head.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING));
iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F));
this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate1, world, blockpos), iblockstate1, blockpos, worldrenderer, true);
worldrenderer.setTranslation((double)((float)x - (float)blockpos.getX()), (double)((float)y - (float)blockpos.getY()), (double)((float)z - (float)blockpos.getZ()));
iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true));
this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, true);
}
else
{
this.blockRenderer.getBlockModelRenderer().renderModel(world, this.blockRenderer.getModelFromBlockState(iblockstate, world, blockpos), iblockstate, blockpos, worldrenderer, false);
}
worldrenderer.setTranslation(0.0D, 0.0D, 0.0D);
tessellator.draw();
RenderHelper.enableStandardItemLighting();
}
}
示例6: renderTileEntityAt
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage)
{
BlockPos blockpos = te.getPos();
IBlockState iblockstate = te.getPistonState();
Block block = iblockstate.getBlock();
if (iblockstate.getMaterial() != Material.AIR && te.getProgress(partialTicks) < 1.0F)
{
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
RenderHelper.disableStandardItemLighting();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.enableBlend();
GlStateManager.disableCull();
if (Minecraft.isAmbientOcclusionEnabled())
{
GlStateManager.shadeModel(7425);
}
else
{
GlStateManager.shadeModel(7424);
}
vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
vertexbuffer.setTranslation(x - (double)blockpos.getX() + (double)te.getOffsetX(partialTicks), y - (double)blockpos.getY() + (double)te.getOffsetY(partialTicks), z - (double)blockpos.getZ() + (double)te.getOffsetZ(partialTicks));
World world = this.getWorld();
if (block == Blocks.PISTON_HEAD && te.getProgress(partialTicks) <= 0.25F)
{
iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true));
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
}
else if (te.shouldPistonHeadBeRendered() && !te.isExtending())
{
BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.STICKY_PISTON ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT;
IBlockState iblockstate1 = Blocks.PISTON_HEAD.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING));
iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F));
this.renderStateModel(blockpos, iblockstate1, vertexbuffer, world, true);
vertexbuffer.setTranslation(x - (double)blockpos.getX(), y - (double)blockpos.getY(), z - (double)blockpos.getZ());
iblockstate = iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true));
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
}
else
{
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, false);
}
vertexbuffer.setTranslation(0.0D, 0.0D, 0.0D);
tessellator.draw();
RenderHelper.enableStandardItemLighting();
}
}
示例7: renderTileEntityAt
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public void renderTileEntityAt(TileEntityPiston te, double x, double y, double z, float partialTicks, int destroyStage)
{
if(blockRenderer == null) blockRenderer = Minecraft.getMinecraft().getBlockRendererDispatcher();
BlockPos blockpos = te.getPos();
IBlockState iblockstate = te.getPistonState();
Block block = iblockstate.getBlock();
if (iblockstate.getMaterial() != Material.AIR && te.getProgress(partialTicks) < 1.0F)
{
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
this.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
RenderHelper.disableStandardItemLighting();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
GlStateManager.enableBlend();
GlStateManager.disableCull();
if (Minecraft.isAmbientOcclusionEnabled())
{
GlStateManager.shadeModel(7425);
}
else
{
GlStateManager.shadeModel(7424);
}
vertexbuffer.begin(7, DefaultVertexFormats.BLOCK);
vertexbuffer.setTranslation((double)((float)x - (float)blockpos.getX() + te.getOffsetX(partialTicks)), (double)((float)y - (float)blockpos.getY() + te.getOffsetY(partialTicks)), (double)((float)z - (float)blockpos.getZ() + te.getOffsetZ(partialTicks)));
World world = this.getWorld();
if (block == Blocks.PISTON_HEAD && te.getProgress(partialTicks) < 0.5F)
{
iblockstate = iblockstate.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(true));
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
}
else if (te.shouldPistonHeadBeRendered() && !te.isExtending())
{
BlockPistonExtension.EnumPistonType blockpistonextension$enumpistontype = block == Blocks.STICKY_PISTON ? BlockPistonExtension.EnumPistonType.STICKY : BlockPistonExtension.EnumPistonType.DEFAULT;
IBlockState iblockstate1 = Blocks.PISTON_HEAD.getDefaultState().withProperty(BlockPistonExtension.TYPE, blockpistonextension$enumpistontype).withProperty(BlockPistonExtension.FACING, iblockstate.getValue(BlockPistonBase.FACING));
iblockstate1 = iblockstate1.withProperty(BlockPistonExtension.SHORT, Boolean.valueOf(te.getProgress(partialTicks) >= 0.5F));
this.renderStateModel(blockpos, iblockstate1, vertexbuffer, world, true);
vertexbuffer.setTranslation((double)((float)x - (float)blockpos.getX()), (double)((float)y - (float)blockpos.getY()), (double)((float)z - (float)blockpos.getZ()));
iblockstate = iblockstate.withProperty(BlockPistonBase.EXTENDED, Boolean.valueOf(true));
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, true);
}
else
{
this.renderStateModel(blockpos, iblockstate, vertexbuffer, world, false);
}
vertexbuffer.setTranslation(0.0D, 0.0D, 0.0D);
tessellator.draw();
RenderHelper.enableStandardItemLighting();
}
}
示例8: renderPiston
import net.minecraft.tileentity.TileEntityPiston; //导入方法依赖的package包/类
public void renderPiston(TileEntityPiston par1TileEntityPiston, double par2, double par4, double par6, float par8)
{
Block block = Block.blocksList[par1TileEntityPiston.getStoredBlockID()];
if (block != null && par1TileEntityPiston.getProgress(par8) < 1.0F)
{
Tessellator tessellator = Tessellator.instance;
this.bindTexture(TextureMap.locationBlocksTexture);
RenderHelper.disableStandardItemLighting();
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_CULL_FACE);
if (Minecraft.isAmbientOcclusionEnabled())
{
GL11.glShadeModel(GL11.GL_SMOOTH);
}
else
{
GL11.glShadeModel(GL11.GL_FLAT);
}
tessellator.startDrawingQuads();
tessellator.setTranslation((double)((float)par2 - (float)par1TileEntityPiston.xCoord + par1TileEntityPiston.getOffsetX(par8)), (double)((float)par4 - (float)par1TileEntityPiston.yCoord + par1TileEntityPiston.getOffsetY(par8)), (double)((float)par6 - (float)par1TileEntityPiston.zCoord + par1TileEntityPiston.getOffsetZ(par8)));
tessellator.setColorOpaque(1, 1, 1);
if (block == Block.pistonExtension && par1TileEntityPiston.getProgress(par8) < 0.5F)
{
this.blockRenderer.renderPistonExtensionAllFaces(block, par1TileEntityPiston.xCoord, par1TileEntityPiston.yCoord, par1TileEntityPiston.zCoord, false);
}
else if (par1TileEntityPiston.shouldRenderHead() && !par1TileEntityPiston.isExtending())
{
Block.pistonExtension.setHeadTexture(((BlockPistonBase)block).getPistonExtensionTexture());
this.blockRenderer.renderPistonExtensionAllFaces(Block.pistonExtension, par1TileEntityPiston.xCoord, par1TileEntityPiston.yCoord, par1TileEntityPiston.zCoord, par1TileEntityPiston.getProgress(par8) < 0.5F);
Block.pistonExtension.clearHeadTexture();
tessellator.setTranslation((double)((float)par2 - (float)par1TileEntityPiston.xCoord), (double)((float)par4 - (float)par1TileEntityPiston.yCoord), (double)((float)par6 - (float)par1TileEntityPiston.zCoord));
this.blockRenderer.renderPistonBaseAllFaces(block, par1TileEntityPiston.xCoord, par1TileEntityPiston.yCoord, par1TileEntityPiston.zCoord);
}
else
{
this.blockRenderer.renderBlockAllFaces(block, par1TileEntityPiston.xCoord, par1TileEntityPiston.yCoord, par1TileEntityPiston.zCoord);
}
tessellator.setTranslation(0.0D, 0.0D, 0.0D);
tessellator.draw();
RenderHelper.enableStandardItemLighting();
}
}