本文整理汇总了Java中forestry.api.apiculture.IHiveFrame类的典型用法代码示例。如果您正苦于以下问题:Java IHiveFrame类的具体用法?Java IHiveFrame怎么用?Java IHiveFrame使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IHiveFrame类属于forestry.api.apiculture包,在下文中一共展示了IHiveFrame类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isItemValid
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public boolean isItemValid(ItemStack itemStack){
if (itemStack == null){
return false;
}
if (!inventory.isItemValidForSlot(getSlotIndex(), itemStack)){
return false;
}
boolean flag = false;
if(itemStack.getItem() instanceof IHiveFrame){
flag = true;
}
return flag;
}
示例2: getFrames
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
public Collection<IHiveFrame> getFrames() {
Collection<IHiveFrame> hiveFrames = new ArrayList<IHiveFrame>(SLOT_FRAME_COUNT);
for (int i = SLOT_FRAME_START; i < SLOT_FRAME_START + SLOT_FRAME_COUNT; i++) {
ItemStack stackInSlot = magicApiary.getStackInSlot(i);
if (stackInSlot == null) {
continue;
}
Item itemInSlot = stackInSlot.getItem();
if (itemInSlot instanceof IHiveFrame) {
hiveFrames.add((IHiveFrame) itemInSlot);
}
}
return hiveFrames;
}
示例3: wearOutEquipment
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public void wearOutEquipment(int amount) {
IBeekeepingMode beekeepingMode = BeeManager.beeRoot.getBeekeepingMode(magicApiary.getWorldObj());
int wear = Math.round(amount * beekeepingMode.getWearModifier());
for (int i = MagicApiaryInventory.SLOT_FRAME_START; i < MagicApiaryInventory.SLOT_FRAME_START + MagicApiaryInventory.SLOT_FRAME_COUNT; i++) {
ItemStack hiveFrameStack = magicApiary.getStackInSlot(i);
if (hiveFrameStack == null) {
continue;
}
Item hiveFrameItem = hiveFrameStack.getItem();
if (!(hiveFrameItem instanceof IHiveFrame)) {
continue;
}
IHiveFrame hiveFrame = (IHiveFrame) hiveFrameItem;
ItemStack queenStack = magicApiary.getBeeInventory().getQueen();
IBee queen = BeeManager.beeRoot.getMember(queenStack);
ItemStack usedFrame = hiveFrame.frameUsed(magicApiary, hiveFrameStack, queen, wear);
magicApiary.setInventorySlotContents(i, usedFrame);
}
}
示例4: wearOutEquipment
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public void wearOutEquipment(int amount) {
int wear = Math.round(amount * BeeManager.breedingManager.getBeekeepingMode(worldObj).getWearModifier());
for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
if (inventory.getStackInSlot(i) == null) {
continue;
}
if (!(inventory.getStackInSlot(i).getItem() instanceof IHiveFrame)) {
continue;
}
inventory.setInventorySlotContents(
i,
((IHiveFrame) inventory.getStackInSlot(i).getItem()).frameUsed(this, inventory.getStackInSlot(i),
BeeManager.beeInterface.getBee(inventory.getStackInSlot(SLOT_QUEEN)), wear));
}
}
示例5: transferStackInSlot
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex){
Slot itemSlot = this.getSlot(slotIndex);
boolean clearSlot = false;
if (itemSlot != null && itemSlot.getHasStack()) {
ItemStack srcStack = itemSlot.getStack();
if (slotIndex <= maxSlot && srcStack != null){
clearSlot = this.mergeItemStack(srcStack, maxSlot + 1, maxSlot + 36, false);
}else{
if (slotIndex > maxSlot && srcStack != null){
if (BeeManager.beeRoot.isMember(srcStack)){
if (!BeeManager.beeRoot.isDrone(srcStack)){
if (this.getSlot(SLOT_QUEEN).getHasStack() == false) {
clearSlot = this.mergeItemStack(srcStack, SLOT_QUEEN, SLOT_QUEEN + 1, false);
}
}else{
if (this.getSlot(SLOT_DRONE).isItemValid(srcStack)){
clearSlot = this.mergeItemStack(srcStack, SLOT_DRONE, SLOT_DRONE + 1, false);
}
}
}else if(srcStack.getItem() instanceof IHiveFrame){
clearSlot = this.mergeItemStack(srcStack, SLOT_FRAME_START, SLOT_FRAME_START + SLOT_FRAME_COUNT, false);
}
}
}
}
if (clearSlot){
itemSlot.putStack(null);
}
itemSlot.onSlotChanged();
player.inventory.markDirty();
return null;
}
示例6: getBeeModifiers
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public Iterable<IBeeModifier> getBeeModifiers() {
List<IBeeModifier> beeModifiers = new ArrayList<IBeeModifier>();
beeModifiers.add(beeModifier);
for (IHiveFrame frame : inventory.getFrames()) {
beeModifiers.add(frame.getBeeModifier());
}
return beeModifiers;
}
示例7: getTerritoryModifier
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public float getTerritoryModifier(IBeeGenome genome) {
float mod = 1.0f;
for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
if (inventory.getStackInSlot(i) == null) {
continue;
}
if (inventory.getStackInSlot(i).getItem() instanceof IHiveFrame) {
mod *= ((IHiveFrame) inventory.getStackInSlot(i).getItem()).getTerritoryModifier(genome);
}
}
return mod;
}
示例8: getProductionModifier
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public float getProductionModifier(IBeeGenome genome) {
float mod = 0.1f;
for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
if (inventory.getStackInSlot(i) == null) {
continue;
}
if (inventory.getStackInSlot(i).getItem() instanceof IHiveFrame) {
mod *= ((IHiveFrame) inventory.getStackInSlot(i).getItem()).getProductionModifier(genome);
}
}
return mod;
}
示例9: getMutationModifier
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate) {
float mod = 1.0f;
for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
if (inventory.getStackInSlot(i) == null) {
continue;
}
if (inventory.getStackInSlot(i).getItem() instanceof IHiveFrame) {
mod *= ((IHiveFrame) inventory.getStackInSlot(i).getItem()).getMutationModifier(genome, mate);
}
}
return mod;
}
示例10: getLifespanModifier
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
@Override
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate) {
float mod = 1.0f;
for (int i = SLOT_FRAMES_1; i < SLOT_FRAMES_1 + SLOT_FRAMES_COUNT; i++) {
if (inventory.getStackInSlot(i) == null) {
continue;
}
if (inventory.getStackInSlot(i).getItem() instanceof IHiveFrame) {
mod *= ((IHiveFrame) inventory.getStackInSlot(i).getItem()).getLifespanModifier(genome, mate);
}
}
return mod;
}
示例11: ContainerApiary
import forestry.api.apiculture.IHiveFrame; //导入依赖的package包/类
public ContainerApiary(InventoryPlayer player, MachineApiary tile) {
super(tile);
this.tile = tile;
tile.sendNetworkUpdate();
// Queen/Princess
this.addSlot(new SlotCustom(tile, new Object[] { ForestryItem.beePrincessGE, ForestryItem.beeQueenGE }, MachineApiary.SLOT_QUEEN, 29, 39));
// Drone
this.addSlot(new SlotCustom(tile, new Object[] { ForestryItem.beeDroneGE }, MachineApiary.SLOT_DRONE, 29, 65));
// Frames
this.addSlot(new SlotCustom(tile, new Object[] { IHiveFrame.class }, MachineApiary.SLOT_FRAMES_1, 66, 23));
this.addSlot(new SlotCustom(tile, new Object[] { IHiveFrame.class }, MachineApiary.SLOT_FRAMES_1 + 1, 66, 52));
this.addSlot(new SlotCustom(tile, new Object[] { IHiveFrame.class }, MachineApiary.SLOT_FRAMES_1 + 2, 66, 81));
// Product Inventory
this.addSlot(new SlotClosed(tile, 2, 116, 52));
this.addSlot(new SlotClosed(tile, 3, 137, 39));
this.addSlot(new SlotClosed(tile, 4, 137, 65));
this.addSlot(new SlotClosed(tile, 5, 116, 78));
this.addSlot(new SlotClosed(tile, 6, 95, 65));
this.addSlot(new SlotClosed(tile, 7, 95, 39));
this.addSlot(new SlotClosed(tile, 8, 116, 26));
// Player inventory
for (int i1 = 0; i1 < 3; i1++) {
for (int l1 = 0; l1 < 9; l1++) {
addSlot(new Slot(player, l1 + i1 * 9 + 9, 8 + l1 * 18, 108 + i1 * 18));
}
}
// Player hotbar
for (int j1 = 0; j1 < 9; j1++) {
addSlot(new Slot(player, j1, 8 + j1 * 18, 166));
}
}