mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-21 04:22:32 +00:00
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:
1 parent
ee272de168
commit
88fd031fb4
277 files changed
+7361
-1930
No files matched your search
@@ -0,0 +1,65 @@
|
||||
package forestry.plugins;
|
||||
|
||||
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.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.ROOTS, name = "Roots", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.module.roots.description")
|
||||
public class PluginRoots extends CompatPlugin {
|
||||
public PluginRoots() {
|
||||
super("Roots", "roots");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user