Merge pull request #162 from RinesThaix/projectilesGravity

Fixing projectiles gravity
This commit is contained in:
TheMode 2021-03-07 15:09:47 +01:00 committed by GitHub
commit 9ea34fb668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -31,12 +31,14 @@ public class EntityProjectile extends Entity {
public EntityProjectile(@Nullable Entity shooter, @NotNull EntityType entityType) { public EntityProjectile(@Nullable Entity shooter, @NotNull EntityType entityType) {
super(entityType); super(entityType);
this.shooter = shooter; this.shooter = shooter;
setup();
} }
@Deprecated @Deprecated
public EntityProjectile(@Nullable Entity shooter, @NotNull EntityType entityType, @NotNull Position spawnPosition) { public EntityProjectile(@Nullable Entity shooter, @NotNull EntityType entityType, @NotNull Position spawnPosition) {
super(entityType, spawnPosition); super(entityType, spawnPosition);
this.shooter = shooter; this.shooter = shooter;
setup();
} }
private void setup() { private void setup() {
@ -44,7 +46,7 @@ public class EntityProjectile extends Entity {
if (getEntityMeta() instanceof ProjectileMeta) { if (getEntityMeta() instanceof ProjectileMeta) {
((ProjectileMeta) getEntityMeta()).setShooter(this.shooter); ((ProjectileMeta) getEntityMeta()).setShooter(this.shooter);
} }
setBoundingBox(.5F, .5F, .5F); setGravity(0.02f, 0.04f, 1.96f);
} }
@Nullable @Nullable