mirror of
https://github.com/Sollace/Unicopia.git
synced 2025-02-24 21:54:33 +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.GameRules;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.WorldEvents;
|
import net.minecraft.world.WorldEvents;
|
||||||
|
import net.minecraft.world.Heightmap.Type;
|
||||||
import net.minecraft.world.event.GameEvent;
|
import net.minecraft.world.event.GameEvent;
|
||||||
|
|
||||||
public class SombraEntity extends HostileEntity implements ArenaCombatant, ParticleSource<SombraEntity> {
|
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();
|
Optional<BlockPos> homePos = getHomePos();
|
||||||
|
|
||||||
if (homePos.isEmpty() && !isRemoved()) {
|
if (homePos.isEmpty() && !isRemoved()) {
|
||||||
setHomePos(getBlockPos());
|
setHomePos(getWorld().getTopPosition(Type.MOTION_BLOCKING_NO_LEAVES, getBlockPos()));
|
||||||
homePos = getHomePos();
|
homePos = getHomePos();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,10 +243,9 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
||||||
setPositionTarget(homePos.get(), (int)getAreaRadius());
|
setPositionTarget(homePos.get(), (int)getAreaRadius());
|
||||||
}
|
}
|
||||||
|
|
||||||
setVelocity(Vec3d.ZERO);
|
|
||||||
super.tick();
|
super.tick();
|
||||||
|
|
||||||
if (getTarget() == null && getVelocity().y < 0) {
|
if (getTarget() == null && getVelocity().y < -0.1F) {
|
||||||
setVelocity(getVelocity().multiply(1, 0.4, 1));
|
setVelocity(getVelocity().multiply(1, 0.4, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +285,7 @@ public class SombraEntity extends HostileEntity implements ArenaCombatant, Parti
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getTarget() == null && getNavigation().isIdle()) {
|
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.putInt("clearTicks", getClearTicks());
|
||||||
nbt.putFloat("size", getSize(1));
|
nbt.putFloat("size", getSize(1));
|
||||||
nbt.putBoolean("cursed", cursed);
|
nbt.putBoolean("cursed", cursed);
|
||||||
|
nbt.putInt("phase", phase);
|
||||||
|
nbt.putInt("nextPhase", nextPhase);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -344,6 +346,8 @@ public class StormCloudEntity extends Entity {
|
||||||
setClearTicks(nbt.getInt("clearTicks"));
|
setClearTicks(nbt.getInt("clearTicks"));
|
||||||
setSize(currentSize = nbt.getFloat("size"));
|
setSize(currentSize = nbt.getFloat("size"));
|
||||||
cursed = nbt.getBoolean("cursed");
|
cursed = nbt.getBoolean("cursed");
|
||||||
|
phase = nbt.getInt("phase");
|
||||||
|
nextPhase = nbt.getInt("nextPhase");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue