本文整理汇总了Java中com.InfinityRaider.AgriCraft.api.APIBase类的典型用法代码示例。如果您正苦于以下问题:Java APIBase类的具体用法?Java APIBase怎么用?Java APIBase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
APIBase类属于com.InfinityRaider.AgriCraft.api包,在下文中一共展示了APIBase类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import com.InfinityRaider.AgriCraft.api.APIBase; //导入依赖的package包/类
@Override
public boolean initialize() {
// Process the seed list
for (ItemStack item : OreDictionaryHelper.getOres("listAllseed")) {
ItemRegistry.setScrapValue(item, ScrapValue.NONE);
ItemRegistry.setCompostIngredientValue(item, CompostIngredient.BROWN);
}
// Register our soil block for use by agricraft
boolean success = false;
try {
final APIBase api = getApi();
if (api instanceof APIv1) {
final APIv1 v1 = (APIv1) api;
success = v1.registerDefaultSoil(new BlockWithMeta(BlockManager.fertileLand, 0));
}
} catch (Throwable t) {
}
if (!success)
ModLog.warn("Unable to register soil block with AgriCraft API");
return true;
}
示例2: detectAgri
import com.InfinityRaider.AgriCraft.api.APIBase; //导入依赖的package包/类
public static void detectAgri() {
APIBase api = API.getAPI(1);
if (api.getStatus().isOK() && api.getVersion() == 1) {
agricraft = (APIv1) api;
cropSticks = agricraft.getCropsItems();
rakes = agricraft.getRakeItems();
AgriDetector.hasAgri = true;
}
}
示例3: init
import com.InfinityRaider.AgriCraft.api.APIBase; //导入依赖的package包/类
@Override
public void init () throws Throwable {
APIBase api = API.getAPI(1);
if (api.getStatus() == APIStatus.OK && api.getVersion() == 1) {
APIv1 agricraft = (APIv1)api;
agricraft.registerDefaultSoil(new BlockWithMeta(ModBlocks.gardenFarmland));
}
}
示例4: getAPI
import com.InfinityRaider.AgriCraft.api.APIBase; //导入依赖的package包/类
@Override
public APIBase getAPI(int maxVersion) {
return this;
}
示例5: getApi
import com.InfinityRaider.AgriCraft.api.APIBase; //导入依赖的package包/类
private static APIBase getApi() {
try {
APIBase api = API.getAPI(AGRICRAFT_API_VERSION);
if (api.getVersion() >= AGRICRAFT_API_VERSION)
return api;
} catch (Throwable t) {
}
return null;
}