Skip to content

Commit

Permalink
feat: Tags
Browse files Browse the repository at this point in the history
  • Loading branch information
darksonic300 committed Jul 26, 2024
1 parent fd13da7 commit 3dc5c3c
Show file tree
Hide file tree
Showing 16 changed files with 129 additions and 42 deletions.
5 changes: 0 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ plugins {
}

tasks.named('wrapper', Wrapper).configure {
// Define wrapper values here so as to not have to always do so when updating gradlew.properties.
// Switching this to Wrapper.DistributionType.ALL will download the full gradle sources that comes with
// documentation attached on cursor hover of gradle classes and methods. However, this comes with increased
// file size for Gradle. If you do switch this to ALL, run the Gradle wrapper task twice afterwards.
// (Verify by checking gradle/wrapper/gradle-wrapper.properties to see if distributionUrl now points to `-all`)
distributionType = Wrapper.DistributionType.BIN
}

Expand Down
24 changes: 1 addition & 23 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,43 +1,21 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
org.gradle.jvmargs=-Xmx1G
org.gradle.daemon=false
org.gradle.debug=false

#read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
neogradle.subsystems.parchment.minecraftVersion=1.20.6
neogradle.subsystems.parchment.mappingsVersion=2024.05.01
# Environment Properties
# You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge
# The Minecraft version must agree with the Neo version to get a valid artifact
minecraft_version=1.21
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.21,1.21.1)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=21.0.83-beta
# The Neo version range can use any version of Neo as bounds
neo_version_range=[21.0.0-beta,)
# The loader version range can only use the major version of FML as bounds
loader_version_range=[4,)

## Mod Properties

# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod.
mod_id=seidr
# The human-readable display name for the mod.
mod_name=Seidr
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=0.1
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=com.github.darksonic300.seidr
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=darksonic300
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.
mod_description=Seidr description.\nI'll write something here eventually.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// 1.21 2024-07-26T21:07:46.567437 Tags for minecraft:block mod id seidr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// 1.21 2024-07-26T21:07:46.564445 Seidr Item Tags
5640e882f4a96a771dd3b110bf99c88e88ce3c70 data/seidr/tags/item/scrolls.json
c90aa8c79e90cd4dc8a6cb9ddbe0dc500832eb40 data/seidr/tags/item/tablets.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.21 2024-07-26T16:43:19.4507505 Recipes
// 1.21 2024-07-26T21:07:46.5654425 Recipes
ad1a46a4de132ef31bc47f8436cddbf827c51cbb data/seidr/advancement/recipes/misc/item.seidr.complete_resistance_scroll.json
ef2102df661efd99e7549e7e49e9615d53affb9d data/seidr/advancement/recipes/misc/item.seidr.complete_resistance_tablet.json
e6152c6a2f496aeee9c2c74a505b90ea60730efe data/seidr/advancement/recipes/misc/item.seidr.complete_undead_scroll.json
Expand All @@ -20,14 +20,14 @@ ed881c79a8007935f38606be0d70b853c89435ef data/seidr/recipe/item.seidr.complete_r
b8e4ae27e4aed28927df48c926103c68c84bb063 data/seidr/recipe/item.seidr.complete_undead_scroll.json
09d948fc5eaa9f57716ae6581b0281b81cc9f6a4 data/seidr/recipe/item.seidr.complete_undead_tablet.json
7194fe4f02f3682d80b7561ede2a87533f8e6958 data/seidr/recipe/item.seidr.damaged_resistance_scroll.json
abb84051ec4b13b53aa0733379fe37bb8c1615c3 data/seidr/recipe/item.seidr.damaged_resistance_tablet.json
d96cb71cebcae94ca288ce25a372c56868a18621 data/seidr/recipe/item.seidr.damaged_resistance_tablet.json
b53fa0757ba982c184133092d3115f2d7cf33f05 data/seidr/recipe/item.seidr.damaged_undead_scroll.json
0b6531d1ae883741bfedda27620f21bf35c56f8a data/seidr/recipe/item.seidr.damaged_undead_tablet.json
4326baf56ea6a3721e50738eeb232c57e9dfd2f9 data/seidr/recipe/item.seidr.damaged_undead_tablet.json
d3858eed60c6072fe2393c8dcfd8dff56ff31445 data/seidr/recipe/item.seidr.effect_remove_scroll.json
c195ce4c4df66f402bcafe831429049125c71bf0 data/seidr/recipe/item.seidr.effect_remove_tablet.json
36f0c2cd4b339a2b4e3127b59b288efc9ee95880 data/seidr/recipe/item.seidr.incomplete_resistance_scroll.json
5e5e6015ad01043b673688b8b9aff76d2c248682 data/seidr/recipe/item.seidr.incomplete_resistance_tablet.json
f002fd8d994e96334fe244a05474f8661c548dfe data/seidr/recipe/item.seidr.incomplete_resistance_tablet.json
b029f220785723dab4ae4ddcb331db7f00d2182c data/seidr/recipe/item.seidr.incomplete_undead_scroll.json
87cbca8aef8ef34137a27e860d3a4dfabfecb21c data/seidr/recipe/item.seidr.incomplete_undead_tablet.json
9883cfba9cd4ff5a2d173bd83ab9dc413de078cf data/seidr/recipe/item.seidr.incomplete_undead_tablet.json
4b70e5efda3c8e454e401f6e33bb089e14a99713 data/seidr/recipe/item.seidr.sound_blast_scroll.json
eb4842c16a69ee430344920baa577f01fa3410ec data/seidr/recipe/item.seidr.sound_blast_tablet.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"category": "misc",
"key": {
"D": {
"item": "minecraft:gold_ingot"
"item": "minecraft:emerald"
},
"T": {
"item": "seidr:damaged_resistance_tablet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"category": "misc",
"key": {
"D": {
"item": "minecraft:gold_ingot"
"item": "minecraft:emerald"
},
"T": {
"item": "seidr:damaged_undead_tablet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"category": "misc",
"key": {
"D": {
"item": "minecraft:emerald"
"item": "minecraft:gold_ingot"
},
"T": {
"item": "seidr:incomplete_resistance_tablet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"category": "misc",
"key": {
"D": {
"item": "minecraft:emerald"
"item": "minecraft:gold_ingot"
},
"T": {
"item": "seidr:incomplete_undead_tablet"
Expand Down
12 changes: 12 additions & 0 deletions src/generated/resources/data/seidr/tags/item/scrolls.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"values": [
"seidr:incomplete_undead_scroll",
"seidr:damaged_undead_scroll",
"seidr:complete_undead_scroll",
"seidr:effect_remove_scroll",
"seidr:incomplete_resistance_scroll",
"seidr:damaged_resistance_scroll",
"seidr:complete_resistance_scroll",
"seidr:sound_blast_scroll"
]
}
12 changes: 12 additions & 0 deletions src/generated/resources/data/seidr/tags/item/tablets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"values": [
"seidr:incomplete_undead_tablet",
"seidr:damaged_undead_tablet",
"seidr:complete_undead_tablet",
"seidr:effect_remove_tablet",
"seidr:incomplete_resistance_tablet",
"seidr:damaged_resistance_tablet",
"seidr:complete_resistance_tablet",
"seidr:sound_blast_tablet"
]
}
6 changes: 5 additions & 1 deletion src/main/java/com/github/darksonic300/seidr/Seidr.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import com.github.darksonic300.seidr.client.renderer.SeidrRenderers;
import com.github.darksonic300.seidr.datagen.SeidrItemModelData;
import com.github.darksonic300.seidr.datagen.SeidrRecipeData;
import com.github.darksonic300.seidr.datagen.tags.SeidrBlockTagData;
import com.github.darksonic300.seidr.datagen.tags.SeidrItemTagData;
import com.github.darksonic300.seidr.entity.SeidrEntityTypes;
import com.github.darksonic300.seidr.item.SeidrScrollItems;
import com.github.darksonic300.seidr.particle.SeidrParticleTypes;
Expand Down Expand Up @@ -66,6 +68,8 @@ public void dataSetup(GatherDataEvent event) {

// Server Data
generator.addProvider(event.includeServer(), new SeidrRecipeData(packOutput, lookupProvider));

SeidrBlockTagData blockTags = new SeidrBlockTagData(packOutput, lookupProvider, fileHelper);
generator.addProvider(event.includeServer(), blockTags);
generator.addProvider(event.includeServer(), new SeidrItemTagData(packOutput, lookupProvider, blockTags.contentsGetter()));
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.github.darksonic300.seidr.datagen;

import com.github.darksonic300.seidr.datagen.tags.SeidrItemTagData;
import com.github.darksonic300.seidr.datagen.tags.SeidrTags;
import com.github.darksonic300.seidr.item.SeidrScrollItems;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.data.PackOutput;
Expand All @@ -17,12 +19,11 @@ public SeidrItemModelData(PackOutput output, ExistingFileHelper existingFileHelp

@Override
protected void registerModels() {
for(DeferredHolder<Item, ? extends Item> item : SeidrScrollItems.SCROLL_ITEMS.getEntries()){
for(DeferredHolder<Item, ? extends Item> item : SeidrScrollItems.SCROLL_ITEMS.getEntries())
this.scrollItem(item.get());
}
for(DeferredHolder<Item, ? extends Item> item : SeidrScrollItems.TABLET_ITEMS.getEntries()){

for(DeferredHolder<Item, ? extends Item> item : SeidrScrollItems.TABLET_ITEMS.getEntries())
this.tabletItem(item.get());
}
}

public void scrollItem(Item item){
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.github.darksonic300.seidr.datagen.tags;

import com.github.darksonic300.seidr.Seidr;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
import net.neoforged.neoforge.common.data.BlockTagsProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;
import org.jetbrains.annotations.Nullable;

import java.util.concurrent.CompletableFuture;

public class SeidrBlockTagData extends BlockTagsProvider {
public SeidrBlockTagData(PackOutput output, CompletableFuture<HolderLookup.Provider> lookupProvider, @Nullable ExistingFileHelper existingFileHelper) {
super(output, lookupProvider, Seidr.MODID, existingFileHelper);
}

@Override
protected void addTags(HolderLookup.Provider pProvider) {

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.github.darksonic300.seidr.datagen.tags;

import com.github.darksonic300.seidr.Seidr;
import com.github.darksonic300.seidr.item.SeidrItems;
import com.github.darksonic300.seidr.item.SeidrScrollItems;
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.ItemTagsProvider;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.neoforged.neoforge.registries.DeferredHolder;

import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;

public class SeidrItemTagData extends ItemTagsProvider {
public SeidrItemTagData(PackOutput pOutput, CompletableFuture<HolderLookup.Provider> pLookupProvider, CompletableFuture<TagLookup<Block>> pBlockTags) {
super(pOutput, pLookupProvider, pBlockTags);
}

@Nonnull
@Override
public String getName() {
return "Seidr Item Tags";
}

@Override
protected void addTags(HolderLookup.Provider pProvider) {
IntrinsicTagAppender<Item> scrollTag = this.tag(SeidrTags.Items.SCROLLS);
IntrinsicTagAppender<Item> tabletTag = this.tag(SeidrTags.Items.TABLETS);
Collection<DeferredHolder<Item, ? extends Item>> scrollEntries = SeidrScrollItems.SCROLL_ITEMS.getEntries();
Collection<DeferredHolder<Item, ? extends Item>> tabletEntries = SeidrScrollItems.TABLET_ITEMS.getEntries();

for (DeferredHolder<Item, ? extends Item> item : scrollEntries)
scrollTag.add(item.get());

for (DeferredHolder<Item, ? extends Item> item : tabletEntries)
tabletTag.add(item.get());

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.darksonic300.seidr.datagen.tags;

import com.github.darksonic300.seidr.Seidr;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;

public class SeidrTags {
public static class Items {
public static final TagKey<Item> SCROLLS = tag("scrolls");
public static final TagKey<Item> TABLETS = tag("tablets");

private static TagKey<Item> tag(String name) {
return TagKey.create(Registries.ITEM, ResourceLocation.fromNamespaceAndPath(Seidr.MODID, name));
}
}
}

0 comments on commit 3dc5c3c

Please sign in to comment.