-
Notifications
You must be signed in to change notification settings - Fork 81
/
NaturaGadgets.java
62 lines (54 loc) · 3.91 KB
/
NaturaGadgets.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
package com.progwml6.natura.gadgets;
import com.progwml6.natura.common.NaturaModule;
import com.progwml6.natura.gadgets.block.PunjiBlock;
import com.progwml6.natura.gadgets.data.GadgetRecipeProvider;
import com.progwml6.natura.shared.NaturaFood;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.data.DataGenerator;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.StandingAndWallBlockItem;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.LadderBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.TorchBlock;
import net.minecraft.world.level.block.WallTorchBlock;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;
import net.minecraftforge.registries.RegistryObject;
import slimeknights.mantle.item.EdibleItem;
import slimeknights.mantle.registration.object.ItemObject;
@SuppressWarnings("unused")
public final class NaturaGadgets extends NaturaModule {
/*
* Blocks
*/
public static final ItemObject<LadderBlock> stoneLadder = BLOCKS.register("stone_ladder", () -> new LadderBlock(builder(Material.DECORATION, SoundType.STONE).strength(0.1F).noOcclusion()) {}, GENERAL_BLOCK_ITEM);
public static final ItemObject<PunjiBlock> punji = BLOCKS.register("punji", () -> new PunjiBlock(builder(Material.PLANT, SoundType.GRASS).strength(3.0F).noOcclusion()), GENERAL_BLOCK_ITEM);
// torch
private static final Block.Properties STONE_TORCH = builder(Material.DECORATION, SoundType.STONE).noCollission().instabreak().lightLevel(s -> 14);
public static final RegistryObject<WallTorchBlock> wallStoneTorch = BLOCKS.registerNoItem("wall_stone_torch", () -> new WallTorchBlock(STONE_TORCH, ParticleTypes.FLAME) {});
public static final ItemObject<TorchBlock> stoneTorch = BLOCKS.register("stone_torch", () -> new TorchBlock(STONE_TORCH, ParticleTypes.FLAME) {}, (block) -> new StandingAndWallBlockItem(block, wallStoneTorch.get(), GENERAL_PROPS));
/*
* Items
*/
public static final ItemObject<Item> stoneStick = ITEMS.register("stone_stick", GENERAL_PROPS);
// jerkies
public static final ItemObject<EdibleItem> monsterJerky = ITEMS.register("monster_jerky", () -> new EdibleItem(NaturaFood.MONSTER_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> beefJerky = ITEMS.register("beef_jerky", () -> new EdibleItem(NaturaFood.BEEF_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> chickenJerky = ITEMS.register("chicken_jerky", () -> new EdibleItem(NaturaFood.CHICKEN_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> porkJerky = ITEMS.register("pork_jerky", () -> new EdibleItem(NaturaFood.PORK_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> muttonJerky = ITEMS.register("mutton_jerky", () -> new EdibleItem(NaturaFood.MUTTON_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> rabbitJerky = ITEMS.register("rabbit_jerky", () -> new EdibleItem(NaturaFood.RABBIT_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> fishJerky = ITEMS.register("fish_jerky", () -> new EdibleItem(NaturaFood.FISH_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> salmonJerky = ITEMS.register("salmon_jerky", () -> new EdibleItem(NaturaFood.SALMON_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> clownfishJerky = ITEMS.register("clownfish_jerky", () -> new EdibleItem(NaturaFood.CLOWNFISH_JERKY, TAB_GENERAL));
public static final ItemObject<EdibleItem> pufferfishJerky = ITEMS.register("pufferfish_jerky", () -> new EdibleItem(NaturaFood.PUFFERFISH_JERKY, TAB_GENERAL));
@SubscribeEvent
void gatherData(final GatherDataEvent event) {
if (event.includeServer()) {
DataGenerator datagenerator = event.getGenerator();
datagenerator.addProvider(new GadgetRecipeProvider(datagenerator));
}
}
}