本文整理汇总了Java中thaumcraft.api.nodes.IRevealer类的典型用法代码示例。如果您正苦于以下问题:Java IRevealer类的具体用法?Java IRevealer怎么用?Java IRevealer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IRevealer类属于thaumcraft.api.nodes包,在下文中一共展示了IRevealer类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getPickBlock
import thaumcraft.api.nodes.IRevealer; //导入依赖的package包/类
@Override
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
double viewDistance = 0D;
double currentDistance = player.getDistance(x + 0.5D, y + 0.5D, z + 0.5D);
boolean hasVisualAcuity = false;
boolean hasWarpVisualAcuity = false;
boolean canView = false;
if (player != null) {
hasVisualAcuity = ThaumUtils.isComplete(player, TOThaum.riVisualAcuity);
hasWarpVisualAcuity = ThaumUtils.isComplete(player, TOThaum.riWarpVisualAcuity);
if ((player.inventory.armorItemInSlot(3) != null)
&& (player.inventory.armorItemInSlot(3).getItem() instanceof IRevealer)
&& (((IRevealer) player.inventory.armorItemInSlot(3).getItem())
.showNodes(player.inventory.armorItemInSlot(3), player))) {
canView = true;
viewDistance = hasVisualAcuity ? 32.0D : 16.0D;
} else if ((player.inventory.getCurrentItem() != null)
&& (player.inventory.getCurrentItem().getItem() instanceof ItemThaumometer)
&& (UtilsFX.isVisibleTo(0.44F, player, x, y, z))) {
canView = true;
viewDistance = hasVisualAcuity ? 16.0D : 8.0D;
}
if (hasWarpVisualAcuity) {
int warp = ThaumUtils.getWarp(player);
canView = true;
double warpViewDistance = warp * TOConfig.generalWarpVisualAcuityModifier;
if (warpViewDistance > viewDistance)
viewDistance = warpViewDistance;
}
}
if (canView && currentDistance <= viewDistance) {
return new ItemStack(this, 1, world.getBlockMetadata(x, y, z));
} else
return new ItemStack(baseBlock, 1, baseMeta);
}
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:36,代码来源:BlockInfusedBlockOre.java
示例2: renderTileEntityAt
import thaumcraft.api.nodes.IRevealer; //导入依赖的package包/类
private void renderTileEntityAt(BlockInfusedBlockOre block, TileInfusedOre tile, double x, double y, double z,
float partialTicks) {
GL11.glPushMatrix();
GL11.glTranslated(x - 0.001D, y - 0.001D, z - 0.001D);
double scale = 1.002F;
GL11.glScaled(scale, scale, scale);
Tessellator tessellator = Tessellator.instance;
int brightness = setBrightness(tessellator, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord, block);
int metadata = tile.getWorldObj().getBlockMetadata(tile.xCoord, tile.yCoord, tile.zCoord);
if (metadata < 6) {
EntityLivingBase viewer = Minecraft.getMinecraft().renderViewEntity;
double viewDistance = 0D;
double currentDistance = viewer.getDistance(tile.xCoord + 0.5D, tile.yCoord + 0.5D, tile.zCoord + 0.5D);
boolean hasVisualAcuity = false;
boolean hasWarpVisualAcuity = false;
boolean canView = false;
if (viewer instanceof EntityPlayer) {
hasVisualAcuity = ThaumUtils.isComplete((EntityPlayer) viewer, TOThaum.riVisualAcuity);
hasWarpVisualAcuity = ThaumUtils.isComplete((EntityPlayer) viewer, TOThaum.riWarpVisualAcuity);
if ((((EntityPlayer) viewer).inventory.armorItemInSlot(3) != null)
&& (((EntityPlayer) viewer).inventory.armorItemInSlot(3).getItem() instanceof IRevealer)
&& (((IRevealer) ((EntityPlayer) viewer).inventory.armorItemInSlot(3).getItem())
.showNodes(((EntityPlayer) viewer).inventory.armorItemInSlot(3), viewer))) {
canView = true;
viewDistance = hasVisualAcuity ? 32.0D : 16.0D;
} else if ((((EntityPlayer) viewer).inventory.getCurrentItem() != null)
&& (((EntityPlayer) viewer).inventory.getCurrentItem().getItem() instanceof ItemThaumometer)
&& (UtilsFX.isVisibleTo(0.44F, viewer, tile.xCoord, tile.yCoord, tile.zCoord))) {
canView = true;
viewDistance = hasVisualAcuity ? 16.0D : 8.0D;
}
if (hasWarpVisualAcuity) {
int warp = ThaumUtils.getWarp((EntityPlayer) viewer);
canView = true;
double warpViewDistance = warp * TOConfig.generalWarpVisualAcuityModifier;
if (warpViewDistance > viewDistance)
viewDistance = warpViewDistance;
}
}
if (canView && currentDistance <= viewDistance) {
if (TOConfig.generalGraphicsRenderInfusedOreParticlesGlasses && viewer.worldObj.rand
.nextInt(TOConfig.generalGraphicsRenderInfusedOreParticlesGlassesChance) == 0)
UtilsFX.infusedStoneSparkle(viewer.worldObj, tile.xCoord, tile.yCoord, tile.zCoord, metadata + 1);
draw(tessellator, block.icon[6], brightness, metadata);
} else if (TOConfig.generalGraphicsRenderInfusedOreParticles
&& viewer.worldObj.rand.nextInt(TOConfig.generalGraphicsRenderInfusedOreParticlesChance) == 0)
UtilsFX.infusedStoneSparkle(viewer.worldObj, tile.xCoord, tile.yCoord, tile.zCoord, metadata + 1);
}
GL11.glPopMatrix();
}
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:51,代码来源:TileInfusedBlockOreRenderer.java
注:本文中的thaumcraft.api.nodes.IRevealer类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论