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
@@ -1,162 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.IChunkGenerator;
|
||||
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
|
||||
import forestry.core.IPickupHandler;
|
||||
import forestry.core.IResupplyHandler;
|
||||
import forestry.core.ISaveEventHandler;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
|
||||
public abstract class BlankForestryPlugin implements IForestryPlugin {
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeDisabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<String> getDependencyUids() {
|
||||
Set<String> dependencyUids = new HashSet<>();
|
||||
dependencyUids.add(ForestryPluginUids.CORE);
|
||||
return dependencyUids;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disabledSetupAPI() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTriggers() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerBackpackItems() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrates() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addLootPoolNames(Set<String> lootPoolNames) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIMCMessage(IMCMessage message) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateChunk(IChunkGenerator chunkGenerator, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateChunkRetroGen(World world, Random rand, int chunkX, int chunkZ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void decorateBiome(World world, Random rand, BlockPos pos) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHiddenItems(List<ItemStack> hiddenItems) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ISaveEventHandler getSaveEventHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IPacketRegistry getPacketRegistry() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IPickupHandler getPickupHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IResupplyHandler getResupplyHandler() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ICommand[] getConsoleCommands() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
ForestryPlugin forestryPlugin = getClass().getAnnotation(ForestryPlugin.class);
|
||||
if (forestryPlugin == null) {
|
||||
return getClass().getSimpleName();
|
||||
}
|
||||
return forestryPlugin.name() + " Plugin";
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import forestry.core.blocks.BlockBase;
|
||||
import forestry.core.blocks.BlockRegistry;
|
||||
+22
-3
@@ -1,4 +1,4 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -10,14 +10,16 @@ import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
|
||||
public abstract class CompatPlugin extends BlankForestryPlugin {
|
||||
public abstract class CompatPlugin extends BlankForestryModule {
|
||||
|
||||
protected final String modName;
|
||||
protected final String modID;
|
||||
@@ -79,4 +81,21 @@ public abstract class CompatPlugin extends BlankForestryPlugin {
|
||||
}
|
||||
return fluid;
|
||||
}
|
||||
|
||||
protected void addBlocksToBackpack(String backpackUid, String... blockNames) {
|
||||
for (String blockName : blockNames) {
|
||||
Block block = getBlock(blockName);
|
||||
if (block != null) {
|
||||
Item item = Item.getItemFromBlock(block);
|
||||
ItemStack blockStack = new ItemStack(item, 1, OreDictionary.WILDCARD_VALUE);
|
||||
if (!blockStack.isEmpty()) {
|
||||
BackpackManager.backpackInterface.addItemToForestryBackpack(backpackUid, blockStack);
|
||||
} else {
|
||||
Log.warning("Could not find an item for block: {}", blockName);
|
||||
}
|
||||
} else {
|
||||
Log.warning("Missing block: {}", blockName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package forestry.plugins;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModules;
|
||||
import forestry.modules.ForestryPluginUtil;
|
||||
import forestry.modules.IForestryModule;
|
||||
import forestry.modules.IModuleContainer;
|
||||
|
||||
public class ForestryCompatPlugins implements IModuleContainer {
|
||||
private static final String MODULE_CONFIG_FILE_NAME = "modules.cfg";
|
||||
private static final String CONFIG_CATEGORY = "modules.plugins";
|
||||
public static final String ID = "forestry_compat";
|
||||
private Configuration config;
|
||||
|
||||
@Override
|
||||
public String getID() {
|
||||
return ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Configuration getModulesConfig() {
|
||||
return ForestryModules.getModulesConfiguration();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isModuleEnabled(IForestryModule module) {
|
||||
ForestryModule info = module.getClass().getAnnotation(ForestryModule.class);
|
||||
|
||||
String comment = ForestryPluginUtil.getComment(module);
|
||||
Property prop = getModulesConfig().get(CONFIG_CATEGORY, info.moduleID(), true, comment);
|
||||
return prop.getBoolean();
|
||||
}
|
||||
}
|
||||
+10
-7
@@ -1,31 +1,34 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forestry.core.PluginCore;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.core.ModuleCore;
|
||||
import forestry.core.blocks.BlockRegistryCore;
|
||||
import forestry.core.items.ItemRegistryCore;
|
||||
import forestry.core.utils.JeiUtil;
|
||||
import forestry.plugins.PluginManager;
|
||||
import forestry.modules.ModuleManager;
|
||||
|
||||
import mezz.jei.api.IJeiHelpers;
|
||||
import mezz.jei.api.IModPlugin;
|
||||
import mezz.jei.api.IModRegistry;
|
||||
import mezz.jei.api.JEIPlugin;
|
||||
import mezz.jei.api.ingredients.IIngredientBlacklist;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@JEIPlugin
|
||||
@SuppressWarnings("unused")
|
||||
public class ForestryJeiPlugin implements IModPlugin {
|
||||
@Override
|
||||
public void register(IModRegistry registry) {
|
||||
IJeiHelpers jeiHelpers = registry.getJeiHelpers();
|
||||
IIngredientBlacklist ingredientBlacklist = jeiHelpers.getIngredientBlacklist();
|
||||
List<ItemStack> hiddenItems = PluginManager.getHiddenItems();
|
||||
List<ItemStack> hiddenItems = ModuleManager.getHiddenItems();
|
||||
for (ItemStack hiddenItem : hiddenItems) {
|
||||
ingredientBlacklist.addIngredientToBlacklist(hiddenItem);
|
||||
}
|
||||
|
||||
ItemRegistryCore items = PluginCore.getItems();
|
||||
ItemRegistryCore items = ModuleCore.getItems();
|
||||
|
||||
JeiUtil.addDescription(registry,
|
||||
items.solderingIron,
|
||||
@@ -37,7 +40,7 @@ public class ForestryJeiPlugin implements IModPlugin {
|
||||
items.fertilizerCompound
|
||||
);
|
||||
|
||||
BlockRegistryCore blocks = PluginCore.getBlocks();
|
||||
BlockRegistryCore blocks = ModuleCore.getBlocks();
|
||||
|
||||
JeiUtil.addDescription(registry,
|
||||
blocks.analyzer,
|
||||
@@ -1,59 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright 2011-2014 SirSengir
|
||||
*
|
||||
* This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details.
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
/**
|
||||
* Optional annotation to provide additional information on IPlugins. This information will be available via the "/forestry plugin info $pluginID" command ingame.
|
||||
*
|
||||
* @author SirSengir
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface ForestryPlugin {
|
||||
|
||||
/**
|
||||
* @return Unique identifier for the plugin, no spaces!
|
||||
*/
|
||||
String pluginID();
|
||||
|
||||
/**
|
||||
* @return Nice and readable plugin name.
|
||||
*/
|
||||
String name();
|
||||
|
||||
/**
|
||||
* @return ForestryPlugin author's name.
|
||||
*/
|
||||
String author() default "";
|
||||
|
||||
/**
|
||||
* @return URL of plugin homepage.
|
||||
*/
|
||||
String url() default "";
|
||||
|
||||
/**
|
||||
* @return Version of the plugin, if any.
|
||||
*/
|
||||
String version() default "";
|
||||
|
||||
/**
|
||||
* @return Localization key for a short description what the plugin does.
|
||||
*/
|
||||
String unlocalizedDescription() default "";
|
||||
|
||||
/**
|
||||
* @return Not used (yet?).
|
||||
*/
|
||||
String help() default "";
|
||||
|
||||
/**
|
||||
* @return The name of the loot table file, if any.
|
||||
*/
|
||||
String lootTable() default "";
|
||||
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package forestry.plugins;
|
||||
|
||||
public class ForestryPluginUids {
|
||||
public static final String APICULTURE = "forestry.apiculture";
|
||||
public static final String ARBORICULTURE = "forestry.arboriculture";
|
||||
public static final String CORE = "forestry.core";
|
||||
public static final String ENERGY = "forestry.energy";
|
||||
public static final String FACTORY = "forestry.factory";
|
||||
public static final String FARMING = "forestry.farming";
|
||||
public static final String GREENHOUSE = "forestry.greenhouse";
|
||||
public static final String FLUIDS = "forestry.fluids";
|
||||
public static final String FOOD = "forestry.food";
|
||||
public static final String LEPIDOPTEROLOGY = "forestry.lepidopterology";
|
||||
public static final String MAIL = "forestry.mail";
|
||||
public static final String STORAGE = "forestry.storage";
|
||||
|
||||
public static final String BIOMES_O_PLENTY = "forestry.biomes.o.plenty";
|
||||
public static final String BUILDCRAFT_FUELS = "forestry.buildcraft.fuels";
|
||||
public static final String BUILDCRAFT_RECIPES = "forestry.buildcraft.recipes";
|
||||
public static final String BUILDCRAFT_STATEMENTS = "forestry.buildcraft.statements";
|
||||
public static final String BUILDCRAFT_TRANSPORT = "forestry.buildcraft.transport";
|
||||
public static final String CHISEL = "forestry.chisel";
|
||||
public static final String ENDER_IO = "forestry.ender.io";
|
||||
public static final String MALISIS_DOORES = "forestry.malisis.doors";
|
||||
public static final String EXTRA_UTILITIES = "forestry.extra.utilities";
|
||||
public static final String NATURA = "forestry.natura";
|
||||
public static final String INDUSTRIALCRAFT2 = "forestry.industrialcraft2";
|
||||
public static final String ACT_ADD = "forestry.actuallyadditions";
|
||||
public static final String HARVESTCRAFT = "forestry.harvestcraft";
|
||||
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";
|
||||
public static final String BETTER_WITH_MODS = "forestry.betterwithmods";
|
||||
}
|
||||
@@ -1,35 +0,0 @@
|
||||
package forestry.plugins;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import forestry.core.utils.Log;
|
||||
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
||||
|
||||
public class ForestryPluginUtil {
|
||||
private ForestryPluginUtil() {
|
||||
|
||||
}
|
||||
|
||||
public static List<IForestryPlugin> getForestryPlugins(ASMDataTable asmDataTable) {
|
||||
return getInstances(asmDataTable, ForestryPlugin.class, IForestryPlugin.class);
|
||||
}
|
||||
|
||||
private static <T> List<T> getInstances(ASMDataTable asmDataTable, Class annotationClass, Class<T> instanceClass) {
|
||||
String annotationClassName = annotationClass.getCanonicalName();
|
||||
Set<ASMDataTable.ASMData> asmDatas = asmDataTable.getAll(annotationClassName);
|
||||
List<T> instances = new ArrayList<>();
|
||||
for (ASMDataTable.ASMData asmData : asmDatas) {
|
||||
try {
|
||||
Class<?> asmClass = Class.forName(asmData.getClassName());
|
||||
Class<? extends T> asmInstanceClass = asmClass.asSubclass(instanceClass);
|
||||
T instance = asmInstanceClass.newInstance();
|
||||
instances.add(instance);
|
||||
} catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
|
||||
Log.error("Failed to load: {}", asmData.getClassName(), e);
|
||||
}
|
||||
}
|
||||
return instances;
|
||||
}
|
||||
}
|
||||
@@ -1,80 +0,0 @@
|
||||
package forestry.plugins;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.IChunkGenerator;
|
||||
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
||||
import forestry.core.IPickupHandler;
|
||||
import forestry.core.IResupplyHandler;
|
||||
import forestry.core.ISaveEventHandler;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
|
||||
public interface IForestryPlugin {
|
||||
boolean isAvailable();
|
||||
|
||||
boolean canBeDisabled();
|
||||
|
||||
String getFailMessage();
|
||||
|
||||
/**
|
||||
* See ForestryPlugin.pluginID()
|
||||
*/
|
||||
Set<String> getDependencyUids();
|
||||
|
||||
void setupAPI();
|
||||
|
||||
void disabledSetupAPI();
|
||||
|
||||
void registerItemsAndBlocks();
|
||||
|
||||
void preInit();
|
||||
|
||||
void registerTriggers();
|
||||
|
||||
void registerBackpackItems();
|
||||
|
||||
void registerCrates();
|
||||
|
||||
void doInit();
|
||||
|
||||
void registerRecipes();
|
||||
|
||||
void addLootPoolNames(Set<String> lootPoolNames);
|
||||
|
||||
void postInit();
|
||||
|
||||
boolean processIMCMessage(FMLInterModComms.IMCMessage message);
|
||||
|
||||
void populateChunk(IChunkGenerator chunkGenerator, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated);
|
||||
|
||||
void populateChunkRetroGen(World world, Random rand, int chunkX, int chunkZ);
|
||||
|
||||
void decorateBiome(World world, Random rand, BlockPos pos);
|
||||
|
||||
void getHiddenItems(List<ItemStack> hiddenItems);
|
||||
|
||||
@Nullable
|
||||
ISaveEventHandler getSaveEventHandler();
|
||||
|
||||
@Nullable
|
||||
IPacketRegistry getPacketRegistry();
|
||||
|
||||
@Nullable
|
||||
IPickupHandler getPickupHandler();
|
||||
|
||||
@Nullable
|
||||
IResupplyHandler getResupplyHandler();
|
||||
|
||||
@Nullable
|
||||
ICommand[] getConsoleCommands();
|
||||
}
|
||||
+8
-5
@@ -1,4 +1,4 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
@@ -7,18 +7,21 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCrops;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
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;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.ACT_ADD, name = "Actually Additions", author = "Ellpeck", url = "http://ellpeck.de/actadd", unlocalizedDescription = "for.plugin.actuallyadditions.description")
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.ACT_ADD, name = "Actually Additions", author = "Ellpeck", url = "http://ellpeck.de/actadd", unlocalizedDescription = "for.module.actuallyadditions.description")
|
||||
public class PluginActuallyAdditions extends CompatPlugin {
|
||||
|
||||
private static final String ACT_ADD = "actuallyadditions";
|
||||
@@ -35,7 +38,7 @@ public class PluginActuallyAdditions extends CompatPlugin {
|
||||
Item coffeeSeed = getItem("item_coffee_seed");
|
||||
|
||||
//add farm seed planting
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING))) {
|
||||
registerSeedPlant(canolaSeed, "block_canola");
|
||||
registerSeedPlant(flaxSeed, "block_flax");
|
||||
registerSeedPlant(riceSeed, "block_rice");
|
||||
+5
-4
@@ -1,4 +1,4 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCrops;
|
||||
@@ -13,10 +13,11 @@ import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.farming.logic.FarmableDoubleCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.BETTER_WITH_MODS, name = "Better With Mods", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.betterwithmods.description")
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.BETTER_WITH_MODS, name = "Better With Mods", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.module.betterwithmods.description")
|
||||
public class PluginBetterWithMods extends CompatPlugin {
|
||||
public PluginBetterWithMods() {
|
||||
super("Better With Mods", "betterwithmods");
|
||||
+35
-65
@@ -8,39 +8,36 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.BIOMES_O_PLENTY, name = "BiomesOPlenty", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.biomesoplenty.description")
|
||||
public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
||||
private static final String BoP = "BiomesOPlenty";
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.core.ModuleCore;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.BIOMES_O_PLENTY, name = "BiomesOPlenty", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.module.biomesoplenty.description")
|
||||
public class PluginBiomesOPlenty extends CompatPlugin {
|
||||
@Nullable
|
||||
private static Block saplings;
|
||||
@Nullable
|
||||
@@ -49,44 +46,34 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
private static Item food;
|
||||
private static int amount;
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return ModUtil.isModLoaded(BoP);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFailMessage() {
|
||||
return "BiomesOPlenty not found";
|
||||
public PluginBiomesOPlenty() {
|
||||
super("BiomesOPlenty", "biomesoplenty");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
saplings = getBlock("saplings");
|
||||
colorizedSaplings = getBlock("colorizedSaplings");
|
||||
food = getItem("food");
|
||||
|
||||
saplings = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(BoP, "saplings"));
|
||||
colorizedSaplings = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(BoP, "colorizedSaplings"));
|
||||
food = ForgeRegistries.ITEMS.getValue(new ResourceLocation(BoP, "food"));
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.APICULTURE)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.APICULTURE))) {
|
||||
addFlowers();
|
||||
}
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING))) {
|
||||
addFarmCrops();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
super.registerRecipes();
|
||||
|
||||
amount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FACTORY)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FACTORY))) {
|
||||
addFermenterRecipes();
|
||||
addSqueezerRecipes();
|
||||
}
|
||||
}
|
||||
|
||||
private static void addFarmCrops() {
|
||||
private void addFarmCrops() {
|
||||
List<String> saplingItemKeys = new ArrayList<>();
|
||||
|
||||
if (saplings != null) {
|
||||
@@ -97,7 +84,7 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
for (String key : saplingItemKeys) {
|
||||
Item saplingItem = ForgeRegistries.ITEMS.getValue(new ResourceLocation(BoP, key));
|
||||
Item saplingItem = getItem(key);
|
||||
String saplingName = ItemStackUtil.getItemNameFromRegistryAsString(saplingItem);
|
||||
if (saplingName != null) {
|
||||
FMLInterModComms.sendMessage(Constants.MOD_ID, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName));
|
||||
@@ -105,18 +92,18 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
//TODO BoP for 1.9: Add farmables
|
||||
// if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && saplings != null && persimmon != null) {
|
||||
// if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && saplings != null && persimmon != null) {
|
||||
// Farmables.farmables.put("farmArboreal", new FarmableGenericSapling(saplings, 15, persimmon));
|
||||
// }
|
||||
|
||||
Block boPTurnip = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(BoP, "turnip"));
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && boPTurnip != null) {
|
||||
Item boPTurnipSeeds = ForgeRegistries.ITEMS.getValue(new ResourceLocation(BoP, "turnipSeeds"));
|
||||
Block boPTurnip = getBlock("turnip");
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && boPTurnip != null) {
|
||||
Item boPTurnipSeeds = getItem("turnipSeeds");
|
||||
ItemStack boPTurnipSeedStack = new ItemStack(boPTurnipSeeds, 1, 0);
|
||||
if (!boPTurnipSeedStack.isEmpty()) {
|
||||
//TODO BoP for 1.9: Add farmable saplings
|
||||
// Farmables.farmables.get("farmVegetables").add(new FarmableHandPlanted(boPTurnipSeedStack, boPTurnip, 7));
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FACTORY)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FACTORY))) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, boPTurnipSeedStack, Fluids.SEED_OIL.getFluid(amount));
|
||||
}
|
||||
}
|
||||
@@ -138,10 +125,10 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
}
|
||||
}
|
||||
|
||||
private static void addSqueezerRecipes() {
|
||||
ItemStack mulch = new ItemStack(PluginCore.getItems().mulch);
|
||||
private void addSqueezerRecipes() {
|
||||
ItemStack mulch = new ItemStack(ModuleCore.getItems().mulch);
|
||||
|
||||
Item pinecone = ForgeRegistries.ITEMS.getValue(new ResourceLocation(BoP, "pinecone"));
|
||||
Item pinecone = getItem("pinecone");
|
||||
if (pinecone != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack(pinecone), Fluids.SEED_OIL.getFluid(3 * amount));
|
||||
}
|
||||
@@ -150,7 +137,7 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack(food), Fluids.JUICE.getFluid(50), mulch, 5);
|
||||
}
|
||||
|
||||
Item persimmon = ForgeRegistries.ITEMS.getValue(new ResourceLocation(BoP, "persimmon"));
|
||||
Item persimmon = getItem("persimmon");
|
||||
if (persimmon != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack(persimmon), Fluids.JUICE.getFluid(200), mulch, 20);
|
||||
}
|
||||
@@ -229,21 +216,4 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
);
|
||||
}
|
||||
|
||||
private static void addBlocksToBackpack(String backpackUid, String... blockNames) {
|
||||
for (String blockName : blockNames) {
|
||||
Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(BoP, blockName));
|
||||
if (block != null) {
|
||||
Item item = Item.getItemFromBlock(block);
|
||||
ItemStack blockStack = new ItemStack(item, 1, OreDictionary.WILDCARD_VALUE);
|
||||
if (!blockStack.isEmpty()) {
|
||||
BackpackManager.backpackInterface.addItemToForestryBackpack(backpackUid, blockStack);
|
||||
} else {
|
||||
Log.warning("Could not find an item for block: {}", blockName);
|
||||
}
|
||||
} else {
|
||||
Log.warning("Missing block: {}", blockName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+6
-6
@@ -8,17 +8,17 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
// TODO: Buildcraft for 1.9
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.BUILDCRAFT_FUELS, name = "BuildCraft 6 Fuels", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.buildcraft6.description")
|
||||
public class PluginBuildCraftFuels extends BlankForestryPlugin {
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.BUILDCRAFT_FUELS, name = "BuildCraft 6 Fuels", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.module.buildcraft6.description")
|
||||
public class PluginBuildCraftFuels extends BlankForestryModule {
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
+8
-7
@@ -8,18 +8,19 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.BUILDCRAFT_RECIPES, name = "BuildCraft 6 Recipes", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.buildcraft6.description")
|
||||
public class PluginBuildCraftRecipes extends BlankForestryPlugin {
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.BUILDCRAFT_RECIPES, name = "BuildCraft 6 Recipes", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.module.buildcraft6.description")
|
||||
public class PluginBuildCraftRecipes extends BlankForestryModule {
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
+8
-7
@@ -8,18 +8,19 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.BUILDCRAFT_STATEMENTS, name = "BuildCraft 6 Statements", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.buildcraft6.description")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.BUILDCRAFT_STATEMENTS, name = "BuildCraft 6 Statements", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.module.buildcraft6.description")
|
||||
//@Optional.Interface(iface = "buildcraft.api.statements.ITriggerProvider", modid = "BuildCraftAPI|statements")
|
||||
public class PluginBuildCraftStatements extends BlankForestryPlugin {//implements ITriggerProvider {
|
||||
public class PluginBuildCraftStatements extends BlankForestryModule {//implements ITriggerProvider {
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
+14
-12
@@ -8,23 +8,25 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import forestry.core.PluginCore;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
import forestry.core.ModuleCore;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.BUILDCRAFT_TRANSPORT, name = "BuildCraft 6 Transport", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.buildcraft6.description")
|
||||
public class PluginBuildCraftTransport extends BlankForestryPlugin {
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.BUILDCRAFT_TRANSPORT, name = "BuildCraft 6 Transport", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.module.buildcraft6.description")
|
||||
public class PluginBuildCraftTransport extends BlankForestryModule {
|
||||
|
||||
private static final String BCT = "buildcrafttransport";
|
||||
|
||||
@@ -40,7 +42,7 @@ public class PluginBuildCraftTransport extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
Item beeswax = PluginCore.getItems().beeswax;
|
||||
Item beeswax = ModuleCore.getItems().beeswax;
|
||||
Item pipeWaterproof = ForgeRegistries.ITEMS.getValue(new ResourceLocation(BCT, "waterproof"));
|
||||
if (pipeWaterproof != null) {
|
||||
RecipeUtil.addShapelessRecipe("pipe_waterproof", new ItemStack(pipeWaterproof), beeswax);
|
||||
+9
-7
@@ -8,19 +8,21 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.CHISEL, name = "Chisel", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.chisel.description")
|
||||
public class PluginChisel extends BlankForestryPlugin {
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.CHISEL, name = "Chisel", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.module.chisel.description")
|
||||
public class PluginChisel extends BlankForestryModule {
|
||||
|
||||
private static final String Chisel = "chisel";
|
||||
|
||||
+13
-10
@@ -1,20 +1,23 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.ENDER_IO, name = "EnderIO", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.enderIO.description")
|
||||
public class PluginEnderIO extends BlankForestryPlugin {
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.ENDER_IO, name = "EnderIO", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.module.enderIO.description")
|
||||
public class PluginEnderIO extends BlankForestryModule {
|
||||
|
||||
private static final String EnderIO = "EnderIO";
|
||||
private static final String EnderIO = "enderio";
|
||||
|
||||
private static final String FLUID_FUEL_ADD = "fluidFuel:add";
|
||||
private static final String FLUID_COOLANT_ADD = "fluidCoolant:add";
|
||||
+11
-13
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.function.Consumer;
|
||||
@@ -26,7 +26,7 @@ import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuit;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.ModuleCore;
|
||||
import forestry.core.circuits.Circuits;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
@@ -38,12 +38,13 @@ import forestry.farming.FarmRegistry;
|
||||
import forestry.farming.circuits.CircuitFarmLogic;
|
||||
import forestry.farming.logic.FarmLogicExU;
|
||||
import forestry.farming.logic.FarmableAgingCrop;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.EXTRA_UTILITIES, name = "ExtraUtilities", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.extrautilities.description")
|
||||
public class PluginExtraUtilities extends BlankForestryPlugin {
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.EXTRA_UTILITIES, name = "ExtraUtilities", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.module.extrautilities.description")
|
||||
public class PluginExtraUtilities extends BlankForestryModule {
|
||||
|
||||
private static final String ExU = "extrautils2";
|
||||
|
||||
@@ -59,8 +60,6 @@ public class PluginExtraUtilities extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
if (Config.isExUtilRedOrchidEnabled()) {
|
||||
registerExPlant("Orchid", "redorchid", "Red Orchid", Blocks.REDSTONE_ORE, circuit -> Circuits.farmOrchidManaged = circuit);
|
||||
}
|
||||
@@ -72,15 +71,14 @@ public class PluginExtraUtilities extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
super.registerRecipes();
|
||||
if (!ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING)) return;
|
||||
if (!ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING))) return;
|
||||
if(Circuits.farmEnderManaged != null) {
|
||||
ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed");
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.getItems().tubes.get(EnumElectronTube.ENDER, 1), Circuits.farmEnderManaged);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, ModuleCore.getItems().tubes.get(EnumElectronTube.ENDER, 1), Circuits.farmEnderManaged);
|
||||
}
|
||||
if(Circuits.farmOrchidManaged != null) {
|
||||
ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed");
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.ORCHID, 1), Circuits.farmOrchidManaged);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, ModuleCore.items.tubes.get(EnumElectronTube.ORCHID, 1), Circuits.farmOrchidManaged);
|
||||
}
|
||||
}
|
||||
|
||||
+21
-19
@@ -8,7 +8,7 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
@@ -16,23 +16,25 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.properties.PropertyInteger;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.IFarmRegistry;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.fuels.MoistenerFuel;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.PluginFluids;
|
||||
import forestry.core.ModuleCore;
|
||||
import forestry.core.ModuleFluids;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.items.ItemRegistryCore;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.farming.logic.FarmableAgingCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.HARVESTCRAFT, name = "HarvestCraft", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.harvestcraft.description")
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.HARVESTCRAFT, name = "HarvestCraft", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.module.harvestcraft.description")
|
||||
public class PluginHarvestCraft extends CompatPlugin {
|
||||
|
||||
private static final String HC = "harvestcraft";
|
||||
@@ -198,7 +200,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
if (berrySeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, berrySeed, Fluids.SEED_OIL.getFluid(seedamount));
|
||||
}
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && berrySeed != null && berryBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && berrySeed != null && berryBlock != null) {
|
||||
farmRegistry.registerFarmables("farmWheat", new FarmableAgingCrop(berrySeed, berryBlock, plantAGE, 3));
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(berrySeed, berryBlock, plantAGE, 3, 0));
|
||||
}
|
||||
@@ -216,7 +218,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
if (fruitSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, fruitSeed, Fluids.SEED_OIL.getFluid(seedamount));
|
||||
}
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && fruitSeed != null && fruitBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && fruitSeed != null && fruitBlock != null) {
|
||||
farmRegistry.registerFarmables("farmWheat", new FarmableAgingCrop(fruitSeed, fruitBlock, plantAGE, 3));
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(fruitSeed, fruitBlock, plantAGE, 3, 0));
|
||||
}
|
||||
@@ -235,14 +237,14 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
if (vegetableSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, vegetableSeed, Fluids.SEED_OIL.getFluid(seedamount));
|
||||
}
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && vegetableSeed != null && vegetableBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && vegetableSeed != null && vegetableBlock != null) {
|
||||
farmRegistry.registerFarmables("farmVegetables", new FarmableAgingCrop(vegetableSeed, vegetableBlock, plantAGE, 3));
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(vegetableSeed, vegetableBlock, plantAGE, 3, 0));
|
||||
}
|
||||
plants.add(vegetableName);
|
||||
}
|
||||
|
||||
ItemRegistryCore coreItems = PluginCore.getItems();
|
||||
ItemRegistryCore coreItems = ModuleCore.getItems();
|
||||
for (String grainName : grains) {
|
||||
ItemStack grain = getItemStack(grainName + "item");
|
||||
ItemStack grainSeed = getItemStack(grainName + "seeditem");
|
||||
@@ -255,7 +257,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, grainSeed, Fluids.SEED_OIL.getFluid(seedamount));
|
||||
RecipeManagers.moistenerManager.addRecipe(grainSeed, new ItemStack(Blocks.MYCELIUM), 5000);
|
||||
}
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && grainSeed != null && grainBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && grainSeed != null && grainBlock != null) {
|
||||
farmRegistry.registerFarmables("farmWheat", new FarmableAgingCrop(grainSeed, grainBlock, plantAGE, 3));
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(grainSeed, grainBlock, plantAGE, 3, 0));
|
||||
}
|
||||
@@ -265,7 +267,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
for (String treeFruitName : treeFruits) {
|
||||
ItemStack treeFruit = getItemStack(treeFruitName + "item");
|
||||
Block treeFruitBlock = getBlock("pam" + treeFruitName);
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && treeFruitBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && treeFruitBlock != null) {
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, treeFruitBlock, fruitAGE, 2, 0));
|
||||
}
|
||||
if (treeFruit != null) {
|
||||
@@ -276,7 +278,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
|
||||
for (String treeName : trees) {
|
||||
Block fruitBlock = getBlock("pam" + treeName);
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && fruitBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && fruitBlock != null) {
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, fruitBlock, fruitAGE, 2, 0));
|
||||
}
|
||||
plants.add(treeName);
|
||||
@@ -284,7 +286,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
|
||||
for (String treeName : treesSpecial) {
|
||||
Block fruitBlock = getBlock("pam" + treeName);
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && fruitBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && fruitBlock != null) {
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, fruitBlock, fruitAGE, 2, 0));
|
||||
}
|
||||
}
|
||||
@@ -302,7 +304,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
if (genericCropSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, genericCropSeed, Fluids.SEED_OIL.getFluid(seedamount));
|
||||
}
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && genericCropSeed != null && genericCropBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && genericCropSeed != null && genericCropBlock != null) {
|
||||
farmRegistry.registerFarmables("farmWheat", new FarmableAgingCrop(genericCropSeed, genericCropBlock, plantAGE, 3));
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(genericCropSeed, genericCropBlock, plantAGE, 3, 0));
|
||||
}
|
||||
@@ -314,7 +316,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
if (mustardCropSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, mustardCropSeed, Fluids.SEED_OIL.getFluid(seedamount));
|
||||
}
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && mustardCropSeed != null && mustardCropBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && mustardCropSeed != null && mustardCropBlock != null) {
|
||||
farmRegistry.registerFarmables("farmWheat", new FarmableAgingCrop(mustardCropSeed, mustardCropBlock, plantAGE, 3));
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(mustardCropSeed, mustardCropBlock, plantAGE, 3, 0));
|
||||
}
|
||||
@@ -336,7 +338,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
if (cropnutSeed != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, cropnutSeed, Fluids.SEED_OIL.getFluid(seedamount));
|
||||
}
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && cropnutSeed != null && cropnutBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && cropnutSeed != null && cropnutBlock != null) {
|
||||
farmRegistry.registerFarmables("farmWheat", new FarmableAgingCrop(cropnutSeed, cropnutBlock, plantAGE, 3));
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(cropnutSeed, cropnutBlock, plantAGE, 3, 0));
|
||||
}
|
||||
@@ -348,7 +350,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
for (String nutName : nuts) {
|
||||
ItemStack nut = getItemStack(nutName + "item");
|
||||
Block nutBlock = getBlock("pam" + nutName);
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING) && nutBlock != null) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING)) && nutBlock != null) {
|
||||
farmRegistry.registerFarmables("farmOrchard", new FarmableAgingCrop(ItemStack.EMPTY, nutBlock, fruitAGE, 2, 0));
|
||||
}
|
||||
if (nut != null) {
|
||||
@@ -363,7 +365,7 @@ public class PluginHarvestCraft extends CompatPlugin {
|
||||
|
||||
ItemStack hcBeeswaxItem = getItemStack("beeswaxitem");
|
||||
if (hcBeeswaxItem != null) {
|
||||
RecipeUtil.addRecipe("pam_wax_capsule", PluginFluids.getItems().waxCapsuleEmpty.getItemStack(ForestryAPI.activeMode.getIntegerSetting("recipe.output.capsule")), "XXX ", 'X', hcBeeswaxItem);
|
||||
RecipeUtil.addRecipe("pam_wax_capsule", ModuleFluids.getItems().waxCapsuleEmpty.getItemStack(ForestryAPI.activeMode.getIntegerSetting("recipe.output.capsule")), "XXX ", 'X', hcBeeswaxItem);
|
||||
}
|
||||
}
|
||||
|
||||
src/main/java/forestry/plugins/compat/PluginIC2.java → src/main/java/forestry/plugins/PluginIC2.java
Executable → Regular
+29
-31
@@ -8,19 +8,22 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
|
||||
import net.minecraftforge.fml.common.Optional;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
|
||||
@@ -34,10 +37,10 @@ import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.apiculture.PluginApiculture;
|
||||
import forestry.apiculture.ModuleApiculture;
|
||||
import forestry.apiculture.items.EnumPropolis;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.ModuleCore;
|
||||
import forestry.core.blocks.BlockBogEarth;
|
||||
import forestry.core.circuits.CircuitLayout;
|
||||
import forestry.core.circuits.Circuits;
|
||||
@@ -49,7 +52,7 @@ import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.ModUtil;
|
||||
import forestry.energy.PluginEnergy;
|
||||
import forestry.energy.ModuleEnergy;
|
||||
import forestry.energy.blocks.BlockRegistryEnergy;
|
||||
import forestry.energy.circuits.CircuitElectricBoost;
|
||||
import forestry.energy.circuits.CircuitElectricChoke;
|
||||
@@ -58,15 +61,16 @@ import forestry.farming.FarmRegistry;
|
||||
import forestry.farming.circuits.CircuitFarmLogic;
|
||||
import forestry.farming.logic.FarmLogicRubber;
|
||||
import forestry.farming.logic.FarmableBasicIC2Crop;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
import ic2.api.item.IC2Items;
|
||||
import ic2.api.recipe.Recipes;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.INDUSTRIALCRAFT2, name = "IndustrialCraft2", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.ic2.description")
|
||||
public class PluginIC2 extends BlankForestryPlugin {
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.INDUSTRIALCRAFT2, name = "IndustrialCraft2", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.module.ic2.description")
|
||||
public class PluginIC2 extends BlankForestryModule {
|
||||
public static final String modId = "ic2";
|
||||
|
||||
@Nullable
|
||||
@@ -95,18 +99,17 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<String> getDependencyUids() {
|
||||
Set<String> dependencyUids = super.getDependencyUids();
|
||||
dependencyUids.add(ForestryPluginUids.FARMING);
|
||||
dependencyUids.add(ForestryPluginUids.FACTORY);
|
||||
public Set<ResourceLocation> getDependencyUids() {
|
||||
Set<ResourceLocation> dependencyUids = new HashSet<>();
|
||||
dependencyUids.add(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.CORE));
|
||||
dependencyUids.add(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING));
|
||||
dependencyUids.add(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FACTORY));
|
||||
return dependencyUids;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Optional.Method(modid = PluginIC2.modId)
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
// rubber chain
|
||||
rubberWood = IC2Items.getItem("rubber_wood");
|
||||
resin = IC2Items.getItem("misc_resource", "resin");
|
||||
@@ -127,11 +130,9 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
@Override
|
||||
@Optional.Method(modid = PluginIC2.modId)
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
// Remove some items from the recycler
|
||||
if (Recipes.recyclerBlacklist != null) {
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.getItems();
|
||||
ItemRegistryApiculture beeItems = ModuleApiculture.getItems();
|
||||
if (beeItems != null) {
|
||||
Recipes.recyclerBlacklist.add(Recipes.inputFactory.forStack(new ItemStack(beeItems.beeQueenGE)));
|
||||
Recipes.recyclerBlacklist.add(Recipes.inputFactory.forStack(new ItemStack(beeItems.beePrincessGE)));
|
||||
@@ -151,8 +152,6 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
super.postInit();
|
||||
|
||||
if (BackpackManager.backpackInterface == null) {
|
||||
return;
|
||||
}
|
||||
@@ -211,7 +210,7 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
@Override
|
||||
@Optional.Method(modid = PluginIC2.modId)
|
||||
public void registerRecipes() {
|
||||
ItemRegistryCore coreItems = PluginCore.items;
|
||||
ItemRegistryCore coreItems = ModuleCore.items;
|
||||
|
||||
if (rubber != null) {
|
||||
RecipeManagers.fabricatorManager.addRecipe(ItemStack.EMPTY, Fluids.GLASS.getFluid(500), coreItems.tubes.get(EnumElectronTube.RUBBER, 4),
|
||||
@@ -228,7 +227,7 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
RecipeUtil.addFermenterRecipes(bioChaff, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat") * 9, Fluids.BIOMASS);
|
||||
}
|
||||
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.getItems();
|
||||
ItemRegistryApiculture beeItems = ModuleApiculture.getItems();
|
||||
if (beeItems != null) {
|
||||
if (resin != null) {
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, beeItems.propolis.get(EnumPropolis.NORMAL, 1), ImmutableMap.of(resin, 1.0f));
|
||||
@@ -256,7 +255,7 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.ENERGY)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.ENERGY))) {
|
||||
Fluid biogas = FluidRegistry.getFluid("ic2biogas");
|
||||
if (biogas != null) {
|
||||
int burnDuration = Math.round(Constants.ENGINE_CYCLE_DURATION_BIOMASS * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.biogas"));
|
||||
@@ -269,7 +268,7 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
if (waterCell != null) {
|
||||
int bogEarthOutputCan = ForestryAPI.activeMode.getIntegerSetting("recipe.output.bogearth.can");
|
||||
if (bogEarthOutputCan > 0) {
|
||||
ItemStack bogEarthCan = PluginCore.getBlocks().bogEarth.get(BlockBogEarth.SoilType.BOG_EARTH, bogEarthOutputCan);
|
||||
ItemStack bogEarthCan = ModuleCore.getBlocks().bogEarth.get(BlockBogEarth.SoilType.BOG_EARTH, bogEarthOutputCan);
|
||||
RecipeUtil.addRecipe("ic2_bog_earth_can", bogEarthCan, "#Y#", "YXY", "#Y#", '#', Blocks.DIRT, 'X', waterCell, 'Y', "sand");
|
||||
}
|
||||
}
|
||||
@@ -282,7 +281,7 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
ChipsetManager.solderManager.addRecipe(layout, coreItems.tubes.get(EnumElectronTube.BRONZE, 1), Circuits.energyElectricBoost2);
|
||||
ChipsetManager.solderManager.addRecipe(layout, coreItems.tubes.get(EnumElectronTube.IRON, 1), Circuits.energyElectricEfficiency1);
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING))) {
|
||||
if (resin != null && rubberWood != null) {
|
||||
ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, coreItems.tubes.get(EnumElectronTube.RUBBER, 1), Circuits.farmRubberManual);
|
||||
@@ -292,7 +291,7 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
}
|
||||
|
||||
|
||||
BlockRegistryEnergy energyBlocks = PluginEnergy.blocks;
|
||||
BlockRegistryEnergy energyBlocks = ModuleEnergy.blocks;
|
||||
if (energyBlocks != null) {
|
||||
RecipeUtil.addRecipe("ic2_generator", blocks.generator,
|
||||
"X#X",
|
||||
@@ -311,11 +310,10 @@ public class PluginIC2 extends BlankForestryPlugin {
|
||||
'Y', "gearTin",
|
||||
'V', Blocks.PISTON);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
super.registerItemsAndBlocks();
|
||||
blocks = new BlockRegistryIC2();
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
blocks = new BlockRegistryIC2();
|
||||
}
|
||||
}
|
||||
+5
-4
@@ -1,4 +1,4 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
@@ -22,10 +22,11 @@ import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.farming.logic.FarmableDoubleCrop;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.IMMERSIVE_ENGINEERING, name = "ImmersiveEngineering", author = "marcin212", url = Constants.URL, unlocalizedDescription = "for.plugin.immersiveengineering.description")
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.IMMERSIVE_ENGINEERING, name = "ImmersiveEngineering", author = "marcin212", url = Constants.URL, unlocalizedDescription = "for.module.immersiveengineering.description")
|
||||
public class PluginImmersiveEngineering extends CompatPlugin {
|
||||
|
||||
public PluginImmersiveEngineering() {
|
||||
@@ -1,355 +0,0 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2011-2014 SirSengir.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the GNU Lesser Public License v3
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
||||
*
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.command.CommandHandler;
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.IChunkGenerator;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import net.minecraftforge.fml.common.discovery.ASMDataTable;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import forestry.Forestry;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.IPickupHandler;
|
||||
import forestry.core.IResupplyHandler;
|
||||
import forestry.core.ISaveEventHandler;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.Translator;
|
||||
|
||||
public class PluginManager {
|
||||
|
||||
private static final String PLUGIN_CONFIG_FILE_NAME = "plugins.cfg";
|
||||
private static final String CATEGORY_PLUGINS = "plugins";
|
||||
|
||||
public static final ArrayList<IPickupHandler> pickupHandlers = Lists.newArrayList();
|
||||
public static final ArrayList<ISaveEventHandler> saveEventHandlers = Lists.newArrayList();
|
||||
public static final ArrayList<IResupplyHandler> resupplyHandlers = Lists.newArrayList();
|
||||
|
||||
private static final Set<IForestryPlugin> loadedPlugins = new LinkedHashSet<>();
|
||||
private static final Set<IForestryPlugin> unloadedPlugins = new LinkedHashSet<>();
|
||||
private static Stage stage = Stage.SETUP;
|
||||
|
||||
public enum Stage {
|
||||
SETUP, // setup API to make it functional. GameMode Configs are not yet accessible
|
||||
SETUP_DISABLED, // setup fallback API to avoid crashes
|
||||
REGISTER, // register basic blocks and items
|
||||
PRE_INIT, // register handlers, triggers, definitions, and anything that depends on basic items
|
||||
BACKPACKS_CRATES, // backpacks, crates
|
||||
INIT, // anything that depends on PreInit stages, recipe registration
|
||||
POST_INIT, // stubborn mod integration, dungeon loot, and finalization of things that take input from mods
|
||||
FINISHED
|
||||
}
|
||||
|
||||
public static final Set<IForestryPlugin> configDisabledPlugins = new HashSet<>();
|
||||
|
||||
public static Stage getStage() {
|
||||
return stage;
|
||||
}
|
||||
|
||||
public static Set<IForestryPlugin> getLoadedPlugins() {
|
||||
return ImmutableSet.copyOf(loadedPlugins);
|
||||
}
|
||||
|
||||
private static void registerHandlers(IForestryPlugin plugin, Side side) {
|
||||
Log.debug("Registering Handlers for Plugin: {}", plugin);
|
||||
|
||||
IPacketRegistry packetRegistry = plugin.getPacketRegistry();
|
||||
if (packetRegistry != null) {
|
||||
packetRegistry.registerPacketsServer();
|
||||
if (side == Side.CLIENT) {
|
||||
packetRegistry.registerPacketsClient();
|
||||
}
|
||||
}
|
||||
|
||||
IPickupHandler pickupHandler = plugin.getPickupHandler();
|
||||
if (pickupHandler != null) {
|
||||
pickupHandlers.add(pickupHandler);
|
||||
}
|
||||
|
||||
ISaveEventHandler saveHandler = plugin.getSaveEventHandler();
|
||||
if (saveHandler != null) {
|
||||
saveEventHandlers.add(saveHandler);
|
||||
}
|
||||
|
||||
IResupplyHandler resupplyHandler = plugin.getResupplyHandler();
|
||||
if (resupplyHandler != null) {
|
||||
resupplyHandlers.add(resupplyHandler);
|
||||
}
|
||||
}
|
||||
|
||||
private static IForestryPlugin getPluginCore(List<IForestryPlugin> forestryPlugins) {
|
||||
for (IForestryPlugin plugin : forestryPlugins) {
|
||||
if (plugin instanceof PluginCore) {
|
||||
return plugin;
|
||||
}
|
||||
}
|
||||
throw new IllegalStateException("Could not find core plugin");
|
||||
}
|
||||
|
||||
private static void configurePlugins(List<IForestryPlugin> forestryPlugins) {
|
||||
Locale locale = Locale.getDefault();
|
||||
Locale.setDefault(Locale.ENGLISH);
|
||||
|
||||
Configuration config = new Configuration(new File(Forestry.instance.getConfigFolder(), PLUGIN_CONFIG_FILE_NAME));
|
||||
|
||||
config.load();
|
||||
config.addCustomCategoryComment(CATEGORY_PLUGINS, "Disabling these plugins can greatly change how the mod functions.\n"
|
||||
+ "Your mileage may vary, please report any issues.");
|
||||
|
||||
IForestryPlugin corePlugin = getPluginCore(forestryPlugins);
|
||||
forestryPlugins.remove(corePlugin);
|
||||
forestryPlugins.add(0, corePlugin);
|
||||
|
||||
Set<String> toLoad = new HashSet<>();
|
||||
|
||||
ImmutableList<IForestryPlugin> allForestryPlugins = ImmutableList.copyOf(forestryPlugins);
|
||||
|
||||
Iterator<IForestryPlugin> iterator = forestryPlugins.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
IForestryPlugin plugin = iterator.next();
|
||||
if (plugin.canBeDisabled()) {
|
||||
if (!isEnabled(config, plugin)) {
|
||||
iterator.remove();
|
||||
Log.info("Plugin disabled: {}", plugin);
|
||||
continue;
|
||||
}
|
||||
if (!plugin.isAvailable()) {
|
||||
iterator.remove();
|
||||
Log.info("Plugin {} failed to load: {}", plugin, plugin.getFailMessage());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
ForestryPlugin info = plugin.getClass().getAnnotation(ForestryPlugin.class);
|
||||
toLoad.add(info.pluginID());
|
||||
}
|
||||
|
||||
boolean changed;
|
||||
do {
|
||||
changed = false;
|
||||
iterator = forestryPlugins.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
IForestryPlugin plugin = iterator.next();
|
||||
Set<String> dependencies = plugin.getDependencyUids();
|
||||
if (!toLoad.containsAll(dependencies)) {
|
||||
iterator.remove();
|
||||
changed = true;
|
||||
ForestryPlugin info = plugin.getClass().getAnnotation(ForestryPlugin.class);
|
||||
String pluginId = info.pluginID();
|
||||
toLoad.remove(pluginId);
|
||||
Log.warning("Plugin {} is missing dependencies: {}", pluginId, dependencies);
|
||||
}
|
||||
}
|
||||
} while (changed);
|
||||
|
||||
loadedPlugins.addAll(forestryPlugins);
|
||||
unloadedPlugins.addAll(allForestryPlugins);
|
||||
unloadedPlugins.removeAll(loadedPlugins);
|
||||
|
||||
ForestryAPI.enabledPlugins = new HashSet<>();
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
ForestryPlugin info = plugin.getClass().getAnnotation(ForestryPlugin.class);
|
||||
ForestryAPI.enabledPlugins.add(info.pluginID());
|
||||
}
|
||||
|
||||
if (config.hasChanged()) {
|
||||
config.save();
|
||||
}
|
||||
|
||||
Locale.setDefault(locale);
|
||||
}
|
||||
|
||||
public static void runSetup(FMLPreInitializationEvent event) {
|
||||
|
||||
ASMDataTable asmDataTable = event.getAsmData();
|
||||
List<IForestryPlugin> forestryPlugins = ForestryPluginUtil.getForestryPlugins(asmDataTable);
|
||||
|
||||
stage = Stage.SETUP;
|
||||
configurePlugins(forestryPlugins);
|
||||
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
Log.debug("Setup API Start: {}", plugin);
|
||||
plugin.setupAPI();
|
||||
Log.debug("Setup API Complete: {}", plugin);
|
||||
}
|
||||
|
||||
stage = Stage.SETUP_DISABLED;
|
||||
for (IForestryPlugin plugin : unloadedPlugins) {
|
||||
Log.debug("Disabled-Setup Start: {}", plugin);
|
||||
plugin.disabledSetupAPI();
|
||||
Log.debug("Disabled-Setup Complete: {}", plugin);
|
||||
}
|
||||
|
||||
stage = Stage.REGISTER;
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
Log.debug("Register Items and Blocks Start: {}", plugin);
|
||||
plugin.registerItemsAndBlocks();
|
||||
Log.debug("Register Items and Blocks Complete: {}", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
public static void runPreInit(Side side) {
|
||||
stage = Stage.PRE_INIT;
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
Log.debug("Pre-Init Start: {}", plugin);
|
||||
registerHandlers(plugin, side);
|
||||
plugin.preInit();
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.BUILDCRAFT_STATEMENTS)) {
|
||||
plugin.registerTriggers();
|
||||
}
|
||||
Log.debug("Pre-Init Complete: {}", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
public static void runRegisterBackpacksAndCrates() {
|
||||
stage = Stage.BACKPACKS_CRATES;
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.STORAGE)) {
|
||||
Log.debug("BackpacksAndCrates Start: {}", plugin);
|
||||
plugin.registerBackpackItems();
|
||||
plugin.registerCrates();
|
||||
Log.debug("BackpacksAndCrates Complete: {}", plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void runInit() {
|
||||
stage = Stage.INIT;
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
Log.debug("Init Start: {}", plugin);
|
||||
plugin.doInit();
|
||||
plugin.registerRecipes();
|
||||
Log.debug("Init Complete: {}", plugin);
|
||||
}
|
||||
}
|
||||
|
||||
public static void runPostInit() {
|
||||
stage = Stage.POST_INIT;
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
Log.debug("Post-Init Start: {}", plugin);
|
||||
plugin.postInit();
|
||||
Log.debug("Post-Init Complete: {}", plugin);
|
||||
}
|
||||
|
||||
stage = Stage.FINISHED;
|
||||
}
|
||||
|
||||
public static void serverStarting(MinecraftServer server) {
|
||||
CommandHandler commandManager = (CommandHandler) server.getCommandManager();
|
||||
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
ICommand[] commands = plugin.getConsoleCommands();
|
||||
if (commands == null) {
|
||||
continue;
|
||||
}
|
||||
for (ICommand command : commands) {
|
||||
commandManager.registerCommand(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void processIMCMessages(ImmutableList<FMLInterModComms.IMCMessage> messages) {
|
||||
for (FMLInterModComms.IMCMessage message : messages) {
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
if (plugin.processIMCMessage(message)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void populateChunk(IChunkGenerator chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
plugin.populateChunk(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated);
|
||||
}
|
||||
}
|
||||
|
||||
public static void decorateBiome(World world, Random rand, BlockPos pos) {
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
plugin.decorateBiome(world, rand, pos);
|
||||
}
|
||||
}
|
||||
|
||||
public static void populateChunkRetroGen(World world, Random rand, int chunkX, int chunkZ) {
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
plugin.populateChunkRetroGen(world, rand, chunkX, chunkZ);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static List<ItemStack> getHiddenItems() {
|
||||
List<ItemStack> hiddenItems = new ArrayList<>();
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
plugin.getHiddenItems(hiddenItems);
|
||||
}
|
||||
return hiddenItems;
|
||||
}
|
||||
|
||||
|
||||
public static Set<String> getLootPoolNames() {
|
||||
Set<String> lootPoolNames = new HashSet<>();
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
plugin.addLootPoolNames(lootPoolNames);
|
||||
}
|
||||
return lootPoolNames;
|
||||
}
|
||||
|
||||
public static Set<String> getLootTableFiles() {
|
||||
Set<String> lootTableNames = new HashSet<>();
|
||||
for (IForestryPlugin plugin : loadedPlugins) {
|
||||
ForestryPlugin info = plugin.getClass().getAnnotation(ForestryPlugin.class);
|
||||
String lootTableFolder = info.lootTable();
|
||||
if (!lootTableFolder.isEmpty()) {
|
||||
lootTableNames.add(lootTableFolder);
|
||||
}
|
||||
}
|
||||
return lootTableNames;
|
||||
}
|
||||
|
||||
private static boolean isEnabled(Configuration config, IForestryPlugin plugin) {
|
||||
ForestryPlugin info = plugin.getClass().getAnnotation(ForestryPlugin.class);
|
||||
|
||||
String comment = Translator.translateToLocal(info.unlocalizedDescription());
|
||||
Property prop = config.get(CATEGORY_PLUGINS, info.pluginID(), true, comment);
|
||||
boolean enabled = prop.getBoolean();
|
||||
|
||||
if (!enabled) {
|
||||
configDisabledPlugins.add(plugin);
|
||||
}
|
||||
|
||||
return enabled;
|
||||
}
|
||||
}
|
||||
+7
-5
@@ -1,10 +1,11 @@
|
||||
package forestry.plugins.compat;
|
||||
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 net.minecraft.util.ResourceLocation;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.IFarmRegistry;
|
||||
@@ -12,10 +13,11 @@ 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;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.MAGICAL_AGRICULTURE, name = "Mystical Agriculture", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.mysticalagriculture.description")
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.MAGICAL_AGRICULTURE, name = "Mystical Agriculture", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.module.mysticalagriculture.description")
|
||||
public class PluginMysticalAgriculture extends CompatPlugin {
|
||||
private static final String MAGICAL_AGRICULTURE = "mysticalagriculture";
|
||||
|
||||
@@ -25,7 +27,7 @@ public class PluginMysticalAgriculture extends CompatPlugin {
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING))) {
|
||||
ImmutableList<String> crops = ImmutableList.of(
|
||||
"stone",
|
||||
"dirt",
|
||||
+17
-16
@@ -8,7 +8,9 @@
|
||||
* Various Contributors including, but not limited to:
|
||||
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
||||
******************************************************************************/
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -22,13 +24,13 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import com.google.common.collect.Iterables;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.IFarmLogic;
|
||||
@@ -37,7 +39,7 @@ import forestry.api.fuels.MoistenerFuel;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.ModuleCore;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
@@ -47,12 +49,13 @@ import forestry.core.utils.ModUtil;
|
||||
import forestry.farming.FarmRegistry;
|
||||
import forestry.farming.logic.FarmableAgingCrop;
|
||||
import forestry.farming.logic.FarmableSapling;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.modules.BlankForestryModule;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.NATURA, name = "Natura", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.natura.description")
|
||||
public class PluginNatura extends BlankForestryPlugin {
|
||||
@SuppressWarnings("unused")
|
||||
@ForestryModule(containerID = ForestryCompatPlugins.ID, moduleID = ForestryModuleUids.NATURA, name = "Natura", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.module.natura.description")
|
||||
public class PluginNatura extends BlankForestryModule {
|
||||
|
||||
public static final String modId = "natura";
|
||||
|
||||
@@ -184,8 +187,6 @@ public class PluginNatura extends BlankForestryPlugin {
|
||||
|
||||
@Override
|
||||
public void registerCrates() {
|
||||
super.registerCrates();
|
||||
|
||||
ICrateRegistry crateRegistry = StorageManager.crateRegistry;
|
||||
|
||||
Iterables.concat(
|
||||
@@ -203,7 +204,7 @@ public class PluginNatura extends BlankForestryPlugin {
|
||||
RecipeManagers.moistenerManager.addRecipe(seed, new ItemStack(Blocks.MYCELIUM), 5000);
|
||||
}
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FARMING)) {
|
||||
if (ForestryAPI.enabledModules.contains(new ResourceLocation(Constants.MOD_ID, ForestryModuleUids.FARMING))) {
|
||||
cropBlocks.forEach(itemStack -> {
|
||||
Block block = ItemStackUtil.getBlock(itemStack);
|
||||
ItemStack seedItem;
|
||||
@@ -232,7 +233,7 @@ public class PluginNatura extends BlankForestryPlugin {
|
||||
|
||||
amount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 2;
|
||||
final int juiceAmount = Math.max(amount, 1); // Produce at least 1 mb of juice.
|
||||
ItemStack mulch = PluginCore.items.mulch.getItemStack();
|
||||
ItemStack mulch = ModuleCore.items.mulch.getItemStack();
|
||||
fruits.forEach(fruit -> RecipeManagers.squeezerManager.addRecipe(
|
||||
10, NonNullList.from(fruit, fruit),
|
||||
Fluids.JUICE.getFluid(juiceAmount), mulch,
|
||||
@@ -252,10 +253,10 @@ public class PluginNatura extends BlankForestryPlugin {
|
||||
|
||||
int compostWheatAmount = ForestryAPI.activeMode.getIntegerSetting("recipe.output.compost.wheat");
|
||||
if (compostWheatAmount > 0) {
|
||||
ItemStack compostWheat = PluginCore.items.fertilizerCompound.getItemStack(compostWheatAmount);
|
||||
ItemStack compostWheat = ModuleCore.items.fertilizerCompound.getItemStack(compostWheatAmount);
|
||||
RecipeUtil.addRecipe(compostWheat.getUnlocalizedName(), compostWheat, " X ", "X#X", " X ", '#', Blocks.DIRT, 'X', crop);
|
||||
}
|
||||
FuelManager.moistenerResource.put(crop, new MoistenerFuel(crop, PluginCore.items.mouldyWheat.getItemStack(), 0, 300));
|
||||
FuelManager.moistenerResource.put(crop, new MoistenerFuel(crop, ModuleCore.items.mouldyWheat.getItemStack(), 0, 300));
|
||||
});
|
||||
}
|
||||
|
||||
+5
-4
@@ -1,4 +1,4 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
@@ -12,10 +12,11 @@ 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;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.ROOTS, name = "Roots", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.roots.description")
|
||||
@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");
|
||||
+5
-4
@@ -1,4 +1,4 @@
|
||||
package forestry.plugins.compat;
|
||||
package forestry.plugins;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
@@ -14,10 +14,11 @@ import forestry.core.fluids.Fluids;
|
||||
import forestry.farming.logic.FarmableAgingCrop;
|
||||
import forestry.farming.logic.FarmableRusticGrape;
|
||||
import forestry.farming.logic.FarmableRusticSapling;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.modules.ForestryModule;
|
||||
import forestry.modules.ForestryModuleUids;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.RUSTIC, name = "rustic", author = "Nedelosk", url = Constants.URL, unlocalizedDescription = "for.plugin.rustic.description")
|
||||
@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() {
|
||||
@@ -1,9 +0,0 @@
|
||||
@ParametersAreNonnullByDefault
|
||||
@FieldsAreNonnullByDefault
|
||||
@MethodsReturnNonnullByDefault
|
||||
package forestry.plugins.compat;
|
||||
|
||||
import javax.annotation.ParametersAreNonnullByDefault;
|
||||
|
||||
import forestry.core.utils.FieldsAreNonnullByDefault;
|
||||
import mcp.MethodsReturnNonnullByDefault;
|
||||
Reference in new issue
Block a user