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