Add Roots Integration

This commit is contained in:
Nedelosk committed 2017-07-23 21:39:16 +02:00
1 parent e391d06f32
commit 4e17804997
4 files changed
+70 -4

No files matched your search

@@ -30,4 +30,5 @@ public class ForestryPluginUids {
public static final String IMMERSIVE_ENGINEERING = "forestry.immersiveengineering";
public static final String MAGICAL_AGRICULTURE = "forestry.mysticalagriculture";
public static final String RUSTIC = "forestry.rustic";
public static final String ROOTS = "forestry.roots";
}
@@ -15,7 +15,7 @@ import forestry.farming.logic.FarmableAgingCrop;
import forestry.plugins.ForestryPlugin;
import forestry.plugins.ForestryPluginUids;
@ForestryPlugin(pluginID = ForestryPluginUids.MAGICAL_AGRICULTURE, name = "mysticalagriculture", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.mysticalagriculture.description")
@ForestryPlugin(pluginID = ForestryPluginUids.MAGICAL_AGRICULTURE, name = "Mystical Agriculture", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.mysticalagriculture.description")
public class PluginMysticalAgriculture extends CompatPlugin {
private static final String MAGICAL_AGRICULTURE = "mysticalagriculture";
@@ -0,0 +1,66 @@
package forestry.plugins.compat;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockCrops;
import net.minecraft.item.ItemStack;
import forestry.api.core.ForestryAPI;
import forestry.api.farming.IFarmRegistry;
import forestry.api.recipes.RecipeManagers;
import forestry.core.config.Constants;
import forestry.core.fluids.Fluids;
import forestry.farming.logic.FarmableAgingCrop;
import forestry.plugins.ForestryPlugin;
import forestry.plugins.ForestryPluginUids;
@ForestryPlugin(pluginID = ForestryPluginUids.RUSTIC, name = "Roots", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.roots.description")
public class PluginRoots extends CompatPlugin {
public PluginRoots() {
super("Roots", "roots");
}
@Override
public void registerRecipes() {
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING)) {
ImmutableList<String> crops = ImmutableList.of(
"moonglow",
"terra_moss",
"aubergine"
);
ImmutableList<String> seeds = ImmutableList.of(
"moontinged_seed",
"terra_moss_spore",
"aubergine_seeds"
);
ImmutableList<String> fruits = ImmutableList.of(
"moonglow_leaf",
"terra_moss_ball",
"aubergine_item"
);
IFarmRegistry farmRegistry = ForestryAPI.farmRegistry;
int seedAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 25;
for(int i = 0;i < fruits.size();i++){
ItemStack seed = getItemStack( seeds.get(i));
Block block = getBlock(crops.get(i));
ItemStack fruit = getItemStack(fruits.get(i));
if (seed != null && i != 1) {
RecipeManagers.squeezerManager.addRecipe(10, seed, Fluids.SEED_OIL.getFluid(seedAmount));
}
if(fruit != null && i == 2){
RecipeManagers.squeezerManager.addRecipe(10, fruit, Fluids.JUICE.getFluid(juiceAmount));
}
if (seed != null && block != null) {
farmRegistry.registerFarmables("farmWheat", new FarmableAgingCrop(seed, block, BlockCrops.AGE, 7));
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(seed, block, BlockCrops.AGE, 7, 0));
}
}
}
}
}
@@ -17,12 +17,11 @@ import forestry.farming.logic.FarmableRusticSapling;
import forestry.plugins.ForestryPlugin;
import forestry.plugins.ForestryPluginUids;
@ForestryPlugin(pluginID = ForestryPluginUids.RUSTIC, name = "rustic", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.rustic.description")
@ForestryPlugin(pluginID = ForestryPluginUids.ROOTS, name = "rustic", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.rustic.description")
public class PluginRustic extends CompatPlugin {
private static final String RUSTIC = "rustic";
public PluginRustic() {
super("Rustic", RUSTIC);
super("Rustic", "rustic");
}
@Override