Compare commits

...
2 Commits
3 changed files with 8 additions and 44 deletions

No files matched your search

@@ -33,7 +33,6 @@ import binnie.extrabees.genetics.ExtraBeesFlowers;
import cofh.api.energy.IEnergyReceiver;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IAlleleBeeEffect;
import forestry.api.apiculture.IArmorApiarist;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.genetics.AlleleManager;
@@ -111,43 +110,6 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
}
}
public static boolean wearsHelmet(EntityPlayer player) {
ItemStack armorItem = player.inventory.armorInventory[3];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsChest(EntityPlayer player) {
ItemStack armorItem = player.inventory.armorInventory[2];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsLegs(EntityPlayer player) {
ItemStack armorItem = player.inventory.armorInventory[1];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static boolean wearsBoots(EntityPlayer player) {
ItemStack armorItem = player.inventory.armorInventory[0];
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
}
public static int wearsItems(EntityPlayer player) {
int count = 0;
if (wearsHelmet(player)) {
count++;
}
if (wearsChest(player)) {
count++;
}
if (wearsLegs(player)) {
count++;
}
if (wearsBoots(player)) {
count++;
}
return count;
}
public void register() {
AlleleManager.alleleRegistry.registerAllele(this);
}
@@ -371,7 +333,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) {
int damage = 4;
if (entity instanceof EntityPlayer) {
int count = wearsItems((EntityPlayer) entity);
int count = BeeManager.armorApiaristHelper.wearsItems(entity, getUID(), true);
if (count > 3) {
continue;
}
@@ -396,7 +358,8 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
private void onHungerEffect(IBeeGenome genome, IBeeHousing housing, World world) {
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
if (world.rand.nextInt(4) < wearsItems(player)) {
if (world.rand.nextInt(4)
< BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true)) {
continue;
}
player.addExhaustion(4.0f);
@@ -406,7 +369,8 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
private void onPotionEffect(IBeeGenome genome, IBeeHousing housing, World world, PotionEffect potion) {
for (EntityPlayer player : getEntities(EntityPlayer.class, genome, housing)) {
if (world.rand.nextInt(4) < wearsItems(player)) {
if (world.rand.nextInt(4)
< BeeManager.armorApiaristHelper.wearsItems((EntityLivingBase) player, getUID(), true)) {
continue;
}
player.addPotionEffect(potion);
@@ -366,7 +366,7 @@ for.extratrees.item.food.gooseberry=Gooseberry
for.extratrees.item.food.goldenraspberry=Golden Raspberry
for.extratrees.item.food.coconut=Coconut
for.extratrees.item.food.cashew=Cashew
for.extratrees.item.food.avacado=Avacado
for.extratrees.item.food.avacado=Avocado
for.extratrees.item.food.nutmeg=Nutmeg
for.extratrees.item.food.allspice=Allspice
for.extratrees.item.food.chilli=Chilli
@@ -282,7 +282,7 @@ extratrees.species.goldenraspberry.name=Golden Raspberry
extratrees.species.cinnamon.name=Cinnamon
extratrees.species.coconut.name=Coconut
extratrees.species.cashew.name=Cashew
extratrees.species.avacado.name=Avacado
extratrees.species.avacado.name=Avocado
extratrees.species.nutmeg.name=Nutmeg
extratrees.species.allspice.name=Allspice
extratrees.species.chilli.name=Chilli Pepper
@@ -386,7 +386,7 @@ for.extratrees.item.food.gooseberry=Gooseberry
for.extratrees.item.food.goldenraspberry=Golden Raspberry
for.extratrees.item.food.coconut=Coconut
for.extratrees.item.food.cashew=Cashew
for.extratrees.item.food.avacado=Avacado
for.extratrees.item.food.avacado=Avocado
for.extratrees.item.food.nutmeg=Nutmeg
for.extratrees.item.food.allspice=Allspice
for.extratrees.item.food.chilli=Chilli