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

Java IManaPool类代码示例

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

本文整理汇总了Java中vazkii.botania.api.mana.IManaPool的典型用法代码示例。如果您正苦于以下问题:Java IManaPool类的具体用法?Java IManaPool怎么用?Java IManaPool使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IManaPool类属于vazkii.botania.api.mana包,在下文中一共展示了IManaPool类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: bindTo

import vazkii.botania.api.mana.IManaPool; //导入依赖的package包/类
@Override
public boolean bindTo(EntityPlayer player, ItemStack wand, BlockPos pos, EnumFacing side) {
	int range = 10;
	range *= range;

	double dist = pos.distanceSq(supertile.getPos());
	if(range >= dist) {
		TileEntity tile = player.worldObj.getTileEntity(pos);
		if(tile instanceof IManaPool) {
			linkedPool = tile;
			return true;
		}
	}

	return false;
}
 
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:17,代码来源:SubTileFunctional.java


示例2: bindTo

import vazkii.botania.api.mana.IManaPool; //导入依赖的package包/类
@Override
public boolean bindTo(EntityPlayer player, ItemStack wand, int x, int y, int z, int side) {
	int range = 10;
	range *= range;

	double dist = (x - supertile.xCoord) * (x - supertile.xCoord) + (y - supertile.yCoord) * (y - supertile.yCoord) + (z - supertile.zCoord) * (z - supertile.zCoord);
	if(range >= dist) {
		TileEntity tile = player.worldObj.getTileEntity(x, y, z);
		if(tile instanceof IManaPool) {
			linkedPool = tile;
			return true;
		}
	}

	return false;
}
 
开发者ID:Nincodedo,项目名称:Nincrafty-Things,代码行数:17,代码来源:SubTileFunctional.java


示例3: onUpdate

import vazkii.botania.api.mana.IManaPool; //导入依赖的package包/类
@Override
public void onUpdate() {
	super.onUpdate();

	linkPool();

	if(linkedPool != null && isValidBinding()) {
		IManaPool pool = (IManaPool) linkedPool;
		int manaInPool = pool.getCurrentMana();
		int manaMissing = getMaxMana() - mana;
		int manaToRemove = Math.min(manaMissing, manaInPool);
		pool.recieveMana(-manaToRemove);
		addMana(manaToRemove);
	}

	if(acceptsRedstone()) {
		redstoneSignal = 0;
		for(EnumFacing dir : EnumFacing.VALUES) {
			int redstoneSide = supertile.getWorld().getRedstonePower(supertile.getPos().offset(dir), dir);
			redstoneSignal = Math.max(redstoneSignal, redstoneSide);
		}
	}

	if(supertile.getWorld().isRemote) {
		double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F;
		Color color = new Color(getColor());
		if(Math.random() > particleChance)
			BotaniaAPI.internalHandler.sparkleFX(supertile.getWorld(), supertile.getPos().getX() + 0.3 + Math.random() * 0.5, supertile.getPos().getY() + 0.5 + Math.random()  * 0.5, supertile.getPos().getZ() + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
	}
}
 
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:31,代码来源:SubTileFunctional.java


示例4: onUpdate

import vazkii.botania.api.mana.IManaPool; //导入依赖的package包/类
@Override
public void onUpdate() {
	super.onUpdate();

	linkPool();

	if(linkedPool != null && isValidBinding()) {
		IManaPool pool = (IManaPool) linkedPool;
		int manaInPool = pool.getCurrentMana();
		int manaMissing = getMaxMana() - mana;
		int manaToRemove = Math.min(manaMissing, manaInPool);
		pool.recieveMana(-manaToRemove);
		addMana(manaToRemove);
	}

	if(acceptsRedstone()) {
		redstoneSignal = 0;
		for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
			int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal());
			redstoneSignal = Math.max(redstoneSignal, redstoneSide);
		}
	}

	if(supertile.getWorldObj().isRemote) {
		double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F;
		Color color = new Color(getColor());
		if(Math.random() > particleChance)
			BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random()  * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
	}
}
 
开发者ID:Nincodedo,项目名称:Nincrafty-Things,代码行数:31,代码来源:SubTileFunctional.java


示例5: onUpdate

import vazkii.botania.api.mana.IManaPool; //导入依赖的package包/类
@Override
public void onUpdate() {
	super.onUpdate();

	linkPool();

	if(linkedPool != null) {
		IManaPool pool = (IManaPool) linkedPool;
		int manaInPool = pool.getCurrentMana();
		int manaMissing = getMaxMana() - mana;
		int manaToRemove = Math.min(manaMissing, manaInPool);
		pool.recieveMana(-manaToRemove);
		addMana(manaToRemove);
	}

	if(acceptsRedstone()) {
		redstoneSignal = 0;
		for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
			int redstoneSide = supertile.getWorldObj().getIndirectPowerLevelTo(supertile.xCoord + dir.offsetX, supertile.yCoord + dir.offsetY, supertile.zCoord + dir.offsetZ, dir.ordinal());
			redstoneSignal = Math.max(redstoneSignal, redstoneSide);
		}
	}

	if(supertile.getWorldObj().isRemote) {
		double particleChance = 1F - (double) mana / (double) getMaxMana() / 3.5F;
		Color color = new Color(getColor());
		if(Math.random() > particleChance)
			BotaniaAPI.internalHandler.sparkleFX(supertile.getWorldObj(), supertile.xCoord + 0.3 + Math.random() * 0.5, supertile.yCoord + 0.5 + Math.random()  * 0.5, supertile.zCoord + 0.3 + Math.random() * 0.5, color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, (float) Math.random(), 5);
	}
}
 
开发者ID:goldenapple3,项目名称:CopperTools,代码行数:31,代码来源:SubTileFunctional.java


示例6: onDissolveTick

import vazkii.botania.api.mana.IManaPool; //导入依赖的package包/类
/**
 * Called for every tick the item is on a mana pool. If the stack has stack
 * size 0 the item is killed. This is called serverside.
 */
public void onDissolveTick(IManaPool pool, ItemStack stack, EntityItem item);
 
开发者ID:VapourDrive,项目名称:Hammerz,代码行数:6,代码来源:IManaDissolvable.java


示例7: onDissolveTick

import vazkii.botania.api.mana.IManaPool; //导入依赖的package包/类
/**
 * Called for every tick the item is on a mana pool. If the stack has stack
 * size 0 the item is killed. This is called in both the server and client.
 */
public void onDissolveTick(IManaPool pool, ItemStack stack, EntityItem item);
 
开发者ID:Nincodedo,项目名称:Nincrafty-Things,代码行数:6,代码来源:IManaDissolvable.java



注:本文中的vazkii.botania.api.mana.IManaPool类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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