mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-01 14:38:50 +00:00
0.4.0
This commit is contained in:
1 parent
fcf1b4168f
commit
2fbe1f5480
46 files changed
+1846
-132
No files matched your search
@@ -8,6 +8,10 @@ import com.moulberry.flashback.keyframe.handler.KeyframeHandler;
|
||||
import com.moulberry.flashback.keyframe.types.CameraKeyframeType;
|
||||
import com.moulberry.flashback.keyframe.types.CameraOrbitKeyframeType;
|
||||
import com.moulberry.flashback.visuals.ReplayVisuals;
|
||||
import net.minecraft.client.Camera;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.multiplayer.ClientLevel;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -59,6 +63,28 @@ public class EditorState {
|
||||
this.push(new EditorStateHistoryEntry(undo, redo, description));
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Camera getAudioCamera() {
|
||||
if (this.audioSourceEntity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
ClientLevel level = Minecraft.getInstance().level;
|
||||
if (level == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Entity sourceEntity = level.getEntities().get(this.audioSourceEntity);
|
||||
if (sourceEntity == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Camera dummyCamera = new Camera();
|
||||
dummyCamera.eyeHeight = sourceEntity.getEyeHeight();
|
||||
dummyCamera.setup(level, sourceEntity, false, false, 1.0f);
|
||||
return dummyCamera;
|
||||
}
|
||||
|
||||
public void push(EditorStateHistoryEntry entry) {
|
||||
if (entry.undo().isEmpty() && entry.redo().isEmpty()) {
|
||||
return;
|
||||
|
||||
Reference in new issue
Block a user