Files
ForestryMC/src/main/java/forestry/apiculture/items/ItemHiveFrame.java
T
Parker 8f2d802f11 Reformed Forestry!
* Updated for BC 6.0.x compatibility
* Re-implemented the Pipes plugin
* Converted to vanilla assets lang system
* Converted to standard gradle file structure
* General warnings cleanup
2014-08-11 16:56:09 -04:00

99 lines
2.5 KiB
Java
Executable File

/*******************************************************************************
* Copyright (c) 2011-2014 SirSengir.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.apiculture.items;
import net.minecraft.item.ItemStack;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IHiveFrame;
import forestry.api.core.Tabs;
import forestry.core.items.ItemForestry;
public class ItemHiveFrame extends ItemForestry implements IHiveFrame {
private final float geneticDecay;
public ItemHiveFrame(int maxDamage, float geneticDecay) {
super();
setMaxStackSize(1);
setMaxDamage(maxDamage);
this.geneticDecay = geneticDecay;
setCreativeTab(Tabs.tabApiculture);
}
@Override
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) {
frame.setItemDamage(frame.getItemDamage() + wear);
if (frame.getItemDamage() >= frame.getMaxDamage())
return null;
else
return frame;
}
@Override
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
return 1.0f;
}
@Override
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
return 1.0f;
}
@Override
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
return 1.0f;
}
@Override
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
return currentModifier < 10f ? 2.0f : 1f;
}
@Override
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
return 1.0f;
}
@Override
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
return this.geneticDecay;
}
@Override
public boolean isSealed() {
return false;
}
@Override
public boolean isSelfLighted() {
return false;
}
@Override
public boolean isSunlightSimulated() {
return false;
}
@Override
public boolean isHellish() {
return false;
}
@Override
public boolean isBookEnchantable(ItemStack itemstack1, ItemStack itemstack2) {
return false;
}
}