Add Photographer API for .mcpr recording (Foliaphotographer-style) #444
No reviewers
Labels
No labels
documentation
good first issue
help wanted
resolution: duplicate
resolution: invalid
resolution: won't fix
status: needs triage
type: bug
type: feature
type: performance
type: question
version: 1.19.4
version: 1.20
version: 1.20.1
version: 1.20.2
version: 1.20.4
version: 1.20.6
version: 1.21.11
version: 1.21.4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Minecraft/Folia!444
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "xiaofanforfabric/ver/1.21.4-PhotographerAPI"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
Main changes
PhotographerManager,Photographer,BukkitRecorderOption. Server exposesServer#getPhotographerManager().ServerPhotographer(fake player),Recorder,ReplayFile,CraftPhotographerManager. Records packets to a temp dir and packs to .mcpr on stop.realPlayerslist,placeNewPhotographer(),removePhotographer(). Photographers do not consume real player slots.getPhotographerManager(); CraftEntity mapsServerPhotographer→CraftPhotographer; player events skip photographers.ServerPhotographer#tick()uses a local tick counter instead ofMinecraftServer.getTickCount()(which is not available on Folia).Testing
createMojmapPaperclipJar, started server, loaded FoliaISEEYOU. Recording starts on player join and saves .mcpr on quit; replay plays correctly in ReplayMod.Notes
不是,你往这里放啥呀?
他又不可能合并你的pr😂这种功能就没必要拉上来了吧?他不可能合并的。
我去,好像提交错地方了,我应该提到我的仓库的1.21.4分支的
没绷住
管他呢,爱合并不合并
⚠️ 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
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??
这本来就是一个错误的拉取请求,本意是要合并到我的项目,结果不知为何拉到了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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.