mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 15:17:59 +01:00
Fix sombra not being able to move, save the summoning progress, and set his home position correctly when spawned directly
This commit is contained in:
parent
bf06bc0ba4
commit
6bbea1766f
2 changed files with 8 additions and 4 deletions
|
@ -72,6 +72,7 @@ import net.minecraft.util.math.Vec3d;
|
|||
import net.minecraft.world.GameRules;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.WorldEvents;
|
||||
import net.minecraft.world.Heightmap.Type;
|
||||
import net.minecraft.world.event.GameEvent;
|
||||
|
||||
public class SombraEntity extends HostileEntity implements ArenaCombatant, ParticleSource<SombraEntity> {
|
||||
|
@ -219,7 +220,7 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
|||
Optional<BlockPos> homePos = getHomePos();
|
||||
|
||||
if (homePos.isEmpty() && !isRemoved()) {
|
||||
setHomePos(getBlockPos());
|
||||
setHomePos(getWorld().getTopPosition(Type.MOTION_BLOCKING_NO_LEAVES, getBlockPos()));
|
||||
homePos = getHomePos();
|
||||
}
|
||||
|
||||
|
@ -242,10 +243,9 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
|||
setPositionTarget(homePos.get(), (int)getAreaRadius());
|
||||
}
|
||||
|
||||
setVelocity(Vec3d.ZERO);
|
||||
super.tick();
|
||||
|
||||
if (getTarget() == null && getVelocity().y < 0) {
|
||||
if (getTarget() == null && getVelocity().y < -0.1F) {
|
||||
setVelocity(getVelocity().multiply(1, 0.4, 1));
|
||||
}
|
||||
|
||||
|
@ -285,7 +285,7 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
|||
}
|
||||
|
||||
if (getTarget() == null && getNavigation().isIdle()) {
|
||||
getNavigation().startMovingTo(homePos.get().getX(), homePos.get().getY() + 10, homePos.get().getZ(), 2);
|
||||
getNavigation().startMovingTo(homePos.get().getX(), homePos.get().getY() + 5, homePos.get().getZ(), 2);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -336,6 +336,8 @@ public class StormCloudEntity extends Entity {
|
|||
nbt.putInt("clearTicks", getClearTicks());
|
||||
nbt.putFloat("size", getSize(1));
|
||||
nbt.putBoolean("cursed", cursed);
|
||||
nbt.putInt("phase", phase);
|
||||
nbt.putInt("nextPhase", nextPhase);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -344,6 +346,8 @@ public class StormCloudEntity extends Entity {
|
|||
setClearTicks(nbt.getInt("clearTicks"));
|
||||
setSize(currentSize = nbt.getFloat("size"));
|
||||
cursed = nbt.getBoolean("cursed");
|
||||
phase = nbt.getInt("phase");
|
||||
nextPhase = nbt.getInt("nextPhase");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue