Improved the way we handle other mods
This commit is contained in:
parent
0d20ba6d55
commit
6deb0b1d32
27 changed files with 2074 additions and 1969 deletions
|
@ -9,7 +9,7 @@ import techreborn.api.recipe.RecipeHandler;
|
||||||
import techreborn.client.GuiHandler;
|
import techreborn.client.GuiHandler;
|
||||||
import techreborn.command.TechRebornDevCommand;
|
import techreborn.command.TechRebornDevCommand;
|
||||||
import techreborn.compat.CompatManager;
|
import techreborn.compat.CompatManager;
|
||||||
import techreborn.compat.recipes.RecipeManager;
|
import techreborn.compat.ICompatModule;
|
||||||
import techreborn.config.ConfigTechReborn;
|
import techreborn.config.ConfigTechReborn;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.init.ModFluids;
|
import techreborn.init.ModFluids;
|
||||||
|
@ -52,6 +52,9 @@ public class Core {
|
||||||
|
|
||||||
config = ConfigTechReborn.initialize(new File(path));
|
config = ConfigTechReborn.initialize(new File(path));
|
||||||
LogHelper.info("PreInitialization Complete");
|
LogHelper.info("PreInitialization Complete");
|
||||||
|
for(ICompatModule compatModule : CompatManager.INSTANCE.compatModules){
|
||||||
|
compatModule.preInit(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
|
@ -71,7 +74,9 @@ public class Core {
|
||||||
//Client only init, needs to be done before parts system
|
//Client only init, needs to be done before parts system
|
||||||
proxy.init();
|
proxy.init();
|
||||||
// Compat
|
// Compat
|
||||||
CompatManager.init(event);
|
for(ICompatModule compatModule : CompatManager.INSTANCE.compatModules){
|
||||||
|
compatModule.init(event);
|
||||||
|
}
|
||||||
// WorldGen
|
// WorldGen
|
||||||
GameRegistry.registerWorldGenerator(new TROreGen(), 0);
|
GameRegistry.registerWorldGenerator(new TROreGen(), 0);
|
||||||
// Register Gui Handler
|
// Register Gui Handler
|
||||||
|
@ -93,18 +98,20 @@ public class Core {
|
||||||
// Has to be done here as Buildcraft registers there recipes late
|
// Has to be done here as Buildcraft registers there recipes late
|
||||||
StopWatch watch = new StopWatch();
|
StopWatch watch = new StopWatch();
|
||||||
watch.start();
|
watch.start();
|
||||||
RecipeManager.init();
|
|
||||||
LogHelper.all(watch + " : main recipes");
|
LogHelper.all(watch + " : main recipes");
|
||||||
watch.stop();
|
watch.stop();
|
||||||
//Has to be done after the recipes have been added
|
for(ICompatModule compatModule : CompatManager.INSTANCE.compatModules){
|
||||||
CompatManager.postInit(event);
|
compatModule.postInit(event);
|
||||||
|
}
|
||||||
LogHelper.info(RecipeHandler.recipeList.size() + " recipes loaded");
|
LogHelper.info(RecipeHandler.recipeList.size() + " recipes loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Mod.EventHandler
|
@Mod.EventHandler
|
||||||
public void serverStarting(FMLServerStartingEvent event){
|
public void serverStarting(FMLServerStartingEvent event){
|
||||||
event.registerServerCommand(new TechRebornDevCommand());
|
event.registerServerCommand(new TechRebornDevCommand());
|
||||||
|
for(ICompatModule compatModule : CompatManager.INSTANCE.compatModules){
|
||||||
|
compatModule.serverStarting(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
@SubscribeEvent
|
||||||
|
|
|
@ -1,34 +1,40 @@
|
||||||
package techreborn.compat;
|
package techreborn.compat;
|
||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
|
||||||
import techreborn.compat.ee3.EmcValues;
|
|
||||||
import techreborn.compat.waila.CompatModuleWaila;
|
|
||||||
import techreborn.init.ModParts;
|
|
||||||
import techreborn.util.LogHelper;
|
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
import techreborn.compat.ee3.EmcValues;
|
||||||
|
import techreborn.compat.qLib.QLib;
|
||||||
|
import techreborn.compat.recipes.RecipesBuildcraft;
|
||||||
|
import techreborn.compat.recipes.RecipesIC2;
|
||||||
|
import techreborn.compat.recipes.RecipesThermalExpansion;
|
||||||
|
import techreborn.compat.waila.CompatModuleWaila;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public class CompatManager {
|
public class CompatManager {
|
||||||
|
|
||||||
public static void init(FMLInitializationEvent event)
|
public ArrayList<ICompatModule> compatModules = new ArrayList<ICompatModule>();
|
||||||
{
|
|
||||||
if (Loader.isModLoaded("Waila"))
|
public static CompatManager INSTANCE = new CompatManager();
|
||||||
{
|
|
||||||
new CompatModuleWaila().init(event);
|
|
||||||
LogHelper.info("Waila Compat Loaded");
|
public CompatManager() {
|
||||||
}
|
registerCompact(CompatModuleWaila.class, "Waila");
|
||||||
if(Loader.isModLoaded("qmunitylib"))
|
registerCompact(RecipesIC2.class, "IC2");
|
||||||
{
|
registerCompact(RecipesBuildcraft.class, "BuildCraft");
|
||||||
// Register Multiparts
|
registerCompact(RecipesThermalExpansion.class, "ThermalExpansion");
|
||||||
ModParts.init();
|
registerCompact(EmcValues.class, "EE3");
|
||||||
}
|
registerCompact(QLib.class, "qmunitylib");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void postInit(FMLPostInitializationEvent event){
|
public void registerCompact(Class<?> moduleClass, String modid) {
|
||||||
if(Loader.isModLoaded("EE3"))
|
if (Loader.isModLoaded(modid)) {
|
||||||
{
|
try {
|
||||||
// Register Emc Values and machine crafting handlers
|
compatModules.add((ICompatModule) moduleClass.newInstance());
|
||||||
EmcValues.init();
|
} catch (InstantiationException e) {
|
||||||
}
|
e.printStackTrace();
|
||||||
}
|
} catch (IllegalAccessException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
17
src/main/java/techreborn/compat/ICompatModule.java
Normal file
17
src/main/java/techreborn/compat/ICompatModule.java
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
package techreborn.compat;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
|
|
||||||
|
public interface ICompatModule {
|
||||||
|
|
||||||
|
public void preInit(FMLPreInitializationEvent event);
|
||||||
|
|
||||||
|
public void init(FMLInitializationEvent event);
|
||||||
|
|
||||||
|
public void postInit(FMLPostInitializationEvent event);
|
||||||
|
|
||||||
|
public void serverStarting(FMLServerStartingEvent event);
|
||||||
|
}
|
|
@ -1,18 +1,37 @@
|
||||||
package techreborn.compat.ee3;
|
package techreborn.compat.ee3;
|
||||||
|
|
||||||
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
||||||
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
import techreborn.api.recipe.IBaseRecipeType;
|
import techreborn.api.recipe.IBaseRecipeType;
|
||||||
import techreborn.api.recipe.RecipeHandler;
|
import techreborn.api.recipe.RecipeHandler;
|
||||||
|
import techreborn.compat.ICompatModule;
|
||||||
|
|
||||||
public class EmcValues {
|
public class EmcValues implements ICompatModule {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
|
||||||
public static void init()
|
|
||||||
{
|
|
||||||
for(IBaseRecipeType recipeType : RecipeHandler.recipeList){
|
|
||||||
if(recipeType.getOutputsSize() == 1){
|
|
||||||
RecipeRegistryProxy.addRecipe(recipeType.getOutput(0), recipeType.getInputs());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
|
for (IBaseRecipeType recipeType : RecipeHandler.recipeList) {
|
||||||
|
if (recipeType.getOutputsSize() == 1) {
|
||||||
|
RecipeRegistryProxy.addRecipe(recipeType.getOutput(0), recipeType.getInputs());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serverStarting(FMLServerStartingEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,138 +21,138 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public class BlastFurnaceRecipeHandler extends TemplateRecipeHandler {
|
public class BlastFurnaceRecipeHandler extends TemplateRecipeHandler {
|
||||||
|
|
||||||
public class CachedBlastFurnaceRecipe extends CachedRecipe {
|
public class CachedBlastFurnaceRecipe extends CachedRecipe {
|
||||||
|
|
||||||
private List<PositionedStack> input = new ArrayList<PositionedStack>();
|
private List<PositionedStack> input = new ArrayList<PositionedStack>();
|
||||||
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
|
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
|
||||||
public Point focus;
|
public Point focus;
|
||||||
public BlastFurnaceRecipe centrifugeRecipie;
|
public BlastFurnaceRecipe centrifugeRecipie;
|
||||||
|
|
||||||
public CachedBlastFurnaceRecipe(BlastFurnaceRecipe recipie) {
|
public CachedBlastFurnaceRecipe(BlastFurnaceRecipe recipie) {
|
||||||
this.centrifugeRecipie = recipie;
|
this.centrifugeRecipie = recipie;
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
PositionedStack pStack = new PositionedStack(
|
PositionedStack pStack = new PositionedStack(
|
||||||
recipie.getInput1(), 56 - offset, 25 - offset);
|
recipie.getInput1(), 56 - offset, 25 - offset);
|
||||||
|
|
||||||
pStack.setMaxSize(1);
|
pStack.setMaxSize(1);
|
||||||
this.input.add(pStack);
|
this.input.add(pStack);
|
||||||
|
|
||||||
PositionedStack pStack2 = new PositionedStack(
|
PositionedStack pStack2 = new PositionedStack(
|
||||||
recipie.getInput2(), 56 - offset, 43 - offset);
|
recipie.getInput2(), 56 - offset, 43 - offset);
|
||||||
|
|
||||||
pStack.setMaxSize(1);
|
pStack.setMaxSize(1);
|
||||||
this.input.add(pStack2);
|
this.input.add(pStack2);
|
||||||
|
|
||||||
if (recipie.getOutput1() != null) {
|
if (recipie.getOutput1() != null) {
|
||||||
this.outputs.add(new PositionedStack(recipie.getOutput1(),
|
this.outputs.add(new PositionedStack(recipie.getOutput1(),
|
||||||
116 - offset, 35 - offset));
|
116 - offset, 35 - offset));
|
||||||
}
|
}
|
||||||
if (recipie.getOutput2() != null) {
|
if (recipie.getOutput2() != null) {
|
||||||
this.outputs.add(new PositionedStack(recipie.getOutput2(),
|
this.outputs.add(new PositionedStack(recipie.getOutput2(),
|
||||||
116 - offset, 53 - offset));
|
116 - offset, 53 - offset));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PositionedStack> getIngredients() {
|
public List<PositionedStack> getIngredients() {
|
||||||
return this.getCycledIngredients(cycleticks / 20, this.input);
|
return this.getCycledIngredients(cycleticks / 20, this.input);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PositionedStack> getOtherStacks() {
|
public List<PositionedStack> getOtherStacks() {
|
||||||
return this.outputs;
|
return this.outputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PositionedStack getResult() {
|
public PositionedStack getResult() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "Blast Furnace";
|
return "Blast Furnace";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/industrial_blast_furnace.png";
|
return "techreborn:textures/gui/industrial_blast_furnace.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiBlastFurnace.class;
|
return GuiBlastFurnace.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBackground(int recipeIndex) {
|
public void drawBackground(int recipeIndex) {
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GuiDraw.changeTexture(getGuiTexture());
|
GuiDraw.changeTexture(getGuiTexture());
|
||||||
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
|
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
|
||||||
GuiDraw.drawTooltipBox(10, 80, 145, 50);
|
GuiDraw.drawTooltipBox(10, 80, 145, 50);
|
||||||
GuiDraw.drawString("Info:", 14, 84, -1);
|
GuiDraw.drawString("Info:", 14, 84, -1);
|
||||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||||
if (recipe instanceof CachedBlastFurnaceRecipe) {
|
if (recipe instanceof CachedBlastFurnaceRecipe) {
|
||||||
CachedBlastFurnaceRecipe centrifugeRecipie = (CachedBlastFurnaceRecipe) recipe;
|
CachedBlastFurnaceRecipe centrifugeRecipie = (CachedBlastFurnaceRecipe) recipe;
|
||||||
GuiDraw.drawString(
|
GuiDraw.drawString(
|
||||||
"EU needed: "
|
"EU needed: "
|
||||||
+ (ConfigTechReborn.CentrifugeInputTick * centrifugeRecipie.centrifugeRecipie
|
+ (ConfigTechReborn.CentrifugeInputTick * centrifugeRecipie.centrifugeRecipie
|
||||||
.getTickTime()), 14, 94, -1);
|
.getTickTime()), 14, 94, -1);
|
||||||
GuiDraw.drawString("Ticks to smelt: "
|
GuiDraw.drawString("Ticks to smelt: "
|
||||||
+ centrifugeRecipie.centrifugeRecipie.getTickTime(), 14,
|
+ centrifugeRecipie.centrifugeRecipie.getTickTime(), 14,
|
||||||
104, -1);
|
104, -1);
|
||||||
GuiDraw.drawString("Time to smelt: "
|
GuiDraw.drawString("Time to smelt: "
|
||||||
+ centrifugeRecipie.centrifugeRecipie.getTickTime() / 20
|
+ centrifugeRecipie.centrifugeRecipie.getTickTime() / 20
|
||||||
+ " seconds", 14, 114, -1);
|
+ " seconds", 14, 114, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int recipiesPerPage() {
|
public int recipiesPerPage() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadTransferRects() {
|
public void loadTransferRects() {
|
||||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||||
new Rectangle(0, 0, 20, 20), "tr.blast", new Object[0]));
|
new Rectangle(0, 0, 20, 20), "tr.blast", new Object[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||||
if (outputId.equals("tr.blast")) {
|
if (outputId.equals("tr.blast")) {
|
||||||
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
|
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
|
||||||
addCached(centrifugeRecipie);
|
addCached(centrifugeRecipie);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.loadCraftingRecipes(outputId, results);
|
super.loadCraftingRecipes(outputId, results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadCraftingRecipes(ItemStack result) {
|
public void loadCraftingRecipes(ItemStack result) {
|
||||||
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
|
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
|
||||||
if (NEIServerUtils.areStacksSameTypeCrafting(
|
if (NEIServerUtils.areStacksSameTypeCrafting(
|
||||||
centrifugeRecipie.getOutput1(), result)) {
|
centrifugeRecipie.getOutput1(), result)) {
|
||||||
addCached(centrifugeRecipie);
|
addCached(centrifugeRecipie);
|
||||||
}
|
}
|
||||||
if (NEIServerUtils.areStacksSameTypeCrafting(
|
if (NEIServerUtils.areStacksSameTypeCrafting(
|
||||||
centrifugeRecipie.getOutput2(), result)) {
|
centrifugeRecipie.getOutput2(), result)) {
|
||||||
addCached(centrifugeRecipie);
|
addCached(centrifugeRecipie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadUsageRecipes(ItemStack ingredient) {
|
public void loadUsageRecipes(ItemStack ingredient) {
|
||||||
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
|
for (BlastFurnaceRecipe centrifugeRecipie : TechRebornAPI.blastFurnaceRecipes) {
|
||||||
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInput1(), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInput2(), ingredient)) {
|
if (NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInput1(), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(centrifugeRecipie.getInput2(), ingredient)) {
|
||||||
addCached(centrifugeRecipie);
|
addCached(centrifugeRecipie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addCached(BlastFurnaceRecipe recipie) {
|
private void addCached(BlastFurnaceRecipe recipie) {
|
||||||
this.arecipes.add(new CachedBlastFurnaceRecipe(recipie));
|
this.arecipes.add(new CachedBlastFurnaceRecipe(recipie));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -2,74 +2,81 @@ package techreborn.compat.nei;
|
||||||
|
|
||||||
import codechicken.nei.api.API;
|
import codechicken.nei.api.API;
|
||||||
import codechicken.nei.api.IConfigureNEI;
|
import codechicken.nei.api.IConfigureNEI;
|
||||||
import techreborn.api.recipe.machines.GrinderRecipe;
|
import techreborn.compat.nei.recipes.AlloySmelterRecipeHandler;
|
||||||
import techreborn.compat.nei.recipes.*;
|
import techreborn.compat.nei.recipes.AssemblingMachineRecipeHandler;
|
||||||
|
import techreborn.compat.nei.recipes.CentrifugeRecipeHandler;
|
||||||
|
import techreborn.compat.nei.recipes.ChemicalReactorRecipeHandler;
|
||||||
|
import techreborn.compat.nei.recipes.GrinderRecipeHandler;
|
||||||
|
import techreborn.compat.nei.recipes.ImplosionCompressorRecipeHandler;
|
||||||
|
import techreborn.compat.nei.recipes.IndustrialSawmillRecipeHandler;
|
||||||
|
import techreborn.compat.nei.recipes.LatheRecipeHandler;
|
||||||
|
import techreborn.compat.nei.recipes.PlateCuttingMachineRecipeHandler;
|
||||||
import techreborn.lib.ModInfo;
|
import techreborn.lib.ModInfo;
|
||||||
|
|
||||||
public class NEIConfig implements IConfigureNEI {
|
public class NEIConfig implements IConfigureNEI {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return ModInfo.MOD_ID;
|
return ModInfo.MOD_ID;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getVersion() {
|
public String getVersion() {
|
||||||
return ModInfo.MOD_VERSION;
|
return ModInfo.MOD_VERSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BlastFurnaceRecipeHandler blastFurnaceRecipeHandle;
|
public static BlastFurnaceRecipeHandler blastFurnaceRecipeHandle;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadConfig() {
|
public void loadConfig() {
|
||||||
ShapedRollingMachineHandler shapedRollingMachineHandler = new ShapedRollingMachineHandler();
|
ShapedRollingMachineHandler shapedRollingMachineHandler = new ShapedRollingMachineHandler();
|
||||||
ShapelessRollingMachineHandler shapelessRollingMachineHandler = new ShapelessRollingMachineHandler();
|
ShapelessRollingMachineHandler shapelessRollingMachineHandler = new ShapelessRollingMachineHandler();
|
||||||
NEIConfig.blastFurnaceRecipeHandle = new BlastFurnaceRecipeHandler();
|
NEIConfig.blastFurnaceRecipeHandle = new BlastFurnaceRecipeHandler();
|
||||||
|
|
||||||
|
|
||||||
ImplosionCompressorRecipeHandler implosion = new ImplosionCompressorRecipeHandler();
|
ImplosionCompressorRecipeHandler implosion = new ImplosionCompressorRecipeHandler();
|
||||||
API.registerUsageHandler(implosion);
|
API.registerUsageHandler(implosion);
|
||||||
API.registerRecipeHandler(implosion);
|
API.registerRecipeHandler(implosion);
|
||||||
|
|
||||||
AlloySmelterRecipeHandler alloy = new AlloySmelterRecipeHandler();
|
AlloySmelterRecipeHandler alloy = new AlloySmelterRecipeHandler();
|
||||||
API.registerUsageHandler(alloy);
|
API.registerUsageHandler(alloy);
|
||||||
API.registerRecipeHandler(alloy);
|
API.registerRecipeHandler(alloy);
|
||||||
|
|
||||||
AssemblingMachineRecipeHandler assembling = new AssemblingMachineRecipeHandler();
|
AssemblingMachineRecipeHandler assembling = new AssemblingMachineRecipeHandler();
|
||||||
API.registerUsageHandler(assembling);
|
API.registerUsageHandler(assembling);
|
||||||
API.registerRecipeHandler(assembling);
|
API.registerRecipeHandler(assembling);
|
||||||
|
|
||||||
LatheRecipeHandler lathe = new LatheRecipeHandler();
|
LatheRecipeHandler lathe = new LatheRecipeHandler();
|
||||||
API.registerUsageHandler(lathe);
|
API.registerUsageHandler(lathe);
|
||||||
API.registerRecipeHandler(lathe);
|
API.registerRecipeHandler(lathe);
|
||||||
|
|
||||||
IndustrialSawmillRecipeHandler sawmill = new IndustrialSawmillRecipeHandler();
|
IndustrialSawmillRecipeHandler sawmill = new IndustrialSawmillRecipeHandler();
|
||||||
API.registerUsageHandler(sawmill);
|
API.registerUsageHandler(sawmill);
|
||||||
API.registerRecipeHandler(sawmill);
|
API.registerRecipeHandler(sawmill);
|
||||||
|
|
||||||
PlateCuttingMachineRecipeHandler plate = new PlateCuttingMachineRecipeHandler();
|
PlateCuttingMachineRecipeHandler plate = new PlateCuttingMachineRecipeHandler();
|
||||||
API.registerUsageHandler(plate);
|
API.registerUsageHandler(plate);
|
||||||
API.registerRecipeHandler(plate);
|
API.registerRecipeHandler(plate);
|
||||||
|
|
||||||
ChemicalReactorRecipeHandler chem = new ChemicalReactorRecipeHandler();
|
ChemicalReactorRecipeHandler chem = new ChemicalReactorRecipeHandler();
|
||||||
API.registerUsageHandler(chem);
|
API.registerUsageHandler(chem);
|
||||||
API.registerRecipeHandler(chem);
|
API.registerRecipeHandler(chem);
|
||||||
|
|
||||||
CentrifugeRecipeHandler cent = new CentrifugeRecipeHandler();
|
CentrifugeRecipeHandler cent = new CentrifugeRecipeHandler();
|
||||||
API.registerUsageHandler(cent);
|
API.registerUsageHandler(cent);
|
||||||
API.registerRecipeHandler(cent);
|
API.registerRecipeHandler(cent);
|
||||||
|
|
||||||
GrinderRecipeHandler grind = new GrinderRecipeHandler();
|
GrinderRecipeHandler grind = new GrinderRecipeHandler();
|
||||||
API.registerUsageHandler(grind);
|
API.registerUsageHandler(grind);
|
||||||
API.registerRecipeHandler(grind);
|
API.registerRecipeHandler(grind);
|
||||||
|
|
||||||
API.registerUsageHandler(shapedRollingMachineHandler);
|
API.registerUsageHandler(shapedRollingMachineHandler);
|
||||||
API.registerRecipeHandler(shapedRollingMachineHandler);
|
API.registerRecipeHandler(shapedRollingMachineHandler);
|
||||||
|
|
||||||
API.registerUsageHandler(shapelessRollingMachineHandler);
|
API.registerUsageHandler(shapelessRollingMachineHandler);
|
||||||
API.registerRecipeHandler(shapelessRollingMachineHandler);
|
API.registerRecipeHandler(shapelessRollingMachineHandler);
|
||||||
|
|
||||||
API.registerUsageHandler(NEIConfig.blastFurnaceRecipeHandle);
|
API.registerUsageHandler(NEIConfig.blastFurnaceRecipeHandle);
|
||||||
API.registerRecipeHandler(NEIConfig.blastFurnaceRecipeHandle);
|
API.registerRecipeHandler(NEIConfig.blastFurnaceRecipeHandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,91 +16,91 @@ import java.util.List;
|
||||||
|
|
||||||
public class ShapedRollingMachineHandler extends ShapedRecipeHandler {
|
public class ShapedRollingMachineHandler extends ShapedRecipeHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiRollingMachine.class;
|
return GuiRollingMachine.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadTransferRects() {
|
public void loadTransferRects() {
|
||||||
this.transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24,
|
this.transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24,
|
||||||
18), "rollingcrafting", new Object[0]));
|
18), "rollingcrafting", new Object[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "rollingcrafting";
|
return "rollingcrafting";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOverlayIdentifier() {
|
public String getOverlayIdentifier() {
|
||||||
return "rollingcrafting";
|
return "rollingcrafting";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||||
if (outputId.equals("rollingcrafting")
|
if (outputId.equals("rollingcrafting")
|
||||||
&& getClass() == ShapedRollingMachineHandler.class) {
|
&& getClass() == ShapedRollingMachineHandler.class) {
|
||||||
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
||||||
.getRecipeList()) {
|
.getRecipeList()) {
|
||||||
CachedShapedRecipe recipe = null;
|
CachedShapedRecipe recipe = null;
|
||||||
if (irecipe instanceof ShapedRecipes)
|
if (irecipe instanceof ShapedRecipes)
|
||||||
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
||||||
else if (irecipe instanceof ShapedOreRecipe)
|
else if (irecipe instanceof ShapedOreRecipe)
|
||||||
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
||||||
|
|
||||||
if (recipe == null)
|
if (recipe == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
recipe.computeVisuals();
|
recipe.computeVisuals();
|
||||||
arecipes.add(recipe);
|
arecipes.add(recipe);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.loadCraftingRecipes(outputId, results);
|
super.loadCraftingRecipes(outputId, results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadCraftingRecipes(ItemStack result) {
|
public void loadCraftingRecipes(ItemStack result) {
|
||||||
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
||||||
.getRecipeList()) {
|
.getRecipeList()) {
|
||||||
if (NEIServerUtils.areStacksSameTypeCrafting(
|
if (NEIServerUtils.areStacksSameTypeCrafting(
|
||||||
irecipe.getRecipeOutput(), result)) {
|
irecipe.getRecipeOutput(), result)) {
|
||||||
CachedShapedRecipe recipe = null;
|
CachedShapedRecipe recipe = null;
|
||||||
if (irecipe instanceof ShapedRecipes)
|
if (irecipe instanceof ShapedRecipes)
|
||||||
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
||||||
else if (irecipe instanceof ShapedOreRecipe)
|
else if (irecipe instanceof ShapedOreRecipe)
|
||||||
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
||||||
|
|
||||||
if (recipe == null)
|
if (recipe == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
recipe.computeVisuals();
|
recipe.computeVisuals();
|
||||||
arecipes.add(recipe);
|
arecipes.add(recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadUsageRecipes(ItemStack ingredient) {
|
public void loadUsageRecipes(ItemStack ingredient) {
|
||||||
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
for (IRecipe irecipe : (List<IRecipe>) RollingMachineRecipe.instance
|
||||||
.getRecipeList()) {
|
.getRecipeList()) {
|
||||||
CachedShapedRecipe recipe = null;
|
CachedShapedRecipe recipe = null;
|
||||||
if (irecipe instanceof ShapedRecipes)
|
if (irecipe instanceof ShapedRecipes)
|
||||||
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
recipe = new CachedShapedRecipe((ShapedRecipes) irecipe);
|
||||||
else if (irecipe instanceof ShapedOreRecipe)
|
else if (irecipe instanceof ShapedOreRecipe)
|
||||||
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
recipe = forgeShapedRecipe((ShapedOreRecipe) irecipe);
|
||||||
|
|
||||||
if (recipe == null
|
if (recipe == null
|
||||||
|| !recipe.contains(recipe.ingredients,
|
|| !recipe.contains(recipe.ingredients,
|
||||||
ingredient.getItem()))
|
ingredient.getItem()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
recipe.computeVisuals();
|
recipe.computeVisuals();
|
||||||
if (recipe.contains(recipe.ingredients, ingredient)) {
|
if (recipe.contains(recipe.ingredients, ingredient)) {
|
||||||
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
|
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
|
||||||
arecipes.add(recipe);
|
arecipes.add(recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,96 +16,96 @@ import java.util.List;
|
||||||
|
|
||||||
public class ShapelessRollingMachineHandler extends ShapelessRecipeHandler {
|
public class ShapelessRollingMachineHandler extends ShapelessRecipeHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiRollingMachine.class;
|
return GuiRollingMachine.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "Shapeless Rolling Machine";
|
return "Shapeless Rolling Machine";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadTransferRects() {
|
public void loadTransferRects() {
|
||||||
transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18),
|
transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18),
|
||||||
"rollingcraftingnoshape"));
|
"rollingcraftingnoshape"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getOverlayIdentifier() {
|
public String getOverlayIdentifier() {
|
||||||
return "rollingcraftingnoshape";
|
return "rollingcraftingnoshape";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||||
if (outputId.equals("rollingcraftingnoshape")
|
if (outputId.equals("rollingcraftingnoshape")
|
||||||
&& getClass() == ShapelessRollingMachineHandler.class) {
|
&& getClass() == ShapelessRollingMachineHandler.class) {
|
||||||
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
||||||
.getRecipeList();
|
.getRecipeList();
|
||||||
for (IRecipe irecipe : allrecipes) {
|
for (IRecipe irecipe : allrecipes) {
|
||||||
CachedShapelessRecipe recipe = null;
|
CachedShapelessRecipe recipe = null;
|
||||||
if (irecipe instanceof ShapelessRecipes)
|
if (irecipe instanceof ShapelessRecipes)
|
||||||
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
||||||
else if (irecipe instanceof ShapelessOreRecipe)
|
else if (irecipe instanceof ShapelessOreRecipe)
|
||||||
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
||||||
|
|
||||||
if (recipe == null)
|
if (recipe == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
arecipes.add(recipe);
|
arecipes.add(recipe);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.loadCraftingRecipes(outputId, results);
|
super.loadCraftingRecipes(outputId, results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadCraftingRecipes(ItemStack result) {
|
public void loadCraftingRecipes(ItemStack result) {
|
||||||
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
||||||
.getRecipeList();
|
.getRecipeList();
|
||||||
for (IRecipe irecipe : allrecipes) {
|
for (IRecipe irecipe : allrecipes) {
|
||||||
if (NEIServerUtils.areStacksSameTypeCrafting(
|
if (NEIServerUtils.areStacksSameTypeCrafting(
|
||||||
irecipe.getRecipeOutput(), result)) {
|
irecipe.getRecipeOutput(), result)) {
|
||||||
CachedShapelessRecipe recipe = null;
|
CachedShapelessRecipe recipe = null;
|
||||||
if (irecipe instanceof ShapelessRecipes)
|
if (irecipe instanceof ShapelessRecipes)
|
||||||
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
||||||
else if (irecipe instanceof ShapelessOreRecipe)
|
else if (irecipe instanceof ShapelessOreRecipe)
|
||||||
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
||||||
|
|
||||||
if (recipe == null)
|
if (recipe == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
arecipes.add(recipe);
|
arecipes.add(recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadUsageRecipes(ItemStack ingredient) {
|
public void loadUsageRecipes(ItemStack ingredient) {
|
||||||
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
List<IRecipe> allrecipes = RollingMachineRecipe.instance
|
||||||
.getRecipeList();
|
.getRecipeList();
|
||||||
for (IRecipe irecipe : allrecipes) {
|
for (IRecipe irecipe : allrecipes) {
|
||||||
CachedShapelessRecipe recipe = null;
|
CachedShapelessRecipe recipe = null;
|
||||||
if (irecipe instanceof ShapelessRecipes)
|
if (irecipe instanceof ShapelessRecipes)
|
||||||
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
recipe = shapelessRecipe((ShapelessRecipes) irecipe);
|
||||||
else if (irecipe instanceof ShapelessOreRecipe)
|
else if (irecipe instanceof ShapelessOreRecipe)
|
||||||
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
recipe = forgeShapelessRecipe((ShapelessOreRecipe) irecipe);
|
||||||
|
|
||||||
if (recipe == null)
|
if (recipe == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (recipe.contains(recipe.ingredients, ingredient)) {
|
if (recipe.contains(recipe.ingredients, ingredient)) {
|
||||||
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
|
recipe.setIngredientPermutation(recipe.ingredients, ingredient);
|
||||||
arecipes.add(recipe);
|
arecipes.add(recipe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CachedShapelessRecipe shapelessRecipe(ShapelessRecipes recipe) {
|
private CachedShapelessRecipe shapelessRecipe(ShapelessRecipes recipe) {
|
||||||
if (recipe.recipeItems == null)
|
if (recipe.recipeItems == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return new CachedShapelessRecipe(recipe.recipeItems,
|
return new CachedShapelessRecipe(recipe.recipeItems,
|
||||||
recipe.getRecipeOutput());
|
recipe.getRecipeOutput());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,36 +9,36 @@ import techreborn.util.ItemUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AlloySmelterRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
public class AlloySmelterRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||||
@Override
|
@Override
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset);
|
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset);
|
||||||
input.add(pStack);
|
input.add(pStack);
|
||||||
|
|
||||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
|
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
|
||||||
input.add(pStack2);
|
input.add(pStack2);
|
||||||
|
|
||||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
|
||||||
outputs.add(pStack3);
|
outputs.add(pStack3);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "alloySmelterRecipe";
|
return "alloySmelterRecipe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/electric_alloy_furnace.png";
|
return "techreborn:textures/gui/electric_alloy_furnace.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiAlloySmelter.class;
|
return GuiAlloySmelter.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,42 +9,42 @@ import techreborn.util.ItemUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class AssemblingMachineRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
public class AssemblingMachineRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||||
@Override
|
@Override
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
if (recipeType.getInputs().size() > 0) {
|
if (recipeType.getInputs().size() > 0) {
|
||||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset);
|
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 47 - offset, 17 - offset);
|
||||||
input.add(pStack);
|
input.add(pStack);
|
||||||
}
|
}
|
||||||
if (recipeType.getInputs().size() > 1) {
|
if (recipeType.getInputs().size() > 1) {
|
||||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
|
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 65 - offset, 17 - offset);
|
||||||
input.add(pStack2);
|
input.add(pStack2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 0) {
|
if (recipeType.getOutputsSize() > 0) {
|
||||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
|
||||||
outputs.add(pStack3);
|
outputs.add(pStack3);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "assemblingMachineRecipe";
|
return "assemblingMachineRecipe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/assembling_machine.png";
|
return "techreborn:textures/gui/assembling_machine.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiAssemblingMachine.class;
|
return GuiAssemblingMachine.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,56 +9,56 @@ import techreborn.util.ItemUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CentrifugeRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
public class CentrifugeRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||||
@Override
|
@Override
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
if (recipeType.getInputs().size() > 0) {
|
if (recipeType.getInputs().size() > 0) {
|
||||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 80 - offset, 35 - offset);
|
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 80 - offset, 35 - offset);
|
||||||
input.add(pStack);
|
input.add(pStack);
|
||||||
}
|
}
|
||||||
if (recipeType.getInputs().size() > 1) {
|
if (recipeType.getInputs().size() > 1) {
|
||||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 50 - offset, 5 - offset);
|
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 50 - offset, 5 - offset);
|
||||||
input.add(pStack2);
|
input.add(pStack2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 0) {
|
if (recipeType.getOutputsSize() > 0) {
|
||||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 5 - offset);
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 5 - offset);
|
||||||
outputs.add(pStack3);
|
outputs.add(pStack3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 1) {
|
if (recipeType.getOutputsSize() > 1) {
|
||||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 110 - offset, 35 - offset);
|
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 110 - offset, 35 - offset);
|
||||||
outputs.add(pStack4);
|
outputs.add(pStack4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 2) {
|
if (recipeType.getOutputsSize() > 2) {
|
||||||
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 80 - offset, 65 - offset);
|
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 80 - offset, 65 - offset);
|
||||||
outputs.add(pStack5);
|
outputs.add(pStack5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 3) {
|
if (recipeType.getOutputsSize() > 3) {
|
||||||
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 50 - offset, 35 - offset);
|
PositionedStack pStack6 = new PositionedStack(recipeType.getOutput(3), 50 - offset, 35 - offset);
|
||||||
outputs.add(pStack6);
|
outputs.add(pStack6);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "centrifugeRecipe";
|
return "centrifugeRecipe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/industrial_centrifuge.png";
|
return "techreborn:textures/gui/industrial_centrifuge.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiCentrifuge.class;
|
return GuiCentrifuge.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,42 +9,42 @@ import techreborn.util.ItemUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ChemicalReactorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
public class ChemicalReactorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||||
@Override
|
@Override
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
if (recipeType.getInputs().size() > 0) {
|
if (recipeType.getInputs().size() > 0) {
|
||||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 70 - offset, 21 - offset);
|
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 70 - offset, 21 - offset);
|
||||||
input.add(pStack);
|
input.add(pStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getInputs().size() > 1) {
|
if (recipeType.getInputs().size() > 1) {
|
||||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 90 - offset, 21 - offset);
|
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 90 - offset, 21 - offset);
|
||||||
input.add(pStack2);
|
input.add(pStack2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 0) {
|
if (recipeType.getOutputsSize() > 0) {
|
||||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 51 - offset);
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 80 - offset, 51 - offset);
|
||||||
outputs.add(pStack3);
|
outputs.add(pStack3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "chemicalReactorRecipe";
|
return "chemicalReactorRecipe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/chemical_reactor.png";
|
return "techreborn:textures/gui/chemical_reactor.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiChemicalReactor.class;
|
return GuiChemicalReactor.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,123 +17,123 @@ import java.util.List;
|
||||||
|
|
||||||
public abstract class GenericRecipeHander extends TemplateRecipeHandler {
|
public abstract class GenericRecipeHander extends TemplateRecipeHandler {
|
||||||
|
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CachedGenericRecipe extends CachedRecipe {
|
public class CachedGenericRecipe extends CachedRecipe {
|
||||||
|
|
||||||
private List<PositionedStack> input = new ArrayList<PositionedStack>();
|
private List<PositionedStack> input = new ArrayList<PositionedStack>();
|
||||||
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
|
private List<PositionedStack> outputs = new ArrayList<PositionedStack>();
|
||||||
public Point focus;
|
public Point focus;
|
||||||
public IBaseRecipeType recipie;
|
public IBaseRecipeType recipie;
|
||||||
public INeiBaseRecipe neiBaseRecipe;
|
public INeiBaseRecipe neiBaseRecipe;
|
||||||
|
|
||||||
public CachedGenericRecipe(IBaseRecipeType recipe, INeiBaseRecipe neiBaseRecipe) {
|
public CachedGenericRecipe(IBaseRecipeType recipe, INeiBaseRecipe neiBaseRecipe) {
|
||||||
this.recipie = recipe;
|
this.recipie = recipe;
|
||||||
this.neiBaseRecipe = neiBaseRecipe;
|
this.neiBaseRecipe = neiBaseRecipe;
|
||||||
neiBaseRecipe.addPositionedStacks(input, outputs, recipe);
|
neiBaseRecipe.addPositionedStacks(input, outputs, recipe);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PositionedStack> getIngredients() {
|
public List<PositionedStack> getIngredients() {
|
||||||
return this.getCycledIngredients(cycleticks / 20, this.input);
|
return this.getCycledIngredients(cycleticks / 20, this.input);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PositionedStack> getOtherStacks() {
|
public List<PositionedStack> getOtherStacks() {
|
||||||
return this.outputs;
|
return this.outputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PositionedStack getResult() {
|
public PositionedStack getResult() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return getNeiBaseRecipe().getRecipeName();
|
return getNeiBaseRecipe().getRecipeName();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return getNeiBaseRecipe().getGuiTexture();
|
return getNeiBaseRecipe().getGuiTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return getNeiBaseRecipe().getGuiClass();
|
return getNeiBaseRecipe().getGuiClass();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void drawBackground(int recipeIndex) {
|
public void drawBackground(int recipeIndex) {
|
||||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
GuiDraw.changeTexture(getGuiTexture());
|
GuiDraw.changeTexture(getGuiTexture());
|
||||||
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
|
GuiDraw.drawTexturedModalRect(0, 0, 4, 4, 166, 78);
|
||||||
GuiDraw.drawTooltipBox(10, 80, 145, 50);
|
GuiDraw.drawTooltipBox(10, 80, 145, 50);
|
||||||
GuiDraw.drawString("Info:", 14, 84, -1);
|
GuiDraw.drawString("Info:", 14, 84, -1);
|
||||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||||
if (recipe instanceof CachedGenericRecipe) {
|
if (recipe instanceof CachedGenericRecipe) {
|
||||||
CachedGenericRecipe genericRecipe = (CachedGenericRecipe) recipe;
|
CachedGenericRecipe genericRecipe = (CachedGenericRecipe) recipe;
|
||||||
GuiDraw.drawString(
|
GuiDraw.drawString(
|
||||||
"EU needed: "
|
"EU needed: "
|
||||||
+ (ConfigTechReborn.CentrifugeInputTick * genericRecipe.recipie
|
+ (ConfigTechReborn.CentrifugeInputTick * genericRecipe.recipie
|
||||||
.tickTime()), 14, 94, -1);
|
.tickTime()), 14, 94, -1);
|
||||||
GuiDraw.drawString("Ticks to smelt: "
|
GuiDraw.drawString("Ticks to smelt: "
|
||||||
+ genericRecipe.recipie.tickTime(), 14,
|
+ genericRecipe.recipie.tickTime(), 14,
|
||||||
104, -1);
|
104, -1);
|
||||||
GuiDraw.drawString("Time to smelt: "
|
GuiDraw.drawString("Time to smelt: "
|
||||||
+ genericRecipe.recipie.tickTime() / 20
|
+ genericRecipe.recipie.tickTime() / 20
|
||||||
+ " seconds", 14, 114, -1);
|
+ " seconds", 14, 114, -1);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int recipiesPerPage() {
|
public int recipiesPerPage() {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadTransferRects() {
|
public void loadTransferRects() {
|
||||||
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
this.transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(
|
||||||
new Rectangle(0, 0, 20, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
new Rectangle(0, 0, 20, 20), getNeiBaseRecipe().getRecipeName(), new Object[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||||
if (outputId.equals(getNeiBaseRecipe().getRecipeName())) {
|
if (outputId.equals(getNeiBaseRecipe().getRecipeName())) {
|
||||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
||||||
addCached(recipeType);
|
addCached(recipeType);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
super.loadCraftingRecipes(outputId, results);
|
super.loadCraftingRecipes(outputId, results);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadCraftingRecipes(ItemStack result) {
|
public void loadCraftingRecipes(ItemStack result) {
|
||||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
||||||
for (int i = 0; i < recipeType.getOutputsSize(); i++) {
|
for (int i = 0; i < recipeType.getOutputsSize(); i++) {
|
||||||
if (ItemUtils.isItemEqual(recipeType.getOutput(i), result, true, false, true)) {
|
if (ItemUtils.isItemEqual(recipeType.getOutput(i), result, true, false, true)) {
|
||||||
addCached(recipeType);
|
addCached(recipeType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void loadUsageRecipes(ItemStack ingredient) {
|
public void loadUsageRecipes(ItemStack ingredient) {
|
||||||
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
for (IBaseRecipeType recipeType : RecipeHandler.getRecipeClassFromName(getNeiBaseRecipe().getRecipeName())) {
|
||||||
for (ItemStack input : recipeType.getInputs()) {
|
for (ItemStack input : recipeType.getInputs()) {
|
||||||
if (ItemUtils.isItemEqual(ingredient, input, true, false, true)) {
|
if (ItemUtils.isItemEqual(ingredient, input, true, false, true)) {
|
||||||
addCached(recipeType);
|
addCached(recipeType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addCached(IBaseRecipeType recipie) {
|
private void addCached(IBaseRecipeType recipie) {
|
||||||
this.arecipes.add(new CachedGenericRecipe(recipie, getNeiBaseRecipe()));
|
this.arecipes.add(new CachedGenericRecipe(recipie, getNeiBaseRecipe()));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -74,10 +74,10 @@ public class GrinderRecipeHandler extends GenericRecipeHander implements INeiBas
|
||||||
public void drawBackground(int recipeIndex) {
|
public void drawBackground(int recipeIndex) {
|
||||||
super.drawBackground(recipeIndex);
|
super.drawBackground(recipeIndex);
|
||||||
CachedRecipe recipe = arecipes.get(recipeIndex);
|
CachedRecipe recipe = arecipes.get(recipeIndex);
|
||||||
if(recipe instanceof CachedGenericRecipe){
|
if (recipe instanceof CachedGenericRecipe) {
|
||||||
if(((CachedGenericRecipe) recipe).recipie instanceof GrinderRecipe){
|
if (((CachedGenericRecipe) recipe).recipie instanceof GrinderRecipe) {
|
||||||
GrinderRecipe grinderRecipe = (GrinderRecipe) ((CachedGenericRecipe) recipe).recipie;
|
GrinderRecipe grinderRecipe = (GrinderRecipe) ((CachedGenericRecipe) recipe).recipie;
|
||||||
if(grinderRecipe.fluidStack != null){
|
if (grinderRecipe.fluidStack != null) {
|
||||||
IIcon fluidIcon = grinderRecipe.fluidStack.getFluid().getIcon();
|
IIcon fluidIcon = grinderRecipe.fluidStack.getFluid().getIcon();
|
||||||
if (fluidIcon != null) {
|
if (fluidIcon != null) {
|
||||||
// GuiDraw.drawRect(7, 16, 176, 31, 0);
|
// GuiDraw.drawRect(7, 16, 176, 31, 0);
|
||||||
|
|
|
@ -11,26 +11,26 @@ import java.util.List;
|
||||||
*/
|
*/
|
||||||
public interface INeiBaseRecipe {
|
public interface INeiBaseRecipe {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add the inputs and the outputs
|
* Add the inputs and the outputs
|
||||||
*
|
*
|
||||||
* @param input add the input stacks to this
|
* @param input add the input stacks to this
|
||||||
* @param outputs add this output stacks to this
|
* @param outputs add this output stacks to this
|
||||||
*/
|
*/
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType);
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the recipe name that is used for the recipe
|
* @return the recipe name that is used for the recipe
|
||||||
*/
|
*/
|
||||||
public String getRecipeName();
|
public String getRecipeName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the guiTexture location
|
* @return the guiTexture location
|
||||||
*/
|
*/
|
||||||
public String getGuiTexture();
|
public String getGuiTexture();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the gui class for the recipe
|
* @return the gui class for the recipe
|
||||||
*/
|
*/
|
||||||
public Class<? extends GuiContainer> getGuiClass();
|
public Class<? extends GuiContainer> getGuiClass();
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,47 +9,47 @@ import techreborn.util.ItemUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class ImplosionCompressorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
public class ImplosionCompressorRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||||
@Override
|
@Override
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
if (recipeType.getInputs().size() > 0) {
|
if (recipeType.getInputs().size() > 0) {
|
||||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 37 - offset, 26 - offset);
|
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 37 - offset, 26 - offset);
|
||||||
input.add(pStack);
|
input.add(pStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getInputs().size() > 1) {
|
if (recipeType.getInputs().size() > 1) {
|
||||||
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 37 - offset, 44 - offset);
|
PositionedStack pStack2 = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(1)), 37 - offset, 44 - offset);
|
||||||
input.add(pStack2);
|
input.add(pStack2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 0) {
|
if (recipeType.getOutputsSize() > 0) {
|
||||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 93 - offset, 35 - offset);
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 93 - offset, 35 - offset);
|
||||||
outputs.add(pStack3);
|
outputs.add(pStack3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 1) {
|
if (recipeType.getOutputsSize() > 1) {
|
||||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 111 - offset, 35 - offset);
|
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 111 - offset, 35 - offset);
|
||||||
outputs.add(pStack4);
|
outputs.add(pStack4);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "implosionCompressorRecipe";
|
return "implosionCompressorRecipe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/implosion_compressor.png";
|
return "techreborn:textures/gui/implosion_compressor.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiImplosionCompressor.class;
|
return GuiImplosionCompressor.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,57 +4,56 @@ import codechicken.nei.PositionedStack;
|
||||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||||
import techreborn.api.recipe.IBaseRecipeType;
|
import techreborn.api.recipe.IBaseRecipeType;
|
||||||
import techreborn.client.gui.GuiIndustrialSawmill;
|
import techreborn.client.gui.GuiIndustrialSawmill;
|
||||||
import techreborn.util.ItemUtils;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class IndustrialSawmillRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
public class IndustrialSawmillRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||||
@Override
|
@Override
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
if (recipeType.getInputs().size() > 0) {
|
if (recipeType.getInputs().size() > 0) {
|
||||||
PositionedStack pStack = new PositionedStack(recipeType.getInputs().get(0), 32 - offset, 26 - offset);
|
PositionedStack pStack = new PositionedStack(recipeType.getInputs().get(0), 32 - offset, 26 - offset);
|
||||||
input.add(pStack);
|
input.add(pStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getInputs().size() > 1) {
|
if (recipeType.getInputs().size() > 1) {
|
||||||
PositionedStack pStack2 = new PositionedStack(recipeType.getInputs().get(1), 32 - offset, 44 - offset);
|
PositionedStack pStack2 = new PositionedStack(recipeType.getInputs().get(1), 32 - offset, 44 - offset);
|
||||||
input.add(pStack2);
|
input.add(pStack2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 0) {
|
if (recipeType.getOutputsSize() > 0) {
|
||||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 84 - offset, 35 - offset);
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 84 - offset, 35 - offset);
|
||||||
outputs.add(pStack3);
|
outputs.add(pStack3);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 1) {
|
if (recipeType.getOutputsSize() > 1) {
|
||||||
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 102 - offset, 35 - offset);
|
PositionedStack pStack4 = new PositionedStack(recipeType.getOutput(1), 102 - offset, 35 - offset);
|
||||||
outputs.add(pStack4);
|
outputs.add(pStack4);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 2) {
|
if (recipeType.getOutputsSize() > 2) {
|
||||||
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 120 - offset, 35 - offset);
|
PositionedStack pStack5 = new PositionedStack(recipeType.getOutput(2), 120 - offset, 35 - offset);
|
||||||
outputs.add(pStack5);
|
outputs.add(pStack5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "industrialSawmillRecipe";
|
return "industrialSawmillRecipe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/industrial_sawmill.png";
|
return "techreborn:textures/gui/industrial_sawmill.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiIndustrialSawmill.class;
|
return GuiIndustrialSawmill.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,37 +9,37 @@ import techreborn.util.ItemUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class LatheRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
public class LatheRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||||
@Override
|
@Override
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
if (recipeType.getInputs().size() > 0) {
|
if (recipeType.getInputs().size() > 0) {
|
||||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 56 - offset, 17 - offset);
|
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 56 - offset, 17 - offset);
|
||||||
input.add(pStack);
|
input.add(pStack);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (recipeType.getOutputsSize() > 0) {
|
if (recipeType.getOutputsSize() > 0) {
|
||||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
|
||||||
outputs.add(pStack3);
|
outputs.add(pStack3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "latheRecipe";
|
return "latheRecipe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/lathe.png";
|
return "techreborn:textures/gui/lathe.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiLathe.class;
|
return GuiLathe.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,36 +9,36 @@ import techreborn.util.ItemUtils;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class PlateCuttingMachineRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
public class PlateCuttingMachineRecipeHandler extends GenericRecipeHander implements INeiBaseRecipe {
|
||||||
@Override
|
@Override
|
||||||
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
public void addPositionedStacks(List<PositionedStack> input, List<PositionedStack> outputs, IBaseRecipeType recipeType) {
|
||||||
int offset = 4;
|
int offset = 4;
|
||||||
if (recipeType.getInputs().size() > 0) {
|
if (recipeType.getInputs().size() > 0) {
|
||||||
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 56 - offset, 17 - offset);
|
PositionedStack pStack = new PositionedStack(ItemUtils.getStackWithAllOre(recipeType.getInputs().get(0)), 56 - offset, 17 - offset);
|
||||||
input.add(pStack);
|
input.add(pStack);
|
||||||
}
|
}
|
||||||
if (recipeType.getOutputsSize() > 0) {
|
if (recipeType.getOutputsSize() > 0) {
|
||||||
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
|
PositionedStack pStack3 = new PositionedStack(recipeType.getOutput(0), 116 - offset, 35 - offset);
|
||||||
outputs.add(pStack3);
|
outputs.add(pStack3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getRecipeName() {
|
public String getRecipeName() {
|
||||||
return "plateCuttingMachineRecipe";
|
return "plateCuttingMachineRecipe";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getGuiTexture() {
|
public String getGuiTexture() {
|
||||||
return "techreborn:textures/gui/plate_cutting_machine.png";
|
return "techreborn:textures/gui/plate_cutting_machine.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Class<? extends GuiContainer> getGuiClass() {
|
public Class<? extends GuiContainer> getGuiClass() {
|
||||||
return GuiPlateCuttingMachine.class;
|
return GuiPlateCuttingMachine.class;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public INeiBaseRecipe getNeiBaseRecipe() {
|
public INeiBaseRecipe getNeiBaseRecipe() {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
30
src/main/java/techreborn/compat/qLib/QLib.java
Normal file
30
src/main/java/techreborn/compat/qLib/QLib.java
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
package techreborn.compat.qLib;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
|
import techreborn.compat.ICompatModule;
|
||||||
|
import techreborn.init.ModParts;
|
||||||
|
|
||||||
|
public class QLib implements ICompatModule {
|
||||||
|
@Override
|
||||||
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
|
ModParts.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serverStarting(FMLServerStartingEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,31 +0,0 @@
|
||||||
package techreborn.compat.recipes;
|
|
||||||
|
|
||||||
import techreborn.util.LogHelper;
|
|
||||||
import cpw.mods.fml.common.Loader;
|
|
||||||
|
|
||||||
public class RecipeManager {
|
|
||||||
|
|
||||||
public static void init()
|
|
||||||
{
|
|
||||||
if (Loader.isModLoaded("IC2"))
|
|
||||||
{
|
|
||||||
RecipesIC2.init();
|
|
||||||
|
|
||||||
LogHelper.info("IC2 Compat Loaded");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Loader.isModLoaded("BuildCraft"))
|
|
||||||
{
|
|
||||||
RecipesBuildcraft.init();
|
|
||||||
|
|
||||||
LogHelper.info("Buildcraft Compat Loaded");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Loader.isModLoaded("ThermalExpansion"))
|
|
||||||
{
|
|
||||||
RecipesThermalExpansion.init();
|
|
||||||
|
|
||||||
LogHelper.info("ThermalExpansion Compat Loaded");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -3,38 +3,21 @@ package techreborn.compat.recipes;
|
||||||
import buildcraft.builders.BlockQuarry;
|
import buildcraft.builders.BlockQuarry;
|
||||||
import buildcraft.core.Version;
|
import buildcraft.core.Version;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
import ic2.api.item.IC2Items;
|
import ic2.api.item.IC2Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import techreborn.compat.ICompatModule;
|
||||||
import techreborn.util.CraftingHelper;
|
import techreborn.util.CraftingHelper;
|
||||||
import techreborn.util.LogHelper;
|
import techreborn.util.LogHelper;
|
||||||
import techreborn.util.RecipeRemover;
|
import techreborn.util.RecipeRemover;
|
||||||
|
|
||||||
public class RecipesBuildcraft {
|
public class RecipesBuildcraft implements ICompatModule {
|
||||||
|
|
||||||
public static BlockQuarry quarryBlock;
|
public static BlockQuarry quarryBlock;
|
||||||
|
|
||||||
public static void init() {
|
|
||||||
try {
|
|
||||||
String itemClass = "buildcraft.BuildCraftBuilders";
|
|
||||||
if (!Version.getVersion().startsWith("7")) {//Buildcraft 6
|
|
||||||
if (Loader.isModLoaded("BuildCraft|Factory")) {
|
|
||||||
itemClass = "buildcraft.BuildCraftFactory";
|
|
||||||
}
|
|
||||||
} else if (!Loader.isModLoaded("Buildcraft|Builders")) { //Buildcraft 7
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Object obj = Class.forName(itemClass).getField("quarryBlock").get(null);
|
|
||||||
if (obj instanceof BlockQuarry) {
|
|
||||||
quarryBlock = (BlockQuarry) obj;
|
|
||||||
}
|
|
||||||
} catch (Exception ex) {
|
|
||||||
LogHelper.fatal("Could not retrieve quarry block from Buildcraft! This is a fatal error!");
|
|
||||||
ex.printStackTrace();
|
|
||||||
}
|
|
||||||
removeRecipes();
|
|
||||||
addRecipies();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void removeRecipes() {
|
public static void removeRecipes() {
|
||||||
RecipeRemover.removeAnyRecipe(new ItemStack(
|
RecipeRemover.removeAnyRecipe(new ItemStack(
|
||||||
quarryBlock));
|
quarryBlock));
|
||||||
|
@ -56,4 +39,41 @@ public class RecipesBuildcraft {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
|
try {
|
||||||
|
String itemClass = "buildcraft.BuildCraftBuilders";
|
||||||
|
if (!Version.getVersion().startsWith("7")) {//Buildcraft 6
|
||||||
|
if (Loader.isModLoaded("BuildCraft|Factory")) {
|
||||||
|
itemClass = "buildcraft.BuildCraftFactory";
|
||||||
|
}
|
||||||
|
} else if (!Loader.isModLoaded("Buildcraft|Builders")) { //Buildcraft 7
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Object obj = Class.forName(itemClass).getField("quarryBlock").get(null);
|
||||||
|
if (obj instanceof BlockQuarry) {
|
||||||
|
quarryBlock = (BlockQuarry) obj;
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LogHelper.fatal("Could not retrieve quarry block from Buildcraft! This is a fatal error!");
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
removeRecipes();
|
||||||
|
addRecipies();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serverStarting(FMLServerStartingEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,10 +1,31 @@
|
||||||
package techreborn.compat.recipes;
|
package techreborn.compat.recipes;
|
||||||
|
|
||||||
public class RecipesThermalExpansion {
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
|
import techreborn.compat.ICompatModule;
|
||||||
|
|
||||||
public static void init()
|
public class RecipesThermalExpansion implements ICompatModule {
|
||||||
{
|
|
||||||
|
@Override
|
||||||
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
// TODO remove basic machine frame recipe
|
// TODO remove basic machine frame recipe
|
||||||
// TODO replace iron in recipe to steel
|
// TODO replace iron in recipe to steel
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serverStarting(FMLServerStartingEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,37 @@
|
||||||
package techreborn.compat.waila;
|
package techreborn.compat.waila;
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaRegistrar;
|
|
||||||
import techreborn.tiles.TileMachineBase;
|
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLInterModComms;
|
import cpw.mods.fml.common.event.FMLInterModComms;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
|
import mcp.mobius.waila.api.IWailaRegistrar;
|
||||||
|
import techreborn.compat.ICompatModule;
|
||||||
|
import techreborn.tiles.TileMachineBase;
|
||||||
|
|
||||||
public class CompatModuleWaila {
|
public class CompatModuleWaila implements ICompatModule {
|
||||||
|
|
||||||
public void init(FMLInitializationEvent event)
|
@Override
|
||||||
{
|
public void preInit(FMLPreInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(FMLInitializationEvent event) {
|
||||||
FMLInterModComms.sendMessage("Waila", "register", getClass().getName()
|
FMLInterModComms.sendMessage("Waila", "register", getClass().getName()
|
||||||
+ ".callbackRegister");
|
+ ".callbackRegister");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void callbackRegister(IWailaRegistrar registrar)
|
@Override
|
||||||
{
|
public void postInit(FMLPostInitializationEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serverStarting(FMLServerStartingEvent event) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void callbackRegister(IWailaRegistrar registrar) {
|
||||||
registrar.registerBodyProvider(new WailaProviderMachines(),
|
registrar.registerBodyProvider(new WailaProviderMachines(),
|
||||||
TileMachineBase.class);
|
TileMachineBase.class);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package techreborn.compat.waila;
|
package techreborn.compat.waila;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||||
import mcp.mobius.waila.api.IWailaDataAccessor;
|
import mcp.mobius.waila.api.IWailaDataAccessor;
|
||||||
import mcp.mobius.waila.api.IWailaDataProvider;
|
import mcp.mobius.waila.api.IWailaDataProvider;
|
||||||
|
@ -13,14 +10,16 @@ import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import techreborn.tiles.TileMachineBase;
|
import techreborn.tiles.TileMachineBase;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class WailaProviderMachines implements IWailaDataProvider {
|
public class WailaProviderMachines implements IWailaDataProvider {
|
||||||
|
|
||||||
private List<String> info = new ArrayList<String>();
|
private List<String> info = new ArrayList<String>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaBody(ItemStack item, List<String> tip,
|
public List<String> getWailaBody(ItemStack item, List<String> tip,
|
||||||
IWailaDataAccessor accessor, IWailaConfigHandler config)
|
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
{
|
|
||||||
|
|
||||||
TileMachineBase machine = (TileMachineBase) accessor.getTileEntity();
|
TileMachineBase machine = (TileMachineBase) accessor.getTileEntity();
|
||||||
|
|
||||||
|
@ -33,32 +32,28 @@ public class WailaProviderMachines implements IWailaDataProvider {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaHead(ItemStack item, List<String> tip,
|
public List<String> getWailaHead(ItemStack item, List<String> tip,
|
||||||
IWailaDataAccessor accessor, IWailaConfigHandler config)
|
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
{
|
|
||||||
|
|
||||||
return tip;
|
return tip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getWailaTail(ItemStack item, List<String> tip,
|
public List<String> getWailaTail(ItemStack item, List<String> tip,
|
||||||
IWailaDataAccessor accessor, IWailaConfigHandler config)
|
IWailaDataAccessor accessor, IWailaConfigHandler config) {
|
||||||
{
|
|
||||||
|
|
||||||
return tip;
|
return tip;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getWailaStack(IWailaDataAccessor accessor,
|
public ItemStack getWailaStack(IWailaDataAccessor accessor,
|
||||||
IWailaConfigHandler config)
|
IWailaConfigHandler config) {
|
||||||
{
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te,
|
public NBTTagCompound getNBTData(EntityPlayerMP player, TileEntity te,
|
||||||
NBTTagCompound tag, World w, int x, int y, int z)
|
NBTTagCompound tag, World w, int x, int y, int z) {
|
||||||
{
|
|
||||||
|
|
||||||
return tag;
|
return tag;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,10 +13,6 @@ import java.util.List;
|
||||||
|
|
||||||
public abstract class TileMachineBase extends TileEntity {
|
public abstract class TileMachineBase extends TileEntity {
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
/**
|
|
||||||
* Try not to use this
|
|
||||||
*/
|
|
||||||
public void syncWithAll() {
|
public void syncWithAll() {
|
||||||
if (!worldObj.isRemote) {
|
if (!worldObj.isRemote) {
|
||||||
PacketHandler.sendPacketToAllPlayers(getDescriptionPacket(),
|
PacketHandler.sendPacketToAllPlayers(getDescriptionPacket(),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue