// Path: src/main/java/com/legobmw99/allomancy/modules/combat/CombatSetup.java
// public class CombatSetup {
//     public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, Allomancy.MODID);
//     public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Allomancy.MODID);
//     public static final RegistryObject<CoinBagItem> COIN_BAG = ITEMS.register("coin_bag", CoinBagItem::new);
//     public static final RegistryObject<ObsidianDaggerItem> OBSIDIAN_DAGGER = ITEMS.register("obsidian_dagger", ObsidianDaggerItem::new);
//     public static final RegistryObject<KolossBladeItem> KOLOSS_BLADE = ITEMS.register("koloss_blade", KolossBladeItem::new);
//     public static final ArmorMaterial WoolArmor = new ArmorMaterial() {
//         @Override
//         public int getDurabilityForSlot(EquipmentSlot slotIn) {
//             return 50;
//         }
// 
//         @Override
//         public int getDefenseForSlot(EquipmentSlot slotIn) {
//             return slotIn == EquipmentSlot.CHEST ? 4 : 0;
//         }
// 
//         @Override
//         public int getEnchantmentValue() {
//             return 15;
//         }
// 
//         @Override
//         public SoundEvent getEquipSound() {
//             return SoundEvents.ARMOR_EQUIP_LEATHER;
//         }
// 
//         @Override
//         public Ingredient getRepairIngredient() {
//             return Ingredient.of(Items.GRAY_WOOL);
//         }
// 
//         @Override
//         public String getName() {
//             return "allomancy:wool";
//         }
// 
//         @Override
//         public float getToughness() {
//             return 0;
//         }
// 
//         @Override
//         public float getKnockbackResistance() {
//             return 0;
//         }
// 
//     };
//     public static final RegistryObject<MistcloakItem> MISTCLOAK = ITEMS.register("mistcloak", MistcloakItem::new);
//     public static final RegistryObject<EntityType<ProjectileNuggetEntity>> NUGGET_PROJECTILE = ENTITIES.register("nugget_projectile", () -> EntityType.Builder
//             .<ProjectileNuggetEntity>of(ProjectileNuggetEntity::new, MobCategory.MISC)
//             .setShouldReceiveVelocityUpdates(true)
//             .setUpdateInterval(20)
//             .setCustomClientFactory((spawnEntity, world) -> new ProjectileNuggetEntity(world, spawnEntity.getEntity()))
//             .sized(0.25F, 0.25F)
//             .build("nugget_projectile"));
// 
//     public static void register() {
//         ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus());
//         ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
//     }
// 
// 
// }


import com.legobmw99.allomancy.modules.combat.CombatSetup;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.ItemSupplier;
import net.minecraft.world.entity.projectile.ThrowableItemProjectile;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.network.NetworkHooks;
package com.legobmw99.allomancy.modules.combat.entity;


@OnlyIn(value = Dist.CLIENT, _interface = ItemSupplier.class)
public class ProjectileNuggetEntity extends ThrowableItemProjectile implements ItemSupplier {
    private static final EntityDataAccessor<ItemStack> ITEM = SynchedEntityData.defineId(ProjectileNuggetEntity.class, EntityDataSerializers.ITEM_STACK);

    private float damage;
    private boolean dropItem = true;

    public ProjectileNuggetEntity(double x, double y, double z, Level worldIn, ItemStack itemIn, float damageIn) {
        super(CombatSetup.NUGGET_PROJECTILE.get(), x, y, z, worldIn);
        this.damage = damageIn;

        if (!itemIn.isEmpty()) {
            this.entityData.set(ITEM, itemIn.copy());
        }
    }

    public ProjectileNuggetEntity(LivingEntity livingEntityIn, Level worldIn, ItemStack itemIn, float damageIn) {
        super(CombatSetup.NUGGET_PROJECTILE.get(), livingEntityIn, worldIn);
        if (livingEntityIn instanceof Player player) {
            if (player.getAbilities().instabuild) {
                this.dropItem = false;
            }
        }
        if (!itemIn.isEmpty()) {
            this.entityData.set(ITEM, itemIn.copy());
        }
        this.damage = damageIn;
    }

    public ProjectileNuggetEntity(EntityType<ProjectileNuggetEntity> entityEntityType, Level world) {
        super(CombatSetup.NUGGET_PROJECTILE.get(), world);
        this.damage = 0;
    }

    public ProjectileNuggetEntity(Level world, Entity other) {
// Path: src/main/java/com/legobmw99/allomancy/modules/combat/CombatSetup.java
// public class CombatSetup {
//     public static final DeferredRegister<EntityType<?>> ENTITIES = DeferredRegister.create(ForgeRegistries.ENTITIES, Allomancy.MODID);
//     public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, Allomancy.MODID);
//     public static final RegistryObject<CoinBagItem> COIN_BAG = ITEMS.register("coin_bag", CoinBagItem::new);
//     public static final RegistryObject<ObsidianDaggerItem> OBSIDIAN_DAGGER = ITEMS.register("obsidian_dagger", ObsidianDaggerItem::new);
//     public static final RegistryObject<KolossBladeItem> KOLOSS_BLADE = ITEMS.register("koloss_blade", KolossBladeItem::new);
//     public static final ArmorMaterial WoolArmor = new ArmorMaterial() {
//         @Override
//         public int getDurabilityForSlot(EquipmentSlot slotIn) {
//             return 50;
//         }
// 
//         @Override
//         public int getDefenseForSlot(EquipmentSlot slotIn) {
//             return slotIn == EquipmentSlot.CHEST ? 4 : 0;
//         }
// 
//         @Override
//         public int getEnchantmentValue() {
//             return 15;
//         }
// 
//         @Override
//         public SoundEvent getEquipSound() {
//             return SoundEvents.ARMOR_EQUIP_LEATHER;
//         }
// 
//         @Override
//         public Ingredient getRepairIngredient() {
//             return Ingredient.of(Items.GRAY_WOOL);
//         }
// 
//         @Override
//         public String getName() {
//             return "allomancy:wool";
//         }
// 
//         @Override
//         public float getToughness() {
//             return 0;
//         }
// 
//         @Override
//         public float getKnockbackResistance() {
//             return 0;
//         }
// 
//     };
//     public static final RegistryObject<MistcloakItem> MISTCLOAK = ITEMS.register("mistcloak", MistcloakItem::new);
//     public static final RegistryObject<EntityType<ProjectileNuggetEntity>> NUGGET_PROJECTILE = ENTITIES.register("nugget_projectile", () -> EntityType.Builder
//             .<ProjectileNuggetEntity>of(ProjectileNuggetEntity::new, MobCategory.MISC)
//             .setShouldReceiveVelocityUpdates(true)
//             .setUpdateInterval(20)
//             .setCustomClientFactory((spawnEntity, world) -> new ProjectileNuggetEntity(world, spawnEntity.getEntity()))
//             .sized(0.25F, 0.25F)
//             .build("nugget_projectile"));
// 
//     public static void register() {
//         ENTITIES.register(FMLJavaModLoadingContext.get().getModEventBus());
//         ITEMS.register(FMLJavaModLoadingContext.get().getModEventBus());
//     }
// 
// 
// }


// Path: src/main/java/com/legobmw99/allomancy/modules/combat/entity/ProjectileNuggetEntity.java
import com.legobmw99.allomancy.modules.combat.CombatSetup;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.syncher.EntityDataAccessor;
import net.minecraft.network.syncher.EntityDataSerializers;
import net.minecraft.network.syncher.SynchedEntityData;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.ItemSupplier;
import net.minecraft.world.entity.projectile.ThrowableItemProjectile;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.level.GameRules;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.EntityHitResult;
import net.minecraft.world.phys.HitResult;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.network.NetworkHooks;

package com.legobmw99.allomancy.modules.combat.entity;


@OnlyIn(value = Dist.CLIENT, _interface = ItemSupplier.class)
public class ProjectileNuggetEntity extends ThrowableItemProjectile implements ItemSupplier {
    private static final EntityDataAccessor<ItemStack> ITEM = SynchedEntityData.defineId(ProjectileNuggetEntity.class, EntityDataSerializers.ITEM_STACK);

    private float damage;
    private boolean dropItem = true;

    public ProjectileNuggetEntity(double x, double y, double z, Level worldIn, ItemStack itemIn, float damageIn) {
        super(CombatSetup.NUGGET_PROJECTILE.get(), x, y, z, worldIn);
        this.damage = damageIn;

        if (!itemIn.isEmpty()) {
            this.entityData.set(ITEM, itemIn.copy());
        }
    }

    public ProjectileNuggetEntity(LivingEntity livingEntityIn, Level worldIn, ItemStack itemIn, float damageIn) {
        super(CombatSetup.NUGGET_PROJECTILE.get(), livingEntityIn, worldIn);
        if (livingEntityIn instanceof Player player) {
            if (player.getAbilities().instabuild) {
                this.dropItem = false;
            }
        }
        if (!itemIn.isEmpty()) {
            this.entityData.set(ITEM, itemIn.copy());
        }
        this.damage = damageIn;
    }

    public ProjectileNuggetEntity(EntityType<ProjectileNuggetEntity> entityEntityType, Level world) {
        super(CombatSetup.NUGGET_PROJECTILE.get(), world);
        this.damage = 0;
    }

    public ProjectileNuggetEntity(Level world, Entity other) {
        this(CombatSetup.NUGGET_PROJECTILE.get(), world);