mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-19 11:49:14 +00:00
Move plugins to their respective folders
This commit is contained in:
1 parent
626d0d8fb5
commit
ff076090e3
79 files changed
+302
-286
No files matched your search
@@ -1,928 +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.ImmutableMap;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.Forestry;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.apiculture.IBeekeepingMode;
|
||||
import forestry.api.apiculture.hives.HiveManager;
|
||||
import forestry.api.apiculture.hives.IHiveRegistry.HiveType;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import forestry.api.genetics.IClassification.EnumClassLevel;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.apiculture.ArmorApiaristHelper;
|
||||
import forestry.apiculture.SaveEventHandlerApiculture;
|
||||
import forestry.apiculture.blocks.BlockAlveary;
|
||||
import forestry.apiculture.blocks.BlockCandle;
|
||||
import forestry.apiculture.blocks.BlockRegistryApiculture;
|
||||
import forestry.apiculture.blocks.BlockTypeApiculture;
|
||||
import forestry.apiculture.blocks.BlockTypeApicultureTesr;
|
||||
import forestry.apiculture.commands.CommandBee;
|
||||
import forestry.apiculture.entities.EntityMinecartApiary;
|
||||
import forestry.apiculture.entities.EntityMinecartBeehouse;
|
||||
import forestry.apiculture.flowers.Flower;
|
||||
import forestry.apiculture.flowers.FlowerRegistry;
|
||||
import forestry.apiculture.genetics.BeeBranchDefinition;
|
||||
import forestry.apiculture.genetics.BeeDefinition;
|
||||
import forestry.apiculture.genetics.BeeFactory;
|
||||
import forestry.apiculture.genetics.BeeRoot;
|
||||
import forestry.apiculture.genetics.BeeMutationFactory;
|
||||
import forestry.apiculture.genetics.BeekeepingMode;
|
||||
import forestry.apiculture.genetics.HiveDrop;
|
||||
import forestry.apiculture.genetics.JubilanceFactory;
|
||||
import forestry.apiculture.genetics.alleles.AlleleEffect;
|
||||
import forestry.apiculture.items.EnumHoneyComb;
|
||||
import forestry.apiculture.items.EnumPollenCluster;
|
||||
import forestry.apiculture.items.EnumPropolis;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.apiculture.multiblock.TileAlvearyFan;
|
||||
import forestry.apiculture.multiblock.TileAlvearyHeater;
|
||||
import forestry.apiculture.multiblock.TileAlvearyHygroregulator;
|
||||
import forestry.apiculture.multiblock.TileAlvearyPlain;
|
||||
import forestry.apiculture.multiblock.TileAlvearySieve;
|
||||
import forestry.apiculture.multiblock.TileAlvearyStabiliser;
|
||||
import forestry.apiculture.multiblock.TileAlvearySwarmer;
|
||||
import forestry.apiculture.network.PacketRegistryApiculture;
|
||||
import forestry.apiculture.proxy.ProxyApiculture;
|
||||
import forestry.apiculture.tiles.TileCandle;
|
||||
import forestry.apiculture.tiles.TileSwarm;
|
||||
import forestry.apiculture.trigger.ApicultureTriggers;
|
||||
import forestry.apiculture.worldgen.HiveDecorator;
|
||||
import forestry.apiculture.worldgen.HiveDescription;
|
||||
import forestry.apiculture.worldgen.HiveGenHelper;
|
||||
import forestry.apiculture.worldgen.HiveRegistry;
|
||||
import forestry.core.ISaveEventHandler;
|
||||
import forestry.core.blocks.BlockTypeCoreTesr;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.LocalizedConfiguration;
|
||||
import forestry.core.entities.EntityFXSnow;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.items.EnumElectronTube;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.EntityUtil;
|
||||
import forestry.core.utils.IMCUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.Stack;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.food.items.ItemRegistryFood;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.APICULTURE, name = "Apiculture", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.apiculture.description")
|
||||
public class PluginApiculture extends BlankForestryPlugin {
|
||||
|
||||
@SidedProxy(clientSide = "forestry.apiculture.proxy.ProxyApicultureClient", serverSide = "forestry.apiculture.proxy.ProxyApiculture")
|
||||
public static ProxyApiculture proxy;
|
||||
private static final String CONFIG_CATEGORY = "apiculture";
|
||||
public static String beekeepingMode = "NORMAL";
|
||||
private static float secondPrincessChance = 0;
|
||||
public static final int ticksPerBeeWorkCycle = 550;
|
||||
public static boolean fancyRenderedBees = false;
|
||||
|
||||
public static ItemRegistryApiculture items;
|
||||
public static BlockRegistryApiculture blocks;
|
||||
|
||||
public static HiveRegistry hiveRegistry;
|
||||
|
||||
private final Map<String, String[]> defaultAcceptedFlowers = new HashMap<>();
|
||||
private final Map<String, String[]> defaultPlantableFlowers = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
HiveManager.hiveRegistry = hiveRegistry = new HiveRegistry();
|
||||
HiveManager.genHelper = new HiveGenHelper();
|
||||
|
||||
FlowerManager.flowerRegistry = new FlowerRegistry();
|
||||
|
||||
BeeManager.villageBees = new ArrayList[]{new ArrayList<>(), new ArrayList<>()};
|
||||
|
||||
BeeManager.beeFactory = new BeeFactory();
|
||||
BeeManager.beeMutationFactory = new BeeMutationFactory();
|
||||
BeeManager.jubilanceFactory = new JubilanceFactory();
|
||||
BeeManager.armorApiaristHelper = new ArmorApiaristHelper();
|
||||
|
||||
// Init bee interface
|
||||
BeeManager.beeRoot = new BeeRoot();
|
||||
AlleleManager.alleleRegistry.registerSpeciesRoot(BeeManager.beeRoot);
|
||||
|
||||
// Modes
|
||||
BeeManager.beeRoot.registerBeekeepingMode(BeekeepingMode.easy);
|
||||
BeeManager.beeRoot.registerBeekeepingMode(BeekeepingMode.normal);
|
||||
BeeManager.beeRoot.registerBeekeepingMode(BeekeepingMode.hard);
|
||||
BeeManager.beeRoot.registerBeekeepingMode(BeekeepingMode.hardcore);
|
||||
BeeManager.beeRoot.registerBeekeepingMode(BeekeepingMode.insane);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
items = new ItemRegistryApiculture();
|
||||
blocks = new BlockRegistryApiculture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
BeeDefinition.preInit();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
blocks.apiculture.addDefinitions(BlockTypeApiculture.VALUES);
|
||||
blocks.apicultureChest.addDefinitions(BlockTypeApicultureTesr.APIARIST_CHEST);
|
||||
|
||||
/*if (Config.enableVillagers) {
|
||||
// Register village components with the Structure registry.
|
||||
VillageHandlerApiculture.registerVillageComponents();
|
||||
}*/
|
||||
|
||||
// Commands
|
||||
PluginCore.rootCommand.addChildCommand(new CommandBee());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTriggers() {
|
||||
ApicultureTriggers.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
File configFile = new File(Forestry.instance.getConfigFolder(), CONFIG_CATEGORY + ".cfg");
|
||||
if (!configFile.exists()) {
|
||||
setDefaultsForConfig();
|
||||
}
|
||||
|
||||
LocalizedConfiguration config = new LocalizedConfiguration(configFile, "2.0.0");
|
||||
if (!Objects.equals(config.getLoadedConfigVersion(), config.getDefinedConfigVersion())) {
|
||||
boolean deleted = configFile.delete();
|
||||
if (deleted) {
|
||||
config = new LocalizedConfiguration(configFile, "2.0.0");
|
||||
setDefaultsForConfig();
|
||||
}
|
||||
}
|
||||
|
||||
List<IBeekeepingMode> beekeepingModes = BeeManager.beeRoot.getBeekeepingModes();
|
||||
String[] validBeekeepingModeNames = new String[beekeepingModes.size()];
|
||||
for (int i = 0; i < beekeepingModes.size(); i++) {
|
||||
validBeekeepingModeNames[i] = beekeepingModes.get(i).getName();
|
||||
}
|
||||
|
||||
beekeepingMode = config.getStringLocalized("beekeeping", "mode", "NORMAL", validBeekeepingModeNames);
|
||||
Log.debug("Beekeeping mode read from config: " + beekeepingMode);
|
||||
|
||||
secondPrincessChance = config.getFloatLocalized("beekeeping", "second.princess", secondPrincessChance, 0.0f, 100.0f);
|
||||
|
||||
String acceptedFlowerMessage = StringUtil.localize("config.beekeeping.flowers.accepted.comment");
|
||||
String plantableFlowerMessage = StringUtil.localize("config.beekeeping.flowers.plantable.comment");
|
||||
|
||||
FlowerRegistry flowerRegistry = (FlowerRegistry) FlowerManager.flowerRegistry;
|
||||
|
||||
for (String flowerType : flowerRegistry.getFlowerTypes()) {
|
||||
String[] defaultAccepted = defaultAcceptedFlowers.get(flowerType);
|
||||
if (defaultAccepted == null) {
|
||||
defaultAccepted = Constants.EMPTY_STRINGS;
|
||||
}
|
||||
Property property = config.get("beekeeping.flowers." + flowerType, "accepted", defaultAccepted);
|
||||
property.comment = acceptedFlowerMessage;
|
||||
parseAcceptedFlowers(property.getStringList(), flowerType);
|
||||
|
||||
String[] defaultPlantable = defaultPlantableFlowers.get(flowerType);
|
||||
if (defaultPlantable == null) {
|
||||
defaultPlantable = Constants.EMPTY_STRINGS;
|
||||
}
|
||||
property = config.get("beekeeping.flowers." + flowerType, "plantable", defaultPlantable);
|
||||
property.comment = plantableFlowerMessage;
|
||||
parsePlantableFlowers(property, flowerType);
|
||||
|
||||
Set<Flower> acceptableFlowers = flowerRegistry.getAcceptableFlowers(flowerType);
|
||||
if (acceptableFlowers == null || acceptableFlowers.size() == 0) {
|
||||
Log.error("Flower type '" + flowerType + "' has no valid flowers set in apiculture.cfg. Add valid flowers or delete the config to set it to default.");
|
||||
}
|
||||
}
|
||||
|
||||
String[] blacklist = config.getStringListLocalized("species", "blacklist", Constants.EMPTY_STRINGS);
|
||||
parseBeeBlacklist(blacklist);
|
||||
|
||||
config.save();
|
||||
|
||||
// Genetics
|
||||
createAlleles();
|
||||
BeeDefinition.initBees();
|
||||
|
||||
AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement("forestry.speciesArgrarian", BeeDefinition.AGRARIAN.getGenome().getPrimary());
|
||||
|
||||
// Hives
|
||||
createHives();
|
||||
registerBeehiveDrops();
|
||||
|
||||
// Inducers for swarmer
|
||||
BeeManager.inducers.put(items.royalJelly.getItemStack(), 10);
|
||||
|
||||
GameRegistry.registerTileEntity(TileAlvearyPlain.class, "forestry.Alveary");
|
||||
GameRegistry.registerTileEntity(TileSwarm.class, "forestry.Swarm");
|
||||
GameRegistry.registerTileEntity(TileAlvearySwarmer.class, "forestry.AlvearySwarmer");
|
||||
GameRegistry.registerTileEntity(TileAlvearyHeater.class, "forestry.AlvearyHeater");
|
||||
GameRegistry.registerTileEntity(TileAlvearyFan.class, "forestry.AlvearyFan");
|
||||
GameRegistry.registerTileEntity(TileAlvearyHygroregulator.class, "forestry.AlvearyHygro");
|
||||
GameRegistry.registerTileEntity(TileAlvearyStabiliser.class, "forestry.AlvearyStabiliser");
|
||||
GameRegistry.registerTileEntity(TileAlvearySieve.class, "forestry.AlvearySieve");
|
||||
GameRegistry.registerTileEntity(TileCandle.class, "forestry.Candle");
|
||||
|
||||
EntityUtil.registerEntity(EntityMinecartBeehouse.class, "cart.beehouse", 1, 0x000000, 0xffffff, 256, 3, true);
|
||||
EntityUtil.registerEntity(EntityMinecartApiary.class, "cart.apiary", 2, 0x000000, 0xffffff, 256, 3, true);
|
||||
|
||||
BeeManager.villageBees[0].add(BeeDefinition.FOREST.getGenome());
|
||||
BeeManager.villageBees[0].add(BeeDefinition.MEADOWS.getGenome());
|
||||
BeeManager.villageBees[0].add(BeeDefinition.MODEST.getGenome());
|
||||
BeeManager.villageBees[0].add(BeeDefinition.MARSHY.getGenome());
|
||||
BeeManager.villageBees[0].add(BeeDefinition.WINTRY.getGenome());
|
||||
BeeManager.villageBees[0].add(BeeDefinition.TROPICAL.getGenome());
|
||||
|
||||
BeeManager.villageBees[1].add(BeeDefinition.FOREST.getRainResist().getGenome());
|
||||
BeeManager.villageBees[1].add(BeeDefinition.COMMON.getGenome());
|
||||
BeeManager.villageBees[1].add(BeeDefinition.VALIANT.getGenome());
|
||||
|
||||
/*if (Config.enableVillagers) {
|
||||
// Register villager stuff
|
||||
VillageHandlerApiculture villageHandler = new VillageHandlerApiculture();
|
||||
VillagerRegistry.instance().registerVillageCreationHandler(villageHandler);
|
||||
VillagerRegistry.instance().registerVillagerId(Constants.ID_VILLAGER_BEEKEEPER);
|
||||
Proxies.render.registerVillagerSkin(Constants.ID_VILLAGER_BEEKEEPER, Constants.TEXTURE_SKIN_BEEKPEEPER);
|
||||
VillagerRegistry.instance().registerVillageTradeHandler(Constants.ID_VILLAGER_BEEKEEPER, villageHandler);
|
||||
}*/
|
||||
|
||||
proxy.initializeRendering();
|
||||
|
||||
blocks.apiculture.init();
|
||||
blocks.apicultureChest.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
super.postInit();
|
||||
registerDungeonLoot();
|
||||
}
|
||||
|
||||
private void setDefaultsForConfig() {
|
||||
|
||||
FlowerRegistry flowerRegistry = (FlowerRegistry) FlowerManager.flowerRegistry;
|
||||
|
||||
// Register acceptable plants
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.dragon_egg, FlowerManager.FlowerTypeEnd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.vine, FlowerManager.FlowerTypeJungle);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.tallgrass, FlowerManager.FlowerTypeJungle);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.wheat, FlowerManager.FlowerTypeWheat);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.pumpkin_stem, FlowerManager.FlowerTypeGourd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.melon_stem, FlowerManager.FlowerTypeGourd);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.nether_wart, FlowerManager.FlowerTypeNether);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.cactus, FlowerManager.FlowerTypeCacti);
|
||||
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.double_plant, 0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.double_plant, 1, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.double_plant, 4, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerAcceptableFlower(Blocks.double_plant, 5, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
|
||||
// Register plantable plants
|
||||
for (int meta = 0; meta <= 8; meta++) {
|
||||
flowerRegistry.registerPlantableFlower(Blocks.red_flower, meta, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
}
|
||||
|
||||
flowerRegistry.registerPlantableFlower(Blocks.yellow_flower, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.brown_mushroom, 0, 1.0, FlowerManager.FlowerTypeMushrooms);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.red_mushroom, 0, 1.0, FlowerManager.FlowerTypeMushrooms);
|
||||
flowerRegistry.registerPlantableFlower(Blocks.cactus, 0, 1.0, FlowerManager.FlowerTypeCacti);
|
||||
|
||||
for (String flowerType : flowerRegistry.getFlowerTypes()) {
|
||||
Set<Flower> flowers = flowerRegistry.getAcceptableFlowers(flowerType);
|
||||
List<String> acceptedFlowerNames = new ArrayList<>();
|
||||
List<String> plantableFlowerNames = new ArrayList<>();
|
||||
if (flowers != null) {
|
||||
for (Flower flower : flowers) {
|
||||
String name = ItemStackUtil.getBlockNameFromRegistryAsSting(flower.getBlock());
|
||||
if (name == null) {
|
||||
Log.warning("Could not find name for flower: " + flower + " with type: " + flowerType);
|
||||
continue;
|
||||
}
|
||||
|
||||
int meta = flower.getMeta();
|
||||
if (flower.getMeta() != OreDictionary.WILDCARD_VALUE) {
|
||||
name = name + ':' + meta;
|
||||
}
|
||||
|
||||
if (flower.isPlantable()) {
|
||||
plantableFlowerNames.add(name);
|
||||
} else {
|
||||
acceptedFlowerNames.add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String[] acceptedFlowerNamesArray = acceptedFlowerNames.toArray(new String[acceptedFlowerNames.size()]);
|
||||
defaultAcceptedFlowers.put(flowerType, acceptedFlowerNamesArray);
|
||||
|
||||
String[] plantableFlowerNamesArray = plantableFlowerNames.toArray(new String[plantableFlowerNames.size()]);
|
||||
defaultPlantableFlowers.put(flowerType, plantableFlowerNamesArray);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacketRegistry getPacketRegistry() {
|
||||
return new PacketRegistryApiculture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrates() {
|
||||
ICrateRegistry crateRegistry = StorageManager.crateRegistry;
|
||||
crateRegistry.registerCrate(PluginCore.items.beeswax.getItemStack(), "cratedBeeswax");
|
||||
crateRegistry.registerCrate(items.pollenCluster.get(EnumPollenCluster.NORMAL, 1), "cratedPollen");
|
||||
crateRegistry.registerCrate(items.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1), "cratedCrystallinePollen");
|
||||
crateRegistry.registerCrate(items.propolis.getItemStack(), "cratedPropolis");
|
||||
crateRegistry.registerCrate(items.honeydew.getItemStack(), "cratedHoneydew");
|
||||
crateRegistry.registerCrate(items.royalJelly.getItemStack(), "cratedRoyalJelly");
|
||||
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.HONEY, 1), "cratedHoneycombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.COCOA, 1), "cratedCocoaComb");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.SIMMERING, 1), "cratedSimmeringCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.STRINGY, 1), "cratedStringyCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.FROZEN, 1), "cratedFrozenCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.DRIPPING, 1), "cratedDrippingCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.SILKY, 1), "cratedSilkyCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.PARCHED, 1), "cratedParchedCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), "cratedMysteriousCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.POWDERY, 1), "cratedPowderyCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.WHEATEN, 1), "cratedWheatenCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.MOSSY, 1), "cratedMossyCombs");
|
||||
crateRegistry.registerCrate(items.beeComb.get(EnumHoneyComb.MELLOW, 1), "cratedMellowCombs");
|
||||
|
||||
crateRegistry.registerCrate(PluginCore.items.refractoryWax.getItemStack(), "cratedRefractoryWax");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
|
||||
// / APIARIST'S ARMOR
|
||||
ItemStack wovenSilk = PluginCore.items.craftingMaterial.getWovenSilk();
|
||||
RecipeUtil.addRecipe(items.apiaristHat,
|
||||
"###", "# #",
|
||||
'#', wovenSilk);
|
||||
RecipeUtil.addRecipe(items.apiaristChest,
|
||||
"# #", "###", "###",
|
||||
'#', wovenSilk);
|
||||
RecipeUtil.addRecipe(items.apiaristLegs,
|
||||
"###", "# #", "# #",
|
||||
'#', wovenSilk);
|
||||
RecipeUtil.addRecipe(items.apiaristBoots,
|
||||
"# #", "# #",
|
||||
'#', wovenSilk);
|
||||
|
||||
// / HABITAT LOCATOR
|
||||
RecipeUtil.addRecipe(items.habitatLocator,
|
||||
" X ",
|
||||
"X#X",
|
||||
" X ",
|
||||
'#', "dustRedstone", 'X', "ingotBronze");
|
||||
|
||||
// Bees
|
||||
RecipeUtil.addRecipe(items.scoop,
|
||||
"#X#", "###", " # ",
|
||||
'#', "stickWood",
|
||||
'X', Blocks.wool);
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.slime_ball),
|
||||
"#X#", "#X#", "#X#",
|
||||
'#', items.propolis,
|
||||
'X', items.pollenCluster.get(EnumPollenCluster.NORMAL, 1));
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.speckled_melon),
|
||||
"#X#", "#Y#", "#X#",
|
||||
'#', items.honeyDrop,
|
||||
'X', items.honeydew,
|
||||
'Y', Items.melon);
|
||||
RecipeUtil.addRecipe(items.frameUntreated,
|
||||
"###", "#S#", "###",
|
||||
'#', "stickWood",
|
||||
'S', Items.string);
|
||||
RecipeUtil.addRecipe(items.frameImpregnated,
|
||||
"###", "#S#", "###",
|
||||
'#', PluginCore.items.stickImpregnated,
|
||||
'S', Items.string);
|
||||
RecipeUtil.addRecipe(items.minecartBeehouse.getBeeHouseMinecart(),
|
||||
"B",
|
||||
"C",
|
||||
'B', blocks.apiculture.get(BlockTypeApiculture.BEE_HOUSE),
|
||||
'C', Items.minecart);
|
||||
RecipeUtil.addRecipe(items.minecartBeehouse.getApiaryMinecart(),
|
||||
"B",
|
||||
"C",
|
||||
'B', blocks.apiculture.get(BlockTypeApiculture.APIARY),
|
||||
'C', Items.minecart);
|
||||
|
||||
// FOOD STUFF
|
||||
ItemRegistryFood foodItems = PluginFood.items;
|
||||
if (foodItems != null) {
|
||||
RecipeUtil.addRecipe(new ItemStack(foodItems.honeyedSlice, 4),
|
||||
"###", "#X#", "###",
|
||||
'#', items.honeyDrop,
|
||||
'X', Items.bread);
|
||||
|
||||
RecipeUtil.addRecipe(foodItems.honeyPot,
|
||||
"# #", " X ", "# #",
|
||||
'#', items.honeyDrop,
|
||||
'X', PluginFluids.items.waxCapsuleEmpty);
|
||||
|
||||
RecipeUtil.addRecipe(foodItems.ambrosia,
|
||||
"#Y#", "XXX", "###",
|
||||
'#', items.honeydew,
|
||||
'X', items.royalJelly,
|
||||
'Y', PluginFluids.items.waxCapsuleEmpty);
|
||||
}
|
||||
|
||||
// / CAPSULES
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.capsule"), "###", '#', PluginCore.items.beeswax);
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.refractory"), "###", '#', PluginCore.items.refractoryWax);
|
||||
|
||||
// / BITUMINOUS PEAT
|
||||
RecipeUtil.addRecipe(PluginCore.items.bituminousPeat.getItemStack(),
|
||||
" # ", "XYX", " # ",
|
||||
'#', "dustAsh",
|
||||
'X', PluginCore.items.peat,
|
||||
'Y', items.propolis);
|
||||
|
||||
// / TORCHES
|
||||
RecipeUtil.addRecipe(new ItemStack(Blocks.torch, 3),
|
||||
" # ", " # ", " Y ",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'Y', "stickWood");
|
||||
RecipeUtil.addRecipe(PluginCore.items.craftingMaterial.getPulsatingMesh(),
|
||||
"# #", " # ", "# #",
|
||||
'#', items.propolis.get(EnumPropolis.PULSATING, 1));
|
||||
|
||||
// / WAX CAST
|
||||
RecipeUtil.addRecipe(items.waxCast,
|
||||
"###",
|
||||
"# #",
|
||||
"###",
|
||||
'#', PluginCore.items.beeswax);
|
||||
|
||||
// / ALVEARY
|
||||
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.AlvearyType.PLAIN),
|
||||
"###",
|
||||
"#X#",
|
||||
"###",
|
||||
'X', PluginCore.items.impregnatedCasing,
|
||||
'#', PluginCore.items.craftingMaterial.getScentedPaneling());
|
||||
// SWARMER
|
||||
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.AlvearyType.SWARMER),
|
||||
"#G#",
|
||||
" X ",
|
||||
"#G#",
|
||||
'#', PluginCore.items.tubes.get(EnumElectronTube.DIAMOND, 1),
|
||||
'X', blocks.alveary,
|
||||
'G', "ingotGold");
|
||||
// FAN
|
||||
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.AlvearyType.FAN),
|
||||
"I I",
|
||||
" X ",
|
||||
"I#I",
|
||||
'#', PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1),
|
||||
'X', blocks.alveary,
|
||||
'I', "ingotIron");
|
||||
// HEATER
|
||||
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.AlvearyType.HEATER),
|
||||
"#I#",
|
||||
" X ",
|
||||
"YYY",
|
||||
'#', PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1),
|
||||
'X', blocks.alveary,
|
||||
'I', "ingotIron", 'Y', "stone");
|
||||
// HYGROREGULATOR
|
||||
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.AlvearyType.HYGRO),
|
||||
"GIG",
|
||||
"GXG",
|
||||
"GIG",
|
||||
'X', blocks.alveary,
|
||||
'I', "ingotIron",
|
||||
'G', "blockGlass");
|
||||
// STABILISER
|
||||
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.AlvearyType.STABILISER),
|
||||
"G G",
|
||||
"GXG",
|
||||
"G G",
|
||||
'X', blocks.alveary,
|
||||
'G', "gemQuartz");
|
||||
// SIEVE
|
||||
RecipeUtil.addRecipe(blocks.alveary.get(BlockAlveary.AlvearyType.SIEVE),
|
||||
"III",
|
||||
" X ",
|
||||
"WWW",
|
||||
'X', blocks.alveary,
|
||||
'I', "ingotIron",
|
||||
'W', PluginCore.items.craftingMaterial.getWovenSilk());
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FACTORY)) {
|
||||
// / SQUEEZER
|
||||
FluidStack honeyDropFluid = Fluids.HONEY.getFluid(Constants.FLUID_PER_HONEY_DROP);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{items.honeyDrop.getItemStack()}, honeyDropFluid, items.propolis.getItemStack(), 5);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{items.honeydew.getItemStack()}, honeyDropFluid);
|
||||
|
||||
ItemStack phosphor = PluginCore.items.phosphor.getItemStack(2);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.sand)}, Fluids.LAVA.getFluid(2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.sand, 1, 1)}, Fluids.LAVA.getFluid(2000));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{phosphor, new ItemStack(Blocks.dirt)}, Fluids.LAVA.getFluid(1600));
|
||||
|
||||
// / CARPENTER
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Fluids.WATER.getFluid(2000), null, items.beealyzer.getItemStack(),
|
||||
"X#X", "X#X", "RDR",
|
||||
'#', "paneGlass",
|
||||
'X', "ingotTin",
|
||||
'R', "dustRedstone",
|
||||
'D', "gemDiamond");
|
||||
RecipeManagers.carpenterManager.addRecipe(50, Fluids.HONEY.getFluid(500), null, PluginCore.items.craftingMaterial.getScentedPaneling(),
|
||||
" J ", "###", "WPW",
|
||||
'#', "plankWood",
|
||||
'J', items.royalJelly,
|
||||
'W', PluginCore.items.beeswax,
|
||||
'P', items.pollenCluster.get(EnumPollenCluster.NORMAL, 1));
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(30, Fluids.WATER.getFluid(600), null, blocks.candle.getUnlitCandle(24),
|
||||
" X ",
|
||||
"###",
|
||||
"###",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'X', Items.string);
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(200), null, blocks.candle.getUnlitCandle(6),
|
||||
"#X#",
|
||||
'#', PluginCore.items.beeswax,
|
||||
'X', PluginCore.items.craftingMaterial.getSilkWisp());
|
||||
RecipeUtil.addShapelessRecipe(blocks.candle.getUnlitCandle(1), blocks.candle.getUnlitCandle(1));
|
||||
RecipeUtil.addShapelessRecipe(blocks.candle.getLitCandle(1), blocks.candle.getLitCandle(1));
|
||||
|
||||
// / CENTRIFUGE
|
||||
// Honey combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.HONEY, 1), ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 1.0f,
|
||||
items.honeyDrop.getItemStack(), 0.9f
|
||||
));
|
||||
|
||||
// Cocoa combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.COCOA, 1), ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 1.0f,
|
||||
new ItemStack(Items.dye, 1, 3), 0.5f
|
||||
));
|
||||
|
||||
// Simmering combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.SIMMERING, 1), ImmutableMap.of(
|
||||
PluginCore.items.refractoryWax.getItemStack(), 1.0f,
|
||||
PluginCore.items.phosphor.getItemStack(2), 0.7f
|
||||
));
|
||||
|
||||
// Stringy combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.STRINGY, 1), ImmutableMap.of(
|
||||
items.propolis.getItemStack(), 1.0f,
|
||||
items.honeyDrop.getItemStack(), 0.4f
|
||||
));
|
||||
|
||||
// Dripping combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.DRIPPING, 1), ImmutableMap.of(
|
||||
items.honeydew.getItemStack(), 1.0f,
|
||||
items.honeyDrop.getItemStack(), 0.4f
|
||||
));
|
||||
|
||||
// Frozen combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.FROZEN, 1), ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 0.8f,
|
||||
items.honeyDrop.getItemStack(), 0.7f,
|
||||
new ItemStack(Items.snowball), 0.4f,
|
||||
items.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1), 0.2f
|
||||
));
|
||||
|
||||
// Silky combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.SILKY, 1), ImmutableMap.of(
|
||||
items.honeyDrop.getItemStack(), 1.0f,
|
||||
items.propolis.get(EnumPropolis.SILKY, 1), 0.8f
|
||||
));
|
||||
|
||||
// Parched combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.PARCHED, 1), ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 1.0f,
|
||||
items.honeyDrop.getItemStack(), 0.9f
|
||||
));
|
||||
|
||||
// Mysterious combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), ImmutableMap.of(
|
||||
items.propolis.get(EnumPropolis.PULSATING, 1), 1.0f,
|
||||
items.honeyDrop.getItemStack(), 0.4f
|
||||
));
|
||||
|
||||
// Irradiated combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), ImmutableMap.<ItemStack, Float>of(
|
||||
));
|
||||
|
||||
// Powdery combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.POWDERY, 1), ImmutableMap.of(
|
||||
items.honeyDrop.getItemStack(), 0.2f,
|
||||
PluginCore.items.beeswax.getItemStack(), 0.2f,
|
||||
new ItemStack(Items.gunpowder), 0.9f
|
||||
));
|
||||
|
||||
// Wheaten Combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.WHEATEN, 1), ImmutableMap.of(
|
||||
items.honeyDrop.getItemStack(), 0.2f,
|
||||
PluginCore.items.beeswax.getItemStack(), 0.2f,
|
||||
new ItemStack(Items.wheat), 0.8f
|
||||
));
|
||||
|
||||
// Mossy Combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.MOSSY, 1), ImmutableMap.of(
|
||||
PluginCore.items.beeswax.getItemStack(), 1.0f,
|
||||
items.honeyDrop.getItemStack(), 0.9f
|
||||
));
|
||||
|
||||
// Mellow Combs
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, items.beeComb.get(EnumHoneyComb.MELLOW, 1), ImmutableMap.of(
|
||||
items.honeydew.getItemStack(), 0.6f,
|
||||
PluginCore.items.beeswax.getItemStack(), 0.2f,
|
||||
new ItemStack(Items.quartz), 0.3f
|
||||
));
|
||||
|
||||
// Silky Propolis
|
||||
RecipeManagers.centrifugeManager.addRecipe(5, items.propolis.get(EnumPropolis.SILKY, 1), ImmutableMap.of(
|
||||
PluginCore.items.craftingMaterial.getSilkWisp(), 0.6f,
|
||||
items.propolis.getItemStack(), 0.1f
|
||||
));
|
||||
|
||||
// / FERMENTER
|
||||
RecipeManagers.fermenterManager.addRecipe(items.honeydew.getItemStack(), 500, 1.0f, Fluids.SHORT_MEAD.getFluid(1), Fluids.HONEY.getFluid(1));
|
||||
}
|
||||
|
||||
// ANALYZER
|
||||
RecipeUtil.addRecipe(PluginCore.blocks.core.get(BlockTypeCoreTesr.ANALYZER),
|
||||
"XTX",
|
||||
" Y ",
|
||||
"X X",
|
||||
'Y', PluginCore.items.sturdyCasing,
|
||||
'T', items.beealyzer,
|
||||
'X', "ingotBronze");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.apiculture.get(BlockTypeApiculture.APIARY),
|
||||
"XXX",
|
||||
"#C#",
|
||||
"###",
|
||||
'X', "slabWood",
|
||||
'#', "plankWood",
|
||||
'C', PluginCore.items.impregnatedCasing);
|
||||
|
||||
RecipeUtil.addRecipe(new ItemStack(blocks.apicultureChest),
|
||||
" # ",
|
||||
"XYX",
|
||||
"XXX",
|
||||
'#', "blockGlass",
|
||||
'X', "beeComb",
|
||||
'Y', "chestWood");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.apiculture.get(BlockTypeApiculture.BEE_HOUSE),
|
||||
"XXX",
|
||||
"#C#",
|
||||
"###",
|
||||
'X', "slabWood",
|
||||
'#', "plankWood",
|
||||
'C', "beeComb");
|
||||
}
|
||||
|
||||
private static void registerBeehiveDrops() {
|
||||
ItemStack honeyComb = items.beeComb.get(EnumHoneyComb.HONEY, 1);
|
||||
hiveRegistry.addDrops(HiveType.FOREST.getHiveName(),
|
||||
new HiveDrop(80, BeeDefinition.FOREST, honeyComb).setIgnobleShare(0.7f),
|
||||
new HiveDrop(8, BeeDefinition.FOREST.getRainResist(), honeyComb),
|
||||
new HiveDrop(3, BeeDefinition.VALIANT, honeyComb)
|
||||
);
|
||||
|
||||
hiveRegistry.addDrops(HiveType.MEADOWS.getHiveName(),
|
||||
new HiveDrop(80, BeeDefinition.MEADOWS, honeyComb).setIgnobleShare(0.7f),
|
||||
new HiveDrop(3, BeeDefinition.VALIANT, honeyComb)
|
||||
);
|
||||
|
||||
ItemStack parchedComb = items.beeComb.get(EnumHoneyComb.PARCHED, 1);
|
||||
hiveRegistry.addDrops(HiveType.DESERT.getHiveName(),
|
||||
new HiveDrop(80, BeeDefinition.MODEST, parchedComb).setIgnobleShare(0.7f),
|
||||
new HiveDrop(3, BeeDefinition.VALIANT, parchedComb)
|
||||
);
|
||||
|
||||
ItemStack silkyComb = items.beeComb.get(EnumHoneyComb.SILKY, 1);
|
||||
hiveRegistry.addDrops(HiveType.JUNGLE.getHiveName(),
|
||||
new HiveDrop(80, BeeDefinition.TROPICAL, silkyComb).setIgnobleShare(0.7f),
|
||||
new HiveDrop(3, BeeDefinition.VALIANT, silkyComb)
|
||||
);
|
||||
|
||||
ItemStack mysteriousComb = items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1);
|
||||
hiveRegistry.addDrops(HiveType.END.getHiveName(),
|
||||
new HiveDrop(90, BeeDefinition.ENDED, mysteriousComb)
|
||||
);
|
||||
|
||||
ItemStack frozenComb = items.beeComb.get(EnumHoneyComb.FROZEN, 1);
|
||||
hiveRegistry.addDrops(HiveType.SNOW.getHiveName(),
|
||||
new HiveDrop(80, BeeDefinition.WINTRY, frozenComb).setIgnobleShare(0.5f),
|
||||
new HiveDrop(3, BeeDefinition.VALIANT, frozenComb)
|
||||
);
|
||||
|
||||
ItemStack mossyComb = items.beeComb.get(EnumHoneyComb.MOSSY, 1);
|
||||
hiveRegistry.addDrops(HiveType.SWAMP.getHiveName(),
|
||||
new HiveDrop(80, BeeDefinition.MARSHY, mossyComb).setIgnobleShare(0.4f),
|
||||
new HiveDrop(3, BeeDefinition.VALIANT, mossyComb)
|
||||
);
|
||||
}
|
||||
|
||||
private static void registerDungeonLoot() {
|
||||
int rarity;
|
||||
if (Config.dungeonLootRare) {
|
||||
rarity = 5;
|
||||
} else {
|
||||
rarity = 10;
|
||||
}
|
||||
|
||||
ChestGenHooks.addItem(ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent(BeeDefinition.STEADFAST.getMemberStack(EnumBeeType.DRONE), 1, 1, rarity));
|
||||
|
||||
ItemStack stack = blocks.candle.getUnlitCandle(1);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
tag.setInteger(BlockCandle.colourTagName, 0xffffff);
|
||||
stack.setTagCompound(tag);
|
||||
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(stack, 7, 12, 12));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(items.scoop.getItemStack(), 1, 1, 8));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(items.propolis.get(EnumPropolis.NORMAL, 1), 2, 4, 6));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(items.beeComb.get(EnumHoneyComb.HONEY, 1), 4, 12, 7));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(items.beeComb.get(EnumHoneyComb.FROZEN, 1), 2, 10, 7));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(items.beeComb.get(EnumHoneyComb.SILKY, 1), 1, 6, 7));
|
||||
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(BeeDefinition.FOREST.getRainResist().getMemberStack(EnumBeeType.PRINCESS), 1, 1, 5));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(BeeDefinition.COMMON.getMemberStack(EnumBeeType.DRONE), 1, 2, 8));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(BeeDefinition.MEADOWS.getMemberStack(EnumBeeType.PRINCESS), 1, 1, 5));
|
||||
}
|
||||
|
||||
private static void createHives() {
|
||||
hiveRegistry.registerHive(HiveType.FOREST.getHiveName(), HiveDescription.FOREST);
|
||||
hiveRegistry.registerHive(HiveType.MEADOWS.getHiveName(), HiveDescription.MEADOWS);
|
||||
hiveRegistry.registerHive(HiveType.DESERT.getHiveName(), HiveDescription.DESERT);
|
||||
hiveRegistry.registerHive(HiveType.JUNGLE.getHiveName(), HiveDescription.JUNGLE);
|
||||
hiveRegistry.registerHive(HiveType.END.getHiveName(), HiveDescription.END);
|
||||
hiveRegistry.registerHive(HiveType.SNOW.getHiveName(), HiveDescription.SNOW);
|
||||
hiveRegistry.registerHive(HiveType.SWAMP.getHiveName(), HiveDescription.SWAMP);
|
||||
}
|
||||
|
||||
private static void createAlleles() {
|
||||
|
||||
IClassification hymnoptera = AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "hymnoptera", "Hymnoptera");
|
||||
AlleleManager.alleleRegistry.getClassification("class.insecta").addMemberGroup(hymnoptera);
|
||||
|
||||
IClassification apidae = AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.FAMILY, "apidae", "Apidae");
|
||||
hymnoptera.addMemberGroup(apidae);
|
||||
|
||||
for (BeeBranchDefinition beeBranch : BeeBranchDefinition.values()) {
|
||||
apidae.addMemberGroup(beeBranch.getBranch());
|
||||
}
|
||||
|
||||
AlleleEffect.createAlleles();
|
||||
}
|
||||
|
||||
public static double getSecondPrincessChance() {
|
||||
return secondPrincessChance;
|
||||
}
|
||||
|
||||
private static void parseBeeBlacklist(String[] items) {
|
||||
for (String item : items) {
|
||||
if (item.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
FMLCommonHandler.instance().getFMLLogger().debug("Blacklisting bee species identified by " + item);
|
||||
AlleleManager.alleleRegistry.blacklistAllele(item);
|
||||
}
|
||||
}
|
||||
|
||||
private static void parseAcceptedFlowers(String[] acceptedFlowers, String flowerType) {
|
||||
List<Stack> acceptedFlowerItemStacks = Stack.parseStackStrings(acceptedFlowers, OreDictionary.WILDCARD_VALUE);
|
||||
for (Stack acceptedFlower : acceptedFlowerItemStacks) {
|
||||
Block acceptedFlowerBlock = acceptedFlower.getBlock();
|
||||
int meta = acceptedFlower.getMeta();
|
||||
if (acceptedFlowerBlock != null) {
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(acceptedFlowerBlock, meta, flowerType);
|
||||
} else {
|
||||
Log.warning("No block found for '" + acceptedFlower + "' in apiculture config for '" + flowerType + "'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void parsePlantableFlowers(Property property, String flowerType) {
|
||||
for (String string : property.getStringList()) {
|
||||
Stack plantableFlower = Stack.parseStackString(string, OreDictionary.WILDCARD_VALUE);
|
||||
if (plantableFlower == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Block plantableFlowerBlock = plantableFlower.getBlock();
|
||||
int meta = plantableFlower.getMeta();
|
||||
if (plantableFlowerBlock != null) {
|
||||
FlowerManager.flowerRegistry.registerPlantableFlower(plantableFlowerBlock, meta, 1.0, flowerType);
|
||||
} else {
|
||||
Log.warning("No block found for '" + string + "' in config '" + property.getName() + "'.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISaveEventHandler getSaveEventHandler() {
|
||||
return new SaveEventHandlerApiculture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateChunk(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) {
|
||||
if (Config.getBeehivesAmount() > 0.0) {
|
||||
HiveDecorator.decorateHives(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void populateChunkRetroGen(World world, Random rand, int chunkX, int chunkZ) {
|
||||
if (Config.getBeehivesAmount() > 0.0) {
|
||||
HiveDecorator.decorateHives(world, rand, chunkX, chunkZ);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIMCMessage(IMCMessage message) {
|
||||
if (message.key.equals("add-candle-lighting-id")) {
|
||||
ItemStack value = message.getItemStackValue();
|
||||
if (value != null) {
|
||||
BlockCandle.addItemToLightingList(value.getItem());
|
||||
} else {
|
||||
IMCUtil.logInvalidIMCMessage(message);
|
||||
}
|
||||
return true;
|
||||
} else if (message.key.equals("add-alveary-slab") && message.isStringMessage()) {
|
||||
String messageString = String.format("Received a '%s' request from mod '%s'. This IMC message has been replaced with the oreDictionary for 'slabWood'. Please contact the author and report this issue.", message.key, message.getSender());
|
||||
Log.warning(messageString);
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.processIMCMessage(message);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void textureHook(TextureStitchEvent.Pre event) {
|
||||
EntityFXSnow.sprites = new TextureAtlasSprite[3];
|
||||
for (int i = 0; i < EntityFXSnow.sprites.length; i++) {
|
||||
EntityFXSnow.sprites[i] = event.map.registerSprite(new ResourceLocation("forestry:items/particles/snow." + (i + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,462 +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 java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.ChestGenHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.api.arboriculture.EnumWoodType;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.WoodItemAccess;
|
||||
import forestry.arboriculture.blocks.BlockFruitPod;
|
||||
import forestry.arboriculture.blocks.BlockRegistryArboriculture;
|
||||
import forestry.arboriculture.blocks.BlockTypeArboricultureTesr;
|
||||
import forestry.arboriculture.commands.CommandTree;
|
||||
import forestry.arboriculture.genetics.TreeBranchDefinition;
|
||||
import forestry.arboriculture.genetics.TreeDefinition;
|
||||
import forestry.arboriculture.genetics.TreeFactory;
|
||||
import forestry.arboriculture.genetics.TreeMutationFactory;
|
||||
import forestry.arboriculture.genetics.TreeRoot;
|
||||
import forestry.arboriculture.genetics.TreekeepingMode;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleGrowth;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleLeafEffect;
|
||||
import forestry.arboriculture.items.ItemRegistryArboriculture;
|
||||
import forestry.arboriculture.network.PacketRegistryArboriculture;
|
||||
import forestry.arboriculture.proxy.ProxyArboriculture;
|
||||
import forestry.arboriculture.render.TextureLeaves;
|
||||
import forestry.arboriculture.tiles.TileFruitPod;
|
||||
import forestry.arboriculture.tiles.TileLeaves;
|
||||
import forestry.arboriculture.tiles.TileSapling;
|
||||
import forestry.arboriculture.tiles.TileWood;
|
||||
import forestry.core.blocks.BlockTypeCoreTesr;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.genetics.alleles.AllelePlantType;
|
||||
import forestry.core.items.ItemFruit.EnumFruit;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.IMCUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.factory.recipes.FabricatorRecipe;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.ARBORICULTURE, name = "Arboriculture", author = "Binnie & SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.arboriculture.description")
|
||||
public class PluginArboriculture extends BlankForestryPlugin {
|
||||
|
||||
@SidedProxy(clientSide = "forestry.arboriculture.proxy.ProxyArboricultureClient", serverSide = "forestry.arboriculture.proxy.ProxyArboriculture")
|
||||
public static ProxyArboriculture proxy;
|
||||
public static String treekeepingMode = "NORMAL";
|
||||
|
||||
public static final List<Block> validFences = new ArrayList<>();
|
||||
|
||||
public static ItemRegistryArboriculture items;
|
||||
public static BlockRegistryArboriculture blocks;
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
TreeManager.treeFactory = new TreeFactory();
|
||||
TreeManager.treeMutationFactory = new TreeMutationFactory();
|
||||
|
||||
TreeManager.woodItemAccess = new WoodItemAccess();
|
||||
|
||||
// Init tree interface
|
||||
TreeManager.treeRoot = new TreeRoot();
|
||||
AlleleManager.alleleRegistry.registerSpeciesRoot(TreeManager.treeRoot);
|
||||
|
||||
// Modes
|
||||
TreeManager.treeRoot.registerTreekeepingMode(TreekeepingMode.easy);
|
||||
TreeManager.treeRoot.registerTreekeepingMode(TreekeepingMode.normal);
|
||||
TreeManager.treeRoot.registerTreekeepingMode(TreekeepingMode.hard);
|
||||
TreeManager.treeRoot.registerTreekeepingMode(TreekeepingMode.hardcore);
|
||||
TreeManager.treeRoot.registerTreekeepingMode(TreekeepingMode.insane);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
items = new ItemRegistryArboriculture();
|
||||
blocks = new BlockRegistryArboriculture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
||||
WoodItemAccess.registerLog(blocks.logs, woodType, false);
|
||||
WoodItemAccess.registerPlanks(blocks.planks, woodType, false);
|
||||
WoodItemAccess.registerSlab(blocks.slabs, woodType, false);
|
||||
WoodItemAccess.registerFence(blocks.fences, woodType, false);
|
||||
WoodItemAccess.registerStairs(blocks.stairs, woodType, false);
|
||||
|
||||
WoodItemAccess.registerLog(blocks.logsFireproof, woodType, true);
|
||||
WoodItemAccess.registerPlanks(blocks.planksFireproof, woodType, true);
|
||||
WoodItemAccess.registerSlab(blocks.slabsFireproof, woodType, true);
|
||||
WoodItemAccess.registerFence(blocks.fencesFireproof, woodType, true);
|
||||
WoodItemAccess.registerStairs(blocks.stairsFireproof, woodType, true);
|
||||
}
|
||||
|
||||
blocks.arboriculture.addDefinitions(BlockTypeArboricultureTesr.ARB_CHEST);
|
||||
|
||||
// Init rendering
|
||||
proxy.initializeModels();
|
||||
|
||||
// Register vanilla and forestry fence ids
|
||||
validFences.add(blocks.fences);
|
||||
validFences.add(blocks.fencesFireproof);
|
||||
validFences.add(Blocks.oak_fence);
|
||||
validFences.add(Blocks.spruce_fence);
|
||||
validFences.add(Blocks.birch_fence);
|
||||
validFences.add(Blocks.jungle_fence);
|
||||
validFences.add(Blocks.dark_oak_fence);
|
||||
validFences.add(Blocks.acacia_fence);
|
||||
validFences.add(Blocks.oak_fence_gate);
|
||||
validFences.add(Blocks.spruce_fence_gate);
|
||||
validFences.add(Blocks.birch_fence_gate);
|
||||
validFences.add(Blocks.jungle_fence_gate);
|
||||
validFences.add(Blocks.dark_oak_fence_gate);
|
||||
validFences.add(Blocks.acacia_fence_gate);
|
||||
validFences.add(Blocks.nether_brick_fence);
|
||||
|
||||
// Commands
|
||||
PluginCore.rootCommand.addChildCommand(new CommandTree());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
// Create alleles
|
||||
createAlleles();
|
||||
TreeDefinition.initTrees();
|
||||
registerErsatzGenomes();
|
||||
|
||||
GameRegistry.registerTileEntity(TileSapling.class, "forestry.Sapling");
|
||||
GameRegistry.registerTileEntity(TileLeaves.class, "forestry.Leaves");
|
||||
GameRegistry.registerTileEntity(TileWood.class, "forestry.Wood");
|
||||
GameRegistry.registerTileEntity(TileFruitPod.class, "forestry.Pods");
|
||||
|
||||
blocks.arboriculture.init();
|
||||
|
||||
/*if (Config.enableVillagers) {
|
||||
VillagerRegistry.instance().registerVillagerId(Constants.ID_VILLAGER_LUMBERJACK);
|
||||
Proxies.render.registerVillagerSkin(Constants.ID_VILLAGER_LUMBERJACK, Constants.TEXTURE_SKIN_LUMBERJACK);
|
||||
VillagerRegistry.instance().registerVillageTradeHandler(Constants.ID_VILLAGER_LUMBERJACK, new VillageHandlerArboriculture());
|
||||
}*/
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
super.postInit();
|
||||
registerDungeonLoot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrates() {
|
||||
ICrateRegistry crateRegistry = StorageManager.crateRegistry;
|
||||
crateRegistry.registerCrate(EnumFruit.CHERRY.getStack(), "cratedCherry");
|
||||
crateRegistry.registerCrate(EnumFruit.WALNUT.getStack(), "cratedWalnut");
|
||||
crateRegistry.registerCrate(EnumFruit.CHESTNUT.getStack(), "cratedChestnut");
|
||||
crateRegistry.registerCrate(EnumFruit.LEMON.getStack(), "cratedLemon");
|
||||
crateRegistry.registerCrate(EnumFruit.PLUM.getStack(), "cratedPlum");
|
||||
crateRegistry.registerCrate(EnumFruit.PAPAYA.getStack(), "cratedPapaya");
|
||||
crateRegistry.registerCrate(EnumFruit.DATES.getStack(), "cratedDates");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
|
||||
RecipeUtil.addSmelting(new ItemStack(blocks.logs, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.coal, 1, 1), 0.15F);
|
||||
|
||||
for (EnumWoodType woodType : EnumWoodType.VALUES) {
|
||||
ItemStack planks = TreeManager.woodItemAccess.getPlanks(woodType, false);
|
||||
ItemStack logs = TreeManager.woodItemAccess.getLog(woodType, false);
|
||||
ItemStack slabs = TreeManager.woodItemAccess.getSlab(woodType, false);
|
||||
ItemStack fences = TreeManager.woodItemAccess.getFence(woodType, false);
|
||||
ItemStack stairs = TreeManager.woodItemAccess.getStairs(woodType, false);
|
||||
|
||||
ItemStack fireproofPlanks = TreeManager.woodItemAccess.getPlanks(woodType, true);
|
||||
ItemStack fireproofLogs = TreeManager.woodItemAccess.getLog(woodType, true);
|
||||
ItemStack fireproofSlabs = TreeManager.woodItemAccess.getSlab(woodType, true);
|
||||
ItemStack fireproofFences = TreeManager.woodItemAccess.getFence(woodType, true);
|
||||
ItemStack fireproofStairs = TreeManager.woodItemAccess.getStairs(woodType, true);
|
||||
|
||||
planks.stackSize = 4;
|
||||
logs.stackSize = 1;
|
||||
RecipeUtil.addShapelessRecipe(planks.copy(), logs.copy());
|
||||
|
||||
fireproofPlanks.stackSize = 4;
|
||||
fireproofLogs.stackSize = 1;
|
||||
RecipeUtil.addShapelessRecipe(fireproofPlanks.copy(), fireproofLogs.copy());
|
||||
|
||||
slabs.stackSize = 6;
|
||||
planks.stackSize = 1;
|
||||
RecipeUtil.addPriorityRecipe(slabs.copy(),
|
||||
"###",
|
||||
'#', planks.copy());
|
||||
|
||||
fireproofSlabs.stackSize = 6;
|
||||
fireproofPlanks.stackSize = 1;
|
||||
RecipeUtil.addPriorityRecipe(fireproofSlabs.copy(),
|
||||
"###",
|
||||
'#', fireproofPlanks.copy());
|
||||
|
||||
fences.stackSize = 3;
|
||||
planks.stackSize = 1;
|
||||
RecipeUtil.addRecipe(fences.copy(),
|
||||
"#X#",
|
||||
"#X#",
|
||||
'#', planks.copy(), 'X', "stickWood");
|
||||
|
||||
fireproofFences.stackSize = 3;
|
||||
fireproofPlanks.stackSize = 1;
|
||||
RecipeUtil.addRecipe(fireproofFences.copy(),
|
||||
"#X#",
|
||||
"#X#",
|
||||
'#', fireproofPlanks.copy(), 'X', "stickWood");
|
||||
|
||||
stairs.stackSize = 4;
|
||||
planks.stackSize = 1;
|
||||
RecipeUtil.addPriorityRecipe(stairs.copy(),
|
||||
"# ",
|
||||
"## ",
|
||||
"###",
|
||||
'#', planks.copy());
|
||||
|
||||
fireproofStairs.stackSize = 4;
|
||||
fireproofPlanks.stackSize = 1;
|
||||
RecipeUtil.addPriorityRecipe(fireproofStairs.copy(),
|
||||
"# ",
|
||||
"## ",
|
||||
"###",
|
||||
'#', fireproofPlanks.copy());
|
||||
|
||||
// Fabricator recipes
|
||||
if (ForestryAPI.enabledPlugins.containsAll(Arrays.asList(ForestryPluginUids.FACTORY, ForestryPluginUids.APICULTURE))) {
|
||||
logs.stackSize = 1;
|
||||
fireproofLogs.stackSize = 1;
|
||||
RecipeManagers.fabricatorManager.addRecipe(new FabricatorRecipe(null, Fluids.GLASS.getFluid(500), fireproofLogs.copy(), new Object[]{
|
||||
" # ",
|
||||
"#X#",
|
||||
" # ",
|
||||
'#', PluginCore.items.refractoryWax,
|
||||
'X', logs.copy()}));
|
||||
|
||||
planks.stackSize = 1;
|
||||
fireproofPlanks.stackSize = 5;
|
||||
RecipeManagers.fabricatorManager.addRecipe(new FabricatorRecipe(null, Fluids.GLASS.getFluid(500), fireproofPlanks.copy(), new Object[]{
|
||||
"X#X",
|
||||
"#X#",
|
||||
"X#X",
|
||||
'#', PluginCore.items.refractoryWax,
|
||||
'X', planks.copy()}));
|
||||
}
|
||||
}
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FACTORY)) {
|
||||
// Treealyzer
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Fluids.WATER.getFluid(2000), null, items.treealyzer.getItemStack(), "X#X", "X#X", "RDR",
|
||||
'#', "paneGlass",
|
||||
'X', "ingotCopper",
|
||||
'R', "dustRedstone",
|
||||
'D', "gemDiamond");
|
||||
|
||||
// SQUEEZER RECIPES
|
||||
int seedOilMultiplier = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
int juiceMultiplier = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
|
||||
int mulchMultiplier = ForestryAPI.activeMode.getIntegerSetting("squeezer.mulch.apple");
|
||||
ItemStack mulch = new ItemStack(PluginCore.items.mulch);
|
||||
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[]{EnumFruit.CHERRY.getStack()}, Fluids.SEEDOIL.getFluid(5 * seedOilMultiplier), mulch, 5);
|
||||
RecipeManagers.squeezerManager.addRecipe(60, new ItemStack[]{EnumFruit.WALNUT.getStack()}, Fluids.SEEDOIL.getFluid(18 * seedOilMultiplier), mulch, 5);
|
||||
RecipeManagers.squeezerManager.addRecipe(70, new ItemStack[]{EnumFruit.CHESTNUT.getStack()}, Fluids.SEEDOIL.getFluid(22 * seedOilMultiplier), mulch, 2);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{EnumFruit.LEMON.getStack()}, Fluids.JUICE.getFluid(juiceMultiplier * 2), mulch, (int) Math.floor(mulchMultiplier * 0.5f));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{EnumFruit.PLUM.getStack()}, Fluids.JUICE.getFluid((int) Math.floor(juiceMultiplier * 0.5f)), mulch, mulchMultiplier * 3);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{EnumFruit.PAPAYA.getStack()}, Fluids.JUICE.getFluid(juiceMultiplier * 3), mulch, (int) Math.floor(mulchMultiplier * 0.5f));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{EnumFruit.DATES.getStack()}, Fluids.JUICE.getFluid((int) Math.floor(juiceMultiplier * 0.25)), mulch, mulchMultiplier);
|
||||
|
||||
RecipeUtil.addFermenterRecipes(items.sapling.getItemStack(), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
|
||||
}
|
||||
|
||||
// Grafter
|
||||
RecipeUtil.addRecipe(items.grafter.getItemStack(),
|
||||
" B",
|
||||
" # ",
|
||||
"# ",
|
||||
'B', "ingotBronze",
|
||||
'#', "stickWood");
|
||||
|
||||
// ANALYZER
|
||||
RecipeUtil.addRecipe(PluginCore.blocks.core.get(BlockTypeCoreTesr.ANALYZER),
|
||||
"XTX",
|
||||
" Y ",
|
||||
"X X",
|
||||
'Y', PluginCore.items.sturdyCasing,
|
||||
'T', items.treealyzer,
|
||||
'X', "ingotBronze");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.arboriculture.get(BlockTypeArboricultureTesr.ARB_CHEST),
|
||||
" # ",
|
||||
"XYX",
|
||||
"XXX",
|
||||
'#', "blockGlass",
|
||||
'X', "treeSapling",
|
||||
'Y', "chestWood");
|
||||
}
|
||||
|
||||
private static void createAlleles() {
|
||||
|
||||
TreeBranchDefinition.createAlleles();
|
||||
|
||||
AlleleGrowth.createAlleles();
|
||||
AlleleLeafEffect.createAlleles();
|
||||
AllelePlantType.createAlleles();
|
||||
}
|
||||
|
||||
private static void registerErsatzGenomes() {
|
||||
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 0), TreeDefinition.Oak.getIndividual());
|
||||
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 1), TreeDefinition.Spruce.getIndividual());
|
||||
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 2), TreeDefinition.Birch.getIndividual());
|
||||
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 3), TreeDefinition.Jungle.getIndividual());
|
||||
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves2, 1, 0), TreeDefinition.AcaciaVanilla.getIndividual());
|
||||
AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves2, 1, 1), TreeDefinition.DarkOak.getIndividual());
|
||||
|
||||
AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 0), TreeDefinition.Oak.getIndividual());
|
||||
AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 1), TreeDefinition.Spruce.getIndividual());
|
||||
AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 2), TreeDefinition.Birch.getIndividual());
|
||||
AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 3), TreeDefinition.Jungle.getIndividual());
|
||||
AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 4), TreeDefinition.AcaciaVanilla.getIndividual());
|
||||
AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 5), TreeDefinition.DarkOak.getIndividual());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFuelHandler getFuelHandler() {
|
||||
return new FuelHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacketRegistry getPacketRegistry() {
|
||||
return new PacketRegistryArboriculture();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIMCMessage(IMCMessage message) {
|
||||
if (message.key.equals("add-fence-block") && message.isStringMessage()) {
|
||||
Block block = ItemStackUtil.getBlockFromRegistry(message.getStringValue());
|
||||
|
||||
if (block != null && block != Blocks.air) {
|
||||
validFences.add(block);
|
||||
} else {
|
||||
IMCUtil.logInvalidIMCMessage(message);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.processIMCMessage(message);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHiddenItems(List<ItemStack> hiddenItems) {
|
||||
// sapling itemBlock is different from the normal item
|
||||
hiddenItems.add(new ItemStack(blocks.saplingGE));
|
||||
}
|
||||
|
||||
private static void registerDungeonLoot() {
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(items.grafter.getItemStack(), 1, 1, 8));
|
||||
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Oak.getMemberStack(EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Spruce.getMemberStack(EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Birch.getMemberStack(EnumGermlingType.SAPLING), 2, 3, 6));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Larch.getMemberStack(EnumGermlingType.SAPLING), 1, 2, 4));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Lime.getMemberStack(EnumGermlingType.SAPLING), 1, 2, 4));
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.APICULTURE)) {
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Oak.getMemberStack(EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Spruce.getMemberStack(EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Birch.getMemberStack(EnumGermlingType.POLLEN), 2, 3, 4));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Larch.getMemberStack(EnumGermlingType.POLLEN), 1, 2, 3));
|
||||
ChestGenHooks.addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Lime.getMemberStack(EnumGermlingType.POLLEN), 1, 2, 3));
|
||||
}
|
||||
}
|
||||
|
||||
private static class FuelHandler implements IFuelHandler {
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
Item item = fuel.getItem();
|
||||
|
||||
if (items.sapling == item) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
if (block instanceof IWoodTyped) {
|
||||
IWoodTyped woodTypedBlock = (IWoodTyped) block;
|
||||
if (woodTypedBlock.isFireproof()) {
|
||||
return 0;
|
||||
} else if (blocks.slabs == block) {
|
||||
return 150;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void textureHook(TextureStitchEvent.Pre event) {
|
||||
TextureLeaves.registerAllSprites();
|
||||
BlockFruitPod.registerSprites();
|
||||
}
|
||||
|
||||
/*@SubscribeEvent
|
||||
public void fuelBurnTimeEvent(FuelBurnTimeEvent fuelBurnTimeEvent) {
|
||||
Item item = fuelBurnTimeEvent.fuel.getItem();
|
||||
Block block = Block.getBlockFromItem(item);
|
||||
|
||||
if (block instanceof IWoodTyped) {
|
||||
IWoodTyped woodTypedBlock = (IWoodTyped) block;
|
||||
if (woodTypedBlock.isFireproof()) {
|
||||
fuelBurnTimeEvent.burnTime = 0;
|
||||
fuelBurnTimeEvent.setResult(Event.Result.DENY);
|
||||
} else if (blocks.slabs == block) {
|
||||
fuelBurnTimeEvent.burnTime = 150;
|
||||
fuelBurnTimeEvent.setResult(Event.Result.DENY);
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@@ -1,359 +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.Nonnull;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.command.ICommand;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.IFuelHandler;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.multiblock.MultiblockManager;
|
||||
import forestry.api.storage.ICrateRegistry;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.core.IPickupHandler;
|
||||
import forestry.core.ISaveEventHandler;
|
||||
import forestry.core.PickupHandlerCore;
|
||||
import forestry.core.SaveEventHandlerCore;
|
||||
import forestry.core.blocks.BlockRegistryCore;
|
||||
import forestry.core.blocks.BlockResourceOre;
|
||||
import forestry.core.blocks.BlockResourceStorage;
|
||||
import forestry.core.blocks.BlockSoil;
|
||||
import forestry.core.blocks.BlockTypeCoreTesr;
|
||||
import forestry.core.circuits.CircuitRegistry;
|
||||
import forestry.core.circuits.SolderManager;
|
||||
import forestry.core.commands.CommandPlugins;
|
||||
import forestry.core.commands.RootCommand;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.genetics.alleles.AlleleFactory;
|
||||
import forestry.core.genetics.alleles.AlleleHelper;
|
||||
import forestry.core.genetics.alleles.AlleleRegistry;
|
||||
import forestry.core.items.EnumContainerType;
|
||||
import forestry.core.items.ItemRegistryCore;
|
||||
import forestry.core.models.ModelManager;
|
||||
import forestry.core.models.baker.ModelBaker;
|
||||
import forestry.core.multiblock.MultiblockLogicFactory;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
import forestry.core.network.PacketRegistryCore;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.ClimateUtil;
|
||||
import forestry.core.utils.ForestryModEnvWarningCallable;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.CORE, name = "Core", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.core.description")
|
||||
public class PluginCore extends BlankForestryPlugin {
|
||||
public static final RootCommand rootCommand = new RootCommand();
|
||||
public static ItemRegistryCore items;
|
||||
public static BlockRegistryCore blocks;
|
||||
|
||||
@Override
|
||||
public boolean canBeDisabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<String> getDependencyUids() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
ChipsetManager.solderManager = new SolderManager();
|
||||
|
||||
ChipsetManager.circuitRegistry = new CircuitRegistry();
|
||||
|
||||
AlleleRegistry alleleRegistry = new AlleleRegistry();
|
||||
AlleleManager.alleleRegistry = alleleRegistry;
|
||||
AlleleManager.climateHelper = new ClimateUtil();
|
||||
AlleleManager.alleleFactory = new AlleleFactory();
|
||||
alleleRegistry.initialize();
|
||||
|
||||
AlleleHelper.instance = new AlleleHelper();
|
||||
|
||||
MultiblockManager.logicFactory = new MultiblockLogicFactory();
|
||||
|
||||
//To crate the ModelBaker
|
||||
ModelBaker.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
items = new ItemRegistryCore();
|
||||
blocks = new BlockRegistryCore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
rootCommand.addChildCommand(new CommandPlugins());
|
||||
|
||||
blocks.core.addDefinitions(BlockTypeCoreTesr.VALUES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
blocks.core.init();
|
||||
|
||||
ForestryModEnvWarningCallable.register();
|
||||
|
||||
AlleleHelper.instance.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAvailable() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISaveEventHandler getSaveEventHandler() {
|
||||
return new SaveEventHandlerCore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerCrates() {
|
||||
ICrateRegistry crateRegistry = StorageManager.crateRegistry;
|
||||
|
||||
// forestry items
|
||||
crateRegistry.registerCrate(items.peat, "cratedPeat");
|
||||
crateRegistry.registerCrate(items.apatite, "cratedApatite");
|
||||
crateRegistry.registerCrate(items.fertilizerCompound, "cratedFertilizer");
|
||||
crateRegistry.registerCrate(items.mulch, "cratedMulch");
|
||||
crateRegistry.registerCrate(items.phosphor, "cratedPhosphor");
|
||||
crateRegistry.registerCrate(items.ash, "cratedAsh");
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotTin, "cratedTin");
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotCopper, "cratedCopper");
|
||||
crateRegistry.registerCrateUsingOreDict(items.ingotBronze, "cratedBronze");
|
||||
|
||||
// forestry blocks
|
||||
crateRegistry.registerCrate(blocks.soil.get(BlockSoil.SoilType.HUMUS, 1), "cratedHumus");
|
||||
crateRegistry.registerCrate(blocks.soil.get(BlockSoil.SoilType.BOG_EARTH, 1), "cratedBogearth");
|
||||
|
||||
// vanilla items
|
||||
crateRegistry.registerCrate(Items.wheat, "cratedWheat");
|
||||
crateRegistry.registerCrate(Items.cookie, "cratedCookies");
|
||||
crateRegistry.registerCrate(Items.redstone, "cratedRedstone");
|
||||
crateRegistry.registerCrate(new ItemStack(Items.dye, 1, 4), "cratedLapis");
|
||||
crateRegistry.registerCrate(Items.reeds, "cratedReeds");
|
||||
crateRegistry.registerCrate(Items.clay_ball, "cratedClay");
|
||||
crateRegistry.registerCrate(Items.glowstone_dust, "cratedGlowstone");
|
||||
crateRegistry.registerCrate(Items.apple, "cratedApples");
|
||||
crateRegistry.registerCrate(new ItemStack(Items.nether_wart), "cratedNetherwart");
|
||||
crateRegistry.registerCrate(new ItemStack(Items.coal, 1, 1), "cratedCharcoal");
|
||||
crateRegistry.registerCrate(new ItemStack(Items.coal, 1, 0), "cratedCoal");
|
||||
crateRegistry.registerCrate(Items.wheat_seeds, "cratedSeeds");
|
||||
crateRegistry.registerCrate(Items.potato, "cratedPotatoes");
|
||||
crateRegistry.registerCrate(Items.carrot, "cratedCarrots");
|
||||
|
||||
// vanilla blocks
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.log, 1, 0), "cratedWood");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.log, 1, 1), "cratedSpruceWood");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.log, 1, 2), "cratedBirchWood");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.log, 1, 3), "cratedJungleWood");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.log2, 1, 0), "cratedAcaciaWood");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.log2, 1, 1), "cratedDarkOakWood");
|
||||
crateRegistry.registerCrate(Blocks.cobblestone, "cratedCobblestone");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.dirt, 1, 0), "cratedDirt");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.dirt, 1, 2), "cratedPodzol");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.stone, 1, 0), "cratedStone");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.stone, 1, 1), "cratedGranite");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.stone, 1, 3), "cratedDiorite");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.stone, 1, 5), "cratedAndesite");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.prismarine, 1, 0), "cratedPrismarine");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.prismarine, 1, 1), "cratedPrismarinebrick");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.prismarine, 1, 2), "cratedPrismarinedark");
|
||||
crateRegistry.registerCrate(Blocks.brick_block, "cratedBrick");
|
||||
crateRegistry.registerCrate(Blocks.cactus, "cratedCacti");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.sand, 1, 0), "cratedSand");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.sand, 1, 1), "cratedRedSand");
|
||||
crateRegistry.registerCrate(Blocks.obsidian, "cratedObsidian");
|
||||
crateRegistry.registerCrate(Blocks.netherrack, "cratedNetherrack");
|
||||
crateRegistry.registerCrate(Blocks.soul_sand, "cratedSoulsand");
|
||||
crateRegistry.registerCrate(Blocks.sandstone, "cratedSandstone");
|
||||
crateRegistry.registerCrate(Blocks.nether_brick, "cratedNetherbrick");
|
||||
crateRegistry.registerCrate(Blocks.mycelium, "cratedMycelium");
|
||||
crateRegistry.registerCrate(Blocks.gravel, "cratedGravel");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.sapling, 1, 0), "cratedSaplings");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.sapling, 1, 1), "cratedSpruceSapling");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.sapling, 1, 2), "cratedBirchSapling");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.sapling, 1, 3), "cratedJungleSapling");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.sapling, 1, 4), "cratedAcaciaSapling");
|
||||
crateRegistry.registerCrate(new ItemStack(Blocks.sapling, 1, 5), "cratedDarkOakSapling");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
|
||||
/* SMELTING RECIPES */
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.APATITE, 1), items.apatite, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.COPPER, 1), items.ingotCopper, 0.5f);
|
||||
RecipeUtil.addSmelting(blocks.resources.get(BlockResourceOre.ResourceType.TIN, 1), items.ingotTin, 0.5f);
|
||||
RecipeUtil.addSmelting(new ItemStack(items.peat), items.ash, 0.0f);
|
||||
|
||||
/* BRONZE INGOTS */
|
||||
if (Config.isCraftingBronzeEnabled()) {
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotBronze, 4), "ingotTin", "ingotCopper", "ingotCopper", "ingotCopper");
|
||||
}
|
||||
|
||||
/* STURDY MACHINE */
|
||||
RecipeUtil.addRecipe(items.sturdyCasing, "###", "# #", "###", '#', "ingotBronze");
|
||||
|
||||
// / EMPTY CANS
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.can"), " # ", "# #", '#', "ingotTin");
|
||||
|
||||
// / GEARS
|
||||
List<ItemStack> stoneGear = OreDictionary.getOres("gearStone");
|
||||
Object gearCenter;
|
||||
if (!stoneGear.isEmpty()) {
|
||||
gearCenter = "gearStone";
|
||||
} else {
|
||||
gearCenter = "ingotCopper";
|
||||
}
|
||||
RecipeUtil.addRecipe(items.gearBronze, " # ", "#X#", " # ", '#', "ingotBronze", 'X', gearCenter);
|
||||
RecipeUtil.addRecipe(items.gearCopper, " # ", "#X#", " # ", '#', "ingotCopper", 'X', gearCenter);
|
||||
RecipeUtil.addRecipe(items.gearTin, " # ", "#X#", " # ", '#', "ingotTin", 'X', gearCenter);
|
||||
|
||||
// / SURVIVALIST TOOLS
|
||||
RecipeUtil.addRecipe(items.bronzePickaxe, " X ", " X ", "###", '#', "ingotBronze", 'X', "stickWood");
|
||||
RecipeUtil.addRecipe(items.bronzeShovel, " X ", " X ", " # ", '#', "ingotBronze", 'X', "stickWood");
|
||||
RecipeUtil.addShapelessRecipe(items.kitPickaxe, items.bronzePickaxe, items.carton);
|
||||
RecipeUtil.addShapelessRecipe(items.kitShovel, items.bronzeShovel, items.carton);
|
||||
|
||||
/* NATURALIST'S ARMOR */
|
||||
RecipeUtil.addRecipe(items.spectacles, " X ", "Y Y", 'X', "ingotBronze", 'Y', "paneGlass");
|
||||
|
||||
// / WRENCH
|
||||
RecipeUtil.addRecipe(items.wrench, "# #", " # ", " # ", '#', "ingotBronze");
|
||||
|
||||
// Manure and Fertilizer
|
||||
if (ForestryAPI.activeMode.getStackSetting("recipe.output.compost.wheat").stackSize > 0) {
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.compost.wheat"), " X ", "X#X", " X ", '#', Blocks.dirt, 'X', "cropWheat");
|
||||
}
|
||||
if (ForestryAPI.activeMode.getStackSetting("recipe.output.compost.ash").stackSize > 0) {
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.compost.ash"), " X ", "X#X", " X ", '#', Blocks.dirt, 'X', "dustAsh");
|
||||
}
|
||||
if (ForestryAPI.activeMode.getStackSetting("recipe.output.fertilizer.apatite").stackSize > 0) {
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.fertilizer.apatite"), " # ", " X ", " # ", '#', "sand", 'X', "gemApatite");
|
||||
}
|
||||
if (ForestryAPI.activeMode.getStackSetting("recipe.output.fertilizer.ash").stackSize > 0) {
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.fertilizer.ash"), "###", "#X#", "###", '#', "dustAsh", 'X', "gemApatite");
|
||||
}
|
||||
|
||||
// Humus
|
||||
if (ForestryAPI.activeMode.getStackSetting("recipe.output.humus.compost").stackSize > 0) {
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.humus.compost"), "###", "#X#", "###", '#', Blocks.dirt, 'X', items.fertilizerBio);
|
||||
}
|
||||
if (ForestryAPI.activeMode.getStackSetting("recipe.output.humus.fertilizer").stackSize > 0) {
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.humus.fertilizer"), "###", "#X#", "###", '#', Blocks.dirt, 'X', items.fertilizerCompound);
|
||||
}
|
||||
|
||||
// Bog earth
|
||||
if (ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.bucket").stackSize > 0) {
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.bucket"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', Items.water_bucket, 'Y', "sand");
|
||||
}
|
||||
|
||||
if (ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.can").stackSize > 0) {
|
||||
ItemStack canWater = PluginFluids.items.getContainer(EnumContainerType.CAN, Fluids.WATER).getItemStack();
|
||||
ItemStack waxCapsuleWater = PluginFluids.items.getContainer(EnumContainerType.CAPSULE, Fluids.WATER).getItemStack();
|
||||
ItemStack refractoryWater = PluginFluids.items.getContainer(EnumContainerType.REFRACTORY, Fluids.WATER).getItemStack();
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', canWater, 'Y', "sand");
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', waxCapsuleWater, 'Y', "sand");
|
||||
RecipeUtil.addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.can"), "#Y#", "YXY", "#Y#", '#', Blocks.dirt, 'X', refractoryWater, 'Y', "sand");
|
||||
}
|
||||
|
||||
// Crafting Material
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.string), "#", "#", "#", '#', items.craftingMaterial.getSilkWisp());
|
||||
|
||||
// / Pipette
|
||||
RecipeUtil.addRecipe(items.pipette, " #", " X ", "X ", 'X', "paneGlass", '#', new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
// Storage Blocks
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(BlockResourceStorage.ResourceType.APATITE), "###", "###", "###", '#', "gemApatite");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.apatite, 9), "blockApatite");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(BlockResourceStorage.ResourceType.COPPER), "###", "###", "###", '#', "ingotCopper");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotCopper, 9), "blockCopper");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(BlockResourceStorage.ResourceType.TIN), "###", "###", "###", '#', "ingotTin");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotTin, 9), "blockTin");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.resourceStorage.get(BlockResourceStorage.ResourceType.BRONZE), "###", "###", "###", '#', "ingotBronze");
|
||||
RecipeUtil.addShapelessRecipe(new ItemStack(items.ingotBronze, 9), "blockBronze");
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacketRegistry getPacketRegistry() {
|
||||
return new PacketRegistryCore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPickupHandler getPickupHandler() {
|
||||
return new PickupHandlerCore();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICommand[] getConsoleCommands() {
|
||||
return new ICommand[]{rootCommand};
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFuelHandler getFuelHandler() {
|
||||
return new FuelHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHiddenItems(List<ItemStack> hiddenItems) {
|
||||
// research note items are not useful without actually having completed research
|
||||
hiddenItems.add(new ItemStack(PluginCore.items.researchNote));
|
||||
}
|
||||
|
||||
private static class FuelHandler implements IFuelHandler {
|
||||
|
||||
@Override
|
||||
public int getBurnTime(ItemStack fuel) {
|
||||
if (fuel != null && fuel.getItem() == items.peat) {
|
||||
return 2000;
|
||||
}
|
||||
if (fuel != null && fuel.getItem() == items.bituminousPeat) {
|
||||
return 4200;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onBakeModel(ModelBakeEvent event) {
|
||||
ModelManager.registerCustomModels(event);
|
||||
}
|
||||
}
|
||||
@@ -1,89 +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 net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.energy.blocks.BlockRegistryEnergy;
|
||||
import forestry.energy.blocks.BlockTypeEngine;
|
||||
import forestry.energy.proxy.ProxyEnergy;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.ENERGY, name = "Energy", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.energy.description")
|
||||
public class PluginEnergy extends BlankForestryPlugin {
|
||||
|
||||
@SidedProxy(clientSide = "forestry.energy.proxy.ProxyEnergyClient", serverSide = "forestry.energy.proxy.ProxyEnergy")
|
||||
public static ProxyEnergy proxy;
|
||||
|
||||
public static BlockRegistryEnergy blocks;
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
blocks = new BlockRegistryEnergy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
blocks.engine.addDefinitions(
|
||||
BlockTypeEngine.PEAT,
|
||||
BlockTypeEngine.BIOGAS
|
||||
);
|
||||
|
||||
if (ForestryAPI.activeMode.getBooleanSetting("energy.engine.clockwork")) {
|
||||
blocks.engine.addDefinitions(BlockTypeEngine.CLOCKWORK);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
blocks.engine.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
super.registerRecipes();
|
||||
|
||||
RecipeUtil.addRecipe(blocks.engine.get(BlockTypeEngine.PEAT),
|
||||
"###",
|
||||
" X ",
|
||||
"YVY",
|
||||
'#', "ingotCopper",
|
||||
'X', "blockGlass",
|
||||
'Y', "gearCopper",
|
||||
'V', Blocks.piston);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.engine.get(BlockTypeEngine.BIOGAS),
|
||||
"###",
|
||||
" X ",
|
||||
"YVY",
|
||||
'#', "ingotBronze",
|
||||
'X', "blockGlass",
|
||||
'Y', "gearBronze",
|
||||
'V', Blocks.piston);
|
||||
|
||||
if (ForestryAPI.activeMode.getBooleanSetting("energy.engine.clockwork")) {
|
||||
RecipeUtil.addRecipe(blocks.engine.get(BlockTypeEngine.CLOCKWORK),
|
||||
"###",
|
||||
" X ",
|
||||
"ZVY",
|
||||
'#', "plankWood",
|
||||
'X', "blockGlass",
|
||||
'Y', Items.clock,
|
||||
'Z', "gearCopper",
|
||||
'V', Blocks.piston);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,499 +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 net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.CircuitSocketType;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.fuels.EngineBronzeFuel;
|
||||
import forestry.api.fuels.EngineCopperFuel;
|
||||
import forestry.api.fuels.FermenterFuel;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.fuels.MoistenerFuel;
|
||||
import forestry.api.fuels.RainSubstrate;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.core.blocks.BlockSoil;
|
||||
import forestry.core.blocks.BlockTypeCoreTesr;
|
||||
import forestry.core.circuits.Circuit;
|
||||
import forestry.core.circuits.CircuitLayout;
|
||||
import forestry.core.circuits.EnumCircuitBoardType;
|
||||
import forestry.core.circuits.ItemCircuitBoard;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.items.EnumElectronTube;
|
||||
import forestry.core.items.ItemElectronTube;
|
||||
import forestry.core.items.ItemRegistryCore;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.datastructures.FluidMap;
|
||||
import forestry.core.utils.datastructures.ItemStackMap;
|
||||
import forestry.factory.DummyManagers;
|
||||
import forestry.factory.blocks.BlockRegistryFactory;
|
||||
import forestry.factory.blocks.BlockTypeFactoryPlain;
|
||||
import forestry.factory.blocks.BlockTypeFactoryTesr;
|
||||
import forestry.factory.circuits.CircuitSpeedUpgrade;
|
||||
import forestry.factory.network.PacketRegistryFactory;
|
||||
import forestry.factory.recipes.CarpenterRecipeManager;
|
||||
import forestry.factory.recipes.CentrifugeRecipeManager;
|
||||
import forestry.factory.recipes.FabricatorRecipeManager;
|
||||
import forestry.factory.recipes.FabricatorSmeltingRecipeManager;
|
||||
import forestry.factory.recipes.FermenterRecipeManager;
|
||||
import forestry.factory.recipes.MoistenerRecipeManager;
|
||||
import forestry.factory.recipes.SqueezerRecipeManager;
|
||||
import forestry.factory.recipes.StillRecipeManager;
|
||||
import forestry.factory.triggers.FactoryTriggers;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.FACTORY, name = "Factory", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.factory.description")
|
||||
public class PluginFactory extends BlankForestryPlugin {
|
||||
public static BlockRegistryFactory blocks;
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
RecipeManagers.carpenterManager = new CarpenterRecipeManager();
|
||||
RecipeManagers.centrifugeManager = new CentrifugeRecipeManager();
|
||||
RecipeManagers.fabricatorManager = new FabricatorRecipeManager();
|
||||
RecipeManagers.fabricatorSmeltingManager = new FabricatorSmeltingRecipeManager();
|
||||
RecipeManagers.fermenterManager = new FermenterRecipeManager();
|
||||
RecipeManagers.moistenerManager = new MoistenerRecipeManager();
|
||||
RecipeManagers.squeezerManager = new SqueezerRecipeManager();
|
||||
RecipeManagers.stillManager = new StillRecipeManager();
|
||||
|
||||
setupFuelManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disabledSetupAPI() {
|
||||
RecipeManagers.carpenterManager = new DummyManagers.DummyCarpenterManager();
|
||||
RecipeManagers.centrifugeManager = new DummyManagers.DummyCentrifugeManager();
|
||||
RecipeManagers.fabricatorManager = new DummyManagers.DummyFabricatorManager();
|
||||
RecipeManagers.fabricatorSmeltingManager = new DummyManagers.DummyFabricatorSmeltingManager();
|
||||
RecipeManagers.fermenterManager = new DummyManagers.DummyFermenterManager();
|
||||
RecipeManagers.moistenerManager = new DummyManagers.DummyMoistenerManager();
|
||||
RecipeManagers.squeezerManager = new DummyManagers.DummySqueezerManager();
|
||||
RecipeManagers.stillManager = new DummyManagers.DummyStillManager();
|
||||
|
||||
setupFuelManager();
|
||||
}
|
||||
|
||||
private static void setupFuelManager() {
|
||||
FuelManager.fermenterFuel = new ItemStackMap<>();
|
||||
FuelManager.moistenerResource = new ItemStackMap<>();
|
||||
FuelManager.rainSubstrate = new ItemStackMap<>();
|
||||
FuelManager.bronzeEngineFuel = new FluidMap<>();
|
||||
FuelManager.copperEngineFuel = new ItemStackMap<>();
|
||||
FuelManager.generatorFuel = new FluidMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
blocks = new BlockRegistryFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacketRegistry getPacketRegistry() {
|
||||
return new PacketRegistryFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
ItemRegistryCore coreItems = PluginCore.items;
|
||||
|
||||
// Set fuels and resources for the fermenter
|
||||
ItemStack fertilizerCompound = coreItems.fertilizerCompound.getItemStack();
|
||||
FuelManager.fermenterFuel.put(fertilizerCompound, new FermenterFuel(fertilizerCompound,
|
||||
ForestryAPI.activeMode.getIntegerSetting("fermenter.value.fertilizer"), ForestryAPI.activeMode.getIntegerSetting("fermenter.cycles.fertilizer")));
|
||||
|
||||
int cyclesCompost = ForestryAPI.activeMode.getIntegerSetting("fermenter.cycles.compost");
|
||||
int valueCompost = ForestryAPI.activeMode.getIntegerSetting("fermenter.value.compost");
|
||||
ItemStack fertilizerBio = coreItems.fertilizerBio.getItemStack();
|
||||
ItemStack mulch = coreItems.mulch.getItemStack();
|
||||
FuelManager.fermenterFuel.put(fertilizerBio, new FermenterFuel(fertilizerBio, valueCompost, cyclesCompost));
|
||||
FuelManager.fermenterFuel.put(mulch, new FermenterFuel(mulch, valueCompost, cyclesCompost));
|
||||
|
||||
// Add moistener resources
|
||||
ItemStack wheat = new ItemStack(Items.wheat);
|
||||
ItemStack mouldyWheat = coreItems.mouldyWheat.getItemStack();
|
||||
ItemStack decayingWheat = coreItems.decayingWheat.getItemStack();
|
||||
FuelManager.moistenerResource.put(wheat, new MoistenerFuel(wheat, mouldyWheat, 0, 300));
|
||||
FuelManager.moistenerResource.put(mouldyWheat, new MoistenerFuel(mouldyWheat, decayingWheat, 1, 600));
|
||||
FuelManager.moistenerResource.put(decayingWheat, new MoistenerFuel(decayingWheat, mulch, 2, 900));
|
||||
|
||||
// Set fuels for our own engines
|
||||
ItemStack peat = coreItems.peat.getItemStack();
|
||||
FuelManager.copperEngineFuel.put(peat, new EngineCopperFuel(peat, Constants.ENGINE_COPPER_FUEL_VALUE_PEAT, Constants.ENGINE_COPPER_CYCLE_DURATION_PEAT));
|
||||
|
||||
ItemStack bituminousPeat = coreItems.bituminousPeat.getItemStack();
|
||||
FuelManager.copperEngineFuel.put(bituminousPeat, new EngineCopperFuel(bituminousPeat, Constants.ENGINE_COPPER_FUEL_VALUE_BITUMINOUS_PEAT, Constants.ENGINE_COPPER_CYCLE_DURATION_BITUMINOUS_PEAT));
|
||||
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.BIOMASS.getFluid(), new EngineBronzeFuel(Fluids.BIOMASS.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_BIOMASS, (int) (Constants.ENGINE_CYCLE_DURATION_BIOMASS * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.biogas")), 1));
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.WATER.getFluid(), new EngineBronzeFuel(Fluids.WATER.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_WATER, Constants.ENGINE_CYCLE_DURATION_WATER, 3));
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.MILK.getFluid(), new EngineBronzeFuel(Fluids.MILK.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_MILK, Constants.ENGINE_CYCLE_DURATION_MILK, 3));
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.SEEDOIL.getFluid(), new EngineBronzeFuel(Fluids.SEEDOIL.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_SEED_OIL, Constants.ENGINE_CYCLE_DURATION_SEED_OIL, 1));
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.HONEY.getFluid(), new EngineBronzeFuel(Fluids.HONEY.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_HONEY, Constants.ENGINE_CYCLE_DURATION_HONEY, 1));
|
||||
FuelManager.bronzeEngineFuel.put(Fluids.JUICE.getFluid(), new EngineBronzeFuel(Fluids.JUICE.getFluid(),
|
||||
Constants.ENGINE_FUEL_VALUE_JUICE, Constants.ENGINE_CYCLE_DURATION_JUICE, 1));
|
||||
|
||||
// Set rain substrates
|
||||
ItemStack iodineCharge = coreItems.iodineCharge.getItemStack();
|
||||
ItemStack dissipationCharge = coreItems.craftingMaterial.getDissipationCharge();
|
||||
FuelManager.rainSubstrate.put(iodineCharge, new RainSubstrate(iodineCharge, Constants.RAINMAKER_RAIN_DURATION_IODINE, 0.01f));
|
||||
FuelManager.rainSubstrate.put(dissipationCharge, new RainSubstrate(dissipationCharge, 0.075f));
|
||||
|
||||
blocks.factoryTESR.addDefinitions(BlockTypeFactoryTesr.VALUES);
|
||||
blocks.factoryPlain.addDefinitions(BlockTypeFactoryPlain.VALUES);
|
||||
|
||||
ICircuitLayout layoutMachineUpgrade = new CircuitLayout("machine.upgrade", CircuitSocketType.MACHINE);
|
||||
ChipsetManager.circuitRegistry.registerLayout(layoutMachineUpgrade);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTriggers() {
|
||||
FactoryTriggers.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
blocks.factoryTESR.init();
|
||||
blocks.factoryPlain.init();
|
||||
|
||||
Circuit.machineSpeedUpgrade1 = new CircuitSpeedUpgrade("machine.speed.boost.1", 0.125f, 0.05f, 4);
|
||||
Circuit.machineSpeedUpgrade2 = new CircuitSpeedUpgrade("machine.speed.boost.2", 0.250f, 0.10f, 4);
|
||||
Circuit.machineEfficiencyUpgrade1 = new CircuitSpeedUpgrade("machine.efficiency.1", 0, -0.10f, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
|
||||
// / FABRICATOR
|
||||
ItemElectronTube electronTube = PluginCore.items.tubes;
|
||||
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.COPPER, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', "ingotCopper"});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.TIN, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', "ingotTin"});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.BRONZE, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', "ingotBronze"});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.IRON, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', "ingotIron"});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.GOLD, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', "ingotGold"});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.DIAMOND, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', "gemDiamond"});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.OBSIDIAN, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', Blocks.obsidian});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.BLAZE, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', Items.blaze_powder});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.EMERALD, 4), new Object[]{
|
||||
" X ", "#X#", "XXX", '#', "dustRedstone", 'X', "gemEmerald"});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.APATITE, 4),
|
||||
new Object[]{" X ", "#X#", "XXX", '#', "dustRedstone", 'X', "gemApatite"});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.LAPIS, 4),
|
||||
new Object[]{" X ", "#X#", "XXX", '#', "dustRedstone", 'X', new ItemStack(Items.dye, 1, 4)});
|
||||
RecipeManagers.fabricatorManager.addRecipe(null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.ENDER, 4),
|
||||
new Object[]{" X ", "#X#", "XXX", '#', new ItemStack(Items.ender_eye, 1, 0), 'X', new ItemStack(Blocks.end_stone, 1, 0)});
|
||||
|
||||
String[] dyes = {"dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan", "dyeLightGray", "dyeGray", "dyePink", "dyeLime",
|
||||
"dyeYellow", "dyeLightBlue", "dyeMagenta", "dyeOrange", "dyeWhite"};
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.APICULTURE)) {
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
FluidStack liquidGlass = Fluids.GLASS.getFluid(Constants.BUCKET_VOLUME);
|
||||
FluidStack liquidGlassX4 = Fluids.GLASS.getFluid(Constants.BUCKET_VOLUME * 4);
|
||||
for (int i = 0; i < 16; i++) {
|
||||
RecipeManagers.fabricatorManager.addRecipe(beeItems.waxCast.getWildcard(), liquidGlass, new ItemStack(Blocks.stained_glass, 4, 15 - i), new Object[]{
|
||||
"#", "X",
|
||||
'#', dyes[i],
|
||||
'X', beeItems.propolis.getWildcard()});
|
||||
}
|
||||
RecipeManagers.fabricatorManager.addRecipe(beeItems.waxCast.getWildcard(), liquidGlassX4, new ItemStack(Blocks.glass, 1, 0), new Object[]{
|
||||
"#", "X",
|
||||
'X', beeItems.propolis.getWildcard()});
|
||||
}
|
||||
|
||||
// / SQUEEZER
|
||||
int appleMulchAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.mulch.apple");
|
||||
int appleJuiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple");
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.apple)}, Fluids.JUICE.getFluid(appleJuiceAmount),
|
||||
PluginCore.items.mulch.getItemStack(), appleMulchAmount);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.carrot)}, Fluids.JUICE.getFluid(appleJuiceAmount),
|
||||
PluginCore.items.mulch.getItemStack(), appleMulchAmount);
|
||||
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.carrot)}, Fluids.JUICE.getFluid(appleJuiceAmount),
|
||||
PluginCore.items.mulch.getItemStack(), appleMulchAmount);
|
||||
int seedOilAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed");
|
||||
FluidStack seedOil = Fluids.SEEDOIL.getFluid(seedOilAmount);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.wheat_seeds)}, seedOil);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.pumpkin_seeds)}, seedOil);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.melon_seeds)}, seedOil);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{PluginCore.items.phosphor.getItemStack(2), new ItemStack(Blocks.cobblestone)}, Fluids.LAVA.getFluid(1600));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Blocks.cactus)}, Fluids.WATER.getFluid(500));
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{new ItemStack(Items.snowball), PluginCore.items.craftingMaterial.getIceShard(4)}, Fluids.ICE.getFluid(4000));
|
||||
|
||||
// STILL
|
||||
RecipeManagers.stillManager.addRecipe(Constants.STILL_DESTILLATION_DURATION, Fluids.BIOMASS.getFluid(Constants.STILL_DESTILLATION_INPUT),
|
||||
Fluids.ETHANOL.getFluid(Constants.STILL_DESTILLATION_OUTPUT));
|
||||
|
||||
// MOISTENER
|
||||
RecipeManagers.moistenerManager.addRecipe(new ItemStack(Items.wheat_seeds), new ItemStack(Blocks.mycelium), 5000);
|
||||
RecipeManagers.moistenerManager.addRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone), 20000);
|
||||
RecipeManagers.moistenerManager.addRecipe(new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stonebrick, 1, 1), 20000);
|
||||
|
||||
// FERMENTER
|
||||
for (int i = 0; i < 6; i++) {
|
||||
RecipeUtil.addFermenterRecipes(new ItemStack(Blocks.sapling, 1, i), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS);
|
||||
}
|
||||
|
||||
RecipeUtil.addFermenterRecipes(new ItemStack(Blocks.cactus), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.cactus"), Fluids.BIOMASS);
|
||||
RecipeUtil.addFermenterRecipes(new ItemStack(Items.wheat), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS);
|
||||
RecipeUtil.addFermenterRecipes(new ItemStack(Items.potato), (2 * ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat")), Fluids.BIOMASS);
|
||||
RecipeUtil.addFermenterRecipes(new ItemStack(Items.reeds), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.cane"), Fluids.BIOMASS);
|
||||
RecipeUtil.addFermenterRecipes(new ItemStack(Blocks.brown_mushroom), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.mushroom"), Fluids.BIOMASS);
|
||||
RecipeUtil.addFermenterRecipes(new ItemStack(Blocks.red_mushroom), ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.mushroom"), Fluids.BIOMASS);
|
||||
|
||||
// FABRICATOR
|
||||
|
||||
RecipeManagers.fabricatorSmeltingManager.addSmelting(new ItemStack(Blocks.glass), Fluids.GLASS.getFluid(1000), 1000);
|
||||
RecipeManagers.fabricatorSmeltingManager.addSmelting(new ItemStack(Blocks.glass_pane), Fluids.GLASS.getFluid(375), 1000);
|
||||
RecipeManagers.fabricatorSmeltingManager.addSmelting(new ItemStack(Blocks.sand), Fluids.GLASS.getFluid(1000), 3000);
|
||||
RecipeManagers.fabricatorSmeltingManager.addSmelting(new ItemStack(Blocks.sand, 1, 1), Fluids.GLASS.getFluid(1000), 3000);
|
||||
RecipeManagers.fabricatorSmeltingManager.addSmelting(new ItemStack(Blocks.sandstone), Fluids.GLASS.getFluid(4000), 4800);
|
||||
RecipeManagers.fabricatorSmeltingManager.addSmelting(new ItemStack(Blocks.sandstone, 1, 1), Fluids.GLASS.getFluid(4000), 4800);
|
||||
RecipeManagers.fabricatorSmeltingManager.addSmelting(new ItemStack(Blocks.sandstone, 1, 2), Fluids.GLASS.getFluid(4000), 4800);
|
||||
|
||||
// / CARPENTER
|
||||
RecipeManagers.carpenterManager.addRecipe(50, Fluids.SEEDOIL.getFluid(250), null, PluginCore.items.impregnatedCasing.getItemStack(),
|
||||
"###",
|
||||
"# #",
|
||||
"###",
|
||||
'#', "logWood");
|
||||
RecipeManagers.carpenterManager.addRecipe(50, Fluids.SEEDOIL.getFluid(500), null,
|
||||
PluginCore.blocks.core.get(BlockTypeCoreTesr.ESCRITOIRE),
|
||||
"# ",
|
||||
"###",
|
||||
"# #",
|
||||
'#', "plankWood");
|
||||
|
||||
// RESOURCES
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.SEEDOIL.getFluid(100), null,
|
||||
PluginCore.items.stickImpregnated.getItemStack(2),
|
||||
"#",
|
||||
"#",
|
||||
'#', "logWood");
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(250), null,
|
||||
PluginCore.items.woodPulp.getItemStack(4),
|
||||
"#",
|
||||
'#', "logWood");
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(250), null,
|
||||
new ItemStack(Items.paper, 1),
|
||||
"#",
|
||||
"#",
|
||||
'#', "pulpWood");
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null,
|
||||
PluginCore.blocks.soil.get(BlockSoil.SoilType.HUMUS, 9),
|
||||
"###",
|
||||
"#X#",
|
||||
"###",
|
||||
'#', Blocks.dirt,
|
||||
'X', PluginCore.items.mulch);
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null,
|
||||
PluginCore.blocks.soil.get(BlockSoil.SoilType.BOG_EARTH, 8),
|
||||
"#X#",
|
||||
"XYX", "#X#",
|
||||
'#', Blocks.dirt,
|
||||
'X', "sand",
|
||||
'Y', PluginCore.items.mulch);
|
||||
RecipeManagers.carpenterManager.addRecipe(75, Fluids.WATER.getFluid(5000), null, PluginCore.items.hardenedCasing.getItemStack(),
|
||||
"# #",
|
||||
" Y ",
|
||||
"# #",
|
||||
'#', "gemDiamond",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
// / CHIPSETS
|
||||
ItemCircuitBoard circuitBoard = PluginCore.items.circuitboards;
|
||||
RecipeManagers.carpenterManager.addRecipe(20, Fluids.WATER.getFluid(1000), null, circuitBoard.get(EnumCircuitBoardType.BASIC),
|
||||
"R R", "R#R", "R R", '#', "ingotTin", 'R', "dustRedstone");
|
||||
RecipeManagers.carpenterManager.addRecipe(40, Fluids.WATER.getFluid(1000), null, circuitBoard.get(EnumCircuitBoardType.ENHANCED),
|
||||
"R#R", "R#R", "R#R", '#', "ingotBronze", 'R', "dustRedstone");
|
||||
RecipeManagers.carpenterManager.addRecipe(80, Fluids.WATER.getFluid(1000), null, circuitBoard.get(EnumCircuitBoardType.REFINED),
|
||||
"R#R", "R#R", "R#R", '#', "ingotIron", 'R', "dustRedstone");
|
||||
RecipeManagers.carpenterManager.addRecipe(80, Fluids.WATER.getFluid(1000), null, circuitBoard.get(EnumCircuitBoardType.INTRICATE),
|
||||
"R#R", "R#R", "R#R", '#', "ingotGold", 'R', "dustRedstone");
|
||||
RecipeManagers.carpenterManager.addRecipe(40, Fluids.WATER.getFluid(1000), null, PluginCore.items.solderingIron.getItemStack(),
|
||||
" # ", "# #", " B", '#', "ingotIron", 'B', "ingotBronze");
|
||||
|
||||
// RAIN SUBSTRATES
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
if (beeItems != null) {
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null, PluginCore.items.iodineCharge.getItemStack(),
|
||||
"Z#Z",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
'#', beeItems.pollenCluster.getWildcard(),
|
||||
'X', Items.gunpowder,
|
||||
'Y', PluginFluids.items.canEmpty,
|
||||
'Z', beeItems.honeyDrop);
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null, PluginCore.items.craftingMaterial.getDissipationCharge(),
|
||||
"Z#Z",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
'#', beeItems.royalJelly,
|
||||
'X', Items.gunpowder,
|
||||
'Y', PluginFluids.items.canEmpty,
|
||||
'Z', beeItems.honeydew);
|
||||
}
|
||||
|
||||
// Ender pearl
|
||||
RecipeManagers.carpenterManager.addRecipe(100, null, new ItemStack(Items.ender_pearl, 1), " # ", "###", " # ", '#',
|
||||
PluginCore.items.craftingMaterial.getPulsatingMesh());
|
||||
// Woven Silk
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(500), null, PluginCore.items.craftingMaterial.getWovenSilk(),
|
||||
"###", "###", "###", '#', PluginCore.items.craftingMaterial.getSilkWisp());
|
||||
|
||||
// Boxes
|
||||
RecipeManagers.carpenterManager.addRecipe(5, Fluids.WATER.getFluid(1000), null, PluginCore.items.carton.getItemStack(2),
|
||||
" # ", "# #", " # ", '#', "pulpWood");
|
||||
|
||||
// Assembly Kits
|
||||
RecipeManagers.carpenterManager.addRecipe(20, null, PluginCore.items.carton.getItemStack(), PluginCore.items.kitPickaxe.getItemStack(), new Object[]{
|
||||
"###",
|
||||
" X ",
|
||||
" X ",
|
||||
'#', "ingotBronze",
|
||||
'X', "stickWood"});
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(20, null, PluginCore.items.carton.getItemStack(), PluginCore.items.kitShovel.getItemStack(),
|
||||
new Object[]{" # ", " X ", " X ", '#', "ingotBronze", 'X', "stickWood"});
|
||||
|
||||
// Reclamation
|
||||
RecipeManagers.carpenterManager.addRecipe(null, PluginCore.items.ingotBronze.getItemStack(2),
|
||||
"#", '#', PluginCore.items.brokenBronzePickaxe);
|
||||
RecipeManagers.carpenterManager.addRecipe(null, PluginCore.items.ingotBronze.getItemStack(), "#", '#', PluginCore.items.brokenBronzeShovel);
|
||||
|
||||
// Crating and uncrating
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.STORAGE)) {
|
||||
PluginStorage.createCrateRecipes();
|
||||
}
|
||||
ICircuitLayout layout = ChipsetManager.circuitRegistry.getLayout("forestry.machine.upgrade");
|
||||
|
||||
// / Solder Manager
|
||||
ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.EMERALD, 1), Circuit.machineSpeedUpgrade1);
|
||||
ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.BLAZE, 1), Circuit.machineSpeedUpgrade2);
|
||||
ChipsetManager.solderManager.addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1), Circuit.machineEfficiencyUpgrade1);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.BOTTLER),
|
||||
"X#X",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', PluginFluids.items.canEmpty,
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.CARPENTER),
|
||||
"X#X",
|
||||
"XYX",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "ingotBronze",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.CENTRIFUGE),
|
||||
"X#X",
|
||||
"XYX",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "ingotCopper",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.FERMENTER),
|
||||
"X#X",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "gearBronze",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.MOISTENER),
|
||||
"X#X",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "gearCopper",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.SQUEEZER),
|
||||
"X#X",
|
||||
"XYX",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "ingotTin",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.STILL),
|
||||
"X#X",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "dustRedstone",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryTESR.get(BlockTypeFactoryTesr.RAINMAKER),
|
||||
"X#X",
|
||||
"#Y#",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "gearTin",
|
||||
'Y', PluginCore.items.hardenedCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryPlain.get(BlockTypeFactoryPlain.FABRICATOR),
|
||||
"X#X",
|
||||
"#Y#",
|
||||
"XZX",
|
||||
'#', "blockGlass",
|
||||
'X', "ingotGold",
|
||||
'Y', PluginCore.items.sturdyCasing,
|
||||
'Z', "chestWood");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryPlain.get(BlockTypeFactoryPlain.RAINTANK),
|
||||
"X#X",
|
||||
"XYX",
|
||||
"X#X",
|
||||
'#', "blockGlass",
|
||||
'X', "ingotIron",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.factoryPlain.get(BlockTypeFactoryPlain.WORKTABLE),
|
||||
"B",
|
||||
"W",
|
||||
"C",
|
||||
'B', Items.book,
|
||||
'W', "craftingTableWood",
|
||||
'C', "chestWood");
|
||||
}
|
||||
}
|
||||
@@ -1,367 +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 java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.regex.MatchResult;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.CircuitSocketType;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
import forestry.api.farming.IFarmable;
|
||||
import forestry.core.circuits.Circuit;
|
||||
import forestry.core.circuits.CircuitLayout;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.items.EnumElectronTube;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.IMCUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.farming.blocks.BlockRegistryFarming;
|
||||
import forestry.farming.blocks.EnumFarmBlockType;
|
||||
import forestry.farming.circuits.CircuitFarmLogic;
|
||||
import forestry.farming.logic.FarmLogicArboreal;
|
||||
import forestry.farming.logic.FarmLogicCereal;
|
||||
import forestry.farming.logic.FarmLogicCocoa;
|
||||
import forestry.farming.logic.FarmLogicGourd;
|
||||
import forestry.farming.logic.FarmLogicInfernal;
|
||||
import forestry.farming.logic.FarmLogicOrchard;
|
||||
import forestry.farming.logic.FarmLogicPeat;
|
||||
import forestry.farming.logic.FarmLogicReeds;
|
||||
import forestry.farming.logic.FarmLogicShroom;
|
||||
import forestry.farming.logic.FarmLogicSucculent;
|
||||
import forestry.farming.logic.FarmLogicVegetable;
|
||||
import forestry.farming.logic.FarmableBasicFruit;
|
||||
import forestry.farming.logic.FarmableGE;
|
||||
import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.farming.logic.FarmableGenericSapling;
|
||||
import forestry.farming.logic.FarmableGourd;
|
||||
import forestry.farming.logic.FarmableStacked;
|
||||
import forestry.farming.logic.FarmableVanillaMushroom;
|
||||
import forestry.farming.logic.FarmableVanillaSapling;
|
||||
import forestry.farming.models.EnumFarmBlockTexture;
|
||||
import forestry.farming.proxy.ProxyFarming;
|
||||
import forestry.farming.tiles.TileFarmControl;
|
||||
import forestry.farming.tiles.TileFarmGearbox;
|
||||
import forestry.farming.tiles.TileFarmHatch;
|
||||
import forestry.farming.tiles.TileFarmPlain;
|
||||
import forestry.farming.tiles.TileFarmValve;
|
||||
import forestry.farming.triggers.FarmingTriggers;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.FARMING, name = "Farming", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.farming.description")
|
||||
public class PluginFarming extends BlankForestryPlugin {
|
||||
|
||||
@SidedProxy(clientSide = "forestry.farming.proxy.ProxyFarmingClient", serverSide = "forestry.farming.proxy.ProxyFarming")
|
||||
public static ProxyFarming proxy;
|
||||
public static int modelIdFarmBlock;
|
||||
|
||||
public static BlockRegistryFarming blocks;
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
blocks = new BlockRegistryFarming();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
Farmables.farmables.put("farmArboreal", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmArboreal").add(new FarmableVanillaSapling());
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.ARBORICULTURE)) {
|
||||
Farmables.farmables.get("farmArboreal").add(new FarmableGE());
|
||||
}
|
||||
|
||||
Farmables.farmables.put("farmOrchard", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(Blocks.wheat, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(Blocks.potatoes, 7));
|
||||
Farmables.farmables.get("farmOrchard").add(new FarmableBasicFruit(Blocks.carrots, 7));
|
||||
|
||||
Farmables.farmables.put("farmShroom", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmShroom").add(new FarmableVanillaMushroom(Blocks.brown_mushroom, 0));
|
||||
Farmables.farmables.get("farmShroom").add(new FarmableVanillaMushroom(Blocks.red_mushroom, 0));
|
||||
|
||||
Farmables.farmables.put("farmWheat", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmWheat").add(new FarmableGenericCrop(new ItemStack(Items.wheat_seeds), Blocks.wheat, 7));
|
||||
|
||||
Farmables.farmables.put("farmGourd", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmGourd").add(
|
||||
new FarmableGourd(new ItemStack(Items.pumpkin_seeds), new ItemStack(Blocks.pumpkin_stem), new ItemStack(Blocks.pumpkin)));
|
||||
Farmables.farmables.get("farmGourd").add(new FarmableGourd(new ItemStack(Items.melon_seeds), new ItemStack(Blocks.melon_stem), new ItemStack(Blocks.melon_block)));
|
||||
|
||||
Farmables.farmables.put("farmInfernal", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmInfernal").add(new FarmableGenericCrop(new ItemStack(Items.nether_wart), Blocks.nether_wart, 3));
|
||||
|
||||
Farmables.farmables.put("farmPoales", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmPoales").add(new FarmableStacked(Blocks.reeds, 3, 0));
|
||||
|
||||
Farmables.farmables.put("farmSucculentes", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmSucculentes").add(new FarmableStacked(Blocks.cactus, 3, 0));
|
||||
|
||||
Farmables.farmables.put("farmVegetables", new ArrayList<IFarmable>());
|
||||
Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(new ItemStack(Items.potato), Blocks.potatoes, 7));
|
||||
Farmables.farmables.get("farmVegetables").add(new FarmableGenericCrop(new ItemStack(Items.carrot), Blocks.carrots, 7));
|
||||
|
||||
proxy.initializeModels();
|
||||
|
||||
// Layouts
|
||||
ICircuitLayout layoutManaged = new CircuitLayout("farms.managed", CircuitSocketType.FARM);
|
||||
ChipsetManager.circuitRegistry.registerLayout(layoutManaged);
|
||||
ICircuitLayout layoutManual = new CircuitLayout("farms.manual", CircuitSocketType.FARM);
|
||||
ChipsetManager.circuitRegistry.registerLayout(layoutManual);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTriggers() {
|
||||
FarmingTriggers.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
GameRegistry.registerTileEntity(TileFarmPlain.class, "forestry.Farm");
|
||||
GameRegistry.registerTileEntity(TileFarmGearbox.class, "forestry.FarmGearbox");
|
||||
GameRegistry.registerTileEntity(TileFarmHatch.class, "forestry.FarmHatch");
|
||||
GameRegistry.registerTileEntity(TileFarmValve.class, "forestry.FarmValve");
|
||||
GameRegistry.registerTileEntity(TileFarmControl.class, "forestry.FarmControl");
|
||||
|
||||
Circuit.farmArborealManaged = new CircuitFarmLogic("managedArboreal", FarmLogicArboreal.class);
|
||||
Circuit.farmShroomManaged = new CircuitFarmLogic("managedShroom", FarmLogicShroom.class);
|
||||
Circuit.farmPeatManaged = new CircuitFarmLogic("managedPeat", FarmLogicPeat.class);
|
||||
Circuit.farmCerealManaged = new CircuitFarmLogic("managedCereal", FarmLogicCereal.class);
|
||||
Circuit.farmVegetableManaged = new CircuitFarmLogic("managedVegetable", FarmLogicVegetable.class);
|
||||
Circuit.farmInfernalManaged = new CircuitFarmLogic("managedInfernal", FarmLogicInfernal.class);
|
||||
|
||||
Circuit.farmPeatManual = new CircuitFarmLogic("manualPeat", FarmLogicPeat.class).setManual();
|
||||
Circuit.farmShroomManual = new CircuitFarmLogic("manualShroom", FarmLogicShroom.class).setManual();
|
||||
Circuit.farmCerealManual = new CircuitFarmLogic("manualCereal", FarmLogicCereal.class).setManual();
|
||||
Circuit.farmVegetableManual = new CircuitFarmLogic("manualVegetable", FarmLogicVegetable.class).setManual();
|
||||
Circuit.farmSucculentManual = new CircuitFarmLogic("manualSucculent", FarmLogicSucculent.class).setManual();
|
||||
Circuit.farmPoalesManual = new CircuitFarmLogic("manualPoales", FarmLogicReeds.class).setManual();
|
||||
Circuit.farmGourdManual = new CircuitFarmLogic("manualGourd", FarmLogicGourd.class).setManual();
|
||||
Circuit.farmCocoaManual = new CircuitFarmLogic("manualCocoa", FarmLogicCocoa.class).setManual();
|
||||
|
||||
Circuit.farmOrchardManual = new CircuitFarmLogic("manualOrchard", FarmLogicOrchard.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIMCMessage(IMCMessage message) {
|
||||
|
||||
if (message.key.equals("add-farmable-sapling")) {
|
||||
String[] tokens = message.getStringValue().split("@");
|
||||
String errormsg = IMCUtil.getInvalidIMCMessageText(message);
|
||||
if (tokens.length != 2) {
|
||||
Log.warning(errormsg);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Farmables.farmables.containsKey(tokens[0])) {
|
||||
Log.warning("%s For non-existent farm %s.", errormsg, tokens[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
Collection<IFarmable> farmables = Farmables.farmables.get(tokens[0]);
|
||||
|
||||
String itemString = tokens[1];
|
||||
|
||||
Matcher matcher = Pattern.compile("(.+?)\\.(-?[0-9][0-9]?)(?:\\.(.+?)\\.(-?[0-9][0-9]?))?").matcher(itemString);
|
||||
if (!matcher.matches()) {
|
||||
Log.warning("%s For farm '%s': unable to parse string.", errormsg, tokens[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
MatchResult matchResult = matcher.toMatchResult();
|
||||
String saplingString = matchResult.group(1);
|
||||
String saplingMetaString = matchResult.group(2);
|
||||
String windfallString = matchResult.group(3);
|
||||
String windfallMetaString = matchResult.group(4);
|
||||
|
||||
try {
|
||||
Block sapling = ItemStackUtil.getBlockFromRegistry(saplingString);
|
||||
if (sapling == null || sapling == Blocks.air) {
|
||||
throw new RuntimeException("can't find block for " + saplingString);
|
||||
}
|
||||
int saplingMeta = Integer.parseInt(saplingMetaString);
|
||||
|
||||
if (windfallString == null) {
|
||||
farmables.add(new FarmableGenericSapling(sapling, saplingMeta));
|
||||
} else {
|
||||
Item windfall = ItemStackUtil.getItemFromRegistry(windfallString);
|
||||
if (windfall == null) {
|
||||
throw new RuntimeException("can't find item for " + windfallString);
|
||||
}
|
||||
|
||||
ItemStack windfallStack = new ItemStack(windfall, 1, Integer.parseInt(windfallMetaString));
|
||||
|
||||
farmables.add(new FarmableGenericSapling(sapling, saplingMeta, windfallStack));
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
Log.warning("%s for farm '%s': %s", errormsg, tokens[0], ex.getMessage());
|
||||
}
|
||||
return true;
|
||||
|
||||
} else if (message.key.equals("add-farmable-crop")) {
|
||||
|
||||
String[] tokens = message.getStringValue().split("@");
|
||||
String errormsg = IMCUtil.getInvalidIMCMessageText(message);
|
||||
if (tokens.length != 2) {
|
||||
Log.warning(errormsg);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!Farmables.farmables.containsKey(tokens[0])) {
|
||||
Log.warning("%s For non-existent farm %s.", errormsg, tokens[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
String[] items = tokens[1].split("[\\.]+");
|
||||
if (items.length != 4) {
|
||||
Log.warning("%s For farm '%s': id definitions did not match.", errormsg, tokens[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
try {
|
||||
Item seed = ItemStackUtil.getItemFromRegistry(items[0]);
|
||||
if (seed == null) {
|
||||
throw new RuntimeException("can't find item for " + items[0]);
|
||||
}
|
||||
Block crop = ItemStackUtil.getBlockFromRegistry(items[2]);
|
||||
if (crop == null || crop == Blocks.air) {
|
||||
throw new RuntimeException("can't find block for " + items[2]);
|
||||
}
|
||||
|
||||
Farmables.farmables.get(tokens[0]).add(
|
||||
new FarmableGenericCrop(new ItemStack(seed, 1, Integer.parseInt(items[1])),
|
||||
crop,
|
||||
Integer.parseInt(items[3])));
|
||||
} catch (Exception ex) {
|
||||
Log.warning("%s for farm '%s': %s", errormsg, tokens[0], ex.getMessage());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
|
||||
ItemStack basic = blocks.farm.get(EnumFarmBlockType.PLAIN, 1);
|
||||
ItemStack gearbox = blocks.farm.get(EnumFarmBlockType.GEARBOX, 1);
|
||||
ItemStack hatch = blocks.farm.get(EnumFarmBlockType.HATCH, 1);
|
||||
ItemStack valve = blocks.farm.get(EnumFarmBlockType.VALVE, 1);
|
||||
ItemStack control = blocks.farm.get(EnumFarmBlockType.CONTROL, 1);
|
||||
|
||||
for (EnumFarmBlockTexture block : EnumFarmBlockTexture.values()) {
|
||||
NBTTagCompound compound = new NBTTagCompound();
|
||||
block.saveToCompound(compound);
|
||||
|
||||
basic.setTagCompound(compound);
|
||||
gearbox.setTagCompound(compound);
|
||||
hatch.setTagCompound(compound);
|
||||
valve.setTagCompound(compound);
|
||||
control.setTagCompound(compound);
|
||||
|
||||
RecipeUtil.addRecipe(basic,
|
||||
"I#I",
|
||||
"WCW",
|
||||
'#', block.getBase(),
|
||||
'W', "slabWood",
|
||||
'C', PluginCore.items.tubes.get(EnumElectronTube.TIN, 1),
|
||||
'I', "ingotCopper");
|
||||
|
||||
RecipeUtil.addRecipe(gearbox,
|
||||
" # ",
|
||||
"TTT",
|
||||
'#', basic,
|
||||
'T', "gearTin");
|
||||
|
||||
RecipeUtil.addRecipe(hatch,
|
||||
" # ",
|
||||
"TDT",
|
||||
'#', basic,
|
||||
'T', "gearTin",
|
||||
'D', Blocks.trapdoor);
|
||||
|
||||
RecipeUtil.addRecipe(valve,
|
||||
" # ",
|
||||
"XTX",
|
||||
'#', basic,
|
||||
'T', "gearTin",
|
||||
'X', "blockGlass");
|
||||
|
||||
RecipeUtil.addRecipe(control,
|
||||
" # ",
|
||||
"XTX",
|
||||
'#', basic,
|
||||
'T', PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1),
|
||||
'X', "dustRedstone");
|
||||
}
|
||||
|
||||
// Circuits
|
||||
ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed");
|
||||
ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual");
|
||||
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), Circuit.farmArborealManaged);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.farmPeatManaged);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), Circuit.farmCerealManaged);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), Circuit.farmVegetableManaged);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.BLAZE, 1), Circuit.farmInfernalManaged);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.APATITE, 1), Circuit.farmShroomManaged);
|
||||
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), Circuit.farmOrchardManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.farmPeatManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), Circuit.farmCerealManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), Circuit.farmVegetableManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1), Circuit.farmSucculentManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.DIAMOND, 1), Circuit.farmPoalesManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.OBSIDIAN, 1), Circuit.farmGourdManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.APATITE, 1), Circuit.farmShroomManual);
|
||||
ChipsetManager.solderManager.addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.LAPIS, 1), Circuit.farmCocoaManual);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHiddenItems(List<ItemStack> hiddenItems) {
|
||||
// mushrooms are a workaround for the farm and should not be obtainable
|
||||
hiddenItems.add(new ItemStack(blocks.mushroom, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void handleTextureRemap(TextureStitchEvent.Pre event) {
|
||||
EnumFarmBlockType.registerSprites();
|
||||
}
|
||||
}
|
||||
@@ -1,181 +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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.fuels.FuelManager;
|
||||
import forestry.api.fuels.GeneratorFuel;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.BlockForestryFluid;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.fluids.LiquidRegistryHelper;
|
||||
import forestry.core.items.EnumContainerType;
|
||||
import forestry.core.items.ItemLiquidContainer;
|
||||
import forestry.core.items.ItemRegistryFluids;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.StringUtil;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.FLUIDS, name = "Fluids", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.fluids.description")
|
||||
public class PluginFluids extends BlankForestryPlugin {
|
||||
|
||||
private static final List<Fluids> forestryFluidsWithBlocks = new ArrayList<>();
|
||||
|
||||
public static ItemRegistryFluids items;
|
||||
|
||||
private static void createFluid(Fluids forestryFluid) {
|
||||
if (forestryFluid.getFluid() == null && Config.isFluidEnabled(forestryFluid)) {
|
||||
String fluidName = forestryFluid.getTag();
|
||||
if (!FluidRegistry.isFluidRegistered(fluidName)) {
|
||||
Fluid fluid = new Fluid(fluidName,
|
||||
forestryFluid.getResources()[0], forestryFluid.flowTextureExists() ? forestryFluid.getResources()[1]
|
||||
: forestryFluid.getResources()[0]).setDensity(forestryFluid.getDensity()).setViscosity(forestryFluid.getViscosity()).setTemperature(forestryFluid.getTemperature());
|
||||
FluidRegistry.registerFluid(fluid);
|
||||
createBlock(forestryFluid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void createBlock(Fluids forestryFluid) {
|
||||
Fluid fluid = forestryFluid.getFluid();
|
||||
Block fluidBlock = fluid.getBlock();
|
||||
|
||||
if (Config.isBlockEnabled(forestryFluid.getTag())) {
|
||||
if (fluidBlock == null) {
|
||||
fluidBlock = forestryFluid.makeBlock();
|
||||
if (fluidBlock != null) {
|
||||
fluidBlock.setUnlocalizedName("forestry.fluid." + forestryFluid.getTag());
|
||||
GameRegistry.registerBlock(fluidBlock, ItemBlock.class, StringUtil.cleanBlockName(fluidBlock));
|
||||
forestryFluidsWithBlocks.add(forestryFluid);
|
||||
Proxies.render.registerFluidStateMapper(fluidBlock, forestryFluid);
|
||||
}
|
||||
} else {
|
||||
GameRegistry.UniqueIdentifier blockID = GameRegistry.findUniqueIdentifierFor(fluidBlock);
|
||||
Log.warning("Pre-existing {0} fluid block detected, deferring to {1}:{2}, "
|
||||
+ "this may cause issues if the server/client have different mod load orders, "
|
||||
+ "recommended that you disable all but one instance of {0} fluid blocks via your configs.", fluid.getName(), blockID.modId, blockID.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeDisabled() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
for (Fluids fluidType : Fluids.forestryFluids) {
|
||||
createFluid(fluidType);
|
||||
}
|
||||
|
||||
items = new ItemRegistryFluids();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
MinecraftForge.EVENT_BUS.register(getFillBucketHook());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
for (Fluids fluidType : Fluids.values()) {
|
||||
if (fluidType.getFluid() == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (EnumContainerType type : EnumContainerType.values()) {
|
||||
ItemLiquidContainer container = items.getContainer(type, fluidType);
|
||||
if (container == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
LiquidRegistryHelper.registerLiquidContainer(fluidType, container.getItemStack());
|
||||
}
|
||||
|
||||
for (ItemStack filledContainer : fluidType.getOtherContainers()) {
|
||||
LiquidRegistryHelper.registerLiquidContainer(fluidType, filledContainer);
|
||||
}
|
||||
}
|
||||
|
||||
if (RecipeManagers.squeezerManager != null) {
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(10, items.canEmpty.getItemStack(), PluginCore.items.ingotTin.getItemStack(), 0.05f);
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(10, items.waxCapsuleEmpty.getItemStack(), PluginCore.items.beeswax.getItemStack(), 0.10f);
|
||||
RecipeManagers.squeezerManager.addContainerRecipe(10, items.refractoryEmpty.getItemStack(), PluginCore.items.refractoryWax.getItemStack(), 0.10f);
|
||||
}
|
||||
|
||||
FluidStack ethanol = Fluids.ETHANOL.getFluid(1);
|
||||
GeneratorFuel ethanolFuel = new GeneratorFuel(ethanol, (int) (32 * ForestryAPI.activeMode.getFloatSetting("fuel.ethanol.generator")), 4);
|
||||
FuelManager.generatorFuel.put(ethanol.getFluid(), ethanolFuel);
|
||||
|
||||
FluidStack biomass = Fluids.BIOMASS.getFluid(1);
|
||||
GeneratorFuel biomassFuel = new GeneratorFuel(biomass, (int) (8 * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.generator")), 1);
|
||||
FuelManager.generatorFuel.put(biomass.getFluid(), biomassFuel);
|
||||
}
|
||||
|
||||
public static class MissingFluidException extends RuntimeException {
|
||||
public MissingFluidException(String tag) {
|
||||
super("Fluid '" + tag + "' was not found. Please check your configs.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
for (Fluids fluidType : Fluids.forestryFluids) {
|
||||
if (fluidType.getFluid() == null && Config.isFluidEnabled(fluidType)) {
|
||||
throw new MissingFluidException(fluidType.getTag());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class FillBucketHook {
|
||||
@SubscribeEvent
|
||||
public void fillBucket(FillBucketEvent event) {
|
||||
MovingObjectPosition movingObjectPosition = event.target;
|
||||
Block targetedBlock = BlockUtil.getBlock(event.world, event.target.getBlockPos());
|
||||
if (targetedBlock instanceof BlockForestryFluid) {
|
||||
Item filledBucket = ItemLiquidContainer.getExistingBucket(targetedBlock);
|
||||
if (filledBucket != null) {
|
||||
event.result = new ItemStack(filledBucket);
|
||||
event.setResult(Event.Result.ALLOW);
|
||||
if (!event.world.isRemote) {
|
||||
event.world.setBlockToAir(event.target.getBlockPos());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Object getFillBucketHook() {
|
||||
return new FillBucketHook();
|
||||
}
|
||||
}
|
||||
@@ -1,72 +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 net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.food.BeverageManager;
|
||||
import forestry.apiculture.items.EnumPollenCluster;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.fluids.LiquidRegistryHelper;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.food.BeverageEffects;
|
||||
import forestry.food.InfuserIngredientManager;
|
||||
import forestry.food.InfuserMixtureManager;
|
||||
import forestry.food.items.EnumBeverage;
|
||||
import forestry.food.items.ItemRegistryFood;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.FOOD, name = "Food", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.food.description")
|
||||
public class PluginFood extends BlankForestryPlugin {
|
||||
|
||||
public static ItemRegistryFood items;
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
// Init seasoner
|
||||
BeverageManager.infuserManager = new InfuserMixtureManager();
|
||||
BeverageManager.ingredientManager = new InfuserIngredientManager();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
items = new ItemRegistryFood();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
LiquidRegistryHelper.registerLiquidContainer(Fluids.SHORT_MEAD, Constants.BUCKET_VOLUME, items.beverage.get(EnumBeverage.MEAD_SHORT, 1), new ItemStack(Items.glass_bottle));
|
||||
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
if (beeItems != null) {
|
||||
ItemStack normalPollenCluster = beeItems.pollenCluster.get(EnumPollenCluster.NORMAL, 1);
|
||||
ItemStack crystallinePollenCluster = beeItems.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1);
|
||||
|
||||
BeverageManager.ingredientManager.addIngredient(normalPollenCluster, "Strong Curative");
|
||||
BeverageManager.ingredientManager.addIngredient(crystallinePollenCluster, "Weak Curative");
|
||||
BeverageManager.infuserManager.addMixture(1, normalPollenCluster, BeverageEffects.strongAntidote);
|
||||
BeverageManager.infuserManager.addMixture(1, crystallinePollenCluster, BeverageEffects.weakAntidote);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
// INFUSER
|
||||
RecipeUtil.addRecipe(items.infuser.getItemStack(),
|
||||
"X", "#", "X",
|
||||
'#', "ingotIron",
|
||||
'X', "ingotBronze");
|
||||
}
|
||||
}
|
||||
@@ -1,156 +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.Nonnull;
|
||||
import java.io.File;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fml.common.SidedProxy;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
|
||||
import forestry.Forestry;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.lepidopterology.ButterflyManager;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.LocalizedConfiguration;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.EntityUtil;
|
||||
import forestry.lepidopterology.ButterflySpawner;
|
||||
import forestry.lepidopterology.blocks.BlockRegistryLepidopterology;
|
||||
import forestry.lepidopterology.blocks.BlockTypeLepidopterologyTesr;
|
||||
import forestry.lepidopterology.commands.CommandButterfly;
|
||||
import forestry.lepidopterology.entities.EntityButterfly;
|
||||
import forestry.lepidopterology.genetics.AlleleButterflyEffect;
|
||||
import forestry.lepidopterology.genetics.ButterflyBranchDefinition;
|
||||
import forestry.lepidopterology.genetics.ButterflyDefinition;
|
||||
import forestry.lepidopterology.genetics.ButterflyFactory;
|
||||
import forestry.lepidopterology.genetics.ButterflyRoot;
|
||||
import forestry.lepidopterology.genetics.MothDefinition;
|
||||
import forestry.lepidopterology.items.ItemButterflyGE;
|
||||
import forestry.lepidopterology.items.ItemRegistryLepidopterology;
|
||||
import forestry.lepidopterology.proxy.ProxyLepidopterology;
|
||||
import forestry.lepidopterology.recipes.MatingRecipe;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.LEPIDOPTEROLOGY, name = "Lepidopterology", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.lepidopterology.description")
|
||||
public class PluginLepidopterology extends BlankForestryPlugin {
|
||||
|
||||
@SidedProxy(clientSide = "forestry.lepidopterology.proxy.ProxyLepidopterologyClient", serverSide = "forestry.lepidopterology.proxy.ProxyLepidopterology")
|
||||
public static ProxyLepidopterology proxy;
|
||||
private static final String CONFIG_CATEGORY = "lepidopterology";
|
||||
public static int spawnConstraint = 100;
|
||||
public static int entityConstraint = 1000;
|
||||
private static boolean allowPollination = true;
|
||||
|
||||
public static ItemRegistryLepidopterology items;
|
||||
public static BlockRegistryLepidopterology blocks;
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
ButterflyManager.butterflyRoot = new ButterflyRoot();
|
||||
AlleleManager.alleleRegistry.registerSpeciesRoot(ButterflyManager.butterflyRoot);
|
||||
|
||||
ButterflyManager.butterflyFactory = new ButterflyFactory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
items = new ItemRegistryLepidopterology();
|
||||
blocks = new BlockRegistryLepidopterology();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
ButterflyBranchDefinition.createAlleles();
|
||||
AlleleButterflyEffect.createAlleles();
|
||||
|
||||
blocks.lepidopterology.addDefinitions(BlockTypeLepidopterologyTesr.VALUES);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Set<String> getDependencyUids() {
|
||||
Set<String> dependencyUids = super.getDependencyUids();
|
||||
dependencyUids.add(ForestryPluginUids.ARBORICULTURE);
|
||||
return dependencyUids;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
File configFile = new File(Forestry.instance.getConfigFolder(), CONFIG_CATEGORY + ".cfg");
|
||||
loadConfig(configFile);
|
||||
|
||||
PluginCore.rootCommand.addChildCommand(new CommandButterfly());
|
||||
|
||||
EntityUtil.registerEntity(EntityButterfly.class, "butterflyGE", 0, 0x000000, 0xffffff, 50, 1, true);
|
||||
proxy.initializeRendering();
|
||||
|
||||
MothDefinition.initMoths();
|
||||
ButterflyDefinition.initButterflies();
|
||||
|
||||
blocks.lepidopterology.init();
|
||||
|
||||
TreeManager.treeRoot.registerLeafTickHandler(new ButterflySpawner());
|
||||
|
||||
RecipeSorter.register("forestry:lepidopterologymating", MatingRecipe.class, RecipeSorter.Category.SHAPELESS, "before:minecraft:shapeless");
|
||||
}
|
||||
|
||||
private static void loadConfig(File configFile) {
|
||||
LocalizedConfiguration config = new LocalizedConfiguration(configFile, "1.0.0");
|
||||
|
||||
spawnConstraint = config.getIntLocalized("butterfly.entities", "spawn.limit", spawnConstraint, 0, 500);
|
||||
entityConstraint = config.getIntLocalized("butterfly.entities", "maximum", entityConstraint, 0, 5000);
|
||||
allowPollination = config.getBooleanLocalized("butterfly.entities", "pollination", allowPollination);
|
||||
|
||||
config.save();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
CraftingManager.getInstance().getRecipeList().add(new MatingRecipe());
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Fluids.WATER.getFluid(2000), null, items.flutterlyzer.getItemStack(),
|
||||
"X#X", "X#X", "RDR", '#', "paneGlass", 'X', "ingotBronze", 'R',
|
||||
"dustRedstone", 'D', "gemDiamond");
|
||||
|
||||
RecipeUtil.addRecipe(blocks.lepidopterology.get(BlockTypeLepidopterologyTesr.LEPICHEST),
|
||||
" # ",
|
||||
"XYX",
|
||||
"XXX",
|
||||
'#', "blockGlass",
|
||||
'X', new ItemStack(items.butterflyGE, 1, OreDictionary.WILDCARD_VALUE),
|
||||
'Y', "chestWood");
|
||||
}
|
||||
|
||||
public static boolean isPollinationAllowed() {
|
||||
return allowPollination;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void textureHook(TextureStitchEvent.Pre event) {
|
||||
ItemButterflyGE.registerSprites();
|
||||
}
|
||||
}
|
||||
@@ -1,160 +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 net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import forestry.api.mail.EnumAddressee;
|
||||
import forestry.api.mail.PostManager;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.apiculture.items.ItemRegistryApiculture;
|
||||
import forestry.core.ISaveEventHandler;
|
||||
import forestry.core.circuits.EnumCircuitBoardType;
|
||||
import forestry.core.config.Config;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.items.EnumElectronTube;
|
||||
import forestry.core.network.IPacketRegistry;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.mail.EventHandlerMailAlert;
|
||||
import forestry.mail.PostRegistry;
|
||||
import forestry.mail.PostalCarrier;
|
||||
import forestry.mail.SaveEventHandlerMail;
|
||||
import forestry.mail.blocks.BlockRegistryMail;
|
||||
import forestry.mail.blocks.BlockTypeMail;
|
||||
import forestry.mail.commands.CommandMail;
|
||||
import forestry.mail.items.EnumStampDefinition;
|
||||
import forestry.mail.items.ItemRegistryMail;
|
||||
import forestry.mail.network.PacketRegistryMail;
|
||||
import forestry.mail.triggers.MailTriggers;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.MAIL, name = "Mail", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.mail.description")
|
||||
public class PluginMail extends BlankForestryPlugin {
|
||||
public static ItemRegistryMail items;
|
||||
public static BlockRegistryMail blocks;
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
PostManager.postRegistry = new PostRegistry();
|
||||
PostManager.postRegistry.registerCarrier(new PostalCarrier(EnumAddressee.PLAYER));
|
||||
PostManager.postRegistry.registerCarrier(new PostalCarrier(EnumAddressee.TRADER));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
items = new ItemRegistryMail();
|
||||
blocks = new BlockRegistryMail();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
super.preInit();
|
||||
|
||||
PluginCore.rootCommand.addChildCommand(new CommandMail());
|
||||
|
||||
if (Config.mailAlertEnabled) {
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandlerMailAlert());
|
||||
}
|
||||
|
||||
blocks.mail.addDefinitions(BlockTypeMail.VALUES);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTriggers() {
|
||||
MailTriggers.initialize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void doInit() {
|
||||
super.doInit();
|
||||
|
||||
blocks.mail.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPacketRegistry getPacketRegistry() {
|
||||
return new PacketRegistryMail();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
Object stampGlue;
|
||||
Object letterGlue;
|
||||
|
||||
ItemRegistryApiculture beeItems = PluginApiculture.items;
|
||||
if (beeItems != null) {
|
||||
stampGlue = beeItems.honeyDrop;
|
||||
letterGlue = beeItems.propolis.getWildcard();
|
||||
} else {
|
||||
stampGlue = Items.slime_ball;
|
||||
letterGlue = Items.slime_ball;
|
||||
}
|
||||
|
||||
RecipeUtil.addShapelessRecipe(items.letters.getItemStack(), Items.paper, letterGlue);
|
||||
|
||||
if (Config.craftingStampsEnabled) {
|
||||
for (EnumStampDefinition stampDefinition : EnumStampDefinition.VALUES) {
|
||||
if (Config.collectorStamps.contains(stampDefinition.getName())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemStack stamps = items.stamps.get(stampDefinition, 9);
|
||||
|
||||
RecipeUtil.addRecipe(stamps,
|
||||
"XXX",
|
||||
"###",
|
||||
"ZZZ",
|
||||
'X', stampDefinition.getCraftingIngredient(),
|
||||
'#', Items.paper,
|
||||
'Z', stampGlue);
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.SEEDOIL.getFluid(300), null, stamps,
|
||||
"XXX",
|
||||
"###",
|
||||
'X', stampDefinition.getCraftingIngredient(),
|
||||
'#', Items.paper);
|
||||
}
|
||||
}
|
||||
|
||||
// Recycling
|
||||
RecipeUtil.addRecipe(new ItemStack(Items.paper), "###", '#', ItemRegistryMail.emptiedLetterOreDict);
|
||||
|
||||
// Carpenter
|
||||
RecipeManagers.carpenterManager.addRecipe(10, Fluids.WATER.getFluid(250), null, items.letters.getItemStack(), "###", "###", '#', PluginCore.items.woodPulp);
|
||||
|
||||
RecipeUtil.addShapelessRecipe(items.catalogue.getItemStack(), items.stamps.getWildcard(), new ItemStack(Items.book));
|
||||
|
||||
RecipeUtil.addRecipe(blocks.mail.get(BlockTypeMail.MAILBOX),
|
||||
" # ",
|
||||
"#Y#",
|
||||
"XXX",
|
||||
'#', "ingotTin",
|
||||
'X', "chestWood",
|
||||
'Y', PluginCore.items.sturdyCasing);
|
||||
|
||||
RecipeUtil.addRecipe(blocks.mail.get(BlockTypeMail.TRADE_STATION),
|
||||
"Z#Z",
|
||||
"#Y#",
|
||||
"XWX",
|
||||
'#', PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1),
|
||||
'X', "chestWood",
|
||||
'Y', PluginCore.items.sturdyCasing,
|
||||
'Z', PluginCore.items.tubes.get(EnumElectronTube.IRON, 1),
|
||||
'W', PluginCore.items.circuitboards.get(EnumCircuitBoardType.REFINED));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISaveEventHandler getSaveEventHandler() {
|
||||
return new SaveEventHandlerMail();
|
||||
}
|
||||
}
|
||||
@@ -46,6 +46,7 @@ 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;
|
||||
|
||||
|
||||
@@ -1,589 +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 java.awt.Color;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import net.minecraft.block.BlockBasePressurePlate;
|
||||
import net.minecraft.block.BlockButton;
|
||||
import net.minecraft.block.BlockChest;
|
||||
import net.minecraft.block.BlockDoor;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.BlockFenceGate;
|
||||
import net.minecraft.block.BlockFurnace;
|
||||
import net.minecraft.block.BlockLadder;
|
||||
import net.minecraft.block.BlockLever;
|
||||
import net.minecraft.block.BlockRedstoneDiode;
|
||||
import net.minecraft.block.BlockSlab;
|
||||
import net.minecraft.block.BlockStairs;
|
||||
import net.minecraft.block.BlockTorch;
|
||||
import net.minecraft.block.BlockTrapDoor;
|
||||
import net.minecraft.block.BlockWall;
|
||||
import net.minecraft.block.BlockWorkbench;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.client.resources.model.ModelBakery;
|
||||
import net.minecraft.client.resources.model.ModelResourceLocation;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemDoor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
|
||||
import net.minecraftforge.fml.common.event.FMLInterModComms.IMCMessage;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import forestry.Forestry;
|
||||
import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.api.storage.BackpackManager;
|
||||
import forestry.api.storage.IBackpackDefinition;
|
||||
import forestry.api.storage.StorageManager;
|
||||
import forestry.apiculture.blocks.BlockRegistryApiculture;
|
||||
import forestry.core.IPickupHandler;
|
||||
import forestry.core.IResupplyHandler;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.config.LocalizedConfiguration;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.items.ItemCrated;
|
||||
import forestry.core.models.ModelCrate;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.IMCUtil;
|
||||
import forestry.core.utils.ItemStackUtil;
|
||||
import forestry.core.utils.Log;
|
||||
import forestry.core.utils.StringUtil;
|
||||
import forestry.lepidopterology.blocks.BlockRegistryLepidopterology;
|
||||
import forestry.lepidopterology.blocks.BlockTypeLepidopterologyTesr;
|
||||
import forestry.storage.BackpackDefinition;
|
||||
import forestry.storage.BackpackDefinition.BackpackDefinitionApiarist;
|
||||
import forestry.storage.BackpackDefinition.BackpackDefinitionLepidopterist;
|
||||
import forestry.storage.BackpackInterface;
|
||||
import forestry.storage.CrateRegistry;
|
||||
import forestry.storage.PickupHandlerStorage;
|
||||
import forestry.storage.ResupplyHandler;
|
||||
import forestry.storage.items.ItemRegistryStorage;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.STORAGE, name = "Storage", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.storage.description")
|
||||
public class PluginStorage extends BlankForestryPlugin {
|
||||
|
||||
private static final List<ItemCrated> crates = new ArrayList<>();
|
||||
private static final String CONFIG_CATEGORY = "backpacks";
|
||||
|
||||
private final ArrayList<ItemStack> minerItems = new ArrayList<>();
|
||||
private final ArrayList<ItemStack> diggerItems = new ArrayList<>();
|
||||
private final ArrayList<ItemStack> foresterItems = new ArrayList<>();
|
||||
private final ArrayList<ItemStack> hunterItems = new ArrayList<>();
|
||||
private final ArrayList<ItemStack> adventurerItems = new ArrayList<>();
|
||||
private final ArrayList<ItemStack> builderItems = new ArrayList<>();
|
||||
|
||||
public static ItemRegistryStorage items;
|
||||
|
||||
@Override
|
||||
public void setupAPI() {
|
||||
super.setupAPI();
|
||||
|
||||
StorageManager.crateRegistry = new CrateRegistry();
|
||||
|
||||
BackpackManager.backpackInterface = new BackpackInterface();
|
||||
|
||||
BackpackManager.backpackItems = new ArrayList[6];
|
||||
|
||||
BackpackManager.backpackItems[0] = minerItems;
|
||||
BackpackManager.backpackItems[1] = diggerItems;
|
||||
BackpackManager.backpackItems[2] = foresterItems;
|
||||
BackpackManager.backpackItems[3] = hunterItems;
|
||||
BackpackManager.backpackItems[4] = adventurerItems;
|
||||
BackpackManager.backpackItems[5] = builderItems;
|
||||
|
||||
BackpackDefinition definition;
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.APICULTURE)) {
|
||||
definition = new BackpackDefinitionApiarist(new Color(0xc4923d).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
}
|
||||
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.LEPIDOPTEROLOGY)) {
|
||||
definition = new BackpackDefinitionLepidopterist(new Color(0x995b31).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
}
|
||||
|
||||
definition = new BackpackDefinition("miner", new Color(0x36187d).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("digger", new Color(0x363cc5).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("forester", new Color(0x347427).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("hunter", new Color(0x412215).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("adventurer", new Color(0x7fb8c2).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
definition = new BackpackDefinition("builder", new Color(0xdd3a3a).getRGB());
|
||||
BackpackManager.definitions.put(definition.getKey(), definition);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disabledSetupAPI() {
|
||||
BackpackManager.backpackItems = new ArrayList[6];
|
||||
BackpackManager.backpackItems[0] = minerItems;
|
||||
BackpackManager.backpackItems[1] = diggerItems;
|
||||
BackpackManager.backpackItems[2] = foresterItems;
|
||||
BackpackManager.backpackItems[3] = hunterItems;
|
||||
BackpackManager.backpackItems[4] = adventurerItems;
|
||||
BackpackManager.backpackItems[5] = builderItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerItemsAndBlocks() {
|
||||
items = new ItemRegistryStorage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
final String newConfig = CONFIG_CATEGORY + ".cfg";
|
||||
|
||||
File configFile = new File(Forestry.instance.getConfigFolder(), newConfig);
|
||||
if (!configFile.exists()) {
|
||||
setDefaultsForConfig();
|
||||
}
|
||||
|
||||
LocalizedConfiguration config = new LocalizedConfiguration(configFile, "1.0.0");
|
||||
|
||||
handleBackpackConfig(config, "miner");
|
||||
handleBackpackConfig(config, "digger");
|
||||
handleBackpackConfig(config, "forester");
|
||||
handleBackpackConfig(config, "hunter");
|
||||
handleBackpackConfig(config, "adventurer");
|
||||
handleBackpackConfig(config, "builder");
|
||||
|
||||
config.save();
|
||||
|
||||
BackpackDefinition forester = (BackpackDefinition) BackpackManager.definitions.get("forester");
|
||||
forester.addValidBlockClasses(Arrays.<Class>asList(
|
||||
IPlantable.class,
|
||||
IGrowable.class,
|
||||
IShearable.class
|
||||
));
|
||||
forester.addValidItemClasses(Arrays.<Class>asList(
|
||||
IPlantable.class,
|
||||
IGrowable.class
|
||||
));
|
||||
|
||||
BackpackDefinition builder = (BackpackDefinition) BackpackManager.definitions.get("builder");
|
||||
builder.addValidBlockClasses(Arrays.<Class>asList(
|
||||
BlockStairs.class,
|
||||
BlockFence.class,
|
||||
BlockFenceGate.class,
|
||||
BlockWall.class,
|
||||
BlockBasePressurePlate.class,
|
||||
BlockLever.class,
|
||||
BlockButton.class,
|
||||
BlockTorch.class,
|
||||
BlockRedstoneDiode.class,
|
||||
BlockChest.class,
|
||||
BlockWorkbench.class,
|
||||
BlockFurnace.class,
|
||||
BlockLadder.class,
|
||||
BlockTrapDoor.class,
|
||||
BlockDoor.class,
|
||||
BlockSlab.class
|
||||
));
|
||||
builder.addValidItemClass(ItemDoor.class);
|
||||
}
|
||||
|
||||
private void setDefaultsForConfig() {
|
||||
|
||||
final BackpackDefinition miner = (BackpackDefinition) BackpackManager.definitions.get("miner");
|
||||
final BackpackDefinition digger = (BackpackDefinition) BackpackManager.definitions.get("digger");
|
||||
final BackpackDefinition forester = (BackpackDefinition) BackpackManager.definitions.get("forester");
|
||||
final BackpackDefinition adventurer = (BackpackDefinition) BackpackManager.definitions.get("adventurer");
|
||||
final BackpackDefinition builder = (BackpackDefinition) BackpackManager.definitions.get("builder");
|
||||
final BackpackDefinition hunter = (BackpackDefinition) BackpackManager.definitions.get("hunter");
|
||||
|
||||
miner.addValidItems(minerItems);
|
||||
digger.addValidItems(diggerItems);
|
||||
forester.addValidItems(foresterItems);
|
||||
hunter.addValidItems(hunterItems);
|
||||
adventurer.addValidItems(adventurerItems);
|
||||
builder.addValidItems(builderItems);
|
||||
|
||||
final Pattern minerOreDictPattern = Pattern.compile("(ore|dust|gem|ingot|nugget|crushed|cluster|denseore)[A-Z].*");
|
||||
final Pattern diggerOreDictPattern = Pattern.compile("(stone)[A-Z].*");
|
||||
final Pattern foresterOreDictPattern = Pattern.compile("(crop|seed|tree)[A-Z].*");
|
||||
final Pattern builderOreDictPattern = Pattern.compile("(block|paneGlass|slabWood|stainedClay|stainedGlass)[A-Z].*");
|
||||
|
||||
final List<String> minerOreDictNames = new ArrayList<>();
|
||||
final List<String> diggerOreDictNames = new ArrayList<>(Arrays.asList(
|
||||
"cobblestone",
|
||||
"stone",
|
||||
"sand"
|
||||
));
|
||||
final List<String> foresterOreDictNames = new ArrayList<>(Arrays.asList(
|
||||
"logWood",
|
||||
"stickWood",
|
||||
"woodStick",
|
||||
"saplingTree"
|
||||
));
|
||||
final List<String> builderOreDictNames = new ArrayList<>(Arrays.asList(
|
||||
"stone",
|
||||
"plankWood",
|
||||
"stairWood",
|
||||
"slabWood",
|
||||
"fenceWood",
|
||||
"glass",
|
||||
"blockGlass",
|
||||
"paneGlass"
|
||||
));
|
||||
|
||||
for (String name : OreDictionary.getOreNames()) {
|
||||
if (minerOreDictPattern.matcher(name).matches()) {
|
||||
minerOreDictNames.add(name);
|
||||
} else if (diggerOreDictPattern.matcher(name).matches()) {
|
||||
if (name.equals("stoneRod")) {
|
||||
continue;
|
||||
}
|
||||
diggerOreDictNames.add(name);
|
||||
} else if (foresterOreDictPattern.matcher(name).matches()) {
|
||||
foresterOreDictNames.add(name);
|
||||
} else if (builderOreDictPattern.matcher(name).matches()) {
|
||||
if (name.equals("blockHopper")) {
|
||||
continue;
|
||||
}
|
||||
builderOreDictNames.add(name);
|
||||
}
|
||||
}
|
||||
|
||||
miner.addValidOreDictNames(minerOreDictNames);
|
||||
miner.addValidItems(Arrays.asList(
|
||||
new ItemStack(Blocks.obsidian),
|
||||
new ItemStack(Blocks.coal_ore),
|
||||
new ItemStack(Items.coal),
|
||||
PluginCore.items.bronzePickaxe.getItemStack(),
|
||||
PluginCore.items.kitPickaxe.getItemStack(),
|
||||
PluginCore.items.brokenBronzePickaxe.getItemStack()
|
||||
));
|
||||
|
||||
digger.addValidOreDictNames(diggerOreDictNames);
|
||||
digger.addValidItems(Arrays.asList(
|
||||
new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Blocks.gravel),
|
||||
new ItemStack(Items.flint),
|
||||
new ItemStack(Blocks.netherrack),
|
||||
new ItemStack(Blocks.sandstone, 1, 0),
|
||||
new ItemStack(Items.clay_ball),
|
||||
new ItemStack(Blocks.soul_sand),
|
||||
PluginCore.items.bronzeShovel.getItemStack(),
|
||||
PluginCore.items.kitShovel.getItemStack(),
|
||||
PluginCore.items.brokenBronzeShovel.getItemStack()
|
||||
));
|
||||
|
||||
forester.addValidOreDictNames(foresterOreDictNames);
|
||||
forester.addValidItems(Arrays.asList(
|
||||
new ItemStack(Blocks.red_mushroom),
|
||||
new ItemStack(Blocks.brown_mushroom),
|
||||
new ItemStack(Blocks.red_flower),
|
||||
new ItemStack(Blocks.yellow_flower),
|
||||
new ItemStack(Blocks.cactus),
|
||||
new ItemStack(Blocks.tallgrass, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Blocks.vine),
|
||||
new ItemStack(Blocks.pumpkin),
|
||||
new ItemStack(Blocks.melon_block),
|
||||
new ItemStack(Items.golden_apple),
|
||||
new ItemStack(Items.nether_wart),
|
||||
new ItemStack(Items.pumpkin_seeds),
|
||||
new ItemStack(Items.melon_seeds)
|
||||
));
|
||||
|
||||
hunter.addValidItems(Arrays.asList(
|
||||
new ItemStack(Items.feather),
|
||||
new ItemStack(Items.gunpowder),
|
||||
new ItemStack(Items.blaze_powder),
|
||||
new ItemStack(Items.blaze_rod),
|
||||
new ItemStack(Items.bone),
|
||||
new ItemStack(Items.string),
|
||||
new ItemStack(Items.rotten_flesh),
|
||||
new ItemStack(Items.ghast_tear),
|
||||
new ItemStack(Items.gold_nugget),
|
||||
new ItemStack(Items.arrow),
|
||||
new ItemStack(Items.porkchop),
|
||||
new ItemStack(Items.cooked_porkchop),
|
||||
new ItemStack(Items.beef),
|
||||
new ItemStack(Items.cooked_beef),
|
||||
new ItemStack(Items.chicken),
|
||||
new ItemStack(Items.cooked_chicken),
|
||||
new ItemStack(Items.leather),
|
||||
new ItemStack(Items.egg),
|
||||
new ItemStack(Items.ender_pearl),
|
||||
new ItemStack(Items.spider_eye),
|
||||
new ItemStack(Items.fermented_spider_eye),
|
||||
new ItemStack(Items.slime_ball),
|
||||
new ItemStack(Items.dye, 1, 0),
|
||||
new ItemStack(Blocks.hay_block),
|
||||
new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Items.ender_eye),
|
||||
new ItemStack(Items.magma_cream),
|
||||
new ItemStack(Items.speckled_melon),
|
||||
new ItemStack(Items.fish),
|
||||
new ItemStack(Items.cooked_fish),
|
||||
new ItemStack(Items.lead),
|
||||
new ItemStack(Items.fishing_rod),
|
||||
new ItemStack(Items.name_tag),
|
||||
new ItemStack(Items.saddle),
|
||||
new ItemStack(Items.diamond_horse_armor),
|
||||
new ItemStack(Items.golden_horse_armor),
|
||||
new ItemStack(Items.iron_horse_armor)
|
||||
));
|
||||
|
||||
builder.addValidOreDictNames(builderOreDictNames);
|
||||
builder.addValidItems(Arrays.asList(
|
||||
new ItemStack(Blocks.torch),
|
||||
new ItemStack(Blocks.redstone_torch),
|
||||
new ItemStack(Blocks.redstone_lamp),
|
||||
new ItemStack(Blocks.stonebrick, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Blocks.sandstone, 1, 1),
|
||||
new ItemStack(Blocks.sandstone, 1, 2),
|
||||
new ItemStack(Blocks.brick_block),
|
||||
new ItemStack(Blocks.clay),
|
||||
new ItemStack(Blocks.hardened_clay, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Blocks.stained_hardened_clay, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Blocks.packed_ice),
|
||||
new ItemStack(Blocks.nether_brick),
|
||||
new ItemStack(Blocks.crafting_table),
|
||||
new ItemStack(Blocks.furnace),
|
||||
new ItemStack(Blocks.lever),
|
||||
new ItemStack(Blocks.dispenser),
|
||||
new ItemStack(Blocks.dropper),
|
||||
new ItemStack(Blocks.ladder),
|
||||
new ItemStack(Blocks.iron_bars),
|
||||
new ItemStack(Blocks.quartz_block, 1, OreDictionary.WILDCARD_VALUE),
|
||||
new ItemStack(Items.sign),
|
||||
new ItemStack(Items.item_frame)
|
||||
));
|
||||
|
||||
BlockRegistryApiculture beeBlocks = PluginApiculture.blocks;
|
||||
if (beeBlocks != null) {
|
||||
builder.addValidItem(new ItemStack(beeBlocks.candle, 1, OreDictionary.WILDCARD_VALUE));
|
||||
builder.addValidItem(new ItemStack(beeBlocks.stump, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
}
|
||||
|
||||
private static void handleBackpackConfig(LocalizedConfiguration config, String backpackName) {
|
||||
BackpackDefinition backpackDefinition = (BackpackDefinition) BackpackManager.definitions.get(backpackName);
|
||||
|
||||
List<ItemStack> backpackItems;
|
||||
List<String> backpackOreDict = new ArrayList<>();
|
||||
|
||||
{
|
||||
List<String> validItems = new ArrayList<>(backpackDefinition.getValidItemStacks());
|
||||
Collections.sort(validItems);
|
||||
String[] defaultValidItems = validItems.toArray(new String[validItems.size()]);
|
||||
|
||||
Property backpackConf = config.get("backpacks." + backpackName, "item.stacks", defaultValidItems);
|
||||
backpackConf.comment = StringUtil.localizeAndFormat("config.backpacks.item.stacks.format", backpackName);
|
||||
|
||||
String[] backpackItemList = backpackConf.getStringList();
|
||||
backpackItems = ItemStackUtil.parseItemStackStrings(backpackItemList, OreDictionary.WILDCARD_VALUE);
|
||||
}
|
||||
|
||||
{
|
||||
List<Integer> oreIds = new ArrayList<>(backpackDefinition.getValidOreIds());
|
||||
String[] defaultOreNames = new String[oreIds.size()];
|
||||
for (int i = 0; i < oreIds.size(); i++) {
|
||||
int oreId = oreIds.get(i);
|
||||
defaultOreNames[i] = OreDictionary.getOreName(oreId);
|
||||
}
|
||||
|
||||
List<String> defaultOreNamesList = new ArrayList<>();
|
||||
Collections.addAll(defaultOreNamesList, defaultOreNames);
|
||||
Collections.sort(defaultOreNamesList);
|
||||
defaultOreNames = defaultOreNamesList.toArray(new String[defaultOreNamesList.size()]);
|
||||
|
||||
Property backpackConf = config.get("backpacks." + backpackName, "ore.dict", defaultOreNames);
|
||||
backpackConf.comment = StringUtil.localizeAndFormat("config.backpacks.ore.dict.format", backpackName);
|
||||
|
||||
String[] oreDictNameList = backpackConf.getStringList();
|
||||
Collections.addAll(backpackOreDict, oreDictNameList);
|
||||
}
|
||||
|
||||
backpackDefinition.clearAllValid();
|
||||
|
||||
backpackDefinition.addValidItems(backpackItems);
|
||||
backpackDefinition.addValidOreDictNames(backpackOreDict);
|
||||
}
|
||||
|
||||
public static void registerCrate(ItemCrated crate) {
|
||||
crates.add(crate);
|
||||
}
|
||||
|
||||
public static void createCrateRecipes() {
|
||||
for (ItemCrated crate : crates) {
|
||||
ItemStack crateStack = new ItemStack(crate);
|
||||
ItemStack uncrated = crate.getContained();
|
||||
if (crate.usesOreDict()) {
|
||||
int[] oreIds = OreDictionary.getOreIDs(uncrated);
|
||||
for (int oreId : oreIds) {
|
||||
String oreName = OreDictionary.getOreName(oreId);
|
||||
addCrating(crateStack, oreName);
|
||||
}
|
||||
} else {
|
||||
addCrating(crateStack, uncrated);
|
||||
}
|
||||
addUncrating(crateStack, uncrated);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addCrating(ItemStack crateStack, Object uncrated) {
|
||||
FluidStack water = Fluids.WATER.getFluid(Constants.CARPENTER_CRATING_LIQUID_QUANTITY);
|
||||
ItemStack box = items.crate.getItemStack();
|
||||
RecipeManagers.carpenterManager.addRecipe(Constants.CARPENTER_CRATING_CYCLES, water, box, crateStack, "###", "###", "###", '#', uncrated);
|
||||
}
|
||||
|
||||
private static void addUncrating(ItemStack crateStack, ItemStack uncrated) {
|
||||
ItemStack product = new ItemStack(uncrated.getItem(), 9, uncrated.getItemDamage());
|
||||
RecipeManagers.carpenterManager.addRecipe(Constants.CARPENTER_UNCRATING_CYCLES, null, product, "#", '#', crateStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean processIMCMessage(IMCMessage message) {
|
||||
if (message.key.equals("add-backpack-items")) {
|
||||
String[] tokens = message.getStringValue().split("@");
|
||||
if (tokens.length != 2) {
|
||||
IMCUtil.logInvalidIMCMessage(message);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!BackpackManager.definitions.containsKey(tokens[0])) {
|
||||
String errorMessage = IMCUtil.getInvalidIMCMessageText(message);
|
||||
Log.warning("%s For non-existent backpack %s.", errorMessage, tokens[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
IBackpackDefinition backpackDefinition = BackpackManager.definitions.get(tokens[0]);
|
||||
List<ItemStack> itemStacks = ItemStackUtil.parseItemStackStrings(tokens[1], 0);
|
||||
backpackDefinition.addValidItems(itemStacks);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPickupHandler getPickupHandler() {
|
||||
return new PickupHandlerStorage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IResupplyHandler getResupplyHandler() {
|
||||
return new ResupplyHandler();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRecipes() {
|
||||
BlockRegistryApiculture beeBlocks = PluginApiculture.blocks;
|
||||
if (items.apiaristBackpack != null && beeBlocks != null) {
|
||||
addBackpackRecipe(items.apiaristBackpack, "stickWood", beeBlocks.apicultureChest);
|
||||
}
|
||||
|
||||
BlockRegistryLepidopterology butterflyBlocks = PluginLepidopterology.blocks;
|
||||
if (items.lepidopteristBackpack != null && butterflyBlocks != null) {
|
||||
ItemStack chest = butterflyBlocks.lepidopterology.get(BlockTypeLepidopterologyTesr.LEPICHEST);
|
||||
addBackpackRecipe(items.lepidopteristBackpack, "stickWood", chest);
|
||||
}
|
||||
|
||||
addBackpackRecipe(items.minerBackpack, "ingotIron");
|
||||
addBackpackRecipe(items.diggerBackpack, "stone");
|
||||
addBackpackRecipe(items.foresterBackpack, "logWood");
|
||||
addBackpackRecipe(items.hunterBackpack, Items.feather);
|
||||
addBackpackRecipe(items.adventurerBackpack, Items.bone);
|
||||
addBackpackRecipe(items.builderBackpack, Items.clay_ball);
|
||||
|
||||
// / CARPENTER
|
||||
if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.FACTORY)) {
|
||||
// / CRATES
|
||||
RecipeManagers.carpenterManager.addRecipe(20, Fluids.WATER.getFluid(1000), null, items.crate.getItemStack(24),
|
||||
" # ", "# #", " # ", '#', "logWood");
|
||||
|
||||
// / BACKPACKS T2
|
||||
addT2BackpackRecipe(items.minerBackpack, items.minerBackpackT2);
|
||||
addT2BackpackRecipe(items.diggerBackpack, items.diggerBackpackT2);
|
||||
addT2BackpackRecipe(items.foresterBackpack, items.foresterBackpackT2);
|
||||
addT2BackpackRecipe(items.hunterBackpack, items.hunterBackpackT2);
|
||||
addT2BackpackRecipe(items.adventurerBackpack, items.adventurerBackpackT2);
|
||||
addT2BackpackRecipe(items.builderBackpack, items.builderBackpackT2);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addBackpackRecipe(Item backpack, Object material) {
|
||||
addBackpackRecipe(backpack, material, "chestWood");
|
||||
}
|
||||
|
||||
private static void addBackpackRecipe(Item backpack, Object material, Object chest) {
|
||||
RecipeUtil.addRecipe(backpack,
|
||||
"X#X",
|
||||
"VYV",
|
||||
"X#X",
|
||||
'#', Blocks.wool,
|
||||
'X', Items.string,
|
||||
'V', material,
|
||||
'Y', chest);
|
||||
}
|
||||
|
||||
private static void addT2BackpackRecipe(Item backpackT1, Item backpackT2) {
|
||||
ItemStack wovenSilk = PluginCore.items.craftingMaterial.getWovenSilk();
|
||||
RecipeManagers.carpenterManager.addRecipe(200, Fluids.WATER.getFluid(1000), null, new ItemStack(backpackT2),
|
||||
"WXW",
|
||||
"WTW",
|
||||
"WWW",
|
||||
'X', "gemDiamond",
|
||||
'W', wovenSilk,
|
||||
'T', backpackT1);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onBakeModel(ModelBakeEvent event) {
|
||||
try {
|
||||
ModelCrate.crateModel = ModelLoaderRegistry.getModel(new ModelResourceLocation("forestry:crate-filled", "inventory"));
|
||||
ModelCrate.MODEL_GENERATED = ObfuscationReflectionHelper.getPrivateValue(ModelBakery.class, event.modelLoader, 14);
|
||||
ModelCrate.MODEL_COMPASS = ObfuscationReflectionHelper.getPrivateValue(ModelBakery.class, event.modelLoader, 15);
|
||||
ModelCrate.MODEL_CLOCK = ObfuscationReflectionHelper.getPrivateValue(ModelBakery.class, event.modelLoader, 16);
|
||||
ModelCrate.loader = event.modelLoader;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,6 +26,7 @@ import forestry.api.core.ForestryAPI;
|
||||
import forestry.api.farming.Farmables;
|
||||
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;
|
||||
@@ -38,7 +39,6 @@ import forestry.farming.logic.FarmableGenericSapling;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.plugins.PluginCore;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.BIOMES_O_PLENTY, name = "BiomesOPlenty", author = "Nirek", url = Constants.URL, unlocalizedDescription = "for.plugin.biomesoplenty.description")
|
||||
public class PluginBiomesOPlenty extends BlankForestryPlugin {
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
|
||||
import forestry.core.PluginCore;
|
||||
import forestry.core.config.Constants;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.Log;
|
||||
@@ -22,7 +23,6 @@ import forestry.core.utils.ModUtil;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.plugins.PluginCore;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.BUILDCRAFT_TRANSPORT, name = "BuildCraft 6 Transport", author = "mezz", url = Constants.URL, unlocalizedDescription = "for.plugin.buildcraft6.description")
|
||||
public class PluginBuildCraftTransport extends BlankForestryPlugin {
|
||||
|
||||
@@ -29,6 +29,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.config.Constants;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
@@ -38,7 +39,6 @@ import forestry.farming.logic.FarmableGenericCrop;
|
||||
import forestry.plugins.BlankForestryPlugin;
|
||||
import forestry.plugins.ForestryPlugin;
|
||||
import forestry.plugins.ForestryPluginUids;
|
||||
import forestry.plugins.PluginCore;
|
||||
|
||||
@ForestryPlugin(pluginID = ForestryPluginUids.NATURA, name = "Natura", author = "SirSengir", url = Constants.URL, unlocalizedDescription = "for.plugin.natura.description")
|
||||
public class PluginNatura extends BlankForestryPlugin {
|
||||
|
||||
Reference in new issue
Block a user