-
-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathKiln.java
More file actions
77 lines (62 loc) · 2.16 KB
/
Kiln.java
File metadata and controls
77 lines (62 loc) · 2.16 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package com.blamejared.compat.betterwithmods;
import betterwithmods.common.BWMRecipes;
import betterwithmods.common.BWRegistry;
import betterwithmods.common.registry.KilnStructureManager;
import com.blamejared.ModTweaker;
import com.blamejared.compat.betterwithmods.base.blockrecipes.KilnBuilder;
import com.blamejared.mtlib.helpers.InputHelper;
import com.blamejared.mtlib.utils.BaseAction;
import crafttweaker.annotations.ModOnly;
import crafttweaker.annotations.ZenRegister;
import crafttweaker.api.item.IIngredient;
import crafttweaker.api.item.IItemStack;
import net.minecraft.block.state.IBlockState;
import stanhebben.zenscript.annotations.NotNull;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenMethod;
import javax.annotation.Nonnull;
@ZenClass("mods.betterwithmods.Kiln")
@ModOnly("betterwithmods")
@ZenRegister
public class Kiln {
public static KilnBuilder INSTANCE = new KilnBuilder(() -> BWRegistry.KILN, "Kiln");
@ZenMethod
public static KilnBuilder builder() {
return INSTANCE;
}
@ZenMethod
public static void add(@Nonnull IIngredient input, IItemStack[] output) {
builder().buildRecipe(input, output).build();
}
@ZenMethod
public static void add(IItemStack[] output, @NotNull IIngredient input) {
add(input, output);
}
@ZenMethod
public static void remove(IItemStack input) {
INSTANCE.removeRecipe(input);
}
@ZenMethod
public static void remove(IItemStack[] outputs) {
INSTANCE.removeRecipe(outputs);
}
@ZenMethod
public static void removeAll() {
builder().removeAll();
}
@ZenMethod
public static void registerBlock(IItemStack block) {
ModTweaker.LATE_ADDITIONS.add(new KilnBlock(BWMRecipes.getStateFromStack(InputHelper.toStack(block))));
}
public static class KilnBlock extends BaseAction {
private IBlockState state;
KilnBlock(IBlockState state) {
super("Set Kiln Structure Block");
this.state = state;
}
@Override
public void apply() {
KilnStructureManager.registerKilnBlock(state);
}
}
}