Skip to content

Commit

Permalink
Fix CustomSpearItem & SpearEntity
Browse files Browse the repository at this point in the history
  • Loading branch information
FirstMegaGame4 committed Apr 26, 2024
1 parent 13efa84 commit fe60316
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@

public class SpearEntity extends TridentEntity {

public SpearEntity(EntityType<? extends SpearEntity> entityType, World world) {
public SpearEntity(EntityType<? extends SpearEntity> entityType, World world, ItemStack stack) {
super(entityType, world);
((TridentEntityAccessor) this).setTridentStack(stack.copy());
}

public SpearEntity(EntityType<? extends SpearEntity> entityType, World world, LivingEntity owner, ItemStack stack) {
this(entityType, world);
this(entityType, world, stack);
this.setPosition(owner.getX(), owner.getEyeY() - 0.1F, owner.getZ());
this.setOwner(owner);
if (owner instanceof PlayerEntity) {
this.pickupType = PersistentProjectileEntity.PickupPermission.ALLOWED;
}
((TridentEntityAccessor) this).setTridentStack(stack.copy());
this.dataTracker.set(TridentEntityAccessor.getLoyalty(), (byte) EnchantmentHelper.getLoyalty(stack));
this.dataTracker.set(TridentEntityAccessor.getEnchanted(), stack.hasGlint());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public class CustomSpearItem extends TridentItem implements ItemRegistrable {
private final LaunchFactory<? extends SpearEntity> launchFactory;

public CustomSpearItem(Settings settings) {
this(settings, null);
this(null, settings);
}

public CustomSpearItem(Settings settings, LaunchFactory<? extends SpearEntity> launchFactory) {
public CustomSpearItem(LaunchFactory<? extends SpearEntity> launchFactory, Settings settings) {
super(settings);
this.launchFactory = launchFactory;
}
Expand Down

0 comments on commit fe60316

Please sign in to comment.