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
78
79
80
81
82
83
84
85
86
87
88
89
90
|
package ganarchy.chewstuff;
import net.fabricmc.api.ModInitializer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* The mod's entry point.
*/
public class ChewStuff implements ModInitializer {
/**
* The ChewStuff Logger.
*/
public static final Logger LOGGER = LoggerFactory.getLogger("chewstuff");
/**
* Silicone. Not to be confused with silicon. Crafting material for
* chews.
*/
public static final Item SILICONE = new Item(
new Item.Settings().group(ItemGroup.MISC)
);
/**
* 1 day, in ticks.
*/
public static final int DAY_MULTIPLIER = 24 * 60 * 60 * 20;
/**
* Soft chew. Lasts 5 days, 1 effect slot.
*/
public static final Item SOFT_CHEW = new ChewableItem(
1,
new Item.Settings().maxDamage(5 * DAY_MULTIPLIER).group(ItemGroup.TOOLS)
);
/**
* Medium chew. Lasts 6 days, 2 effect slots.
*/
public static final Item MEDIUM_CHEW = new ChewableItem(
2,
new Item.Settings().maxDamage(6 * DAY_MULTIPLIER).group(ItemGroup.TOOLS)
);
/**
* Hard chew. Lasts 7 days, 3 effect slots.
*/
public static final Item HARD_CHEW = new ChewableItem(
3,
new Item.Settings().maxDamage(7 * DAY_MULTIPLIER).group(ItemGroup.TOOLS)
);
/**
* The stat for chew effects.
*/
public static final Identifier CHEW_EFFECTS = new Identifier(
"chewstuff", "effects"
);
@Override
public void onInitialize() {
// This code runs as soon as Minecraft is in a mod-load-ready state.
// However, some things (like resources) may still be uninitialized.
// Proceed with mild caution.
LOGGER.info("This software is made with love by a queer trans person.");
Registry.register(
Registry.ITEM,
new Identifier("chewstuff", "silicone"),
SILICONE
);
Registry.register(
Registry.ITEM,
new Identifier("chewstuff", "soft_chew"),
SOFT_CHEW
);
Registry.register(
Registry.ITEM,
new Identifier("chewstuff", "medium_chew"),
MEDIUM_CHEW
);
Registry.register(
Registry.ITEM,
new Identifier("chewstuff", "hard_chew"),
HARD_CHEW
);
// Registry.register(Registry.CUSTOM_STAT, CHEW_EFFECTS, CHEW_EFFECTS);
// Stats.CUSTOM.getOrCreateStat(CHEW_EFFECTS, StatFormatter.DEFAULT);
}
}
|