本文整理汇总了Java中vazkii.botania.api.mana.IManaPool.getCurrentMana方法的典型用法代码示例。如果您正苦于以下问题:Java IManaPool.getCurrentMana方法的具体用法?Java IManaPool.getCurrentMana怎么用?Java IManaPool.getCurrentMana使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vazkii.botania.api.mana.IManaPool
的用法示例。
在下文中一共展示了IManaPool.getCurrentMana方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
}
示例2: 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);
}
}
示例3: 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);
}
}