11
11
import net .minecraft .registry .Registry ;
12
12
import net .minecraft .sound .BlockSoundGroup ;
13
13
14
+ import java .util .function .Function ;
15
+
14
16
public class FBlocks {
15
17
16
18
public static final Block ICICLE = register (
17
19
"icicle" ,
18
- new IcicleBlock (
19
- AbstractBlock . Settings . create ()
20
+ settings -> new IcicleBlock (
21
+ settings
20
22
.mapColor (MapColor .CYAN )
21
23
.nonOpaque ()
22
24
.sounds (BlockSoundGroup .GLASS )
@@ -31,9 +33,9 @@ public class FBlocks {
31
33
32
34
public static final Block COLD_SUN_LICHEN = register (
33
35
"cold_sun_lichen" ,
34
- new SunLichenBlock (
36
+ settings -> new SunLichenBlock (
35
37
SunLichenBlock .COLD_LEVEL ,
36
- AbstractBlock . Settings . create ()
38
+ settings
37
39
.replaceable ()
38
40
.mapColor (MapColor .RED )
39
41
.pistonBehavior (PistonBehavior .DESTROY )
@@ -47,9 +49,9 @@ public class FBlocks {
47
49
);
48
50
public static final Block COOL_SUN_LICHEN = register (
49
51
"cool_sun_lichen" ,
50
- new SunLichenBlock (
52
+ settings -> new SunLichenBlock (
51
53
SunLichenBlock .COOL_LEVEL ,
52
- AbstractBlock . Settings . create ()
54
+ settings
53
55
.replaceable ()
54
56
.mapColor (MapColor .RED )
55
57
.pistonBehavior (PistonBehavior .DESTROY )
@@ -63,9 +65,9 @@ public class FBlocks {
63
65
);
64
66
public static final Block WARM_SUN_LICHEN = register (
65
67
"warm_sun_lichen" ,
66
- new SunLichenBlock (
68
+ settings -> new SunLichenBlock (
67
69
SunLichenBlock .WARM_LEVEL ,
68
- AbstractBlock . Settings . create ()
70
+ settings
69
71
.replaceable ()
70
72
.mapColor (MapColor .RED )
71
73
.pistonBehavior (PistonBehavior .DESTROY )
@@ -79,9 +81,9 @@ public class FBlocks {
79
81
);
80
82
public static final Block HOT_SUN_LICHEN = register (
81
83
"hot_sun_lichen" ,
82
- new SunLichenBlock (
84
+ settings -> new SunLichenBlock (
83
85
SunLichenBlock .HOT_LEVEL ,
84
- AbstractBlock . Settings . create ()
86
+ settings
85
87
.replaceable ()
86
88
.mapColor (MapColor .RED )
87
89
.pistonBehavior (PistonBehavior .DESTROY )
@@ -96,8 +98,8 @@ public class FBlocks {
96
98
97
99
public static final Block FROZEN_TORCH = register (
98
100
"frozen_torch" ,
99
- new FrozenTorchBlock (
100
- AbstractBlock . Settings . create ()
101
+ settings -> new FrozenTorchBlock (
102
+ settings
101
103
.noCollision ()
102
104
.breakInstantly ()
103
105
.pistonBehavior (PistonBehavior .DESTROY )
@@ -107,16 +109,17 @@ public class FBlocks {
107
109
108
110
public static final Block FROZEN_WALL_TORCH = register (
109
111
"frozen_wall_torch" ,
110
- new FrozenWallTorchBlock (
111
- AbstractBlock . Settings . copy ( FROZEN_TORCH )
112
+ settings -> new FrozenWallTorchBlock (
113
+ settings
112
114
.dropsLike (FROZEN_TORCH )
113
- )
115
+ ),
116
+ AbstractBlock .Settings .copy (FROZEN_TORCH )
114
117
);
115
118
116
119
public static final Block PACKED_SNOW = register (
117
120
"packed_snow" ,
118
- new PackedSnowBlock (
119
- AbstractBlock . Settings . create ()
121
+ settings -> new PackedSnowBlock (
122
+ settings
120
123
.mapColor (MapColor .WHITE )
121
124
.replaceable ()
122
125
.notSolid ()
@@ -133,8 +136,8 @@ public class FBlocks {
133
136
134
137
public static final Block PACKED_SNOW_BLOCK = register (
135
138
"packed_snow_block" ,
136
- new Block (
137
- AbstractBlock . Settings . create ()
139
+ settings -> new Block (
140
+ settings
138
141
.mapColor (MapColor .WHITE_GRAY )
139
142
.requiresTool ()
140
143
.strength (1.5f , 6.0f )
@@ -144,8 +147,8 @@ public class FBlocks {
144
147
145
148
public static final Block PACKED_SNOW_BRICKS = register (
146
149
"packed_snow_bricks" ,
147
- new Block (
148
- AbstractBlock . Settings . create ()
150
+ settings -> new Block (
151
+ settings
149
152
.mapColor (MapColor .WHITE_GRAY )
150
153
.requiresTool ()
151
154
.strength (1.5f , 6.0f )
@@ -155,26 +158,29 @@ public class FBlocks {
155
158
156
159
public static final Block PACKED_SNOW_BRICK_STAIRS = register (
157
160
"packed_snow_brick_stairs" ,
158
- new StairsBlock (
161
+ settings -> new StairsBlock (
159
162
PACKED_SNOW_BRICKS .getDefaultState (),
160
- AbstractBlock .Settings .copy (PACKED_SNOW_BRICKS )
161
- )
163
+ settings
164
+ ),
165
+ AbstractBlock .Settings .copy (PACKED_SNOW_BRICKS )
162
166
);
163
167
164
168
public static final Block PACKED_SNOW_BRICK_SLAB = register (
165
169
"packed_snow_brick_slab" ,
166
- new SlabBlock (AbstractBlock .Settings .copy (PACKED_SNOW_BRICKS ))
170
+ settings -> new SlabBlock (settings ),
171
+ AbstractBlock .Settings .copy (PACKED_SNOW_BRICKS )
167
172
);
168
173
169
174
public static final Block PACKED_SNOW_BRICK_WALL = register (
170
175
"packed_snow_brick_wall" ,
171
- new WallBlock (AbstractBlock .Settings .copy (PACKED_SNOW_BRICKS ))
176
+ settings -> new WallBlock (settings ),
177
+ AbstractBlock .Settings .copy (PACKED_SNOW_BRICKS )
172
178
);
173
179
174
180
public static final Block ICE_PANE = register (
175
181
"ice_pane" ,
176
- new IcePaneBlock (
177
- AbstractBlock . Settings . create ()
182
+ settings -> new IcePaneBlock (
183
+ settings
178
184
.mapColor (MapColor .PALE_PURPLE )
179
185
.strength (0.5f )
180
186
.ticksRandomly ()
@@ -187,8 +193,8 @@ public class FBlocks {
187
193
188
194
public static final Block CUT_PACKED_ICE = register (
189
195
"cut_packed_ice" ,
190
- new Block (
191
- AbstractBlock . Settings . create ()
196
+ settings -> new Block (
197
+ settings
192
198
.mapColor (MapColor .PALE_PURPLE )
193
199
.instrument (NoteBlockInstrument .CHIME )
194
200
.slipperiness (0.98f )
@@ -200,55 +206,62 @@ public class FBlocks {
200
206
201
207
public static final Block CUT_PACKED_ICE_STAIRS = register (
202
208
"cut_packed_ice_stairs" ,
203
- new StairsBlock (
209
+ settings -> new StairsBlock (
204
210
CUT_PACKED_ICE .getDefaultState (),
205
- AbstractBlock .Settings .copy (CUT_PACKED_ICE )
206
- )
211
+ settings
212
+ ),
213
+ AbstractBlock .Settings .copy (CUT_PACKED_ICE )
207
214
);
208
215
209
216
public static final Block CUT_PACKED_ICE_SLAB = register (
210
217
"cut_packed_ice_slab" ,
211
- new SlabBlock (AbstractBlock .Settings .copy (CUT_PACKED_ICE ))
218
+ settings -> new SlabBlock (settings ),
219
+ AbstractBlock .Settings .copy (CUT_PACKED_ICE )
212
220
);
213
221
214
222
public static final Block CUT_PACKED_ICE_WALL = register (
215
223
"cut_packed_ice_wall" ,
216
- new WallBlock (AbstractBlock .Settings .copy (CUT_PACKED_ICE ))
224
+ settings -> new WallBlock (settings ),
225
+ AbstractBlock .Settings .copy (CUT_PACKED_ICE )
217
226
);
218
227
219
228
public static final Block CUT_BLUE_ICE = register (
220
229
"cut_blue_ice" ,
221
- new Block (AbstractBlock .Settings .create ()
222
- .mapColor (MapColor .PALE_PURPLE )
223
- .slipperiness (0.989f )
224
- .strength (2.8f )
225
- .requiresTool ()
226
- .sounds (BlockSoundGroup .GLASS )
230
+ settings -> new Block (
231
+ settings
232
+ .mapColor (MapColor .PALE_PURPLE )
233
+ .slipperiness (0.989f )
234
+ .strength (2.8f )
235
+ .requiresTool ()
236
+ .sounds (BlockSoundGroup .GLASS )
227
237
)
228
238
);
229
239
230
240
public static final Block CUT_BLUE_ICE_STAIRS = register (
231
241
"cut_blue_ice_stairs" ,
232
- new StairsBlock (
242
+ settings -> new StairsBlock (
233
243
CUT_BLUE_ICE .getDefaultState (),
234
- AbstractBlock .Settings .copy (CUT_BLUE_ICE )
235
- )
244
+ settings
245
+ ),
246
+ AbstractBlock .Settings .copy (CUT_BLUE_ICE )
236
247
);
237
248
238
249
public static final Block CUT_BLUE_ICE_SLAB = register (
239
250
"cut_blue_ice_slab" ,
240
- new SlabBlock (AbstractBlock .Settings .copy (CUT_BLUE_ICE ))
251
+ settings -> new SlabBlock (settings ),
252
+ AbstractBlock .Settings .copy (CUT_BLUE_ICE )
241
253
);
242
254
243
255
public static final Block CUT_BLUE_ICE_WALL = register (
244
256
"cut_blue_ice_wall" ,
245
- new WallBlock (AbstractBlock .Settings .copy (CUT_BLUE_ICE ))
257
+ settings -> new WallBlock (settings ),
258
+ AbstractBlock .Settings .copy (CUT_BLUE_ICE )
246
259
);
247
260
248
261
public static final Block ICY_TRIAL_SPAWNER = register (
249
262
"icy_trial_spawner" ,
250
- new TrialSpawnerBlock (
251
- AbstractBlock . Settings . create ()
263
+ settings -> new TrialSpawnerBlock (
264
+ settings
252
265
.mapColor (MapColor .DARK_AQUA )
253
266
.instrument (NoteBlockInstrument .BASEDRUM )
254
267
.luminance (state -> state .get (TrialSpawnerBlock .TRIAL_SPAWNER_STATE ).getLuminance ())
@@ -260,8 +273,8 @@ public class FBlocks {
260
273
);
261
274
public static final Block ICY_VAULT = register (
262
275
"icy_vault" ,
263
- new VaultBlock (
264
- AbstractBlock . Settings . create ()
276
+ settings -> new VaultBlock (
277
+ settings
265
278
.mapColor (MapColor .DARK_AQUA )
266
279
.instrument (NoteBlockInstrument .BASEDRUM )
267
280
.nonOpaque ()
@@ -274,8 +287,8 @@ public class FBlocks {
274
287
275
288
public static final Block BRITTLE_ICE = register (
276
289
"brittle_ice" ,
277
- new BrittleIceBlock (
278
- AbstractBlock . Settings . create ()
290
+ settings -> new BrittleIceBlock (
291
+ settings
279
292
.mapColor (MapColor .PALE_PURPLE )
280
293
.slipperiness (0.98f )
281
294
.ticksRandomly ()
@@ -295,7 +308,12 @@ public static void initialize() {
295
308
BlockEntityType .VAULT .addSupportedBlock (ICY_VAULT );
296
309
}
297
310
298
- private static Block register (String id , Block block ) {
311
+ private static Block register (String id , Function <AbstractBlock .Settings , Block > blockFactory ) {
312
+ return register (id , blockFactory , AbstractBlock .Settings .create ());
313
+ }
314
+
315
+ private static Block register (String id , Function <AbstractBlock .Settings , Block > blockFactory , AbstractBlock .Settings settings ) {
316
+ Block block = blockFactory .apply (settings );
299
317
return Registry .register (Registries .BLOCK , Frostiful .id (id ), block );
300
318
}
301
319
0 commit comments