Search in sources :

Example 1 with Things

use of com.enderio.core.common.util.stackable.Things in project EnderIO by SleepyTrousers.

the class HandleThings method read.

@Override
public Things read(@Nonnull Registry registry, @Nonnull Set<NBTAction> phase, @Nonnull NBTTagCompound nbt, @Nullable Field field, @Nonnull String name, @Nullable Things object) throws IllegalArgumentException, IllegalAccessException, InstantiationException, NoHandlerFoundException {
    object = new Things();
    NBTTagList list = nbt.getTagList(name, 8);
    for (int i = 0; i < list.tagCount(); i++) {
        object.add(list.getStringTagAt(i));
    }
    return object;
}
Also used : NBTTagList(net.minecraft.nbt.NBTTagList) Things(com.enderio.core.common.util.stackable.Things)

Example 2 with Things

use of com.enderio.core.common.util.stackable.Things in project EnderIO by SleepyTrousers.

the class Glowstone method registerGlowstoneRecipes.

public static void registerGlowstoneRecipes() {
    Fluid f = FluidRegistry.getFluid(TicProxy.GLOWSTONE_FLUID_NAME);
    if (f != null) {
        // Note: We match the old TE amounts
        TicHandler.instance.registerSmelterySmelting(new Things().add(Items.GLOWSTONE_DUST), f, 250);
        TicHandler.instance.registerSmelterySmelting(new Things().add(Blocks.GLOWSTONE), f, 1000);
        TicHandler.instance.registerBasinCasting(new Things().add(Blocks.GLOWSTONE), new Things(), f, 1000);
    }
}
Also used : Fluid(net.minecraftforge.fluids.Fluid) Things(com.enderio.core.common.util.stackable.Things)

Example 3 with Things

use of com.enderio.core.common.util.stackable.Things in project EnderIO by SleepyTrousers.

the class Redstone method registerRedstoneRecipes.

public static void registerRedstoneRecipes() {
    Fluid f = FluidRegistry.getFluid(TicProxy.REDSTONE_FLUID_NAME);
    if (f != null) {
        // Note: We match the old TE amounts
        TicHandler.instance.registerSmelterySmelting(new Things().add(Items.REDSTONE), f, 100);
        TicHandler.instance.registerSmelterySmelting(new Things().add(Blocks.REDSTONE_BLOCK), f, 900);
        TicHandler.instance.registerBasinCasting(new Things().add(Blocks.REDSTONE_BLOCK), new Things(), f, 900);
    }
}
Also used : Fluid(net.minecraftforge.fluids.Fluid) Things(com.enderio.core.common.util.stackable.Things)

Example 4 with Things

use of com.enderio.core.common.util.stackable.Things in project EnderIO by SleepyTrousers.

the class Ender method registerEnderRecipes.

public static void registerEnderRecipes() {
    Fluid f = FluidRegistry.getFluid(TicProxy.ENDER_FLUID_NAME);
    if (f != null) {
        // Note: We match the old TE amounts
        TicHandler.instance.registerSmelterySmelting(new Things().add(Items.ENDER_PEARL), f, 250);
        // Need to do this late because of the cast
        Things cast = new Things("tconstruct:cast_custom:2");
        TicHandler.instance.registerTableCast(new Things().add(Items.ENDER_PEARL), cast, f, 250, false);
    }
    TicHandler.instance.registerSmelterySmelting(new Things().add(POWDER_ENDER.getStack()), f, 250 / 9);
}
Also used : Fluid(net.minecraftforge.fluids.Fluid) Things(com.enderio.core.common.util.stackable.Things)

Example 5 with Things

use of com.enderio.core.common.util.stackable.Things in project EnderIO by SleepyTrousers.

the class TicRegistration method tryBasinAloying.

private static void tryBasinAloying(@Nonnull Things result, NNList<Things> inputs) {
    if (!result.isValid() || result.getItemStack().getCount() != 1 || !(result.getItemStack().getItem() instanceof ItemBlock) || inputs.size() != 2) {
        return;
    }
    final Things input0 = inputs.get(0);
    final Things input1 = inputs.get(1);
    if (!input0.isValid() || !input1.isValid()) {
        return;
    }
    FluidStack a = getFluidForItems(input0);
    FluidStack b = getFluidForItems(input1);
    if ((a == null) == (b == null)) {
        return;
    }
    if (a == null && !(input0.getItemStack().getCount() == 1 && input0.getItemStack().getItem() instanceof ItemBlock)) {
        return;
    }
    if (b == null && !(input1.getItemStack().getCount() == 1 && input1.getItemStack().getItem() instanceof ItemBlock)) {
        return;
    }
    if (a != null) {
        TicHandler.instance.registerBasinCasting(result, input1, a.getFluid(), a.amount);
    } else if (b != null) {
        TicHandler.instance.registerBasinCasting(result, input0, b.getFluid(), b.amount);
    }
}
Also used : FluidStack(net.minecraftforge.fluids.FluidStack) Things(com.enderio.core.common.util.stackable.Things) ItemBlock(net.minecraft.item.ItemBlock)

Aggregations

Things (com.enderio.core.common.util.stackable.Things)9 Fluid (net.minecraftforge.fluids.Fluid)3 FluidStack (net.minecraftforge.fluids.FluidStack)2 NNList (com.enderio.core.common.util.NNList)1 EnchanterRecipe (crazypants.enderio.base.recipe.enchanter.EnchanterRecipe)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 Nonnull (javax.annotation.Nonnull)1 ItemBlock (net.minecraft.item.ItemBlock)1 ItemStack (net.minecraft.item.ItemStack)1 NBTTagList (net.minecraft.nbt.NBTTagList)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 TextComponentString (net.minecraft.util.text.TextComponentString)1 ConfigCategory (net.minecraftforge.common.config.ConfigCategory)1 Property (net.minecraftforge.common.config.Property)1