本文整理汇总了Java中net.minecraft.block.BlockRedstoneDiode类的典型用法代码示例。如果您正苦于以下问题:Java BlockRedstoneDiode类的具体用法?Java BlockRedstoneDiode怎么用?Java BlockRedstoneDiode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockRedstoneDiode类属于net.minecraft.block包,在下文中一共展示了BlockRedstoneDiode类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onValidSurface
import net.minecraft.block.BlockRedstoneDiode; //导入依赖的package包/类
/**
* checks to make sure painting can be placed there
*/
public boolean onValidSurface()
{
if (!this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty())
{
return false;
}
else
{
int i = Math.max(1, this.getWidthPixels() / 16);
int j = Math.max(1, this.getHeightPixels() / 16);
BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite());
EnumFacing enumfacing = this.facingDirection.rotateYCCW();
for (int k = 0; k < i; ++k)
{
for (int l = 0; l < j; ++l)
{
BlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l);
Block block = this.worldObj.getBlockState(blockpos1).getBlock();
if (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block))
{
return false;
}
}
}
for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()))
{
if (entity instanceof EntityHanging)
{
return false;
}
}
return true;
}
}
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:42,代码来源:EntityHanging.java
示例2: onValidSurface
import net.minecraft.block.BlockRedstoneDiode; //导入依赖的package包/类
/**
* checks to make sure painting can be placed there
*/
public boolean onValidSurface()
{
if (!this.world.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty())
{
return false;
}
else
{
int i = Math.max(1, this.getWidthPixels() / 16);
int j = Math.max(1, this.getHeightPixels() / 16);
BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite());
EnumFacing enumfacing = this.facingDirection.rotateYCCW();
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for (int k = 0; k < i; ++k)
{
for (int l = 0; l < j; ++l)
{
int i1 = (i - 1) / -2;
int j1 = (j - 1) / -2;
blockpos$mutableblockpos.setPos(blockpos).move(enumfacing, k + i1).move(EnumFacing.UP, l + j1);
IBlockState iblockstate = this.world.getBlockState(blockpos$mutableblockpos);
if (!iblockstate.getMaterial().isSolid() && !BlockRedstoneDiode.isDiode(iblockstate))
{
return false;
}
}
}
return this.world.getEntitiesInAABBexcluding(this, this.getEntityBoundingBox(), IS_HANGING_ENTITY).isEmpty();
}
}
开发者ID:sudofox,项目名称:Backmemed,代码行数:37,代码来源:EntityHanging.java
示例3: onValidSurface
import net.minecraft.block.BlockRedstoneDiode; //导入依赖的package包/类
/**
* checks to make sure painting can be placed there
*/
public boolean onValidSurface()
{
if (!this.worldObj.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty())
{
return false;
}
else
{
int i = Math.max(1, this.getWidthPixels() / 16);
int j = Math.max(1, this.getHeightPixels() / 16);
BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite());
EnumFacing enumfacing = this.facingDirection.rotateYCCW();
BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();
for (int k = 0; k < i; ++k)
{
for (int l = 0; l < j; ++l)
{
int i1 = (i - 1) / -2;
int j1 = (j - 1) / -2;
blockpos$mutableblockpos.setPos(blockpos).move(enumfacing, k + i1).move(EnumFacing.UP, l + j1);
IBlockState iblockstate = this.worldObj.getBlockState(blockpos$mutableblockpos);
if (iblockstate.isSideSolid(this.worldObj, blockpos$mutableblockpos, this.facingDirection))
continue;
if (!iblockstate.getMaterial().isSolid() && !BlockRedstoneDiode.isDiode(iblockstate))
{
return false;
}
}
}
return this.worldObj.getEntitiesInAABBexcluding(this, this.getEntityBoundingBox(), IS_HANGING_ENTITY).isEmpty();
}
}
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:40,代码来源:EntityHanging.java
示例4: renderBlockRedstoneDiode
import net.minecraft.block.BlockRedstoneDiode; //导入依赖的package包/类
public boolean renderBlockRedstoneDiode(BlockRedstoneDiode p_147748_1_, int p_147748_2_, int p_147748_3_, int p_147748_4_)
{
Tessellator var5 = Tessellator.instance;
this.renderBlockRedstoneDiodeMetadata(p_147748_1_, p_147748_2_, p_147748_3_, p_147748_4_, this.blockAccess.getBlockMetadata(p_147748_2_, p_147748_3_, p_147748_4_) & 3);
return true;
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:7,代码来源:RenderBlocks.java
示例5: renderBlockRedstoneDiodeMetadata
import net.minecraft.block.BlockRedstoneDiode; //导入依赖的package包/类
public void renderBlockRedstoneDiodeMetadata(BlockRedstoneDiode p_147732_1_, int p_147732_2_, int p_147732_3_, int p_147732_4_, int p_147732_5_)
{
this.renderStandardBlock(p_147732_1_, p_147732_2_, p_147732_3_, p_147732_4_);
Tessellator var6 = Tessellator.instance;
var6.setBrightness(p_147732_1_.getBlockBrightness(this.blockAccess, p_147732_2_, p_147732_3_, p_147732_4_));
var6.setColorOpaque_F(1.0F, 1.0F, 1.0F);
int var7 = this.blockAccess.getBlockMetadata(p_147732_2_, p_147732_3_, p_147732_4_);
IIcon var8 = this.getBlockIconFromSideAndMetadata(p_147732_1_, 1, var7);
double var9 = (double)var8.getMinU();
double var11 = (double)var8.getMaxU();
double var13 = (double)var8.getMinV();
double var15 = (double)var8.getMaxV();
double var17 = 0.125D;
double var19 = (double)(p_147732_2_ + 1);
double var21 = (double)(p_147732_2_ + 1);
double var23 = (double)(p_147732_2_ + 0);
double var25 = (double)(p_147732_2_ + 0);
double var27 = (double)(p_147732_4_ + 0);
double var29 = (double)(p_147732_4_ + 1);
double var31 = (double)(p_147732_4_ + 1);
double var33 = (double)(p_147732_4_ + 0);
double var35 = (double)p_147732_3_ + var17;
if (p_147732_5_ == 2)
{
var19 = var21 = (double)(p_147732_2_ + 0);
var23 = var25 = (double)(p_147732_2_ + 1);
var27 = var33 = (double)(p_147732_4_ + 1);
var29 = var31 = (double)(p_147732_4_ + 0);
}
else if (p_147732_5_ == 3)
{
var19 = var25 = (double)(p_147732_2_ + 0);
var21 = var23 = (double)(p_147732_2_ + 1);
var27 = var29 = (double)(p_147732_4_ + 0);
var31 = var33 = (double)(p_147732_4_ + 1);
}
else if (p_147732_5_ == 1)
{
var19 = var25 = (double)(p_147732_2_ + 1);
var21 = var23 = (double)(p_147732_2_ + 0);
var27 = var29 = (double)(p_147732_4_ + 1);
var31 = var33 = (double)(p_147732_4_ + 0);
}
var6.addVertexWithUV(var25, var35, var33, var9, var13);
var6.addVertexWithUV(var23, var35, var31, var9, var15);
var6.addVertexWithUV(var21, var35, var29, var11, var15);
var6.addVertexWithUV(var19, var35, var27, var11, var13);
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:51,代码来源:RenderBlocks.java
示例6: renderBlockByRenderType
import net.minecraft.block.BlockRedstoneDiode; //导入依赖的package包/类
public boolean renderBlockByRenderType(Block p_147805_1_, int p_147805_2_, int p_147805_3_, int p_147805_4_)
{
int l = p_147805_1_.getRenderType();
if (l == -1)
{
return false;
}
else
{
p_147805_1_.setBlockBoundsBasedOnState(this.blockAccess, p_147805_2_, p_147805_3_, p_147805_4_);
this.setRenderBoundsFromBlock(p_147805_1_);
switch (l)
{
//regex: ' : \(l == ([\d]+) \?' replace: ';\ncase \1: return' ::: IMPORTANT: REMEMBER THIS ON FIRST line!
case 0 : return this.renderStandardBlock(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 4: return this.renderBlockLiquid(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 31: return this.renderBlockLog(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 1: return this.renderCrossedSquares(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 40: return this.renderBlockDoublePlant((BlockDoublePlant)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 2: return this.renderBlockTorch(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 20: return this.renderBlockVine(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 11: return this.renderBlockFence((BlockFence)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 39: return this.renderBlockQuartz(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 5: return this.renderBlockRedstoneWire(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 13: return this.renderBlockCactus(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 9: return this.renderBlockMinecartTrack((BlockRailBase)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 19: return this.renderBlockStem(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 23: return this.renderBlockLilyPad(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 6: return this.renderBlockCrops(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 3: return this.renderBlockFire((BlockFire)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 8: return this.renderBlockLadder(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 7: return this.renderBlockDoor(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 10: return this.renderBlockStairs((BlockStairs)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 27: return this.renderBlockDragonEgg((BlockDragonEgg)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 32: return this.renderBlockWall((BlockWall)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 12: return this.renderBlockLever(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 29: return this.renderBlockTripWireSource(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 30: return this.renderBlockTripWire(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 14: return this.renderBlockBed(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 15: return this.renderBlockRepeater((BlockRedstoneRepeater)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 36: return this.renderBlockRedstoneDiode((BlockRedstoneDiode)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 37: return this.renderBlockRedstoneComparator((BlockRedstoneComparator)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 16: return this.renderPistonBase(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, false) ;
case 17: return this.renderPistonExtension(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_, true) ;
case 18: return this.renderBlockPane((BlockPane)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 41: return this.renderBlockStainedGlassPane(p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 21: return this.renderBlockFenceGate((BlockFenceGate)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 24: return this.renderBlockCauldron((BlockCauldron)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 33: return this.renderBlockFlowerpot((BlockFlowerPot)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 35: return this.renderBlockAnvil((BlockAnvil)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 25: return this.renderBlockBrewingStand((BlockBrewingStand)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 26: return this.renderBlockEndPortalFrame((BlockEndPortalFrame)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 28: return this.renderBlockCocoa((BlockCocoa)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 34: return this.renderBlockBeacon((BlockBeacon)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_) ;
case 38: return this.renderBlockHopper((BlockHopper)p_147805_1_, p_147805_2_, p_147805_3_, p_147805_4_);
default: return FMLRenderAccessLibrary.renderWorldBlock(this, blockAccess, p_147805_2_, p_147805_3_, p_147805_4_, p_147805_1_, l);
}
}
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:62,代码来源:RenderBlocks.java
示例7: renderBlockRedstoneDiode
import net.minecraft.block.BlockRedstoneDiode; //导入依赖的package包/类
public boolean renderBlockRedstoneDiode(BlockRedstoneDiode p_147748_1_, int p_147748_2_, int p_147748_3_, int p_147748_4_)
{
Tessellator tessellator = Tessellator.instance;
this.renderBlockRedstoneDiodeMetadata(p_147748_1_, p_147748_2_, p_147748_3_, p_147748_4_, this.blockAccess.getBlockMetadata(p_147748_2_, p_147748_3_, p_147748_4_) & 3);
return true;
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:7,代码来源:RenderBlocks.java
示例8: renderBlockRedstoneDiodeMetadata
import net.minecraft.block.BlockRedstoneDiode; //导入依赖的package包/类
public void renderBlockRedstoneDiodeMetadata(BlockRedstoneDiode p_147732_1_, int p_147732_2_, int p_147732_3_, int p_147732_4_, int p_147732_5_)
{
this.renderStandardBlock(p_147732_1_, p_147732_2_, p_147732_3_, p_147732_4_);
Tessellator tessellator = Tessellator.instance;
tessellator.setBrightness(p_147732_1_.getMixedBrightnessForBlock(this.blockAccess, p_147732_2_, p_147732_3_, p_147732_4_));
tessellator.setColorOpaque_F(1.0F, 1.0F, 1.0F);
int i1 = this.blockAccess.getBlockMetadata(p_147732_2_, p_147732_3_, p_147732_4_);
IIcon iicon = this.getBlockIconFromSideAndMetadata(p_147732_1_, 1, i1);
double d0 = (double)iicon.getMinU();
double d1 = (double)iicon.getMaxU();
double d2 = (double)iicon.getMinV();
double d3 = (double)iicon.getMaxV();
double d4 = 0.125D;
double d5 = (double)(p_147732_2_ + 1);
double d6 = (double)(p_147732_2_ + 1);
double d7 = (double)(p_147732_2_ + 0);
double d8 = (double)(p_147732_2_ + 0);
double d9 = (double)(p_147732_4_ + 0);
double d10 = (double)(p_147732_4_ + 1);
double d11 = (double)(p_147732_4_ + 1);
double d12 = (double)(p_147732_4_ + 0);
double d13 = (double)p_147732_3_ + d4;
if (p_147732_5_ == 2)
{
d5 = d6 = (double)(p_147732_2_ + 0);
d7 = d8 = (double)(p_147732_2_ + 1);
d9 = d12 = (double)(p_147732_4_ + 1);
d10 = d11 = (double)(p_147732_4_ + 0);
}
else if (p_147732_5_ == 3)
{
d5 = d8 = (double)(p_147732_2_ + 0);
d6 = d7 = (double)(p_147732_2_ + 1);
d9 = d10 = (double)(p_147732_4_ + 0);
d11 = d12 = (double)(p_147732_4_ + 1);
}
else if (p_147732_5_ == 1)
{
d5 = d8 = (double)(p_147732_2_ + 1);
d6 = d7 = (double)(p_147732_2_ + 0);
d9 = d10 = (double)(p_147732_4_ + 1);
d11 = d12 = (double)(p_147732_4_ + 0);
}
tessellator.addVertexWithUV(d8, d13, d12, d0, d2);
tessellator.addVertexWithUV(d7, d13, d11, d0, d3);
tessellator.addVertexWithUV(d6, d13, d10, d1, d3);
tessellator.addVertexWithUV(d5, d13, d9, d1, d2);
}
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:51,代码来源:RenderBlocks.java
注:本文中的net.minecraft.block.BlockRedstoneDiode类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论