-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathMisc.java
More file actions
40 lines (34 loc) · 1.47 KB
/
Misc.java
File metadata and controls
40 lines (34 loc) · 1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package com.blamejared.compat.betterwithmods;
import betterwithmods.module.hardcore.crafting.HCFurnace;
import com.blamejared.ModTweaker;
import com.blamejared.mtlib.utils.BaseMapAddition;
import crafttweaker.annotations.ModOnly;
import crafttweaker.annotations.ZenRegister;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.minecraft.CraftTweakerMC;
import net.minecraft.item.crafting.Ingredient;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@ZenClass("mods.betterwithmods.Misc")
@ModOnly("betterwithmods")
@ZenRegister
public class Misc {
@ZenMethod
public static void setFurnaceSmeltingTime(IIngredient ingredient, int time) {
HashMap<Ingredient,Integer> map = new HashMap<>();
map.put(CraftTweakerMC.getIngredient(ingredient),time);
ModTweaker.LATE_ADDITIONS.add(new SetSmeltingTime(map));
}
public static class SetSmeltingTime extends BaseMapAddition<Ingredient,Integer> {
protected SetSmeltingTime(Map<Ingredient,Integer> map) {
super("Set HCFurnace Smelting Time", HCFurnace.FURNACE_TIMINGS, map);
}
@Override
protected String getRecipeInfo(Map.Entry<Ingredient,Integer> recipe) {
return Arrays.toString(recipe.getKey().getMatchingStacks()) + " -> " + recipe.getValue(); //Fortunately mojang is adding a toString method to Ingredient
}
}
}