Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag shenanigans #1787

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values": [
"gtceu:nanomuscle_boots",
"gtceu:hazmat_boots",
"gtceu:quarktech_boots"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"values": [
"gtceu:nanomuscle_chestplate",
"gtceu:rubber_gloves",
"gtceu:hazmat_chestpiece",
"gtceu:quarktech_chestplate",
"gtceu:liquid_fuel_jetpack",
"gtceu:electric_jetpack",
"gtceu:advanced_electric_jetpack",
"gtceu:avanced_nanomuscle_chestplate",
"gtceu:advanced_quarktech_chestplate"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"values": [
"gtceu:nightvision_goggles",
"gtceu:nanomuscle_helmet",
"gtceu:face_mask",
"gtceu:hazmat_headpiece",
"gtceu:quarktech_helmet"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values": [
"gtceu:nanomuscle_leggings",
"gtceu:hazmat_leggings",
"gtceu:quarktech_leggings"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"values": [
"gtceu:rubber_log"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.BucketItem;
import net.minecraft.world.item.Items;
Expand All @@ -32,12 +33,18 @@

import com.google.common.base.Preconditions;
import com.tterrag.registrate.AbstractRegistrate;
import com.tterrag.registrate.builders.*;
import com.tterrag.registrate.builders.AbstractBuilder;
import com.tterrag.registrate.builders.BlockBuilder;
import com.tterrag.registrate.builders.BuilderCallback;
import com.tterrag.registrate.builders.ItemBuilder;
import com.tterrag.registrate.providers.ProviderType;
import com.tterrag.registrate.providers.RegistrateTagsProvider;
import com.tterrag.registrate.util.OneTimeEventReceiver;
import com.tterrag.registrate.util.entry.RegistryEntry;
import com.tterrag.registrate.util.nullness.*;
import com.tterrag.registrate.util.nullness.NonNullBiConsumer;
import com.tterrag.registrate.util.nullness.NonNullBiFunction;
import com.tterrag.registrate.util.nullness.NonNullConsumer;
import com.tterrag.registrate.util.nullness.NonNullSupplier;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.jetbrains.annotations.Nullable;
Expand Down Expand Up @@ -232,6 +239,7 @@ public ItemBuilder<GTBucketItem, GTFluidBuilder<P>> bucket() {

return getOwner().item(this, bucketName, p -> new GTBucketItem(this.source, p, this.material, this.langKey))
.properties(p -> p.craftRemainder(Items.BUCKET).stacksTo(1))
.tag(ItemTags.create(new ResourceLocation("ae2", "p2p_attunements/fluid_p2p_tunnel")))
.color(() -> () -> GTBucketItem::color)
.setData(ProviderType.LANG, NonNullBiConsumer.noop())
.model(NonNullBiConsumer.noop())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ private static BlockEntry<ActiveBlock> createFireboxCasing(BoilerFireboxType typ
.hasProperty(RubberLogBlock.NATURAL, true)))
.when(LootItemRandomChanceCondition.randomChance(0.85F))))))
.lang("Rubber Log")
.tag(BlockTags.LOGS_THAT_BURN)
.tag(BlockTags.LOGS_THAT_BURN, BlockTags.OVERWORLD_NATURAL_LOGS)
.blockstate((ctx, provider) -> provider.logBlock(ctx.get()))
.item()
.tag(ItemTags.LOGS_THAT_BURN)
Expand Down
21 changes: 21 additions & 0 deletions src/main/java/com/gregtechceu/gtceu/common/data/GTItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.model.generators.ModelFile;
import net.minecraftforge.common.Tags;
import net.minecraftforge.common.TierSortingRegistry;

import com.google.common.collect.ArrayTable;
Expand Down Expand Up @@ -2465,6 +2466,7 @@ public Component getItemName(ItemStack stack) {
Math.pow(1, ConfigHolder.INSTANCE.tools.voltageTierNightVision - 1)),
ConfigHolder.INSTANCE.tools.voltageTierNightVision, ArmorItem.Type.HELMET)))
.lang("Nightvision Goggles")
.tag(Tags.Items.ARMORS_HELMETS)
.register();

