-
Notifications
You must be signed in to change notification settings - Fork 18
/
InspirationsShared.java
69 lines (60 loc) · 2.51 KB
/
InspirationsShared.java
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
package knightminer.inspirations.shared;
import knightminer.inspirations.common.CommonProxy;
import knightminer.inspirations.common.Config;
import knightminer.inspirations.common.PulseBase;
import knightminer.inspirations.common.item.HidableItem;
import net.minecraft.item.Food;
import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.potion.EffectInstance;
import net.minecraft.potion.Effects;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.LootTableLoadEvent;
import net.minecraftforge.event.RegistryEvent.Register;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.lifecycle.InterModEnqueueEvent;
import net.minecraftforge.fml.event.lifecycle.InterModProcessEvent;
import net.minecraftforge.registries.IForgeRegistry;
import slimeknights.mantle.pulsar.pulse.Pulse;
@Pulse(id = InspirationsShared.pulseID, description = "Blocks and items used by all modules", forced = true)
public class InspirationsShared extends PulseBase {
public static final String pulseID = "InspirationsShared";
@SuppressWarnings("Convert2MethodRef")
public static Object proxy = DistExecutor.callWhenOn(Dist.CLIENT, ()->()->new SharedClientProxy());
// materials
public static Item splashBottle;
public static Item lingeringBottle;
public static Item mushrooms;
public static Item rabbitStewMix;
@SubscribeEvent
public void registerItems(Register<Item> event) {
IForgeRegistry<Item> r = event.getRegistry();
// add items from modules
if(isRecipesLoaded()) {
splashBottle = registerItem(r, new HidableItem(
new Item.Properties().group(ItemGroup.BREWING),
Config::enableCauldronPotions
), "splash_bottle");
lingeringBottle = registerItem(r, new HidableItem(
new Item.Properties().group(ItemGroup.BREWING),
Config::enableCauldronPotions
), "lingering_bottle");
mushrooms = registerItem(r, new HidableItem(
new Item.Properties().group(ItemGroup.MATERIALS),
Config::enableCauldronFluids
), "mushrooms");
rabbitStewMix = registerItem(r, new HidableItem(
new Item.Properties().group(ItemGroup.MATERIALS),
Config::enableCauldronFluids
), "rabbit_stew_mix");
}
}
@SubscribeEvent
public void setup(FMLCommonSetupEvent event) {
MinecraftForge.EVENT_BUS.addListener(SharedEvents::updateMilkCooldown);
}
}