2022-12-09 14:55:42 +01:00
|
|
|
package com.minelittlepony.unicopia.item;
|
|
|
|
|
2022-12-09 21:45:49 +01:00
|
|
|
import com.minelittlepony.unicopia.entity.ItemTracker;
|
2022-12-09 14:55:42 +01:00
|
|
|
import com.minelittlepony.unicopia.entity.Living;
|
|
|
|
import com.minelittlepony.unicopia.particle.ParticleUtils;
|
|
|
|
|
|
|
|
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
|
|
|
|
import net.minecraft.entity.*;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraft.particle.ParticleTypes;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
|
2022-12-09 21:45:49 +01:00
|
|
|
public class PegasusAmuletItem extends AmuletItem implements ItemTracker.Trackable {
|
2022-12-09 14:55:42 +01:00
|
|
|
public PegasusAmuletItem(FabricItemSettings settings, int maxEnergy) {
|
|
|
|
super(settings, maxEnergy);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-12-09 21:45:49 +01:00
|
|
|
public void onUnequipped(Living<?> living, long timeWorn) {
|
2022-12-09 14:55:42 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2022-12-09 21:45:49 +01:00
|
|
|
public void onEquipped(Living<?> living) {
|
2022-12-09 14:55:42 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void inventoryTick(ItemStack stack, World world, Entity entity, int slot, boolean selected) {
|
|
|
|
if (entity.world.getTime() % 6 == 0 && entity instanceof LivingEntity living && isApplicable(living)) {
|
|
|
|
ParticleUtils.spawnParticles(entity.world.getDimension().ultrawarm() ? ParticleTypes.SOUL_FIRE_FLAME : ParticleTypes.COMPOSTER, entity, 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|