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)));
}
}
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);
}
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));
}
}
}
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);
}
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)));
}
Aggregations