當前位置: 首頁>>代碼示例>>Java>>正文


Java Behavior類代碼示例

本文整理匯總了Java中li.cil.oc.api.nanomachines.Behavior的典型用法代碼示例。如果您正苦於以下問題:Java Behavior類的具體用法?Java Behavior怎麽用?Java Behavior使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Behavior類屬於li.cil.oc.api.nanomachines包,在下文中一共展示了Behavior類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeToNBT

import li.cil.oc.api.nanomachines.Behavior; //導入依賴的package包/類
@Override
public NBTTagCompound writeToNBT(Behavior behavior) {
    NBTTagCompound nbt = new NBTTagCompound();
    nbt.setString("provider", id);
    writeBehaviorToNBT(behavior, nbt);
    return nbt;
}
 
開發者ID:Herobone,項目名稱:HeroUtils,代碼行數:8,代碼來源:AbstractProvider.java

示例2: readFromNBT

import li.cil.oc.api.nanomachines.Behavior; //導入依賴的package包/類
@Override
public Behavior readFromNBT(EntityPlayer player, NBTTagCompound nbt) {
    if (id.equals(nbt.getString("provider"))) {
        return readBehaviorFromNBT(player, nbt);
    } else {
        return null;
    }
}
 
開發者ID:Herobone,項目名稱:HeroUtils,代碼行數:9,代碼來源:AbstractProvider.java

示例3: writeBehaviorToNBT

import li.cil.oc.api.nanomachines.Behavior; //導入依賴的package包/類
/**
 * Called when saving a behavior created using this behavior to NBT.
 * <p/>
 * The ID will already have been written, don't overwrite it. Store
 * any additional data you need to restore the behavior here, if any.
 *
 * @param behavior the behavior to persist.
 * @param nbt      the NBT tag to persist it to.
 */
protected void writeBehaviorToNBT(Behavior behavior, NBTTagCompound nbt) {
}
 
開發者ID:Herobone,項目名稱:HeroUtils,代碼行數:12,代碼來源:AbstractProvider.java

示例4: readBehaviorFromNBT

import li.cil.oc.api.nanomachines.Behavior; //導入依賴的package包/類
/**
 * Called when loading a behavior from NBT.
 * <p/>
 * Use the data written in {@link #writeBehaviorToNBT} to restore the behavior
 * to its previous state, then return it.
 *
 * @param player the player to restore the behavior for.
 * @param nbt    the NBT tag to load restore the behavior from.
 * @return the restored behavior.
 */
protected abstract Behavior readBehaviorFromNBT(EntityPlayer player, NBTTagCompound nbt);
 
開發者ID:Herobone,項目名稱:HeroUtils,代碼行數:12,代碼來源:AbstractProvider.java


注:本文中的li.cil.oc.api.nanomachines.Behavior類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。