Cancel fire effect when wearing fireward necklace #45

Merged
BlakeRain merged 1 commits from BlakeRain/utamacraft:34-fireward-fire-effect into main 2023-12-17 11:32:20 +00:00
Showing only changes of commit 0bf8ac88d2 - Show all commits

View File

@ -10,6 +10,7 @@ import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.level.Level;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import top.theillusivec4.curios.api.SlotContext;
import top.theillusivec4.curios.api.type.capability.ICurioItem;
import javax.annotation.Nonnull;
@ -30,6 +31,13 @@ public class FireWardItem extends Item implements ICurioItem {
return true;
}
@Override
public void curioTick(SlotContext slotContext, ItemStack stack) {
if (slotContext.entity().isOnFire()) {
slotContext.entity().clearFire();
}
}
private static Properties getProperties() {
return new Properties().tab(ModCreativeModeTab.TAB).stacksTo(1);
}