• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java IRevealer类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MetadataFinder类代码示例发布时间:2022-05-23
下一篇:
Java ExceptionsManagerModule类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap