本文整理汇总了Java中ic2.api.info.Info类的典型用法代码示例。如果您正苦于以下问题:Java Info类的具体用法?Java Info怎么用?Java Info使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Info类属于ic2.api.info包,在下文中一共展示了Info类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: discharge
import ic2.api.info.Info; //导入依赖的package包/类
public double discharge(double amount, boolean ignoreLimit) {
if(amount <= 0.0D) {
throw new IllegalArgumentException("Amount must be > 0.");
} else {
ItemStack stack = this.getStack();
if(stack == null) {
return 0.0D;
} else {
double realAmount = ElectricItem.manager.discharge(stack, amount, ((TileElectricContainer) this.tile).tier, ignoreLimit, true, false);
if(realAmount <= 0.0D) {
realAmount = Info.itemInfo.getEnergyValue(stack);
if(realAmount <= 0.0D) {
return 0.0D;
}
--stack.stackSize;
if(stack.stackSize <= 0) {
this.putStack(null);
}
}
return realAmount;
}
}
}
开发者ID:GoodTimeStudio,项目名称:Production-Line,代码行数:26,代码来源:TileSlotDischarge.java
示例2: discharge
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Discharge the supplied ItemStack into this sink's energy buffer.
*
* @param stack ItemStack to discharge (null is ignored)
* @param limit Transfer limit, values <= 0 will use the battery's limit
* @return true if energy was transferred
*/
public boolean discharge(ItemStack stack, int limit) {
if (stack == null || !Info.isIc2Available()) {
return false;
}
double amount = capacity - energyStored;
if (amount <= 0) {
return false;
}
if (limit > 0 && limit < amount) {
amount = limit;
}
amount = ElectricItem.manager.discharge(stack, amount, tier, limit > 0, true, false);
energyStored += amount;
return amount > 0;
}
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:28,代码来源:BasicSink.java
示例3: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loaded, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!parent.getWorld().isRemote &&
Info.isIc2Available()) {
worldObj = parent.getWorld();
pos = parent.getPos();
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:Herobone,项目名称:HeroUtils,代码行数:17,代码来源:BasicSink.java
示例4: onChunkUnload
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link.
* Both invalidate and onChunkUnload have to be used.
*/
@Override
public void onChunkUnload() {
if (addedToEnet &&
Info.isIc2Available()) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
addedToEnet = false;
}
}
开发者ID:Herobone,项目名称:HeroUtils,代码行数:14,代码来源:BasicSink.java
示例5: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loading, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!parent.getWorld().isRemote &&
Info.isIc2Available()) {
worldObj = parent.getWorld();
pos = parent.getPos();
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:Herobone,项目名称:HeroUtils,代码行数:17,代码来源:BasicSource.java
示例6: onEntityCollision
import ic2.api.info.Info; //导入依赖的package包/类
@Override
public boolean onEntityCollision(ICropTile crop, Entity entity) {
if (entity instanceof EntityLivingBase) {
((EntityLivingBase) entity).attackEntityFrom(Info.DMG_ELECTRIC, crop.getGain());
return ((EntityLivingBase) entity).isSprinting();
}
return false;
}
开发者ID:estebes,项目名称:Useful-Crops,代码行数:9,代码来源:CropSpecialEnet.java
示例7: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loaded, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:nikita488,项目名称:RainbowElectricity,代码行数:19,代码来源:BasicSink.java
示例8: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loading, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:nikita488,项目名称:RainbowElectricity,代码行数:19,代码来源:BasicSource.java
示例9: updateEntity
import ic2.api.info.Info; //导入依赖的package包/类
public void updateEntity()
{
if ((!addedToEnet) && (!FMLCommonHandler.instance().getEffectiveSide().isClient()) && (Info.isIc2Available()))
{
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:UnderMybrella,项目名称:Minegate,代码行数:11,代码来源:TileEntityEUProvider.java
示例10: onChunkUnload
import ic2.api.info.Info; //导入依赖的package包/类
public void onChunkUnload()
{
if ((addedToEnet) && (Info.isIc2Available()))
{
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
addedToEnet = false;
}
}
开发者ID:UnderMybrella,项目名称:Minegate,代码行数:10,代码来源:TileEntityEUProvider.java
示例11: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loaded, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:19,代码来源:BasicSink.java
示例12: onChunkUnload
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link.
* Both invalidate and onChunkUnload have to be used.
*/
@Override
public void onChunkUnload() {
if (addedToEnet &&
Info.isIc2Available()) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
addedToEnet = false;
}
}
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:14,代码来源:BasicSink.java
示例13: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loading, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:19,代码来源:BasicSource.java
示例14: charge
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Charge the supplied ItemStack from this source's energy buffer.
*
* @param stack ItemStack to charge (null is ignored)
* @return true if energy was transferred
*/
public boolean charge(ItemStack stack) {
if (stack == null || !Info.isIc2Available()) {
return false;
}
double amount = ElectricItem.manager.charge(stack, energyStored, tier, false, false);
energyStored -= amount;
return amount > 0;
}
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:18,代码来源:BasicSource.java
示例15: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loaded, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:TeamAmeriFrance,项目名称:Electro-Magic-Tools,代码行数:19,代码来源:BasicSink.java
示例16: onChunkUnload
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Forward for the base TileEntity's onChunkUnload(), used for destroying the energy net link.
* Both invalidate and onChunkUnload have to be used.
*/
@Override
public void onChunkUnload() {
if (addedToEnet &&
Info.isIc2Available()) {
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
addedToEnet = false;
}
}
开发者ID:TeamAmeriFrance,项目名称:Electro-Magic-Tools,代码行数:14,代码来源:BasicSink.java
示例17: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loading, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.getWorldObj();
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:TeamAmeriFrance,项目名称:Electro-Magic-Tools,代码行数:19,代码来源:BasicSource.java
示例18: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loaded, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.worldObj;
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:Gaarnik,项目名称:bsamod,代码行数:19,代码来源:BasicSink.java
示例19: onLoaded
import ic2.api.info.Info; //导入依赖的package包/类
/**
* Notification that the base TileEntity finished loading, for advanced uses.
* Either updateEntity or onLoaded have to be used.
*/
public void onLoaded() {
if (!addedToEnet &&
!FMLCommonHandler.instance().getEffectiveSide().isClient() &&
Info.isIc2Available()) {
worldObj = parent.worldObj;
xCoord = parent.xCoord;
yCoord = parent.yCoord;
zCoord = parent.zCoord;
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
addedToEnet = true;
}
}
开发者ID:Gaarnik,项目名称:bsamod,代码行数:19,代码来源:BasicSource.java
注:本文中的ic2.api.info.Info类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论