Skip to content

Comments

Add Photographer API for .mcpr recording (Foliaphotographer-style)#444

Open
xiaofanforfabric wants to merge 2 commits intoPaperMC:ver/1.21.4from
xiaofanforfabric:ver/1.21.4-PhotographerAPI
Open

Add Photographer API for .mcpr recording (Foliaphotographer-style)#444
xiaofanforfabric wants to merge 2 commits intoPaperMC:ver/1.21.4from
xiaofanforfabric:ver/1.21.4-PhotographerAPI

Conversation

@xiaofanforfabric
Copy link

Summary

This PR adds a Photographer API to Folia so the server can record gameplay as .mcpr replays (ReplayMod-compatible). Plugins can create "photographer" entities that mirror a player, capture network packets, and write them to a .mcpr file when recording stops.

Motivation

  • Recording on Folia: Servers (e.g. anti-cheat, moderation, replay) need a way to record players as .mcpr without a client-side ReplayMod. Leaves and some other cores already provide a Photographer API; this brings the same capability to Folia.
  • Plugin compatibility: The API is aligned with the existing "photographer" concept (e.g. Leaves), so plugins like ISeeYou (Folia) can support Folia with minimal changes.

Main changes

Area Description
API (folia-api) New interfaces: PhotographerManager, Photographer, BukkitRecorderOption. Server exposes Server#getPhotographerManager().
Server implementation ServerPhotographer (fake player), Recorder, ReplayFile, CraftPhotographerManager. Records packets to a temp dir and packs to .mcpr on stop.
PlayerList realPlayers list, placeNewPhotographer(), removePhotographer(). Photographers do not consume real player slots.
CraftServer / events getPhotographerManager(); CraftEntity maps ServerPhotographerCraftPhotographer; player events skip photographers.
Folia threading ServerPhotographer#tick() uses a local tick counter instead of MinecraftServer.getTickCount() (which is not available on Folia).

Testing

  • Built with createMojmapPaperclipJar, started server, loaded FoliaISEEYOU. Recording starts on player join and saves .mcpr on quit; replay plays correctly in ReplayMod.

Notes

  • Patches are structured for the existing Folia/Paper patch flow (e.g. paper-patches and minecraft-patches). Happy to adjust to upstream conventions or split into smaller PRs if preferred.

xiaofanforfabric and others added 2 commits February 20, 2026 17:36
Co-authored-by: Cursor <cursoragent@cursor.com>
@Q2297045667
Copy link

不是,你往这里放啥呀?
他又不可能合并你的pr😂这种功能就没必要拉上来了吧?他不可能合并的。

@xiaofanforfabric
Copy link
Author

我去,好像提交错地方了,我应该提到我的仓库的1.21.4分支的

@virgil698
Copy link

没绷住

@xiaofanforfabric
Copy link
Author

管他呢,爱合并不合并

@Fawe00
Copy link

Fawe00 commented Feb 20, 2026

⚠️ Security & License Concerns - Compiled .class Files Should Not Be Committed
To the maintainers (@PaperMC team):
I recommend not merging this PR in its current state due to serious concerns about binary files and GPL compliance.
To the PR author (@xiaofanforfabric):
Thank you for your contribution, but there are some critical issues that need to be addressed:
🔴 Problems:

24 compiled .class files are being committed to the repository

Binary files like .class should never be in version control
They are automatically generated during the build process
They belong in .gitignore, not in the repository

GPL License violation concern

The GPL requires source code transparency
Committing pre-compiled binaries without a verifiable build process contradicts open-source principles
Users cannot verify if the .class files actually match the provided .java source code

Security risk

Pre-compiled .class files could contain malicious bytecode not visible in the source
There's no way to verify the binaries match the source code
This creates a potential attack vector

Build artifacts shouldn't be in git

Files in bin/main/ are build outputs
These should be generated locally via ./gradlew build, not committed

✅ Required changes:

Remove all .class files from the commit
Add proper .gitignore rules for bin/, build/, and *.class
Only commit source files (.java, .patch, build scripts)
Let the Gradle build process generate .class files locally

@Dueris
Copy link

Dueris commented Feb 20, 2026

Holy AI... both semi in code and in comments

This is out of scope of Folias intentions and goals, and most likely will not get merged, along with the fact that there are changes in the README too..??? And weird new MD files??? And compiled class files???

Out of scope, I don't think this would rly ever be merged, especially given this seems to be doing a lot more than just a Photographer API, like calling it a Folia fork in the unneeded README changes... when being PRed to merge with Folia?? And the insanely long debug file??

@xiaofanforfabric
Copy link
Author

这本来就是一个错误的拉取请求,本意是要合并到我的项目,结果不知为何拉到了paperMC官方的项目,我了解不会合并的,我不在意
This was originally an erroneous pull request. The intention was to merge it into my own project, but for some reason it was submitted to the PaperMC official repository. I understand it won’t be merged, and I don’t mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants