|
1
|
|
|
package de.pewpewproject.lasertag.block; |
|
2
|
|
|
|
|
3
|
|
|
import de.pewpewproject.lasertag.LasertagMod; |
|
4
|
|
|
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings; |
|
5
|
|
|
import net.minecraft.block.*; |
|
6
|
|
|
import net.minecraft.sound.BlockSoundGroup; |
|
7
|
|
|
import net.minecraft.util.Identifier; |
|
8
|
|
|
import net.minecraft.util.registry.Registry; |
|
9
|
|
|
|
|
10
|
|
|
/** |
|
11
|
|
|
* Class to register all blocks |
|
12
|
|
|
* |
|
13
|
|
|
* @author Étienne Muser |
|
14
|
|
|
*/ |
|
15
|
|
|
public class Blocks { |
|
16
|
|
|
// Arena blocks |
|
17
|
|
|
public static final Block ARENA_BLOCK_ORANGE= new Block(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
18
|
|
|
public static final Block ARENA_BLOCK_PINK = new Block(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
19
|
|
|
public static final Block ARENA_BLOCK_BLUE = new Block(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
20
|
|
|
public static final Block ARENA_BLOCK_YELLOW = new Block(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
21
|
|
|
public static final Block ARENA_BLOCK_GREEN = new Block(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
22
|
|
|
public static final Block ARENA_BLOCK_PURPLE = new Block(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
23
|
|
|
public static final Block ARENA_BLOCK_RED = new Block(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
24
|
|
|
|
|
25
|
|
|
// Arena block pillars |
|
26
|
|
|
public static final Block ARENA_PILLAR_BLOCK_ORANGE = new PillarBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
27
|
|
|
public static final Block ARENA_PILLAR_BLOCK_PINK = new PillarBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
28
|
|
|
public static final Block ARENA_PILLAR_BLOCK_BLUE = new PillarBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
29
|
|
|
public static final Block ARENA_PILLAR_BLOCK_YELLOW = new PillarBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
30
|
|
|
public static final Block ARENA_PILLAR_BLOCK_GREEN = new PillarBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
31
|
|
|
public static final Block ARENA_PILLAR_BLOCK_PURPLE = new PillarBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
32
|
|
|
public static final Block ARENA_PILLAR_BLOCK_RED = new PillarBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
33
|
|
|
|
|
34
|
|
|
// Arena block stairs |
|
35
|
|
|
public static final Block ARENA_BLOCK_STAIRS_ORANGE = new StairsBlock(ARENA_BLOCK_YELLOW.getDefaultState(), FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
36
|
|
|
public static final Block ARENA_BLOCK_STAIRS_PINK = new StairsBlock(ARENA_BLOCK_YELLOW.getDefaultState(), FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
37
|
|
|
public static final Block ARENA_BLOCK_STAIRS_BLUE = new StairsBlock(ARENA_BLOCK_YELLOW.getDefaultState(), FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
38
|
|
|
public static final Block ARENA_BLOCK_STAIRS_YELLOW = new StairsBlock(ARENA_BLOCK_YELLOW.getDefaultState(), FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
39
|
|
|
public static final Block ARENA_BLOCK_STAIRS_GREEN = new StairsBlock(ARENA_BLOCK_YELLOW.getDefaultState(), FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
40
|
|
|
public static final Block ARENA_BLOCK_STAIRS_PURPLE = new StairsBlock(ARENA_BLOCK_YELLOW.getDefaultState(), FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
41
|
|
|
public static final Block ARENA_BLOCK_STAIRS_RED = new StairsBlock(ARENA_BLOCK_YELLOW.getDefaultState(), FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
42
|
|
|
|
|
43
|
|
|
// Arena block slabs |
|
44
|
|
|
public static final Block ARENA_BLOCK_SLAB_ORANGE = new SlabBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
45
|
|
|
public static final Block ARENA_BLOCK_SLAB_PINK = new SlabBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
46
|
|
|
public static final Block ARENA_BLOCK_SLAB_BLUE = new SlabBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
47
|
|
|
public static final Block ARENA_BLOCK_SLAB_YELLOW = new SlabBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
48
|
|
|
public static final Block ARENA_BLOCK_SLAB_GREEN = new SlabBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
49
|
|
|
public static final Block ARENA_BLOCK_SLAB_PURPLE = new SlabBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
50
|
|
|
public static final Block ARENA_BLOCK_SLAB_RED = new SlabBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
51
|
|
|
|
|
52
|
|
|
// Arena dividers |
|
53
|
|
|
public static final Block ARENA_DIVIDER_ORANGE = new ArenaDividerBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
54
|
|
|
public static final Block ARENA_DIVIDER_PINK = new ArenaDividerBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
55
|
|
|
public static final Block ARENA_DIVIDER_BLUE = new ArenaDividerBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
56
|
|
|
public static final Block ARENA_DIVIDER_YELLOW = new ArenaDividerBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
57
|
|
|
public static final Block ARENA_DIVIDER_GREEN = new ArenaDividerBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
58
|
|
|
public static final Block ARENA_DIVIDER_PURPLE = new ArenaDividerBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
59
|
|
|
public static final Block ARENA_DIVIDER_RED = new ArenaDividerBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
60
|
|
|
|
|
61
|
|
|
// Blocks without color |
|
62
|
|
|
public static final Block ARENA_BLOCK_DARK = new Block(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
63
|
|
|
public static final Block ARENA_PRESSURE_PLATE = new PressurePlateBlock(PressurePlateBlock.ActivationRule.MOBS, AbstractBlock.Settings.of(Material.STONE).requiresTool().noCollision().strength(0.5f)); |
|
64
|
|
|
public static final Block LASER_TARGET = new LaserTargetBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f).luminance(2)); |
|
65
|
|
|
|
|
66
|
|
|
// Interactable blocks |
|
67
|
|
|
public static final Block LASERTAG_GAME_MANAGER_BLOCK = new LasertagGameManagerBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
68
|
|
|
public static final Block LASERTAG_TEAM_SELECTOR_BLOCK = new LasertagTeamSelectorBlock(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
69
|
|
|
public static final Block LASERTAG_CREDITS_BUTTON = new LasertagCreditsButton(FabricBlockSettings.of(Material.DECORATION).noCollision().strength(4.0f)); |
|
70
|
|
|
public static final Block LASERTAG_START_GAME_BUTTON = new LasertagStartGameButton(FabricBlockSettings.of(Material.DECORATION).noCollision().strength(4.0f)); |
|
71
|
|
|
public static final Block LASERTAG_TEAM_ZONE_GENERATOR_BLOCK = new LasertagTeamZoneGenerator(FabricBlockSettings.of(Material.METAL).strength(4.0f)); |
|
72
|
|
|
|
|
73
|
|
|
// Other |
|
74
|
|
|
public static final Block LASERTAG_FLAG_BLOCK = new LasertagFlagBlock(FabricBlockSettings.of(Material.DECORATION).noCollision().strength(0.05f).sounds(BlockSoundGroup.WOOL)); |
|
75
|
|
|
|
|
76
|
|
|
public static void register() { |
|
77
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_orange"), ARENA_BLOCK_ORANGE); |
|
78
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_pink"), ARENA_BLOCK_PINK); |
|
79
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_blue"), ARENA_BLOCK_BLUE); |
|
80
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_yellow"), ARENA_BLOCK_YELLOW); |
|
81
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_green"), ARENA_BLOCK_GREEN); |
|
82
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_purple"), ARENA_BLOCK_PURPLE); |
|
83
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_red"), ARENA_BLOCK_RED); |
|
84
|
|
|
|
|
85
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_pillar_block_orange"), ARENA_PILLAR_BLOCK_ORANGE); |
|
86
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_pillar_block_pink"), ARENA_PILLAR_BLOCK_PINK); |
|
87
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_pillar_block_blue"), ARENA_PILLAR_BLOCK_BLUE); |
|
88
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_pillar_block_yellow"), ARENA_PILLAR_BLOCK_YELLOW); |
|
89
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_pillar_block_green"), ARENA_PILLAR_BLOCK_GREEN); |
|
90
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_pillar_block_purple"), ARENA_PILLAR_BLOCK_PURPLE); |
|
91
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_pillar_block_red"), ARENA_PILLAR_BLOCK_RED); |
|
92
|
|
|
|
|
93
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_stairs_orange"), ARENA_BLOCK_STAIRS_ORANGE); |
|
94
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_stairs_pink"), ARENA_BLOCK_STAIRS_PINK); |
|
95
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_stairs_blue"), ARENA_BLOCK_STAIRS_BLUE); |
|
96
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_stairs_yellow"), ARENA_BLOCK_STAIRS_YELLOW); |
|
97
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_stairs_green"), ARENA_BLOCK_STAIRS_GREEN); |
|
98
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_stairs_purple"), ARENA_BLOCK_STAIRS_PURPLE); |
|
99
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_stairs_red"), ARENA_BLOCK_STAIRS_RED); |
|
100
|
|
|
|
|
101
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_slab_orange"), ARENA_BLOCK_SLAB_ORANGE); |
|
102
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_slab_pink"), ARENA_BLOCK_SLAB_PINK); |
|
103
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_slab_blue"), ARENA_BLOCK_SLAB_BLUE); |
|
104
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_slab_yellow"), ARENA_BLOCK_SLAB_YELLOW); |
|
105
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_slab_green"), ARENA_BLOCK_SLAB_GREEN); |
|
106
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_slab_purple"), ARENA_BLOCK_SLAB_PURPLE); |
|
107
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_slab_red"), ARENA_BLOCK_SLAB_RED); |
|
108
|
|
|
|
|
109
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_divider_orange"), ARENA_DIVIDER_ORANGE); |
|
110
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_divider_pink"), ARENA_DIVIDER_PINK); |
|
111
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_divider_blue"), ARENA_DIVIDER_BLUE); |
|
112
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_divider_yellow"), ARENA_DIVIDER_YELLOW); |
|
113
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_divider_green"), ARENA_DIVIDER_GREEN); |
|
114
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_divider_purple"), ARENA_DIVIDER_PURPLE); |
|
115
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_divider_red"), ARENA_DIVIDER_RED); |
|
116
|
|
|
|
|
117
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_block_dark"), ARENA_BLOCK_DARK); |
|
118
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "arena_pressure_plate"), ARENA_PRESSURE_PLATE); |
|
119
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "lasertarget"), LASER_TARGET); |
|
120
|
|
|
|
|
121
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "game_manager"), LASERTAG_GAME_MANAGER_BLOCK); |
|
122
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "team_selector"), LASERTAG_TEAM_SELECTOR_BLOCK); |
|
123
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "lasertag_credits_button"), LASERTAG_CREDITS_BUTTON); |
|
124
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "lasertag_start_game_button"), LASERTAG_START_GAME_BUTTON); |
|
125
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "team_zone_generator"), LASERTAG_TEAM_ZONE_GENERATOR_BLOCK); |
|
126
|
|
|
|
|
127
|
|
|
Registry.register(Registry.BLOCK, new Identifier(LasertagMod.ID, "lasertag_flag"), LASERTAG_FLAG_BLOCK); |
|
128
|
|
|
} |
|
129
|
|
|
} |
|
130
|
|
|
|