Get things compiling.

Move ForestryAPI into the Forestry project instead of as a submodule
Include the new RF API
Remove code for mods that have not yet ported to 1.8.9 (add it back later)
Bump version to 5.0.0
This commit is contained in:
mezz committed 2016-02-20 19:51:49 -08:00
1 parent 73812d8765
commit 8da0c0dc95
325 files changed
+9600 -4026

No files matched your search

@@ -1,62 +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.factory.recipes.craftguide;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidContainerRegistry;
import forestry.factory.blocks.BlockFactoryTesrType;
import forestry.factory.recipes.BottlerRecipe;
import forestry.plugins.PluginFactory;
import uristqwerty.CraftGuide.api.ItemSlot;
import uristqwerty.CraftGuide.api.LiquidSlot;
import uristqwerty.CraftGuide.api.RecipeGenerator;
import uristqwerty.CraftGuide.api.RecipeProvider;
import uristqwerty.CraftGuide.api.RecipeTemplate;
import uristqwerty.CraftGuide.api.Slot;
import uristqwerty.CraftGuide.api.SlotType;
public class CraftGuideBottler implements RecipeProvider {
private final Slot[] slots = new Slot[4];
public CraftGuideBottler() {
slots[0] = new ItemSlot(12, 12, 16, 16).drawOwnBackground();
slots[1] = new LiquidSlot(12, 30);
slots[2] = new ItemSlot(50, 21, 16, 16).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground();
slots[3] = new ItemSlot(31, 21, 16, 16).setSlotType(SlotType.MACHINE_SLOT);
}
@Override
public void generateRecipes(RecipeGenerator generator) {
if (PluginFactory.blocks.factoryTESR == null) {
return;
}
ItemStack machine = PluginFactory.blocks.factoryTESR.get(BlockFactoryTesrType.BOTTLER);
RecipeTemplate template = generator.createRecipeTemplate(slots, machine);
for (FluidContainerRegistry.FluidContainerData container : FluidContainerRegistry.getRegisteredFluidContainerData()) {
BottlerRecipe recipe = BottlerRecipe.getRecipe(container.fluid, container.emptyContainer);
if (recipe != null) {
Object[] array = new Object[4];
array[0] = recipe.empty;
array[1] = recipe.input;
array[2] = recipe.filled;
array[3] = machine;
generator.addRecipe(template, array);
}
}
}
}
@@ -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.factory.recipes.craftguide;
import net.minecraft.item.ItemStack;
import forestry.api.recipes.ICarpenterRecipe;
import forestry.api.recipes.RecipeManagers;
import forestry.core.recipes.RecipeUtil;
import forestry.factory.blocks.BlockFactoryTesrType;
import forestry.plugins.PluginFactory;
import uristqwerty.CraftGuide.api.ItemSlot;
import uristqwerty.CraftGuide.api.LiquidSlot;
import uristqwerty.CraftGuide.api.RecipeGenerator;
import uristqwerty.CraftGuide.api.RecipeProvider;
import uristqwerty.CraftGuide.api.RecipeTemplate;
import uristqwerty.CraftGuide.api.Slot;
import uristqwerty.CraftGuide.api.SlotType;
public class CraftGuideCarpenter implements RecipeProvider {
private final Slot[] slots = new Slot[12];
public CraftGuideCarpenter() {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
slots[i + j * 3] = new ItemSlot(i * 18 + 3, j * 18 + 3, 16, 16).drawOwnBackground();
}
}
slots[9] = new ItemSlot(59, 21, 16, 16, true).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground();
slots[10] = new LiquidSlot(59, 39);
slots[11] = new ItemSlot(59, 3, 16, 16).setSlotType(SlotType.MACHINE_SLOT);
}
@Override
public void generateRecipes(RecipeGenerator generator) {
if (PluginFactory.blocks.factoryTESR == null) {
return;
}
ItemStack machine = PluginFactory.blocks.factoryTESR.get(BlockFactoryTesrType.CARPENTER);
RecipeTemplate template = generator.createRecipeTemplate(slots, machine);
for (ICarpenterRecipe recipe : RecipeManagers.carpenterManager.recipes()) {
Object[] array = new Object[12];
Object[] flattened = RecipeUtil.getCraftingRecipeAsArray(recipe.getCraftingGridRecipe());
if (flattened == null) {
flattened = generator.getCraftingRecipe(recipe.getCraftingGridRecipe());
}
if (flattened == null) {
continue;
}
System.arraycopy(flattened, 0, array, 0, flattened.length);
if (recipe.getFluidResource() != null) {
array[10] = recipe.getFluidResource();
}
array[11] = machine;
generator.addRecipe(template, array);
}
}
}
@@ -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.factory.recipes.craftguide;
import java.util.ArrayList;
import java.util.List;
import java.util.Map.Entry;
import net.minecraft.item.ItemStack;
import forestry.api.recipes.ICentrifugeRecipe;
import forestry.api.recipes.RecipeManagers;
import forestry.factory.blocks.BlockFactoryTesrType;
import forestry.plugins.PluginFactory;
import uristqwerty.CraftGuide.api.ChanceSlot;
import uristqwerty.CraftGuide.api.ItemSlot;
import uristqwerty.CraftGuide.api.RecipeGenerator;
import uristqwerty.CraftGuide.api.RecipeProvider;
import uristqwerty.CraftGuide.api.RecipeTemplate;
import uristqwerty.CraftGuide.api.Slot;
import uristqwerty.CraftGuide.api.SlotType;
public class CraftGuideCentrifuge implements RecipeProvider {
private final Slot[] slots = new Slot[11];
public CraftGuideCentrifuge() {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
slots[i + j * 3] = new ChanceSlot(i * 18 + 24, j * 18 + 3, 16, 16).setRatio(100).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground();
}
}
slots[9] = new ItemSlot(4, 31, 16, 16, true).drawOwnBackground();
slots[10] = new ItemSlot(4, 11, 16, 16).setSlotType(SlotType.MACHINE_SLOT);
}
@Override
public void generateRecipes(RecipeGenerator generator) {
if (PluginFactory.blocks.factoryTESR == null) {
return;
}
ItemStack machine = PluginFactory.blocks.factoryTESR.get(BlockFactoryTesrType.CENTRIFUGE);
RecipeTemplate template = generator.createRecipeTemplate(slots, machine);
for (ICentrifugeRecipe recipe : RecipeManagers.centrifugeManager.recipes()) {
Object[] array = new Object[11];
List<Entry<ItemStack, Float>> entries = new ArrayList<>(recipe.getAllProducts().entrySet());
for (int i = 0; i < Math.min(entries.size(), 9); i++) {
Entry<ItemStack, Float> entry = entries.get(i);
array[i] = entry.getValue() > 0 ? new Object[]{entry.getKey(), entry.getValue()} : null;
}
array[9] = recipe.getInput();
array[10] = machine;
generator.addRecipe(template, array);
}
}
}
@@ -1,71 +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.factory.recipes.craftguide;
import net.minecraft.item.ItemStack;
import forestry.api.recipes.IFabricatorRecipe;
import forestry.api.recipes.RecipeManagers;
import forestry.factory.blocks.BlockFactoryPlainType;
import forestry.plugins.PluginFactory;
import uristqwerty.CraftGuide.api.ItemSlot;
import uristqwerty.CraftGuide.api.LiquidSlot;
import uristqwerty.CraftGuide.api.RecipeGenerator;
import uristqwerty.CraftGuide.api.RecipeProvider;
import uristqwerty.CraftGuide.api.RecipeTemplate;
import uristqwerty.CraftGuide.api.Slot;
import uristqwerty.CraftGuide.api.SlotType;
public class CraftGuideFabricator implements RecipeProvider {
private final Slot[] slots = new Slot[12];
public CraftGuideFabricator() {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
slots[i + j * 3] = new ItemSlot(i * 18 + 3, j * 18 + 3, 16, 16).drawOwnBackground();
}
}
slots[9] = new ItemSlot(59, 21, 16, 16, true).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground();
slots[10] = new LiquidSlot(59, 39);
slots[11] = new ItemSlot(59, 3, 16, 16).setSlotType(SlotType.MACHINE_SLOT);
}
@Override
public void generateRecipes(RecipeGenerator generator) {
if (PluginFactory.blocks.factoryPlain == null) {
return;
}
ItemStack machine = PluginFactory.blocks.factoryPlain.get(BlockFactoryPlainType.FABRICATOR);
RecipeTemplate template = generator.createRecipeTemplate(slots, machine);
for (IFabricatorRecipe recipe : RecipeManagers.fabricatorManager.recipes()) {
Object[] array = new Object[12];
Object[] recipeIngredients = recipe.getIngredients();
if (recipeIngredients == null) {
continue;
}
System.arraycopy(recipeIngredients, 0, array, 0, recipeIngredients.length);
array[9] = recipe.getRecipeOutput();
if (recipe.getLiquid() != null) {
array[10] = recipe.getLiquid();
}
array[11] = machine;
generator.addRecipe(template, array);
}
}
}
@@ -1,70 +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.factory.recipes.craftguide;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;
import forestry.api.fuels.FuelManager;
import forestry.api.recipes.IFermenterRecipe;
import forestry.api.recipes.RecipeManagers;
import forestry.factory.blocks.BlockFactoryTesrType;
import forestry.plugins.PluginFactory;
import uristqwerty.CraftGuide.api.ItemSlot;
import uristqwerty.CraftGuide.api.LiquidSlot;
import uristqwerty.CraftGuide.api.RecipeGenerator;
import uristqwerty.CraftGuide.api.RecipeProvider;
import uristqwerty.CraftGuide.api.RecipeTemplate;
import uristqwerty.CraftGuide.api.Slot;
import uristqwerty.CraftGuide.api.SlotType;
public class CraftGuideFermenter implements RecipeProvider {
private final Slot[] slots = new Slot[5];
public CraftGuideFermenter() {
slots[0] = new ItemSlot(3, 12, 16, 16, true);
slots[1] = new ItemSlot(3, 30, 16, 16, true);
slots[2] = new LiquidSlot(21, 21);
slots[3] = new LiquidSlot(59, 21).setSlotType(SlotType.OUTPUT_SLOT);
slots[4] = new ItemSlot(40, 21, 16, 16).setSlotType(SlotType.MACHINE_SLOT);
}
@Override
public void generateRecipes(RecipeGenerator generator) {
if (PluginFactory.blocks.factoryTESR == null) {
return;
}
ItemStack machine = PluginFactory.blocks.factoryTESR.get(BlockFactoryTesrType.FERMENTER);
RecipeTemplate template = generator.createRecipeTemplate(slots, machine);
List<Object> fuels = new ArrayList<Object>(FuelManager.fermenterFuel.keySet());
for (IFermenterRecipe recipe : RecipeManagers.fermenterManager.recipes()) {
Object[] array = new Object[5];
array[0] = recipe.getResource();
array[1] = fuels;
array[2] = recipe.getFluidResource();
int amount = Math.round(recipe.getFermentationValue() * recipe.getModifier());
FluidStack output = new FluidStack(recipe.getOutput(), amount);
array[3] = output;
array[4] = machine;
generator.addRecipe(template, array);
}
}
}
@@ -1,69 +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.factory.recipes.craftguide;
import net.minecraft.item.ItemStack;
import forestry.api.recipes.ISqueezerRecipe;
import forestry.api.recipes.RecipeManagers;
import forestry.factory.blocks.BlockFactoryTesrType;
import forestry.plugins.PluginFactory;
import uristqwerty.CraftGuide.api.ChanceSlot;
import uristqwerty.CraftGuide.api.ItemSlot;
import uristqwerty.CraftGuide.api.LiquidSlot;
import uristqwerty.CraftGuide.api.RecipeGenerator;
import uristqwerty.CraftGuide.api.RecipeProvider;
import uristqwerty.CraftGuide.api.RecipeTemplate;
import uristqwerty.CraftGuide.api.Slot;
import uristqwerty.CraftGuide.api.SlotType;
public class CraftGuideSqueezer implements RecipeProvider {
private final Slot[] slots = new Slot[12];
public CraftGuideSqueezer() {
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
slots[i + j * 3] = new ItemSlot(i * 18 + 3, j * 18 + 3, 16, 16).drawOwnBackground();
}
}
slots[9] = new ChanceSlot(59, 39, 16, 16, true).setRatio(100).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground();
slots[10] = new LiquidSlot(59, 21).setSlotType(SlotType.OUTPUT_SLOT);
slots[11] = new ItemSlot(59, 3, 16, 16).setSlotType(SlotType.MACHINE_SLOT);
}
@Override
public void generateRecipes(RecipeGenerator generator) {
if (PluginFactory.blocks.factoryTESR == null) {
return;
}
ItemStack machine = PluginFactory.blocks.factoryTESR.get(BlockFactoryTesrType.SQUEEZER);
RecipeTemplate template = generator.createRecipeTemplate(slots, machine);
for (ISqueezerRecipe recipe : RecipeManagers.squeezerManager.recipes()) {
Object[] array = new Object[12];
System.arraycopy(recipe.getResources(), 0, array, 0, recipe.getResources().length);
if (recipe.getRemnants() != null) {
array[9] = recipe.getRemnantsChance() > 0 ? new Object[]{recipe.getRemnants().copy(), recipe.getRemnantsChance()} : null;
}
if (recipe.getFluidOutput() != null) {
array[10] = recipe.getFluidOutput();
}
array[11] = machine;
generator.addRecipe(template, array);
}
}
}
@@ -1,56 +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.factory.recipes.craftguide;
import net.minecraft.item.ItemStack;
import forestry.api.recipes.IStillRecipe;
import forestry.api.recipes.RecipeManagers;
import forestry.factory.blocks.BlockFactoryTesrType;
import forestry.plugins.PluginFactory;
import uristqwerty.CraftGuide.api.ItemSlot;
import uristqwerty.CraftGuide.api.LiquidSlot;
import uristqwerty.CraftGuide.api.RecipeGenerator;
import uristqwerty.CraftGuide.api.RecipeProvider;
import uristqwerty.CraftGuide.api.RecipeTemplate;
import uristqwerty.CraftGuide.api.Slot;
import uristqwerty.CraftGuide.api.SlotType;
public class CraftGuideStill implements RecipeProvider {
private final Slot[] slots = new Slot[3];
public CraftGuideStill() {
slots[0] = new LiquidSlot(12, 21);
slots[1] = new LiquidSlot(50, 21).setSlotType(SlotType.OUTPUT_SLOT);
slots[2] = new ItemSlot(31, 21, 16, 16).setSlotType(SlotType.MACHINE_SLOT);
}
@Override
public void generateRecipes(RecipeGenerator generator) {
if (PluginFactory.blocks.factoryTESR == null) {
return;
}
ItemStack machine = PluginFactory.blocks.factoryTESR.get(BlockFactoryTesrType.STILL);
RecipeTemplate template = generator.createRecipeTemplate(slots, machine);
for (IStillRecipe recipe : RecipeManagers.stillManager.recipes()) {
Object[] array = new Object[3];
array[0] = recipe.getInput();
array[1] = recipe.getOutput();
array[2] = machine;
generator.addRecipe(template, array);
}
}
}