Search in sources :

Example 1 with GateVariant

use of buildcraft.transport.gate.GateVariant in project BuildCraft by BuildCraft.

the class BCTransportRecipes method makeGateModifierAssembly.

private static void makeGateModifierAssembly(int multiplier, EnumGateMaterial material, EnumGateModifier modifier, IngredientStack... mods) {
    for (EnumGateLogic logic : EnumGateLogic.VALUES) {
        String name = String.format("gate-modifier-%s-%s-%s", logic, material, modifier);
        ItemStack toUpgrade = BCTransportItems.plugGate.getStack(new GateVariant(logic, material, EnumGateModifier.NO_MODIFIER));
        ItemStack output = BCTransportItems.plugGate.getStack(new GateVariant(logic, material, modifier));
        ImmutableSet<IngredientStack> input = new ImmutableSet.Builder<IngredientStack>().add(IngredientStack.of(toUpgrade)).add(mods).build();
        AssemblyRecipeRegistry.register((new AssemblyRecipeBasic(name, MjAPI.MJ * multiplier, input, output)));
    }
}
Also used : AssemblyRecipeBasic(buildcraft.api.recipes.AssemblyRecipeBasic) ImmutableSet(com.google.common.collect.ImmutableSet) GateVariant(buildcraft.transport.gate.GateVariant) ItemStack(net.minecraft.item.ItemStack) IngredientStack(buildcraft.api.recipes.IngredientStack) EnumGateLogic(buildcraft.transport.gate.EnumGateLogic)

Example 2 with GateVariant

use of buildcraft.transport.gate.GateVariant in project BuildCraft by BuildCraft.

the class BCTransportRecipes method makeGateRecipe.

private static void makeGateRecipe(RecipeBuilderShaped builder, EnumGateMaterial material, EnumGateModifier modifier) {
    GateVariant variant = new GateVariant(EnumGateLogic.AND, material, modifier);
    builder.setResult(BCTransportItems.plugGate.getStack(variant));
    builder.registerNbtAware("buildcrafttransport:plug_gate_create_" + material + "_" + modifier);
}
Also used : GateVariant(buildcraft.transport.gate.GateVariant)

Example 3 with GateVariant

use of buildcraft.transport.gate.GateVariant in project BuildCraft by BuildCraft.

the class ItemPluggableGate method addInformation.

@Override
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, World world, List<String> tooltip, ITooltipFlag flag) {
    GateVariant variant = getVariant(StackUtil.asNonNull(stack));
    tooltip.add(LocaleUtil.localize("gate.slots", variant.numSlots));
    if (variant.numTriggerArgs == variant.numActionArgs) {
        if (variant.numTriggerArgs > 0) {
            tooltip.add(LocaleUtil.localize("gate.params", variant.numTriggerArgs));
        }
    } else {
        if (variant.numTriggerArgs > 0) {
            tooltip.add(LocaleUtil.localize("gate.params.trigger", variant.numTriggerArgs));
        }
        if (variant.numActionArgs > 0) {
            tooltip.add(LocaleUtil.localize("gate.params.action", variant.numTriggerArgs));
        }
    }
}
Also used : GateVariant(buildcraft.transport.gate.GateVariant) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 4 with GateVariant

use of buildcraft.transport.gate.GateVariant in project BuildCraft by BuildCraft.

the class ItemPluggableGate method onPlace.

@Override
public PipePluggable onPlace(@Nonnull ItemStack stack, IPipeHolder holder, EnumFacing side, EntityPlayer player, EnumHand hand) {
    GateVariant variant = getVariant(stack);
    SoundUtil.playBlockPlace(holder.getPipeWorld(), holder.getPipePos(), variant.material.block.getDefaultState());
    PluggableDefinition def = BCTransportPlugs.gate;
    return new PluggableGate(def, holder, side, variant);
}
Also used : PluggableGate(buildcraft.transport.plug.PluggableGate) GateVariant(buildcraft.transport.gate.GateVariant) PluggableDefinition(buildcraft.api.transport.pluggable.PluggableDefinition)

Example 5 with GateVariant

use of buildcraft.transport.gate.GateVariant in project BuildCraft by BuildCraft.

the class BCTransportRecipes method makeGateAssembly.

private static void makeGateAssembly(int multiplier, EnumGateMaterial material, EnumGateModifier modifier, EnumRedstoneChipset chipset, IngredientStack... additional) {
    ImmutableSet.Builder<IngredientStack> temp = ImmutableSet.builder();
    temp.add(IngredientStack.of(chipset.getStack()));
    temp.add(additional);
    ImmutableSet<IngredientStack> input = temp.build();
    String name = String.format("gate-and-%s-%s", material, modifier);
    ItemStack output = BCTransportItems.plugGate.getStack(new GateVariant(EnumGateLogic.AND, material, modifier));
    AssemblyRecipeRegistry.register((new AssemblyRecipeBasic(name, MjAPI.MJ * multiplier, input, output)));
    name = String.format("gate-or-%s-%s", material, modifier);
    output = BCTransportItems.plugGate.getStack(new GateVariant(EnumGateLogic.OR, material, modifier));
    AssemblyRecipeRegistry.register((new AssemblyRecipeBasic(name, MjAPI.MJ * multiplier, input, output)));
}
Also used : AssemblyRecipeBasic(buildcraft.api.recipes.AssemblyRecipeBasic) ImmutableSet(com.google.common.collect.ImmutableSet) GateVariant(buildcraft.transport.gate.GateVariant) IngredientStack(buildcraft.api.recipes.IngredientStack) ItemStack(net.minecraft.item.ItemStack)

Aggregations

GateVariant (buildcraft.transport.gate.GateVariant)6 AssemblyRecipeBasic (buildcraft.api.recipes.AssemblyRecipeBasic)3 IngredientStack (buildcraft.api.recipes.IngredientStack)3 ItemStack (net.minecraft.item.ItemStack)3 ImmutableSet (com.google.common.collect.ImmutableSet)2 AssemblyRecipe (buildcraft.api.recipes.AssemblyRecipe)1 PluggableDefinition (buildcraft.api.transport.pluggable.PluggableDefinition)1 IngredientNBTBC (buildcraft.lib.recipe.IngredientNBTBC)1 RecipeBuilderShaped (buildcraft.lib.recipe.RecipeBuilderShaped)1 EnumGateLogic (buildcraft.transport.gate.EnumGateLogic)1 EnumGateMaterial (buildcraft.transport.gate.EnumGateMaterial)1 EnumGateModifier (buildcraft.transport.gate.EnumGateModifier)1 PluggableGate (buildcraft.transport.plug.PluggableGate)1 HashSet (java.util.HashSet)1 EnumDyeColor (net.minecraft.item.EnumDyeColor)1 Item (net.minecraft.item.Item)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)1 ShapedOreRecipe (net.minecraftforge.oredict.ShapedOreRecipe)1