コード例 #1
0
 @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");
   }
 }
コード例 #2
0
 @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");
   }
 }
コード例 #3
0
 /**
  * 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));
   }
 }
コード例 #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);
    }
  }
コード例 #5
0
ファイル: FruitPicker.java プロジェクト: fluffle/MineTweaker3
 @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);
     }
   }
 }