40 lines
1.4 KiB
Java
40 lines
1.4 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* org.jspecify.annotations.Nullable
|
|
*/
|
|
package net.minecraft.world.item;
|
|
|
|
import net.minecraft.core.Direction;
|
|
import net.minecraft.core.Position;
|
|
import net.minecraft.world.entity.LivingEntity;
|
|
import net.minecraft.world.entity.projectile.AbstractArrow;
|
|
import net.minecraft.world.entity.projectile.Projectile;
|
|
import net.minecraft.world.entity.projectile.SpectralArrow;
|
|
import net.minecraft.world.item.ArrowItem;
|
|
import net.minecraft.world.item.Item;
|
|
import net.minecraft.world.item.ItemStack;
|
|
import net.minecraft.world.level.Level;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
public class SpectralArrowItem
|
|
extends ArrowItem {
|
|
public SpectralArrowItem(Item.Properties properties) {
|
|
super(properties);
|
|
}
|
|
|
|
@Override
|
|
public AbstractArrow createArrow(Level level, ItemStack itemStack, LivingEntity owner, @Nullable ItemStack firedFromWeapon) {
|
|
return new SpectralArrow(level, owner, itemStack.copyWithCount(1), firedFromWeapon);
|
|
}
|
|
|
|
@Override
|
|
public Projectile asProjectile(Level level, Position position, ItemStack itemStack, Direction direction) {
|
|
SpectralArrow arrow = new SpectralArrow(level, position.x(), position.y(), position.z(), itemStack.copyWithCount(1), null);
|
|
arrow.pickup = AbstractArrow.Pickup.ALLOWED;
|
|
return arrow;
|
|
}
|
|
}
|
|
|