public static ItemEntry<ArmorComponentItem> NANO_CHESTPLATE = REGISTRATE
Expand All @@ -2477,6 +2479,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierNanoSuit)))
.lang("NanoMuscle™ Suite Chestplate")
.properties(p -> p.rarity(Rarity.UNCOMMON))
.tag(Tags.Items.ARMORS_CHESTPLATES)
.register();
public static ItemEntry<ArmorComponentItem> NANO_LEGGINGS = REGISTRATE
.item("nanomuscle_leggings",
Expand All @@ -2488,6 +2491,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierNanoSuit)))
.lang("NanoMuscle™ Suite Leggings")
.properties(p -> p.rarity(Rarity.UNCOMMON))
.tag(Tags.Items.ARMORS_LEGGINGS)
.register();
public static ItemEntry<ArmorComponentItem> NANO_BOOTS = REGISTRATE
.item("nanomuscle_boots", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, ArmorItem.Type.BOOTS, p)
Expand All @@ -2498,6 +2502,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierNanoSuit)))
.lang("NanoMuscle™ Suite Boots")
.properties(p -> p.rarity(Rarity.UNCOMMON))
.tag(Tags.Items.ARMORS_BOOTS)
.register();
public static ItemEntry<ArmorComponentItem> NANO_HELMET = REGISTRATE
.item("nanomuscle_helmet", (p) -> new ArmorComponentItem(GTArmorMaterials.ARMOR, ArmorItem.Type.HELMET, p)
Expand All @@ -2507,6 +2512,7 @@ public Component getItemName(ItemStack stack) {
Math.pow(4, ConfigHolder.INSTANCE.tools.voltageTierNanoSuit - 3)),
ConfigHolder.INSTANCE.tools.voltageTierNanoSuit)))
.lang("NanoMuscle™ Suite Helmet")
.tag(Tags.Items.ARMORS_HELMETS)
.properties(p -> p.rarity(Rarity.UNCOMMON))
.register();

Expand All @@ -2515,6 +2521,7 @@ public Component getItemName(ItemStack stack) {
(p) -> new ArmorComponentItem(GTArmorMaterials.BAD_PPE_EQUIPMENT, ArmorItem.Type.HELMET, p)
.setArmorLogic(new HazmatSuit(ArmorItem.Type.HELMET, "bad_hazmat")))
.lang("Face Mask")
.tag(Tags.Items.ARMORS_HELMETS)
.tag(CustomTags.PPE_ARMOR)
.onRegister(attach(new TooltipBehavior(tooltips -> {
tooltips.add(Component.translatable("gtceu.hazard_trigger.protection.description"));
Expand All @@ -2526,6 +2533,7 @@ public Component getItemName(ItemStack stack) {
(p) -> new ArmorComponentItem(GTArmorMaterials.BAD_PPE_EQUIPMENT, ArmorItem.Type.HELMET, p)
.setArmorLogic(new HazmatSuit(ArmorItem.Type.CHESTPLATE, "bad_hazmat")))
.lang("Rubber Gloves")
.tag(Tags.Items.ARMORS_CHESTPLATES)
.tag(CustomTags.PPE_ARMOR)
.onRegister(attach(new TooltipBehavior(tooltips -> {
tooltips.add(Component.translatable("gtceu.hazard_trigger.protection.description"));
Expand All @@ -2538,6 +2546,7 @@ public Component getItemName(ItemStack stack) {
.setArmorLogic(new HazmatSuit(ArmorItem.Type.CHESTPLATE, "hazmat")))
.lang("Hazardous Materials Suit Chestpiece")
.properties(p -> p.rarity(Rarity.UNCOMMON))
.tag(Tags.Items.ARMORS_CHESTPLATES)
.tag(CustomTags.PPE_ARMOR)
.register();
public static ItemEntry<ArmorComponentItem> HAZMAT_LEGGINGS = REGISTRATE
Expand All @@ -2546,6 +2555,7 @@ public Component getItemName(ItemStack stack) {
.setArmorLogic(new HazmatSuit(ArmorItem.Type.LEGGINGS, "hazmat")))
.lang("Hazardous Materials Suit Leggings")
.properties(p -> p.rarity(Rarity.UNCOMMON))
.tag(Tags.Items.ARMORS_LEGGINGS)
.tag(CustomTags.PPE_ARMOR)
.register();
public static ItemEntry<ArmorComponentItem> HAZMAT_BOOTS = REGISTRATE
Expand All @@ -2554,6 +2564,7 @@ public Component getItemName(ItemStack stack) {
.setArmorLogic(new HazmatSuit(ArmorItem.Type.BOOTS, "hazmat")))
.lang("Hazardous Materials Suit Boots")
.properties(p -> p.rarity(Rarity.UNCOMMON))
.tag(Tags.Items.ARMORS_BOOTS)
.tag(CustomTags.PPE_ARMOR)
.register();
public static ItemEntry<ArmorComponentItem> HAZMAT_HELMET = REGISTRATE
Expand All @@ -2562,6 +2573,7 @@ public Component getItemName(ItemStack stack) {
.setArmorLogic(new HazmatSuit(ArmorItem.Type.HELMET, "hazmat")))
.lang("Hazardous Materials Suit Headpiece")
.properties(p -> p.rarity(Rarity.UNCOMMON))
.tag(Tags.Items.ARMORS_HELMETS)
.tag(CustomTags.PPE_ARMOR)
.register();

Expand All @@ -2575,6 +2587,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierQuarkTech)))
.lang("QuarkTech™ Suite Chestplate")
.properties(p -> p.rarity(Rarity.RARE))
.tag(Tags.Items.ARMORS_CHESTPLATES)
.tag(CustomTags.PPE_ARMOR)
.register();
public static ItemEntry<ArmorComponentItem> QUANTUM_LEGGINGS = REGISTRATE
Expand All @@ -2587,6 +2600,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierQuarkTech)))
.lang("QuarkTech™ Suite Leggings")
.properties(p -> p.rarity(Rarity.RARE))
.tag(Tags.Items.ARMORS_LEGGINGS)
.tag(CustomTags.PPE_ARMOR)
.register();
public static ItemEntry<ArmorComponentItem> QUANTUM_BOOTS = REGISTRATE
Expand All @@ -2598,6 +2612,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierQuarkTech)))
.lang("QuarkTech™ Suite Boots")
.properties(p -> p.rarity(Rarity.RARE))
.tag(Tags.Items.ARMORS_BOOTS)
.tag(CustomTags.PPE_ARMOR)
.register();
public static ItemEntry<ArmorComponentItem> QUANTUM_HELMET = REGISTRATE
Expand All @@ -2609,6 +2624,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierQuarkTech)))
.lang("QuarkTech™ Suite Helmet")
.properties(p -> p.rarity(Rarity.RARE))
.tag(Tags.Items.ARMORS_HELMETS)
.tag(CustomTags.PPE_ARMOR)
.register();

