mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-02 06:28:48 +00:00
Stop spectating when applying camera keyframe
This commit is contained in:
1 parent
7b9f11f60d
commit
a6bb7bf506
4 files changed
+22
No files matched your search
@@ -9,9 +9,11 @@ import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.stats.Stat;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.crafting.RecipeHolder;
|
||||
import net.minecraft.world.level.biome.BiomeManager;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.UUID;
|
||||
@@ -43,6 +45,15 @@ public class ReplayPlayer extends ServerPlayer {
|
||||
serverLevel.isDebug(), serverLevel.isFlat(), this.getLastDeathLocation(), this.getPortalCooldown());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCamera(@Nullable Entity entity) {
|
||||
super.setCamera(entity);
|
||||
|
||||
if (entity == null) {
|
||||
this.spectatingUuid = null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int awardRecipes(Collection<RecipeHolder<?>> collection) {
|
||||
return 0;
|
||||
|
||||
@@ -885,6 +885,7 @@ public class ReplayServer extends IntegratedServer {
|
||||
if (targetEntity != null && !targetEntity.isRemoved()) {
|
||||
replayViewer.setCamera(null);
|
||||
replayViewer.setCamera(targetEntity);
|
||||
replayViewer.spectatingUuid = targetEntity.getUUID();
|
||||
|
||||
if (replayViewer.forceRespectateTickCount == 0) {
|
||||
replayViewer.forceRespectateTickCount = 5;
|
||||
|
||||
Reference in new issue
Block a user