@Override
 public void addAll(IOreDictEntry entry) {
   if (entry instanceof MCOreDictEntry) {
     MineTweakerAPI.apply(new ActionAddAll(id, ((MCOreDictEntry) entry).id));
   } else {
     MineTweakerAPI.logError("not a valid entry");
   }
 }
 @Override
 public void mirror(IOreDictEntry other) {
   if (other instanceof MCOreDictEntry) {
     MineTweakerAPI.apply(new ActionMirror(id, ((MCOreDictEntry) other).id));
   } else {
     MineTweakerAPI.logError("not a valid oredict entry");
   }
 }
 /**
  * Adds an implosion compressor recipe with one or two outputs.
  *
  * @param output array with 1-2 outputs
  * @param input primary input
  * @param tnt amount of TNT needed
  */
 @ZenMethod
 public static void addRecipe(IItemStack[] output, IItemStack input, int tnt) {
   if (output.length == 0) {
     MineTweakerAPI.logError("Implosion compressor recipe requires at least 1 output");
   } else {
     MineTweakerAPI.apply(
         new AddRecipeAction(output[0], output.length > 1 ? output[1] : null, input, tnt));
   }
 }
Example #4
0
  public void addFuelPattern(SetFuelPattern pattern) {
    List<IItemStack> items = pattern.getPattern().getItems();
    if (items == null) {
      MineTweakerAPI.logError("Cannot set fuel for <*>");
      return;
    }

    for (IItemStack item : pattern.getPattern().getItems()) {
      if (!quickList.containsKey(item.getName())) {
        quickList.put(item.getName(), new ArrayList<SetFuelPattern>());
      }
      quickList.get(item.getName()).add(pattern);
    }
  }
Example #5
0
 @Override
 public void apply() {
   Map<Block, IFactoryFruit> fruits = MFRRegistry.getFruits();
   for (IBlock partial : fruit.block.getBlocks()) {
     Block block = ((MCBlockDefinition) partial.getDefinition()).getInternalBlock();
     if (fruits != null && fruits.containsKey(block)) {
       IFactoryFruit existingFruit = fruits.get(block);
       if (existingFruit instanceof TweakerFruitPartial) {
         TweakerFruitPartial existingFruitPartial = (TweakerFruitPartial) existingFruit;
         if (!existingFruitPartial.fruits.contains(fruit)) {
           existingFruitPartial.fruits.add(fruit);
         }
       } else {
         MineTweakerAPI.logError("A non-MineTweaker fruit already exists for this ID");
       }
     } else {
       TweakerFruitPartial factoryFruit = new TweakerFruitPartial(block);
       MFRRegistry.registerFruit(factoryFruit);
     }
   }
 }