generated from neoforged/MDK
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
331b80b
commit 2636d84
Showing
13 changed files
with
76 additions
and
39 deletions.
There are no files selected for viewing
7 changes: 0 additions & 7 deletions
7
src/generated/resources/.cache/d36fd299023053fea6baa01b00ac5d3345c21441
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
"examplemod:example_block" | ||
] | ||
} |
5 changes: 5 additions & 0 deletions
5
src/generated/resources/data/minecraft/tags/blocks/mushroom_grow_block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
"examplemod:example_block" | ||
] | ||
} |
5 changes: 5 additions & 0 deletions
5
src/generated/resources/data/minecraft/tags/items/planks.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"values": [ | ||
"examplemod:example_block" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
src/main/java/com/example/examplemod/data/EnderBlockTagProvider.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/com/example/examplemod/data/EnderTagProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.example.examplemod.data; | ||
|
||
import com.example.examplemod.registry.ITagagble; | ||
import net.minecraft.core.HolderLookup; | ||
import net.minecraft.core.Registry; | ||
import net.minecraft.data.PackOutput; | ||
import net.minecraft.data.tags.IntrinsicHolderTagsProvider; | ||
import net.minecraft.resources.ResourceKey; | ||
import net.minecraft.tags.TagKey; | ||
import net.neoforged.neoforge.common.data.ExistingFileHelper; | ||
import net.neoforged.neoforge.registries.DeferredHolder; | ||
import net.neoforged.neoforge.registries.DeferredRegister; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.Set; | ||
import java.util.concurrent.CompletableFuture; | ||
import java.util.function.Function; | ||
|
||
public class EnderTagProvider<T> extends IntrinsicHolderTagsProvider<T> { | ||
private final DeferredRegister<T> registry; | ||
|
||
public EnderTagProvider(PackOutput output, ResourceKey<? extends Registry<T>> key, Function<T, ResourceKey<T>> func, CompletableFuture<HolderLookup.Provider> lookupProvider, String modId, @Nullable ExistingFileHelper existingFileHelper, DeferredRegister<T> registry) { | ||
super(output, key, lookupProvider, func, modId, existingFileHelper); | ||
this.registry = registry; | ||
} | ||
|
||
@Override | ||
protected void addTags(HolderLookup.Provider p_256380_) { | ||
for (DeferredHolder<T, ? extends T> entry : registry.getEntries()) { | ||
Set<TagKey<T>> tag = ((ITagagble<T>) entry).getTags(); | ||
tag.forEach(t -> tag(t).add(entry.get())); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/main/java/com/example/examplemod/registry/ITagagble.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.example.examplemod.registry; | ||
|
||
import net.minecraft.tags.TagKey; | ||
import net.minecraft.world.level.block.Block; | ||
|
||
import java.util.Set; | ||
|
||
public interface ITagagble<T> { | ||
|
||
Set<TagKey<T>> getTags(); | ||
} |