Skip to content

Commit d52e050

Browse files
committed
*wait, we need that*
1 parent 7b4be65 commit d52e050

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

src/main/java/de/dafuqs/spectrum/registries/SpectrumBlockTags.java

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package de.dafuqs.spectrum.registries;
22

33
import de.dafuqs.spectrum.*;
4+
import de.dafuqs.spectrum.data.*;
45
import net.minecraft.core.registries.*;
56
import net.minecraft.resources.*;
67
import net.minecraft.tags.*;
@@ -9,6 +10,8 @@
910
@SuppressWarnings("unused")
1011
public class SpectrumBlockTags {
1112

13+
private static final DeferredRegistrar.Contextual<DatagenProxy.ProvidedTagBuilderBuilder<Block>> REGISTRAR = new DeferredRegistrar.Contextual<>(DatagenProxy.IS_DATAGEN);
14+
1215
// PLANTS
1316
public static final TagKey<Block> AMARANTH_PLANTABLE = of("amaranth_plantable");
1417
public static final TagKey<Block> MERMAIDS_BRUSH_PLANTABLE = of("mermaids_brush_plantable");
@@ -80,22 +83,6 @@ public class SpectrumBlockTags {
8083
public static final TagKey<Block> MEMORY_VERY_FAST_MANIFESTERS = of("memory_very_fast_manifesters");
8184

8285
// CONVENTIONAL TAGS ("c" namespace)
83-
public static final TagKey<Block> C_LIGHTNING_RODS = conventional("lightning_rods");
84-
public static final TagKey<Block> C_BRUSHABLE_BLOCKS = conventional("brushable_blocks");
85-
public static final TagKey<Block> C_INFESTED_BLOCKS = conventional("infested_blocks");
86-
87-
private static TagKey<Block> of(String id) {
88-
return TagKey.create(Registries.BLOCK, SpectrumCommon.locate(id));
89-
}
90-
91-
private static TagKey<Block> conventional(String id) {
92-
return TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath("c", id));
93-
}
94-
95-
// TODO: port datagen
96-
/*
97-
private static final DeferredRegister.Contextual<DatagenProxy.ProvidedTagBuilderBuilder<Block>> REGISTRAR = new DeferredRegistrar.Contextual<>(DatagenProxy.IS_DATAGEN);
98-
9986
public static final TagKey<Block> C_LIGHTNING_RODS = conventional("lightning_rods", provider -> provider
10087
.add(Blocks.LIGHTNING_ROD)
10188
.addOptionalTag(ResourceLocation.parse("friendsandfoes:lightning_rods")));
@@ -114,10 +101,23 @@ private static TagKey<Block> conventional(String id) {
114101
.add(Blocks.INFESTED_MOSSY_STONE_BRICKS)
115102
.add(Blocks.INFESTED_STONE_BRICKS)
116103
.add(SpectrumBlocks.INFESTED_BLACKSLAG));
104+
105+
private static TagKey<Block> of(String id) {
106+
return TagKey.create(Registries.BLOCK, SpectrumCommon.locate(id));
107+
}
108+
109+
private static TagKey<Block> conventional(String id) {
110+
return TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath("c", id));
111+
}
112+
113+
private static TagKey<Block> conventional(String id, DatagenProxy.TagBuilderCallback<Block> builder) {
114+
TagKey<Block> tag = TagKey.create(Registries.BLOCK, ResourceLocation.fromNamespaceAndPath("c", id));
115+
REGISTRAR.defer(ctx -> builder.build(ctx.build(tag)));
116+
return tag;
117117
}
118118

119119
public static void provideTags(DatagenProxy.ProvidedTagBuilderBuilder<Block> provider) {
120120
REGISTRAR.flush(provider);
121-
}*/
121+
}
122122

123123
}

0 commit comments

Comments
 (0)