本文整理汇总了Java中me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem.getResearch方法的典型用法代码示例。如果您正苦于以下问题:Java SlimefunItem.getResearch方法的具体用法?Java SlimefunItem.getResearch怎么用?Java SlimefunItem.getResearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem
的用法示例。
在下文中一共展示了SlimefunItem.getResearch方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasUnlocked
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; //导入方法依赖的package包/类
public boolean hasUnlocked(Player p)
{
for(Iterator iterator = parents.iterator(); iterator.hasNext();)
{
Category category = (Category)iterator.next();
for(Iterator iterator1 = category.getItems().iterator(); iterator1.hasNext();)
{
SlimefunItem item = (SlimefunItem)iterator1.next();
if(Slimefun.isEnabled(p, item.getItem(), false) && Slimefun.hasPermission(p, item, false) && item.getResearch() != null && !item.getResearch().hasUnlocked(p))
return false;
}
}
return true;
}
示例2: hasUnlocked
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; //导入方法依赖的package包/类
public static boolean hasUnlocked(Player p, SlimefunItem sfItem, boolean message)
{
if(isEnabled(p, sfItem, message) && hasPermission(p, sfItem, message))
{
if(sfItem.getResearch() == null)
return true;
if(sfItem.getResearch().hasUnlocked(p))
return true;
if(message && !(sfItem instanceof VanillaItem))
Messages.local.sendTranslation(p, "messages.not-researched", true, new Variable[0]);
return false;
} else
{
return false;
}
}
示例3: hasUnlocked
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; //导入方法依赖的package包/类
/**
* Checks if this player can use this item.
*
* @param p the player to check, not null
* @param item the item to check, not null
* @param message whether a message should be sent to the player or not
*
* @return <code>true</code> if the item is a SlimefunItem, enabled, researched and if the player has the permission to use it,
* <code>false</code> otherwise.
*/
public static boolean hasUnlocked(Player p, ItemStack item, boolean message) {
SlimefunItem sfItem = SlimefunItem.getByItem(item);
State state = SlimefunItem.getState(item);
if (sfItem == null) {
if (state != State.ENABLED) {
if (message && state != State.VANILLA) Messages.local.sendTranslation(p, "messages.disabled-item", true);
return false;
}
else return true;
}
else if (isEnabled(p, item, message) && hasPermission(p, sfItem, message)) {
if (sfItem.getResearch() == null) return true;
else if (sfItem.getResearch().hasUnlocked(p)) return true;
else {
if (message && !(sfItem instanceof VanillaItem)) Messages.local.sendTranslation(p, "messages.not-researched", true);
return false;
}
}
else return false;
}
示例4: hasUnlocked
import me.mrCookieSlime.Slimefun.Objects.SlimefunItem.SlimefunItem; //导入方法依赖的package包/类
/**
* Checks if the player has fully unlocked parent categories.
*
* @param p Player to check
* @return true if the player has fully completed the parent categories, otherwise false
*
* @since 4.0
*/
public boolean hasUnlocked(Player p) {
for (Category category: parents) {
for (SlimefunItem item: category.getItems()) {
if (Slimefun.isEnabled(p, item.getItem(), false) && Slimefun.hasPermission(p, item, false)) {
if (item.getResearch() != null) {
if (!item.getResearch().hasUnlocked(p)) return false;
}
}
}
}
return true;
}