本文整理汇总了Java中dan200.turtle.api.ITurtleUpgrade类的典型用法代码示例。如果您正苦于以下问题:Java ITurtleUpgrade类的具体用法?Java ITurtleUpgrade怎么用?Java ITurtleUpgrade使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ITurtleUpgrade类属于dan200.turtle.api包,在下文中一共展示了ITurtleUpgrade类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayAllReleventItems
import dan200.turtle.api.ITurtleUpgrade; //导入依赖的package包/类
@Override
public void displayAllReleventItems(List list) {
super.displayAllReleventItems(list);
ItemStack base = GameRegistry.findItemStack("CCTurtle", "CC-TurtleExpanded", 1);
if (base == null) return;
for (ITurtleUpgrade upgrade : upgrades) {
boolean isTool = upgrade.getType() == TurtleUpgradeType.Tool;
ItemStack upg1 = base.copy();
upg1.stackTagCompound = new NBTTagCompound();
upg1.stackTagCompound.setShort(isTool ? "leftUpgrade" : "rightUpgrade", (short) upgrade.getUpgradeID());
for (int id : new int[] {1,2,3,4,5,6,7}) {
if (isTool && id > 2) continue;
ItemStack upg2 = upg1.copy();
upg2.stackTagCompound.setShort(isTool ? "rightUpgrade" : "leftUpgrade", (short) id);
list.add(upg2);
}
}
}
示例2: registerUpgrade
import dan200.turtle.api.ITurtleUpgrade; //导入依赖的package包/类
public static void registerUpgrade(ITurtleUpgrade upgrade) {
if (upgrade.getUpgradeID() > 255 && ccVersion != null && (ccVersion.contains("1.52") || ccVersion.contains("1.51"))) {
log.warning("Not registering upgrade [" + upgrade.getAdjective() + "] due to high ID and old CC (" + ccVersion + ")");
return;
}
TurtleAPI.registerUpgrade(upgrade);
Icons.registerUpgrade(upgrade);
CreativeTabMiscPeripherals.registerUpgrade(upgrade);
}
示例3: registerUpgrade
import dan200.turtle.api.ITurtleUpgrade; //导入依赖的package包/类
public static void registerUpgrade(ITurtleUpgrade upgrade) {
upgrades.add(upgrade);
}
示例4: setTurtleUpgrade
import dan200.turtle.api.ITurtleUpgrade; //导入依赖的package包/类
public static void setTurtleUpgrade(ITurtleAccess turtle, TurtleSide side, ITurtleUpgrade upgrade) {
Reflector.invoke(turtle, "set"+side.name()+"Upgrade", Object.class, upgrade);
}
示例5: registerUpgradeIcons
import dan200.turtle.api.ITurtleUpgrade; //导入依赖的package包/类
@Override
public void registerUpgradeIcons(ITurtleUpgrade icons) {
Icons.registerUpgrade(icons);
}
示例6: createTurtleItemStack
import dan200.turtle.api.ITurtleUpgrade; //导入依赖的package包/类
public static ItemStack createTurtleItemStack(boolean advanced, ITurtleUpgrade left, ITurtleUpgrade right) {
return createTurtleItemStack(advanced,
left == null ? null : (short)left.getUpgradeID(),
right == null ? null : (short)right.getUpgradeID());
}
示例7: addUpgradedTurtles
import dan200.turtle.api.ITurtleUpgrade; //导入依赖的package包/类
private static void addUpgradedTurtles(List<ItemStack> result, ITurtleUpgrade upgrade, boolean advanced) {
for (int i = 0; i < NUMBER_OF_TURTLE_TOOLS; i++)
result.add(createTurtleItemStack(advanced, (short)upgrade.getUpgradeID(), (short)i));
}
示例8: registerUpgradeIcons
import dan200.turtle.api.ITurtleUpgrade; //导入依赖的package包/类
/**
* Register an upgrade implementing {@link IUpgradeIcons} or {@link IUpgradeToolIcons} to receive icons.
*
* @param icons Upgrade to be registered
*/
public abstract void registerUpgradeIcons(ITurtleUpgrade icons);