1
1
package org.valkyrienskies.eureka
2
2
3
- import net.minecraft.core.registries.Registries
3
+ import net.minecraft.core.Registry
4
4
import net.minecraft.world.item.BlockItem
5
5
import net.minecraft.world.item.Item
6
6
import net.minecraft.world.level.block.Block
7
7
import net.minecraft.world.level.block.Blocks
8
8
import net.minecraft.world.level.block.FireBlock
9
9
import net.minecraft.world.level.block.SoundType
10
10
import net.minecraft.world.level.block.state.BlockBehaviour
11
- import net.minecraft.world.level.material.MapColor
12
- import org.valkyrienskies.eureka.block.AnchorBlock
13
- import org.valkyrienskies.eureka.block.BallastBlock
14
- import org.valkyrienskies.eureka.block.BalloonBlock
15
- import org.valkyrienskies.eureka.block.EngineBlock
16
- import org.valkyrienskies.eureka.block.FloaterBlock
17
- import org.valkyrienskies.eureka.block.ShipHelmBlock
18
- import org.valkyrienskies.eureka.block.WoodType
11
+ import net.minecraft.world.level.material.Material
12
+ import net.minecraft.world.level.material.MaterialColor
13
+ import org.valkyrienskies.eureka.block.*
19
14
import org.valkyrienskies.eureka.registry.DeferredRegister
20
15
import org.valkyrienskies.mod.common.hooks.VSGameEvents
21
16
22
17
@Suppress(" unused" )
23
18
object EurekaBlocks {
24
- internal val BLOCKS = DeferredRegister .create(EurekaMod .MOD_ID , Registries . BLOCK )
19
+ private val BLOCKS = DeferredRegister .create(EurekaMod .MOD_ID , Registry . BLOCK_REGISTRY )
25
20
26
21
val ANCHOR = BLOCKS .register(" anchor" , ::AnchorBlock )
27
22
val ENGINE = BLOCKS .register(" engine" , ::EngineBlock )
@@ -31,49 +26,49 @@ object EurekaBlocks {
31
26
// region Ship Helms
32
27
val OAK_SHIP_HELM = BLOCKS .register(" oak_ship_helm" ) {
33
28
ShipHelmBlock (
34
- BlockBehaviour .Properties .of().mapColor( MapColor .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
29
+ BlockBehaviour .Properties .of(Material .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
35
30
WoodType .OAK
36
31
)
37
32
}
38
33
val SPRUCE_SHIP_HELM = BLOCKS .register(" spruce_ship_helm" ) {
39
34
ShipHelmBlock (
40
- BlockBehaviour .Properties .of().mapColor( MapColor .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
35
+ BlockBehaviour .Properties .of(Material .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
41
36
WoodType .SPRUCE
42
37
)
43
38
}
44
39
val BIRCH_SHIP_HELM = BLOCKS .register(" birch_ship_helm" ) {
45
40
ShipHelmBlock (
46
- BlockBehaviour .Properties .of().mapColor( MapColor .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
41
+ BlockBehaviour .Properties .of(Material .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
47
42
WoodType .BIRCH
48
43
)
49
44
}
50
45
val JUNGLE_SHIP_HELM = BLOCKS .register(" jungle_ship_helm" ) {
51
46
ShipHelmBlock (
52
- BlockBehaviour .Properties .of().mapColor( MapColor .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
47
+ BlockBehaviour .Properties .of(Material .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
53
48
WoodType .JUNGLE
54
49
)
55
50
}
56
51
val ACACIA_SHIP_HELM = BLOCKS .register(" acacia_ship_helm" ) {
57
52
ShipHelmBlock (
58
- BlockBehaviour .Properties .of().mapColor( MapColor .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
53
+ BlockBehaviour .Properties .of(Material .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
59
54
WoodType .ACACIA
60
55
)
61
56
}
62
57
val DARK_OAK_SHIP_HELM = BLOCKS .register(" dark_oak_ship_helm" ) {
63
58
ShipHelmBlock (
64
- BlockBehaviour .Properties .of().mapColor( MapColor .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
59
+ BlockBehaviour .Properties .of(Material .WOOD ).strength(2.5F ).sound(SoundType .WOOD ),
65
60
WoodType .DARK_OAK
66
61
)
67
62
}
68
63
val CRIMSON_SHIP_HELM = BLOCKS .register(" crimson_ship_helm" ) {
69
64
ShipHelmBlock (
70
- BlockBehaviour .Properties .of().mapColor( MapColor . NETHER ).strength(2.5F ).sound(SoundType .STEM ),
65
+ BlockBehaviour .Properties .of(Material . NETHER_WOOD ).strength(2.5F ).sound(SoundType .STEM ),
71
66
WoodType .CRIMSON
72
67
)
73
68
}
74
69
val WARPED_SHIP_HELM = BLOCKS .register(" warped_ship_helm" ) {
75
70
ShipHelmBlock (
76
- BlockBehaviour .Properties .of().mapColor( MapColor . NETHER ).strength(2.5F ).sound(SoundType .STEM ),
71
+ BlockBehaviour .Properties .of(Material . NETHER_WOOD ).strength(2.5F ).sound(SoundType .STEM ),
77
72
WoodType .WARPED
78
73
)
79
74
}
@@ -82,87 +77,87 @@ object EurekaBlocks {
82
77
// region Balloons
83
78
val BALLOON = BLOCKS .register(" balloon" ) {
84
79
BalloonBlock (
85
- BlockBehaviour .Properties .of().mapColor( MapColor .WOOL ).strength(0.8F ).sound(SoundType .WOOL )
80
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .WOOL ).strength(0.8F ).sound(SoundType .WOOL )
86
81
)
87
82
}
88
83
val WHITE_BALLOON = BLOCKS .register(" white_balloon" ) {
89
84
BalloonBlock (
90
- BlockBehaviour .Properties .of().mapColor( MapColor .SNOW ).strength(0.8F ).sound(SoundType .WOOL )
85
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .SNOW ).strength(0.8F ).sound(SoundType .WOOL )
91
86
)
92
87
}
93
88
val LIGHT_GRAY_BALLOON = BLOCKS .register(" light_gray_balloon" ) {
94
89
BalloonBlock (
95
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_LIGHT_GRAY ).strength(0.8F ).sound(SoundType .WOOL )
90
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_LIGHT_GRAY ).strength(0.8F ).sound(SoundType .WOOL )
96
91
)
97
92
}
98
93
val GRAY_BALLOON = BLOCKS .register(" gray_balloon" ) {
99
94
BalloonBlock (
100
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_GRAY ).strength(0.8F ).sound(SoundType .WOOL )
95
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_GRAY ).strength(0.8F ).sound(SoundType .WOOL )
101
96
)
102
97
}
103
98
val BLACK_BALLOON = BLOCKS .register(" black_balloon" ) {
104
99
BalloonBlock (
105
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_BLACK ).strength(0.8F ).sound(SoundType .WOOL )
100
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_BLACK ).strength(0.8F ).sound(SoundType .WOOL )
106
101
)
107
102
}
108
103
val RED_BALLOON = BLOCKS .register(" red_balloon" ) {
109
104
BalloonBlock (
110
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_RED ).strength(0.8F ).sound(SoundType .WOOL )
105
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_RED ).strength(0.8F ).sound(SoundType .WOOL )
111
106
)
112
107
}
113
108
val ORANGE_BALLOON = BLOCKS .register(" orange_balloon" ) {
114
109
BalloonBlock (
115
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_ORANGE ).strength(0.8F ).sound(SoundType .WOOL )
110
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_ORANGE ).strength(0.8F ).sound(SoundType .WOOL )
116
111
)
117
112
}
118
113
val YELLOW_BALLOON = BLOCKS .register(" yellow_balloon" ) {
119
114
BalloonBlock (
120
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_YELLOW ).strength(0.8F ).sound(SoundType .WOOL )
115
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_YELLOW ).strength(0.8F ).sound(SoundType .WOOL )
121
116
)
122
117
}
123
118
val LIME_BALLOON = BLOCKS .register(" lime_balloon" ) {
124
119
BalloonBlock (
125
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_LIGHT_GREEN ).strength(0.8F ).sound(SoundType .WOOL )
120
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_LIGHT_GREEN ).strength(0.8F ).sound(SoundType .WOOL )
126
121
)
127
122
}
128
123
val GREEN_BALLOON = BLOCKS .register(" green_balloon" ) {
129
124
BalloonBlock (
130
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_GREEN ).strength(0.8F ).sound(SoundType .WOOL )
125
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_GREEN ).strength(0.8F ).sound(SoundType .WOOL )
131
126
)
132
127
}
133
128
val LIGHT_BLUE_BALLOON = BLOCKS .register(" light_blue_balloon" ) {
134
129
BalloonBlock (
135
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_LIGHT_BLUE ).strength(0.8F ).sound(SoundType .WOOL )
130
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_LIGHT_BLUE ).strength(0.8F ).sound(SoundType .WOOL )
136
131
)
137
132
}
138
133
val CYAN_BALLOON = BLOCKS .register(" cyan_balloon" ) {
139
134
BalloonBlock (
140
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_CYAN ).strength(0.8F ).sound(SoundType .WOOL )
135
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_CYAN ).strength(0.8F ).sound(SoundType .WOOL )
141
136
)
142
137
}
143
138
val BLUE_BALLOON = BLOCKS .register(" blue_balloon" ) {
144
139
BalloonBlock (
145
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_BLUE ).strength(0.8F ).sound(SoundType .WOOL )
140
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_BLUE ).strength(0.8F ).sound(SoundType .WOOL )
146
141
)
147
142
}
148
143
val PURPLE_BALLOON = BLOCKS .register(" purple_balloon" ) {
149
144
BalloonBlock (
150
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_PURPLE ).strength(0.8F ).sound(SoundType .WOOL )
145
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_PURPLE ).strength(0.8F ).sound(SoundType .WOOL )
151
146
)
152
147
}
153
148
val MAGENTA_BALLOON = BLOCKS .register(" magenta_balloon" ) {
154
149
BalloonBlock (
155
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_MAGENTA ).strength(0.8F ).sound(SoundType .WOOL )
150
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_MAGENTA ).strength(0.8F ).sound(SoundType .WOOL )
156
151
)
157
152
}
158
153
val PINK_BALLOON = BLOCKS .register(" pink_balloon" ) {
159
154
BalloonBlock (
160
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_PINK ).strength(0.8F ).sound(SoundType .WOOL )
155
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_PINK ).strength(0.8F ).sound(SoundType .WOOL )
161
156
)
162
157
}
163
158
val BROWN_BALLOON = BLOCKS .register(" brown_balloon" ) {
164
159
BalloonBlock (
165
- BlockBehaviour .Properties .of().mapColor( MapColor .COLOR_BROWN ).strength(0.8F ).sound(SoundType .WOOL )
160
+ BlockBehaviour .Properties .of(Material . WOOL , MaterialColor .COLOR_BROWN ).strength(0.8F ).sound(SoundType .WOOL )
166
161
)
167
162
}
168
163
// endregion
@@ -214,7 +209,7 @@ object EurekaBlocks {
214
209
// aka all blocks
215
210
fun registerItems (items : DeferredRegister <Item >) {
216
211
BLOCKS .forEach {
217
- items.register(it.name) { BlockItem (it.get(), Item .Properties ()) }
212
+ items.register(it.name) { BlockItem (it.get(), Item .Properties ().tab( EurekaItems . TAB ) ) }
218
213
}
219
214
}
220
215
}
0 commit comments