Change the plugin system to a module system and slit up modules

-Moved the woodpile from the arboriculture module to the charcoal module
-Moved the backpacks from the storage module to the backpacks module
-Moved the crates from the storage module to the creates module
-Added the database module with a new storage for individuals
-Added a gui element system to improve the alyzer api
-Added a species plugin interface to handle the database gui
-Added some alyzer methods to the species plugin to move the alyzer
integration later to it
This commit is contained in:
Nedelosk committed 2017-11-02 16:03:33 +01:00
1 parent ee272de168
commit 88fd031fb4
277 files changed
+7361 -1930

No files matched your search

@@ -0,0 +1,79 @@
package forestry.plugins;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.Block;
import net.minecraft.block.properties.PropertyInteger;
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.farming.logic.FarmableRusticGrape;
import forestry.farming.logic.FarmableRusticSapling;
import forestry.modules.ForestryModule;
import forestry.modules.ForestryModuleUids;
@SuppressWarnings("unused")
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.RUSTIC, name = "rustic", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.module.rustic.description")
public class PluginRustic extends CompatPlugin {
public PluginRustic() {
super("Rustic", "rustic");
}
@Override
public void registerRecipes() {
ImmutableList<String> fruits = ImmutableList.of(
"tomato",
"chili_pepper"
);
ImmutableList<String> crops = ImmutableList.of(
"tomato",
"chili"
);
PropertyInteger cropAge = PropertyInteger.create("age", 0, 3);
int seedAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
IFarmRegistry farmRegistry = ForestryAPI.farmRegistry;
ItemStack grapes = getItemStack("grapes");
ItemStack grapeSeeds = getItemStack("grape_stem");
Block grapeLeaves = getBlock("grape_leaves");
if (grapeSeeds != null) {
RecipeManagers.squeezerManager.addRecipe(10, grapeSeeds, Fluids.SEED_OIL.getFluid(seedAmount));
}
if (grapes != null) {
RecipeManagers.squeezerManager.addRecipe(10, grapes, Fluids.JUICE.getFluid(juiceAmount / 12));
}
if (grapeLeaves != null) {
farmRegistry.registerFarmables("farmOrchard", new FarmableRusticGrape(grapeLeaves));
}
ItemStack sapling = getItemStack("sapling");
ItemStack ironBerries = getItemStack("ironberries");
ItemStack olives = getItemStack("olives");
if (sapling != null && ironBerries != null && olives != null) {
farmRegistry.registerFarmables("farmArboreal", new FarmableRusticSapling(sapling.getItem(), new ItemStack[]{ironBerries, olives}));
}
for (int i = 0; i < fruits.size(); i++) {
String fruitName = fruits.get(i);
ItemStack seeds = getItemStack(fruitName + "_seeds");
Block block = getBlock(crops.get(i) + "_crop");
ItemStack fruit = getItemStack(fruitName);
if (seeds != null) {
RecipeManagers.squeezerManager.addRecipe(10, seeds, Fluids.SEED_OIL.getFluid(seedAmount));
}
if (fruit != null) {
RecipeManagers.squeezerManager.addRecipe(10, fruit, Fluids.JUICE.getFluid(juiceAmount / 25));
}
if (seeds != null && block != null) {
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(seeds, block, cropAge, 3, 2));
}
}
}
}