Boblet 574c46995c IMC recipe support for centrifuges, slightly improved centrifuge TE
or rather, slightly reduced centrifuge horribleness

2015 bobcode *shivers*
2021-08-23 16:47:49 +02:00

44 lines
1.1 KiB
Java

package com.hbm.handler.imc;
import java.util.HashMap;
import com.hbm.inventory.RecipesCommon;
import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class IMCCrystallizer extends IMCHandler {
public static HashMap<Object, ItemStack> buffer = new HashMap();
@Override
public void process(IMCMessage message) {
NBTTagCompound data = message.getNBTValue();
NBTTagCompound output = data.getCompoundTag("output");
ItemStack out = ItemStack.loadItemStackFromNBT(output);
if(out == null) {
this.printError(message, "Output stack could not be read!");
return;
}
NBTTagCompound input = data.getCompoundTag("input");
ItemStack in = ItemStack.loadItemStackFromNBT(input);
if(in != null) {
buffer.put(new RecipesCommon.ComparableStack(in), out);
} else {
String dict = data.getString("oredict");
if(!dict.isEmpty()) {
buffer.put(dict, out);
} else {
this.printError(message, "Input stack could not be read!");
}
}
}
}