Expand All @@ -2617,6 +2633,7 @@ public Component getItemName(ItemStack stack) {
(p) -> new ArmorComponentItem(GTArmorMaterials.JETPACK, ArmorItem.Type.CHESTPLATE, p)
.setArmorLogic(new PowerlessJetpack()))
.lang("Liquid Fuel Jetpack")
.tag(Tags.Items.ARMORS_CHESTPLATES)
.setData(ProviderType.ITEM_MODEL, NonNullBiConsumer.noop())
.register();
public static ItemEntry<ArmorComponentItem> ELECTRIC_JETPACK = REGISTRATE
Expand All @@ -2628,6 +2645,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierImpeller)))
.lang("Electric Jetpack")
.properties(p -> p.rarity(Rarity.UNCOMMON))
.tag(Tags.Items.ARMORS_CHESTPLATES)
.model(overrideModel(GTCEu.id("electric_jetpack"), 8))
.onRegister(modelPredicate(GTCEu.id("electric_jetpack"), ElectricStats::getStoredPredicate))
.register();
Expand All @@ -2641,6 +2659,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierAdvImpeller)))
.lang("Advanced Electric Jetpack")
.properties(p -> p.rarity(Rarity.RARE))
.tag(Tags.Items.ARMORS_CHESTPLATES)
.register();
public static ItemEntry<ArmorComponentItem> NANO_CHESTPLATE_ADVANCED = REGISTRATE
.item("avanced_nanomuscle_chestplate",
Expand All @@ -2651,6 +2670,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierAdvNanoSuit)))
.lang("Advanced NanoMuscle™ Suite Chestplate")
.properties(p -> p.rarity(Rarity.RARE))
.tag(Tags.Items.ARMORS_CHESTPLATES)
.tag(CustomTags.PPE_ARMOR)
.register();
public static ItemEntry<ArmorComponentItem> QUANTUM_CHESTPLATE_ADVANCED = REGISTRATE
Expand All @@ -2663,6 +2683,7 @@ public Component getItemName(ItemStack stack) {
ConfigHolder.INSTANCE.tools.voltageTierAdvQuarkTech)))
.lang("Advanced QuarkTech™ Suite Chestplate")
.properties(p -> p.rarity(Rarity.EPIC))
.tag(Tags.Items.ARMORS_CHESTPLATES)
.tag(CustomTags.PPE_ARMOR)
.register();

Expand Down
Loading