Skip to content

Commit bfbbbbd

Browse files
committed
fix
1 parent 9cdb529 commit bfbbbbd

File tree

2 files changed

+6
-17
lines changed

2 files changed

+6
-17
lines changed

src/MiNET/MiNET/Entities/Projectiles/Projectile.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
using MiNET.Blocks;
3131
using MiNET.Net;
3232
using MiNET.Particles;
33-
using MiNET.Utils;
3433
using MiNET.Utils.Metadata;
3534
using MiNET.Utils.Vectors;
3635
using MiNET.Worlds;
@@ -144,11 +143,13 @@ public override void OnTick(Entity[] entities)
144143
player.LastAttackTarget = entityCollided;
145144
}
146145

147-
entityCollided.HealthManager.TakeHit(this, (int) damage, DamageCause.Projectile);
148146
entityCollided.HealthManager.LastDamageSource = Shooter;
149-
150147
OnHitEntity(entityCollided);
151148
DespawnEntity();
149+
150+
if (damage == -1) { return; }
151+
152+
entityCollided.HealthManager.TakeHit(this, (int) damage, DamageCause.Projectile);
152153
return;
153154
}
154155
else

src/MiNET/MiNET/Player.cs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,16 +1890,6 @@ public virtual void SpawnLevel(Level toLevel, PlayerLocation spawnPoint, bool us
18901890
toLevel = levelFunc();
18911891
}
18921892

1893-
SetPosition(new PlayerLocation
1894-
{
1895-
X = KnownPosition.X,
1896-
Y = 4000,
1897-
Z = KnownPosition.Z,
1898-
Yaw = 91,
1899-
Pitch = 28,
1900-
HeadYaw = 91,
1901-
});
1902-
19031893
Action transferFunc = delegate
19041894
{
19051895
if (useLoadingScreen)
@@ -1928,10 +1918,7 @@ public virtual void SpawnLevel(Level toLevel, PlayerLocation spawnPoint, bool us
19281918

19291919
CleanCache();
19301920

1931-
ForcedSendChunk(SpawnPosition);
1932-
1933-
// send teleport to spawn
1934-
SetPosition(SpawnPosition);
1921+
ForcedSendChunk(Level.SpawnPoint);
19351922

19361923
MiNetServer.FastThreadPool.QueueUserWorkItem(() =>
19371924
{
@@ -1948,6 +1935,7 @@ public virtual void SpawnLevel(Level toLevel, PlayerLocation spawnPoint, bool us
19481935
postSpawnAction?.Invoke();
19491936
});
19501937
});
1938+
SetPosition(SpawnPosition);
19511939
};
19521940

19531941
transferFunc();

0 commit comments

Comments
 (0)