Skip to content

Commit

Permalink
Add ItemTag to deny Fuel Canister Fuel
Browse files Browse the repository at this point in the history
  • Loading branch information
Direwolf20-MC committed Feb 18, 2024
1 parent 5941a6b commit 90788f5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
// 1.20.4 2024-02-17T22:37:21.925802 JustDireThings Item Tags
// 1.20.4 2024-02-18T15:08:04.8342124 JustDireThings Item Tags
efe9e0caf089100a228c46379f3aa70d7f602ddc data/justdirethings/tags/items/deny_fuel_canister.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.direwolf20.justdirethings.common.containers.handlers;

import com.direwolf20.justdirethings.common.items.FuelCanister;
import com.direwolf20.justdirethings.datagen.ItemTags;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.RecipeType;
import net.neoforged.neoforge.common.CommonHooks;
Expand All @@ -26,6 +27,6 @@ protected void onContentsChanged(int slot) {

@Override
public boolean isItemValid(int slot, @Nonnull ItemStack stack) {
return !(stack.getItem() instanceof FuelCanister) && CommonHooks.getBurnTime(stack, RecipeType.SMELTING) > 0 && !stack.hasCraftingRemainingItem();
return !(stack.getItem() instanceof FuelCanister) && CommonHooks.getBurnTime(stack, RecipeType.SMELTING) > 0 && !stack.hasCraftingRemainingItem() && !stack.is(ItemTags.FUEL_CANISTER_DENY);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
import net.minecraft.data.tags.ItemTagsProvider;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.neoforged.neoforge.common.data.BlockTagsProvider;
import net.neoforged.neoforge.common.data.ExistingFileHelper;

Expand All @@ -14,9 +18,12 @@ public ItemTags(PackOutput packOutput, CompletableFuture<HolderLookup.Provider>
super(packOutput, lookupProvider, blockTags.contentsGetter(), JustDireThings.MODID, helper);
}

public static final TagKey<Item> FUEL_CANISTER_DENY = net.minecraft.tags.ItemTags.create(new ResourceLocation(JustDireThings.MODID, "deny_fuel_canister"));

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

tag(FUEL_CANISTER_DENY)
.add(Items.LAVA_BUCKET);
}

@Override
Expand Down

0 comments on commit 90788f5

Please sign in to comment.