mirror of
https://github.com/GTNewHorizons/Avaritia.git
synced 2026-11-19 11:49:35 +00:00
Migrate to unified build script
This commit is contained in:
1 parent
43a0fc09a7
commit
79cffbb8ae
17 files changed
+876
-185
No files matched your search
@@ -2,20 +2,20 @@ package fox.spiteful.avaritia.compat.forestry;
|
||||
|
||||
import forestry.api.apiculture.*;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
public class ExpensiveMutation implements IBeeMutation {
|
||||
|
||||
private IAllele mom;
|
||||
private IAllele dad;
|
||||
private IAlleleBeeSpecies mom;
|
||||
private IAlleleBeeSpecies dad;
|
||||
private IAllele[] template;
|
||||
private boolean secret = false;
|
||||
private float baseChance;
|
||||
|
||||
public ExpensiveMutation(IAllele first, IAllele second, IAllele[] result, float chance){
|
||||
public ExpensiveMutation(IAlleleBeeSpecies first, IAlleleBeeSpecies second, IAllele[] result, float chance){
|
||||
mom = first;
|
||||
dad = second;
|
||||
template = result;
|
||||
@@ -24,8 +24,8 @@ public class ExpensiveMutation implements IBeeMutation {
|
||||
}
|
||||
|
||||
public static void mutate(){
|
||||
IAllele first;
|
||||
IAllele second;
|
||||
IAlleleBeeSpecies first;
|
||||
IAlleleBeeSpecies second;
|
||||
if(Ranger.extra)
|
||||
first = Allele.getExtraSpecies("Relic");
|
||||
else
|
||||
@@ -70,12 +70,12 @@ public class ExpensiveMutation implements IBeeMutation {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getAllele0() {
|
||||
public IAlleleSpecies getAllele0() {
|
||||
return mom;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getAllele1() {
|
||||
public IAlleleSpecies getAllele1() {
|
||||
return dad;
|
||||
}
|
||||
|
||||
@@ -111,38 +111,23 @@ public class ExpensiveMutation implements IBeeMutation {
|
||||
return new ArrayList<String>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||
float finalChance = 0f;
|
||||
float chance = this.baseChance * 1f;
|
||||
|
||||
if(isPartner(allele0) && isPartner(allele1)){
|
||||
finalChance = Math.round(chance
|
||||
* housing.getMutationModifier((IBeeGenome)genome0,
|
||||
(IBeeGenome)genome1, chance)
|
||||
* BeeManager.beeRoot.getBeekeepingMode(housing.getWorld())
|
||||
.getMutationModifier((IBeeGenome) genome0,
|
||||
(IBeeGenome) genome1, chance));
|
||||
}
|
||||
|
||||
return finalChance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1) {
|
||||
float finalChance = 0f;
|
||||
float chance = this.baseChance * 1f;
|
||||
|
||||
if(isPartner(allele0) && isPartner(allele1)){
|
||||
float housingModifier = 1.0f;
|
||||
for (IBeeModifier modifier : housing.getBeeModifiers()) {
|
||||
housingModifier *= modifier.getMutationModifier(genome0, genome1, chance);
|
||||
}
|
||||
finalChance = Math.round(chance
|
||||
* housing.getMutationModifier(genome0,
|
||||
genome1, chance)
|
||||
* BeeManager.beeRoot.getBeekeepingMode(housing.getWorld())
|
||||
* housingModifier
|
||||
* BeeManager.beeRoot.getBeekeepingMode(housing.getWorld()).getBeeModifier()
|
||||
.getMutationModifier(genome0,
|
||||
genome1, chance));
|
||||
}
|
||||
|
||||
return finalChance;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -185,16 +185,6 @@ public enum GreedyBeeSpecies implements IAlleleBeeSpecies, IIconProvider {
|
||||
return specialties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<ItemStack, Integer> getProducts() {
|
||||
return legacyProducts;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<ItemStack, Integer> getSpecialty() {
|
||||
return legacySpecialties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeRoot getRoot() {
|
||||
return BeeManager.beeRoot;
|
||||
|
||||
@@ -14,6 +14,10 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Ranger {
|
||||
|
||||
public static Item honey;
|
||||
@@ -46,14 +50,19 @@ public class Ranger {
|
||||
GreedyBeeSpecies.buzz();
|
||||
ExpensiveMutation.mutate();
|
||||
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, new ItemStack(LudicrousItems.combs, 1, 1),
|
||||
new ItemStack[]{new ItemStack(Items.dye, 1, 1), new ItemStack(Items.dye, 1, 2),
|
||||
new ItemStack(Items.dye, 1, 4), new ItemStack(Items.dye, 1, 5),
|
||||
new ItemStack(Items.dye, 1, 11), new ItemStack(Items.dye, 1, 14)},
|
||||
new int[]{16, 16, 16, 16, 16, 16});
|
||||
final float centrifugeChanceA = 0.16f;
|
||||
Map<ItemStack, Float> products = new HashMap<>();
|
||||
products.put(new ItemStack(Items.dye, 1, 1), centrifugeChanceA);
|
||||
products.put(new ItemStack(Items.dye, 1, 2), centrifugeChanceA);
|
||||
products.put(new ItemStack(Items.dye, 1, 4), centrifugeChanceA);
|
||||
products.put(new ItemStack(Items.dye, 1, 5), centrifugeChanceA);
|
||||
products.put(new ItemStack(Items.dye, 1, 11), centrifugeChanceA);
|
||||
products.put(new ItemStack(Items.dye, 1, 14), centrifugeChanceA);
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, new ItemStack(LudicrousItems.combs, 1, 1), products);
|
||||
|
||||
final float centrifugeChanceB = 1.0f;
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, new ItemStack(LudicrousItems.combs, 1, 0),
|
||||
new ItemStack(LudicrousItems.beesource, 1, 1));
|
||||
Collections.singletonMap(new ItemStack(LudicrousItems.beesource, 1, 1), centrifugeChanceB));
|
||||
|
||||
Grinder.catalyst.getInput().add(new ItemStack(panel, 1, 6));
|
||||
Grinder.catalyst.getInput().add(new ItemStack(LudicrousItems.beesource, 1, 0));
|
||||
|
||||
Reference in new issue
Block a user