Compare commits

...

208 Commits

Author SHA1 Message Date
AlphaKR93
a020337531 rebuild patches 2025-02-24 16:56:51 +09:00
AlphaKR93
bcf356ff4a [ci skip] Update Gradle Wrapper version to 8.12.1 2025-02-24 16:39:14 +09:00
AlphaKR93
eead936c54 /gc, /heal 2025-02-24 02:50:43 +09:00
AlphaKR93
55fbffae38 Command related patches 2025-02-24 01:53:56 +09:00
AlphaKR93
637b0ef8cb PlayerVehicleMovedIncorrectlyEvent 2025-02-24 01:08:21 +09:00
AlphaKR93
4904f64392 Fix build 2025-02-23 23:42:01 +09:00
AlphaKR93
7456362b05 More optimizations 2025-02-23 23:37:08 +09:00
AlphaKR93
d9625f4213 Apply more optimizations 2025-02-23 23:22:13 +09:00
AlphaKR93
7fac157785 Reapply more patches 2025-02-23 22:54:00 +09:00
AlphaKR93
14403ebab9 Akarin ports 2025-02-23 22:35:05 +09:00
AlphaKR93
fb72bc56c3 [ci skip] Cleanup unapplied patches 2025-02-23 20:24:18 +09:00
AlphaKR93
4e0b4a2732 Remove Timings 2025-02-23 19:54:35 +09:00
AlphaKR93
96cb741c0e Remove Mojang Profiler 2025-02-23 18:58:11 +09:00
AlphaKR93
8b0a4c75c5 Remove unnecessary client features 2025-02-23 17:48:53 +09:00
AlphaKR93
e286d62894 comment some lines 2025-02-19 21:24:33 +09:00
AlphaKR93
883f334864 Fix NPE on startup 2025-02-19 21:07:18 +09:00
AlphaKR93
063137dce4 Plazma Configurations 2025-02-19 20:40:59 +09:00
AlphaKR93
6958022ef9 Rebrand 2025-02-19 12:56:37 +09:00
AlphaKR93
7e1f20905c Hardfork - Initial Commit 2025-02-19 10:57:48 +09:00
IPECTER 이팩터
b9b81666d7 Fix SparklyPaper - Optimize farm check 2025-02-06 18:07:43 +09:00
IPECTER 이팩터
fc74a019dc Fix SparklyPaper - Optimize farm check 2025-02-06 18:03:46 +09:00
AlphaKR93
5788942629 Some fixes 2025-01-22 13:54:35 +09:00
AlphaKR93
0c58a0b04a Fix build 2024-12-26 01:22:49 +09:00
AlphaKR93
379451fec5 fix build 2024-12-25 23:51:18 +09:00
AlphaKR93
fae89fb86d Add options for help.yml and version_history.json 2024-12-25 23:47:55 +09:00
AlphaKR93
b1368732a3 Fix #105, add /heal command, etc. 2024-12-25 19:12:48 +09:00
AlphaKR93
ebe98dd7f4 Add some features 2024-12-25 15:08:30 +09:00
Alpha
6d6a60fcde "sanpshots"
Signed-off-by: Alpha <dev@alpha93.kr>
2024-12-15 16:40:54 +09:00
Alpha
02ffa930f1 publish api (again)
Signed-off-by: Alpha <dev@alpha93.kr>
2024-12-15 16:07:30 +09:00
Alpha
eb4036a64d publish api
Signed-off-by: Alpha <dev@alpha93.kr>
2024-12-15 15:54:51 +09:00
AlphaKR93
1764f1095e 1.21.4 2024-12-15 15:04:13 +09:00
AlphaKR93
22bcf63585 publish 2024-12-14 20:10:05 +09:00
AlphaKR93
86b9aa41cc minor fix 2024-12-14 18:29:01 +09:00
AlphaKR93
e55f818ab2 Fix build 2024-12-14 12:25:54 +09:00
AlphaKR93
e54f3fcf11 Add tick toggle command 2024-12-14 12:22:39 +09:00
AlphaKR93
3f15d7a684 Updated Upstream (Paper, Pufferfish, Purpur)
Upstream has released updates that appear to apply and compile correctly.

[Purpur Changes]
PurpurMC/Purpur@e86a1b6: Updated Upstream (Paper)
PurpurMC/Purpur@962ee30: Updated Upstream (Paper)
PurpurMC/Purpur@74d1b4c: Updated Upstream (Paper)
PurpurMC/Purpur@e2e8c61: Updated Upstream (Paper)
PurpurMC/Purpur@7a01fd8: Updated Upstream (Paper)
PurpurMC/Purpur@34c18f0: Updated Upstream (Paper)
PurpurMC/Purpur@ca668ab: Updated Upstream (Paper)
PurpurMC/Purpur@200178d: Updated Upstream (Paper)
PurpurMC/Purpur@9968cbb: Updated Upstream (Paper)
PurpurMC/Purpur@db09358: Fix clamp-levels option not being true by default (#1609)
PurpurMC/Purpur@f289b6a: Updated Upstream (Paper)
PurpurMC/Purpur@959c29d: Fix Tridents giving errors without having an Elytra equipped (#1612)
PurpurMC/Purpur@68c1612: Fix villagers not spawning when the `follow-emerald-blocks` option is enabled (#1611)
PurpurMC/Purpur@5b75c68: fix `bypass-mob-griefing` not being the inverse of mobgriefing gamerule, closes #1603
PurpurMC/Purpur@55d4309: Updated Upstream (Paper)
PurpurMC/Purpur@0601f87: Updated Upstream (Paper)
PurpurMC/Purpur@06dde9d: Add Ridable and Attribute options for Creaking mob (#1613)
PurpurMC/Purpur@420a1ce: Set the bee's `takes-damage-from-water` option to true by default (#1614)
PurpurMC/Purpur@2b6f273: Updated Upstream (Paper)
PurpurMC/Purpur@504f311: Updated Upstream (Paper)
PurpurMC/Purpur@2b694c9: Updated Upstream (Paper)
PurpurMC/Purpur@96d7ef7: Updated Upstream (Paper)
PurpurMC/Purpur@e141f68: Updated Upstream (Paper)
PurpurMC/Purpur@7f6f667: Updated Upstream (Pufferfish)
PurpurMC/Purpur@de20ba9: ignore `minecart.max-speed` config value if using minecart experiment, closes #1618
PurpurMC/Purpur@03062a8: fix ridable mobs not being controllable, closes #1620
PurpurMC/Purpur@0493ac3: Updated Upstream (Paper)
PurpurMC/Purpur@16ce24a: fix(ridables/creaking): override tick method in look/move control
2024-12-14 01:59:42 +09:00
AlphaKR93
851cab54e0 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly.

[Paper Changes]
PaperMC/Paper@00ef8bd: Fix Entity#isTicking and update Paper entity command (#11590)
PaperMC/Paper@6483ecb: Updated Upstream (Bukkit/CraftBukkit)
PaperMC/Paper@17dbf74: Improve CraftEntity and CraftPlayer equals
PaperMC/Paper@0af4e84: [ci skip] Add identifying line to some larger/optimization patches
PaperMC/Paper@bcbd108: Call CraftPlayer#onEntityRemove for all online players (#11598)
PaperMC/Paper@e47f79a: Configure mockito agent (#11560)
PaperMC/Paper@94ea770: Re-add exact choice shapeless support (#11546)
PaperMC/Paper@2e6eafb: Improve Minecart#getMinecartMaterial (#11544)
PaperMC/Paper@9d1c91d: [ci skip] Fix UseCooldownComponent jd (#11565)
PaperMC/Paper@59b79c8: Fix NPE with enchantable (#11557)
PaperMC/Paper@6da7b9e: Update Eigencraft patch to 1.21.3 (#11553)
PaperMC/Paper@1ef4c0e: Improve performance of RecipeMap#removeRecipe (#11547)
PaperMC/Paper@52fb265: Optimize custom map rendering (#11000)
PaperMC/Paper@661839e: Fix and optimize getChunkCount (#11610)
PaperMC/Paper@c60af44: Fix experimental minecart collisions on sloped rails
PaperMC/Paper@13f48d8: [ci skip] Rebuild patches
PaperMC/Paper@be886cf: Fix Naming issue inside Add PlayerArmorChangeEvent (#11614)
2024-11-15 23:41:52 +09:00
AlphaKR93
f63645c2fb fix build 2024-11-09 16:24:26 +09:00
AlphaKR93
8062ccb4ed Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly.

[Purpur Changes]
PurpurMC/Purpur@e86a1b6: Updated Upstream (Paper)

[Paper Changes]
PaperMC/Paper@a6df4c8: Handle corrupt light data gracefully
PaperMC/Paper@ce0a041: [ci skip] Rebuild patches

[Paper Changes]
PaperMC/Paper@c6aa61e: Updated Upstream (Bukkit/CraftBukkit/Spigot) (#11561)
PaperMC/Paper@93b435d: [ci skip] better instructions for patch apply conflict (#11568)
PaperMC/Paper@42a1901: Correctly adopt upstream item EAR fix (#11582)
PaperMC/Paper@fcb6c72: Correctly pass velocity native compressor (#11509)
PaperMC/Paper@99f4bb2: Fix infinite fireworks (#11592) (#11594)
2024-11-08 23:01:41 +09:00
AlphaKR93
c0d36db38d Hashed RCON password 2024-11-05 18:33:34 +09:00
Alpha
62f90e3fba Update build.gradle.kts
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-05 09:42:00 +09:00
Alpha
2986abeee1 Update release.yaml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-04 16:22:38 +09:00
Alpha
fc38239b61 Update release.yaml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-04 16:22:03 +09:00
AlphaKR93
cfe2db6181 Updated Upstream (Paper, Purpur)
Upstream has released updates that appear to apply and compile correctly.

[Purpur Changes]
PurpurMC/Purpur@e86a1b6: Updated Upstream (Paper)

[Paper Changes]
PaperMC/Paper@a6df4c8: Handle corrupt light data gracefully
PaperMC/Paper@ce0a041: [ci skip] Rebuild patches
2024-11-04 16:21:00 +09:00
AlphaKR93
8975d5676b add back more patches 2024-11-04 16:18:16 +09:00
Alpha
3e1399c421 more readme fixes
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-03 23:50:49 +09:00
Alpha
d110f25a23 PlazmaBukkit, not Plazmaclip
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-03 23:47:35 +09:00
Alpha
7543f3adbd Update README.md
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-03 23:41:44 +09:00
Alpha
6a16940e2b Fix build
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-03 23:33:52 +09:00
Alpha
5596d998c1 Rename release.yml to release.yaml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-03 23:19:04 +09:00
Alpha
75fad4cd35 first try
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-03 23:18:20 +09:00
Alpha
f476809251 Update release.yml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-03 00:43:47 +09:00
Alpha
269cbb507b Update release.yml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-03 00:04:58 +09:00
Alpha
54dfd7163a Update release.yml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-02 22:22:58 +09:00
Alpha
d975acec6b more buildscript fix
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-02 22:08:25 +09:00
Alpha
72565bec8e protip: be sure to check the docs when you make something
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-02 18:58:05 +09:00
Alpha
05215498c3 Update release.yml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-02 18:44:27 +09:00
Alpha
ae94d43098 Update release.yml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-02 18:34:13 +09:00
Alpha
8889a877d6 💀
Signed-off-by: Alpha <dev@alpha93.kr>
2024-11-02 18:18:54 +09:00
AlphaKR93
e915eadfad fix 2024-11-02 18:06:37 +09:00
AlphaKR93
28ce30ec48 fix 2024-11-02 17:43:18 +09:00
AlphaKR93
dd8042f88a Updated Upstream (Paper & Purpur)
Upstream has released updates that appear to apply and compile correctly.

[Purpur Changes]
PurpurMC/Purpur@3fc255d: Updated Upstream (Paper)
PurpurMC/Purpur@93f3948: bump Gradle wrapper version to 8.10.2
PurpurMC/Purpur@1a67c42: drop the patch that removes the mojang profiler for now
PurpurMC/Purpur@803bf62: Final 1.21.1 Upstream (Paper)
PurpurMC/Purpur@af96590: Merge branch 'ver/1.21.1' into ver/1.21.3
PurpurMC/Purpur@c6802b0: Updated Upstream (Paper)

[Paper Changes]
PaperMC/Paper@99b1bf9: Use new ClientboundPlayerRotationPacket for setting player rotation
PaperMC/Paper@40211a0: Update Gradle wrapper to 8.10.2
PaperMC/Paper@49eae0d: remove some leftovers
PaperMC/Paper@d576cfc: cleanup bugfix patch
PaperMC/Paper@1196ab5: Avoid issues with certain tasks not processing during sleep (#11526)
PaperMC/Paper@fe2f3d4: Fix portal exit resulting in bad teleport transition
PaperMC/Paper@9f1fa0b: Fix item gravity on inactive items, remove dumb active skipping
PaperMC/Paper@1a1d0cf: Use target pitch in teleport (generally the same thing)
PaperMC/Paper@8ba3073: fix "is_freezing" damage type tag
PaperMC/Paper@1523212: don't resend effects when PlayerItemConsumeEvent is cancelled
PaperMC/Paper@1330880: Add Friction API to minecarts
PaperMC/Paper@580a610: Allow using old ender pearl behavior & apply ender pearl exploit patch (#11524)
PaperMC/Paper@40a960d: Rebuild patches
PaperMC/Paper@dfedf79: Correctly cancel consumption of consumable
PaperMC/Paper@147b796: get previous redstone level from the right state for experimental wires
PaperMC/Paper@ad9c58e: Only expose velocity relative tp flags to API (#11532)
PaperMC/Paper@f273e6e: Set updatingMinecraft to false
PaperMC/Paper@c5c1250: [ci skip] Remove leftover todo file (#11540)
PaperMC/Paper@7ee4835: Correctly clear  explosion density cache(#11541)
PaperMC/Paper@52a0590: Updated Upstream (Bukkit/CraftBukkit) (#11543)
PaperMC/Paper@5c0930d: Fix fix recipe iterator patch
PaperMC/Paper@1de0130: re-add a dispense fix patch
PaperMC/Paper@16d7d73: bunch more general fixes
PaperMC/Paper@a5d7426: Correctly support RecipeChoice.empty (#11550)
PaperMC/Paper@85c870e: Correct update cursor (#11554)
PaperMC/Paper@d19be64: Fix NPE with spark when CraftServer is not init yet (#11558)
PaperMC/Paper@92131ad: Decrease dead entity teleport warning (#11559)
2024-11-02 16:54:55 +09:00
AlphaKR93
54bc879a9e fix build 2024-11-02 16:40:43 +09:00
AlphaKR93
33701c1eca more work 2024-11-02 16:39:08 +09:00
AlphaKR93
2028e19bf8 work 2024-11-01 18:12:14 +09:00
AlphaKR93
7a7a88a7bb fix build 2024-10-31 22:54:03 +09:00
AlphaKR93
8860cedaf7 work 2024-10-31 15:33:54 +09:00
AlphaKR93
527b6c7eaf more work 2024-10-31 14:31:42 +09:00
AlphaKR93
e37f05bd87 work 2024-10-31 13:18:20 +09:00
AlphaKR93
dfb64f50db [ci-skip] Bump Gradle Wrapper 2024-10-31 12:50:27 +09:00
AlphaKR93
69d4f4bf86 compile 2024-10-31 09:40:04 +09:00
AlphaKR93
64802e7e50 1.21.3 2024-10-30 15:03:07 +09:00
AlphaKR93
a313424212 [ci-skip] license 2024-10-27 16:03:28 +09:00
AlphaKR93
fa3c15b4f3 more optimizations 2024-10-27 16:01:43 +09:00
AlphaKR93
393e079743 minor optimization 2024-10-27 00:18:44 +09:00
AlphaKR93
90d412bbf3 random things 2024-10-26 22:07:15 +09:00
AlphaKR93
98cf5b2d13 Updated SparklyPaper port to latest 2024-10-25 19:30:16 +09:00
AlphaKR93
32243963f5 some works 2024-10-25 19:00:52 +09:00
AlphaKR93
72183c64b9 runnable 2024-10-25 18:42:48 +09:00
AlphaKR93
f7998d1955 fix build 2024-10-25 14:22:07 +09:00
AlphaKR93
58ddbf4dd6 generated api 2024-10-25 14:11:46 +09:00
AlphaKR93
3484117415 patches done 2024-10-25 07:50:20 +09:00
AlphaKR93
bff96101bb workworkworkwork 2024-10-25 07:28:41 +09:00
AlphaKR93
6b54d11f9c more work 2024-10-25 07:22:54 +09:00
AlphaKR93
08a067e974 prepare for 1.21.3 2024-10-24 10:51:28 +09:00
AlphaKR93
46433f7303 6 2024-10-22 13:29:21 +09:00
AlphaKR93
72415ee5f2 API patches 2024-10-22 07:47:40 +09:00
AlphaKR93
6d7683503c Updated Upstream (Paper, Purpur)
Upstream has released updates that appear to apply and compile correctly.

[Purpur Changes]
PurpurMC/Purpur@a52426c: Updated Upstream (Paper)
PurpurMC/Purpur@86ad0b3: Updated Upstream (Paper)
PurpurMC/Purpur@79d199c: Updated Upstream (Paper)
PurpurMC/Purpur@7708a4c: don't send keepalive packet early, closes #1520
PurpurMC/Purpur@4873495: add config to reverse bubble column flow for soulsand and magma blocks
PurpurMC/Purpur@eac4198: Updated Upstream (Paper)
PurpurMC/Purpur@7219263: [ci skip] inline fqn imports
PurpurMC/Purpur@cc56332: Final 1.20.6 Paper Upstream \o/
PurpurMC/Purpur@f1c87e4: add missing armadillo & bogged options, closes #1527
PurpurMC/Purpur@d259ed5: prepare for update
PurpurMC/Purpur@1544081: Updated Upstream (Paper)
PurpurMC/Purpur@e2b5e14: apply API patches
PurpurMC/Purpur@7c38d97: first 5 patches!
PurpurMC/Purpur@0ab7756: ridables patch \o/
PurpurMC/Purpur@085de5a: first 50 patches \o/
PurpurMC/Purpur@b191556: 100 patches \o/
PurpurMC/Purpur@2a4d2e5: 150 patches \o/
PurpurMC/Purpur@c716c80: 200 patches \o/
PurpurMC/Purpur@699969f: 250 patches \o/
PurpurMC/Purpur@cfc96e0: all patches apply \o/
PurpurMC/Purpur@59c536c: Updated Upstream (Paper)
PurpurMC/Purpur@20e182a: Updated Upstream (Paper)
PurpurMC/Purpur@973bcd4: drop damage-with-frost-walker option - can be done with a datapack
PurpurMC/Purpur@331c216: re-add timings/mojang profiler removal patches
PurpurMC/Purpur@b27c8b2: add back leashable villagers option
PurpurMC/Purpur@6b2acdc: infinity on crossbows can be done with datapacks now
PurpurMC/Purpur@c3829f2: add back portal permission bypass patch
PurpurMC/Purpur@0510294: add back fix-stuck-in-portal patch
PurpurMC/Purpur@dedcdd0: re-add generated api patches
PurpurMC/Purpur@00126e8: re-add removing curse of binding with weakness patch
PurpurMC/Purpur@09ec31b: infinity bow settings can be done through a datapack
PurpurMC/Purpur@cdb192f: mending muliplier is better done through a datapack
PurpurMC/Purpur@bf6dbdd: fix timings/profiler compilation issues
PurpurMC/Purpur@6e1147f: Updated Upstream (Paper)
PurpurMC/Purpur@c991735: Fix compilation issues (#1530)
PurpurMC/Purpur@25ecbc4: rename enchantment convenience patch
PurpurMC/Purpur@ea406a0: use matchingSlot helper method
PurpurMC/Purpur@4dca11b: elytra.ignore-unbreaking option can probably be done through datapacks now
PurpurMC/Purpur@fa88174: clear out TODOs
PurpurMC/Purpur@04a9fec: reuse extrainfo in crash report
PurpurMC/Purpur@45774b4: apply the rest of the unapplied patches
PurpurMC/Purpur@dd826a3: Updated Upstream (Paper)
PurpurMC/Purpur@778995d: Updated Upstream (Paper)
PurpurMC/Purpur@9ff84cb: Updated Upstream (Paper)
PurpurMC/Purpur@bd49055: [ci skip] replace paper with purpur in log message
PurpurMC/Purpur@a122fd7: Updated Upstream (Paper)
PurpurMC/Purpur@783acfe: Updated Upstream (Paper)
PurpurMC/Purpur@b5f1c48: Updated Upstream (Paper)
PurpurMC/Purpur@c0f5e78: add default silverfish movement speed & attack damage attributes
PurpurMC/Purpur@b82f693: configurable mob size attribute (#1538)
PurpurMC/Purpur@e05f91b: [ci skip] move import to config patch
PurpurMC/Purpur@2ba7bee: Updated Upstream (Paper)
PurpurMC/Purpur@19da21c: Updated Upstream (Paper)
PurpurMC/Purpur@21ec259: fix kickForOutOfOrderChat being applied in the incorrect spot
PurpurMC/Purpur@9efd5fc: Updated Upstream (Paper)
PurpurMC/Purpur@ad910f8: Updated Upstream (Paper)
PurpurMC/Purpur@39617d5: entities with passengers can go through portals now, closes #1540
PurpurMC/Purpur@7d59f25: fix blast resistence config not accepting namespaced values
PurpurMC/Purpur@1615793: set burp delay in the correct spot
PurpurMC/Purpur@797ce6b: Updated Upstream (Paper)
PurpurMC/Purpur@ac6c312: Updated Upstream (Paper)
PurpurMC/Purpur@d5c06b4: fix summon_entity effect attempting to add incorrect entity, closes #1545
PurpurMC/Purpur@faa1f93: add PlayerSetTrialSpawnerTypeWithEggEvent, fixes #1546 (#1547)
PurpurMC/Purpur@1ab7990: Updated Upstream (Paper)
PurpurMC/Purpur@8b987b1: fix infinityWorksWithoutArrows not working
PurpurMC/Purpur@de2e7a7: Updated Upstream (Paper)
PurpurMC/Purpur@cb0f04b: Updated Upstream (Paper)
PurpurMC/Purpur@ff19bcc: Updated Upstream (Paper)
PurpurMC/Purpur@b3709b1: Updated Upstream (Paper)
PurpurMC/Purpur@5e70800: Updated Upstream (Paper)
PurpurMC/Purpur@14136b8: Updated Upstream (Paper)
PurpurMC/Purpur@458dc18: Updated Upstream (Paper), closes #1556
PurpurMC/Purpur@87cf9f1: Updated Upstream (Paper)
PurpurMC/Purpur@bf63cfa: Updated Upstream (Paper)
PurpurMC/Purpur@8f0f20d: Updated Upstream (Paper)
PurpurMC/Purpur@86a6543: Updated Upstream (Paper)
PurpurMC/Purpur@2e39567: Re-add missing chunk api calls, fixes #1560
PurpurMC/Purpur@eadfff7: Updated Upstream (Paper)
PurpurMC/Purpur@65d3665: Updated Upstream (Paper)
PurpurMC/Purpur@936c29a: Updated Upstream (Paper)
PurpurMC/Purpur@032697e: Updated Upstream (Paper)
PurpurMC/Purpur@b2d1fea: always output bukkit/paper plugin header in plugin command
PurpurMC/Purpur@61b63b1: Updated Upstream (Paper)
PurpurMC/Purpur@c3849be: Fire EntityTeleportHinderedEvent when attempting to teleport a player with passengers (#1563)
PurpurMC/Purpur@7e0ca92: [ci skip] missed rebranding
PurpurMC/Purpur@82ccc76: Updated Upstream (Paper)
PurpurMC/Purpur@72ccfbd: Updated Upstream (Paper)
PurpurMC/Purpur@0bd5579: Updated Upstream (Paper)
PurpurMC/Purpur@b3623fa: Updated Upstream (Paper)
PurpurMC/Purpur@9e444c5: Add Entities can use portals patch back (#1571)
PurpurMC/Purpur@930003b: Updated Upstream (Paper)
PurpurMC/Purpur@7950960: Updated Upstream (Paper)
PurpurMC/Purpur@02e4e76: Updated Upstream (Paper)
PurpurMC/Purpur@afabbc9: missed these
PurpurMC/Purpur@73a90e8: Updated Upstream (Paper)
PurpurMC/Purpur@75e81d8: deprecate old anvil api methods
PurpurMC/Purpur@699448c: Merge branch 'ver/1.21' into ver/1.21.1
PurpurMC/Purpur@4e55e26: final 1.21 Paper upstream
PurpurMC/Purpur@edd9be7: Merge branch 'ver/1.21' into ver/1.21.1
PurpurMC/Purpur@abf2f21: Updated Upstream (Paper)
PurpurMC/Purpur@366af80: Updated Upstream (Paper)
PurpurMC/Purpur@07979c3: Updated Upstream (Paper)
PurpurMC/Purpur@3f790ac: Updated Upstream (Paper)
PurpurMC/Purpur@201e928: Updated Upstream (Pufferfish) (#1575)
PurpurMC/Purpur@f2307b8: Updated Upstream (Paper)
PurpurMC/Purpur@bba87bf: Updated Upstream (Paper)
PurpurMC/Purpur@f530395: Fix no exp drops from spawners using silk touch pickaxe without option enabled  (#1582)
PurpurMC/Purpur@3510a9e: Updated Upstream (Paper)
PurpurMC/Purpur@1d3cef7: Updated Upstream (Paper)
PurpurMC/Purpur@c4a6f63: Updated Upstream (Paper)
PurpurMC/Purpur@568a028: Updated Upstream (Paper)
PurpurMC/Purpur@ef12ede: Updated Upstream (Paper)
PurpurMC/Purpur@a61db94: Updated Upstream (Paper)
PurpurMC/Purpur@5c0d2f7: Updated Upstream (Paper)
PurpurMC/Purpur@49db849: Updated Upstream (Paper)
PurpurMC/Purpur@a43711d: Updated Upstream (Paper)
PurpurMC/Purpur@0a9941e: Updated Upstream (Paper)
PurpurMC/Purpur@88352c3: Updated Upstream (Paper)
PurpurMC/Purpur@dee41bc: Updated Upstream (Paper)
PurpurMC/Purpur@fdfc12e: Updated Upstream (Paper)
PurpurMC/Purpur@bc7bcbb: Fix elytra durability setting not working properly (#1589)
PurpurMC/Purpur@8af4ea6: Updated Upstream (Paper)
PurpurMC/Purpur@8332fa4: Updated Upstream (Paper)
PurpurMC/Purpur@be61a07: Updated Upstream (Paper)
PurpurMC/Purpur@f154903: Updated Upstream (Paper)
PurpurMC/Purpur@0fa9a50: Updated Upstream (Paper)
PurpurMC/Purpur@d7a7c91: Updated Upstream (Paper)
PurpurMC/Purpur@20fa61e: Updated Upstream (Paper)
PurpurMC/Purpur@501e7c5: Updated Upstream (Paper)
PurpurMC/Purpur@2a50638: Updated Upstream (Paper)
PurpurMC/Purpur@639bcbd: Updated Upstream (Paper)
PurpurMC/Purpur@bcf8103: remove obsolete allowUnsafeEnchants config option
PurpurMC/Purpur@51f15ee: fully remove obsolete allowUnsafeEnchants config option
PurpurMC/Purpur@3d0716d: Fix colored shulker box contents not dropping when destroyed, supercedes #1594
PurpurMC/Purpur@12e2926: [ci skip] drop old migration patch
PurpurMC/Purpur@212c942: delegate itemstack convenience methods
PurpurMC/Purpur@2eaea6a: switch to JSpecify annotations
PurpurMC/Purpur@4565f41: these options should be off by default
PurpurMC/Purpur@4671e1e: show a message stating the removal of mojang profiler when running perf comamnd, closes #1591
PurpurMC/Purpur@e12a4de: Updated Upstream (Paper)
PurpurMC/Purpur@7f490a6: Updated Upstream (Paper)
PurpurMC/Purpur@4f2fe31: Updated Upstream (Paper)
PurpurMC/Purpur@4b57bed: Updated Upstream (Paper)
2024-10-22 07:36:03 +09:00
AlphaKR93
6a7a817c0d stable 2024-10-18 21:21:16 +09:00
github-actions[bot]
c531844986 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Upstream has released updates that appear to apply and compile correctly.

[Paper Changes]
PaperMC/Paper@bd5867a: Handle alpha channel from potion_contents component (#10808)
2024-06-04 21:12:54 +00:00
github-actions[bot]
e721df9890 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Upstream has released updates that appear to apply and compile correctly.

[Paper Changes]
PaperMC/Paper@88d76d9: Make Bogged implement Shearable (#10844)
2024-06-04 20:45:48 +00:00
github-actions[bot]
44f2749fe5 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Upstream has released updates that appear to apply and compile correctly.

[Paper Changes]
PaperMC/Paper@79c1ce1: Add since to deprecated for removals (#10848)
2024-06-04 19:45:36 +00:00
github-actions[bot]
451d2cc363 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Upstream has released updates that appear to apply and compile correctly.

[Paper Changes]
PaperMC/Paper@4f13be9: Do not perform chunk existance check for I/O scheduling
2024-06-03 20:45:14 +00:00
github-actions[bot]
da6e51f141 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Upstream has released updates that appear to apply and compile correctly.

[Paper Changes]
PaperMC/Paper@b8f2101: Only assign blockstate data if super ctor did not (#10841)
2024-06-03 17:45:43 +00:00
github-actions[bot]
acb774fbb8 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Upstream has released updates that appear to apply and compile correctly.

[Paper Changes]
PaperMC/Paper@54fbd0c: clarify what getEntityId actually returns (#10839)
2024-06-03 17:29:48 +00:00
github-actions[bot]
ad01d8a450 Updated Upstream (Paper, Purpur)
Upstream has released updates that appear to apply and compile correctly

Upstream has released updates that appear to apply and compile correctly.

[Purpur Changes]
PlazmaMC/Purpur@be3a6d5: Updated Upstream (Paper)
PlazmaMC/Purpur@0cbff64: Add back Pufferfish patches
2024-06-02 23:13:46 +00:00
AlphaKR93
45fe520135 Fix javadoc update 2024-06-02 22:43:09 +09:00
AlphaKR93
2c85fd3304 . 2024-06-02 22:03:34 +09:00
AlphaKR93
443f09d9e7 real build fix 2024-06-02 22:01:33 +09:00
AlphaKR93
1d63c3808d [ci skip] Updated Gradle Wrapper to 8.8 2024-06-02 21:51:17 +09:00
AlphaKR93
cbeb17c8e8 Fix build, again 2024-06-02 21:48:55 +09:00
AlphaKR93
5557065f36 Build 2024-06-02 21:30:39 +09:00
AlphaKR93
4f2deab03f Updated Upstream (Paper, Purpur)
Upstream has released updates that appear to apply and compile correctly.

[Purpur Changes]
PlazmaMC/Purpur@69d3bb4: Updated Upstream (Paper)
PlazmaMC/Purpur@ad32b22: fix version command throwing an exception
PlazmaMC/Purpur@9dcfdf1: [ci skip] missed this from the upstream
PlazmaMC/Purpur@88aa731: Updated Upstream (Paper)
PlazmaMC/Purpur@3d25693: Updated Upstream (Paper)
PlazmaMC/Purpur@248ba17: Updated Upstream (Paper)
PlazmaMC/Purpur@ed1e0ec: Updated Upstream (Paper)
PlazmaMC/Purpur@1bbb033: Updated Upstream (Paper)
PlazmaMC/Purpur@222387f: Updated Upstream (Paper)
PlazmaMC/Purpur@692ff89: [ci skip] specify purpur in version command
PlazmaMC/Purpur@7b850ef: [ci skip] Fix version inconsistency in README (#1517)
PlazmaMC/Purpur@22fc5f9: Updated Upstream (Paper)
PlazmaMC/Purpur@2842b97: Updated Upstream (Paper)
PlazmaMC/Purpur@ec1b4fa: Updated Upstream (Paper)
PlazmaMC/Purpur@b1464f3: Updated Upstream (Paper)
PlazmaMC/Purpur@ee56117: Updated Upstream (Paper)
PlazmaMC/Purpur@847719c: one punch!! improvements
PlazmaMC/Purpur@1af7456: [ci skip] document mods that patches took inspiration from
PlazmaMC/Purpur@224e7c7: Updated Upstream (Paper)
PlazmaMC/Purpur@7095128: Add back Pufferfish patches

[Paper Changes]
PaperMC/Paper@23fe116: Fix missing debug trace
PaperMC/Paper@b0c9b9c: Only remove worldgen block entity on changed block (#10794)
PaperMC/Paper@9c917fe: [ci skip] Clean up paperclip build-pr workflow (#10802)
PaperMC/Paper@9d6f2cc: [ci skip] Rebuild patches (#10803)
PaperMC/Paper@84f6e6e: Fix max temper API for llama (#10823)
PaperMC/Paper@672c077: handle BODY slot for non-mobs (#10822)
PaperMC/Paper@716b868: Use RegistryOps for loadAdvancement (#10799)
PaperMC/Paper@d9e659a: Allow firework effects with no colors (#10814)
PaperMC/Paper@7e2b682: Fix skipping custom block entity tag (#10812)
PaperMC/Paper@ed85aac: Flatten namespaced vanilla command alias redirects (#10821)
PaperMC/Paper@a31dc90: Several fixes and new api for experience merging/stacking (#9242)
PaperMC/Paper@efd91e5: Add registry-related argument types (#10770)
PaperMC/Paper@27d2ed8: Extend fishing API (#10634)
PaperMC/Paper@0fcf3e3: Deprecate InvAction#HOTBAR_MOVE_AND_READD (#10784)
PaperMC/Paper@8e6554a: Fix sending disconnect packet in phases where it doesn't exist
PaperMC/Paper@06e69c8: Use CommandSourceStack in AsyncPlayerSendCommandsEvent (#10826)
PaperMC/Paper@a47e11d: fix knockback events (#10831)
PaperMC/Paper@3181470: Add entity heal API (#10267)
PaperMC/Paper@0513374: Fire TabCompleteEvent for legacy commands (#10834)
PaperMC/Paper@5d8e53d: Fix CommandSourceStack#bypassSelectorPermissions (#10837)
2024-06-02 20:24:50 +09:00
Alpha
b099cccffb Update README.md
Signed-off-by: Alpha <dev@alpha93.kr>
2024-05-29 23:15:42 +00:00
Alpha
c2f67d1f59 Update Task.kt
Signed-off-by: Alpha <dev@alpha93.kr>
2024-05-29 06:32:00 +09:00
AlphaKR93
fd98985104 . 2024-05-29 00:10:12 +09:00
AlphaKR93
75f88071bc Fix AlwaysUpToDate 2024-05-29 00:06:29 +09:00
AlphaKR93
e6586daeaa Fix startup 2024-05-28 02:31:33 +09:00
AlphaKR93
305ff4d587 [ci skip] Cleanup 2024-05-27 15:03:26 +09:00
AlphaKR93
5a966df572 fix build 2024-05-27 14:24:10 +09:00
AlphaKR93
0d05ccbffc Updated Upstream (Paper) 2024-05-27 14:13:49 +09:00
AlphaKR93
6d70d2180f Fix build 2024-05-26 23:29:57 +09:00
AlphaKR93
15a9cac376 Updated Upstream (Paper, Purpur)
[Purpur Changes]
PlazmaMC/Purpur@ceeec1c: work
PlazmaMC/Purpur@e8f8f93: Updated Upstream (Paper, Pufferfish)

[Paper Changes]
PaperMC/Paper@f175193: Expose server build information (#10729)
PaperMC/Paper@d8d59e0: Fix NPE sending resource pack without prompt
PaperMC/Paper@5a9afbe: Fixes issues in the suppress dismount cancellation patch (#10735)
PaperMC/Paper@0ad09de: Make PaperSimplePluginClassLoader show class which is not found
PaperMC/Paper@b3b3406: fix CompassMeta not being correct (#10737)
PaperMC/Paper@591521e: Check for more correct profile validation (#10730)
PaperMC/Paper@7d2e5c3: Add an 'empty' RecipeChoice for certain ingredient slots (#10710)
PaperMC/Paper@9bf4855: Add a better warning message than "Server performance will be affected" for CommandRegisteredEvent use (#10754)
PaperMC/Paper@66cb880: Remove ThreadedWorldUpgrader patch
PaperMC/Paper@980cff9: Fix compile
PaperMC/Paper@d3ffa62: fix default item attributes
PaperMC/Paper@b149584: Always show command exception stack traces in logs (#10766)
PaperMC/Paper@a9201d4: [ci skip] Move logic in our patches to ItemType/BlockType (#10772)
PaperMC/Paper@3de408e: Fix equipment slot and group API (#10767)
PaperMC/Paper@d408381: Print CommandRegisteredEvent deprecation warnings again (#10756)
PaperMC/Paper@6de7a1f: Improve default item attributes API (#10765)
PaperMC/Paper@2a90732: Remove incorrect logic for Fireball#setVelocity (#10764)
PaperMC/Paper@5e7b65a: Allow using PluginLoader classpath API from Bukkit plugins (#10758)
PaperMC/Paper@3004717: Do not re-wrap vanilla goals (#10751)
PaperMC/Paper@377733d: Use getter/setter on Mob for equipment drop chances (#10780)
PaperMC/Paper@dff591d: Allow to define new map cursor types (#10782)
PaperMC/Paper@4fd3ac0: [ci skip] Update Player#getListeningPluginChannels Jdoc (#10778)
PaperMC/Paper@535dca5: Fix a few issues with ItemMeta (#10740)
PaperMC/Paper@26e90b9: Fix CraftMetaBlockState for data components (#10731)
PaperMC/Paper@f0bd0cc: Expose anvil cost in the API (#10682)
PaperMC/Paper@41bee55: Fix NPE for color-related metas
PaperMC/Paper@4e10fad: reset meta block state on BlockStateMeta#setBlockState
2024-05-26 23:21:05 +09:00
AlphaKR93
c3681a26f5 Fix fluid generation 2024-05-26 19:33:04 +09:00
Alpha
33812e0bc8 💀
Signed-off-by: Alpha <dev@alpha93.kr>
2024-05-26 17:30:32 +09:00
AlphaKR93
7ef7531cd3 Add back cave lava see level configuration 2024-05-26 17:21:30 +09:00
AlphaKR93
d75427a54e Add an option to apply the configuration to the vanilla default 2024-05-15 16:33:01 +09:00
AlphaKR93
9dbff3634b some patch cleanups 2024-05-15 16:09:49 +09:00
AlphaKR93
64df11da56 nahh 2024-05-15 14:58:31 +09:00
AlphaKR93
892269673e Add back Pufferfish related patches 2024-05-15 14:32:29 +09:00
github-actions[bot]
e5158825bf Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

[Purpur Changes]
PlazmaMC/Purpur@ba950ad: reparse minimessage from serialized playerlist component, closes #1515
PlazmaMC/Purpur@1ffd250: Add back Pufferfish patch
PlazmaMC/Purpur@150395f: 💀
2024-05-15 03:20:56 +00:00
AlphaKR93
09d30a5d9f some cleanups 2024-05-15 11:32:49 +09:00
AlphaKR93
718927ee70 💀💀💀 2024-05-14 23:48:56 +09:00
AlphaKR93
63e37b3633 Add back Pufferfish patch 2024-05-14 23:12:29 +09:00
AlphaKR93
6e591f2d3f bruh 2024-05-14 19:03:56 +09:00
AlphaKR93
34fef470e5 Updated Upstream (Paper & Purpur) 2024-05-14 18:58:32 +09:00
AlphaKR93
069250da59 [ci skip] cleanup 2024-05-09 17:39:59 +09:00
AlphaKR93
4a3d274bda more tweaks 2024-05-09 15:23:46 +09:00
AlphaKR93
930ef33a61 Revert "more cleanups"
This reverts commit ace7a1abe9.
2024-05-09 13:55:25 +09:00
AlphaKR93
ace7a1abe9 more cleanups 2024-05-09 13:50:41 +09:00
AlphaKR93
10ddca5626 [ci skip] Cleanup codes 2024-05-09 13:46:25 +09:00
AlphaKR93
da7a4324cd oops 2024-05-09 13:10:43 +09:00
AlphaKR93
7c8614f897 fix some mistakes 2024-05-09 12:55:32 +09:00
AlphaKR93
151f97c9c7 💀 2024-05-09 12:40:43 +09:00
AlphaKR93
225708db0a more improve 2024-05-09 11:41:26 +09:00
AlphaKR93
6bb6091980 more easy fork 2024-05-09 08:24:34 +09:00
AlphaKR93
f0c635282d Fix API publish 2024-05-09 07:54:18 +09:00
github-actions[bot]
14981765c5 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

[Purpur Changes]
PurpurMC/Purpur@f9258cd: fix bows shooting infinite arrows
2024-05-08 08:19:09 +00:00
github-actions[bot]
386d064269 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

[Purpur Changes]
PurpurMC/Purpur@3239393: add config for startup commands
2024-05-08 03:51:20 +00:00
github-actions[bot]
6123e40664 Updated Upstream (Paper, Purpur)
Upstream has released updates that appear to apply and compile correctly

[Purpur Changes]
PurpurMC/Purpur@117ed5f: Updated Upstream (Paper)

[Paper Changes]
PaperMC/Paper@eee55d0: Correctly compare holders in BeaconMenu (#10673)
2024-05-08 02:06:33 +00:00
Alpha
b5e0e31e3e Update Paperweight
Signed-off-by: Alpha <dev@alpha93.kr>
2024-05-07 23:30:54 +09:00
AlphaKR93
0a8bd76ac3 Fix build 2024-05-07 23:10:01 +09:00
AlphaKR93
e88cac21e4 cleanups 2024-05-07 22:54:00 +09:00
AlphaKR93
040724b445 easy fork 2024-05-07 22:47:32 +09:00
github-actions[bot]
531a3bbe3e Updated Upstream (Paper, Purpur)
Upstream has released updates that appear to apply and compile correctly

[Purpur Changes]
PurpurMC/Purpur@e1a0fc3: Updated Upstream (Paper)

[Paper Changes]
PaperMC/Paper@9e51f94: Fix ping event always receiving protocol version 0 (#10671)
PaperMC/Paper@89ad61f: Fix hopper pull event being skipped after the first call (#10667)
2024-05-07 13:18:10 +00:00
github-actions[bot]
dd781d2610 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

[Purpur Changes]
PurpurMC/Purpur@a398e71: add option to make ravagers afraid of rabbits
2024-05-07 12:23:17 +00:00
github-actions[bot]
4810a20e50 Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

[Purpur Changes]
PurpurMC/Purpur@61e91ba: re-add sign and book color code patches
2024-05-07 11:33:09 +00:00
AlphaKR93
fac51e8b64 Some tweaks 2024-05-06 20:44:16 +09:00
AlphaKR93
1cd33a9a1d Add some info messages 2024-05-06 15:33:44 +09:00
AlphaKR93
b4737f1a07 Apply more rebrand 2024-05-06 15:24:07 +09:00
AlphaKR93
ab38e33809 Updated Upstream (Paper, Purpur)
[Purpur Changes]
PurpurMC/Purpur@7a63a45: [ci-skip] fix adventure dependency in dev bundle
PurpurMC/Purpur@44858f5: Updated Upstream (Paper)
PurpurMC/Purpur@bbb0457: Updated Upstream (Paper)
PurpurMC/Purpur@d3971ad: Updated Upstream (Paper)

[Paper Changes]
PaperMC/Paper@156675c: Fix lodestone compass target conversion
PaperMC/Paper@5632210: add RegistryAccess for managing registries (#10154)
PaperMC/Paper@6fcca46: Add missing step in V3818
PaperMC/Paper@7401313: fix shear drops for wolf and bogged
PaperMC/Paper@7ae2c67: Keep components using single items in creative (#10664)
PaperMC/Paper@b13c7db: Add missing experimental field and annotations (#10653)
PaperMC/Paper@9d8d38d: Updated Upstream (CraftBukkit) (#10646)
PaperMC/Paper@0e43d3c: Added API to get player's proxy address (#10400)
PaperMC/Paper@54c5ecb: Add missing SpigotConfig logCommands check (#10659)
PaperMC/Paper@816ea9e: [ci skip] Update old particle reference in javadoc (#10652)
PaperMC/Paper@716dfd8: Fix EntityLoadCrossbowEvent (#10645)
PaperMC/Paper@21d91ce: Prevent profile lookups when unnecessary (#10651)
PaperMC/Paper@2a6a5fe: Add a way to check whether the chest is blocked (#10635)
PaperMC/Paper@ac3a547: Fix BlockStateMeta (#10647)
2024-05-06 15:11:20 +09:00
AlphaKR93
71243ee5e6 Readd FreedomChat 2024-05-06 15:05:18 +09:00
AlphaKR93
90e0b1b857 Async Path Process 2024-05-06 13:44:12 +09:00
AlphaKR93
71e7a6f43f some fixes 2024-05-05 20:11:34 +09:00
AlphaKR93
c655047139 fix build 2024-05-05 10:33:28 +09:00
AlphaKR93
ce17ed2020 Fix global configuration, Complete SparklyPaper porting (closes #73) 2024-05-05 09:15:29 +09:00
AlphaKR93
e765830ef2 More SparklyPaper patches 2024-05-05 00:13:31 +09:00
AlphaKR93
a21f3bab8a #73 - 2 Patches remain 2024-05-04 22:42:27 +09:00
AlphaKR93
491c491ba6 Updated Upstream (Paper, Purpur) 2024-05-04 18:13:25 +09:00
AlphaKR93
4815251655 1.20.6 2024-05-04 17:41:34 +09:00
AlphaKR93
4fc2eec8b7 fix compile 2024-05-04 17:29:16 +09:00
AlphaKR93
39a32b7ea3 done. 2024-05-04 17:13:01 +09:00
AlphaKR93
5b5d1c1281 30/37 2024-05-04 17:07:01 +09:00
AlphaKR93
aede6b2591 20/37 2024-05-04 16:50:58 +09:00
AlphaKR93
d526550c66 work 2024-05-03 21:51:38 +09:00
AlphaKR93
8e50bc4b0c aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa 2024-05-03 17:12:08 +09:00
AlphaKR93
e25871e11c 10/37 2024-05-01 21:02:18 +09:00
AlphaKR93
75f1875e4b Reduce allocations 2024-05-01 19:34:01 +09:00
AlphaKR93
f495171031 work 2024-05-01 13:18:20 +09:00
AlphaKR93
9b1303d849 API patches done 2024-04-30 23:49:03 +09:00
AlphaKR93
cee005f2b9 work 2024-04-30 23:18:39 +09:00
AlphaKR93
6b4bc276a0 initial work 2024-04-30 15:24:46 +09:00
Alpha
39728823f0 Final 1.20.4 Update (#97) 2024-04-29 15:43:49 +09:00
Alpha
a479b3e02f [ci-skip] Now stable
Signed-off-by: Alpha <dev@alpha93.kr>
2024-03-19 17:54:49 +09:00
github-actions[bot]
e4ca876d98 Updated Upstream (Paper, Purpur)
Upstream has released updates that appear to apply and compile correctly

[Purpur Changes]PurpurMC/Purpur@d80fbed: port PaperMC/Paper#10285

[Paper Changes]PaperMC/Paper@850b736: Close PRs opened from orgs or bot accounts (#10281)
2024-03-03 01:02:28 +00:00
Alpha
38c2cfa282 [ci skip] Add MojangAPI patch 2024-02-27 18:38:09 +09:00
Alpha
3852ef88c4 Make configurations more extendable 2024-02-25 17:26:00 +09:00
Alpha
03821dffe9 Fix #90 2024-02-25 14:24:32 +09:00
Alpha
02143d8487 Updated Upstream (Paper, Purpur) 2024-02-25 13:00:05 +09:00
AlphaKR93
83e396bde6 Fix Purpur Upstream 2024-01-27 17:26:06 +09:00
AlphaKR93
bdc88bc21f Clear compare file when update Paper 2024-01-27 17:20:59 +09:00
AlphaKR93
2a7f161519 Improve AlwaysUpToDate 2024-01-27 16:51:48 +09:00
AlphaKR93
1338975cb7 Fix API version 2024-01-26 18:08:33 +09:00
Alpha
07d5d1a905 Fix
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-26 15:52:00 +09:00
AlphaKR93
1c4ffc2a14 Fix version fetching 2024-01-26 15:35:32 +09:00
Alpha
e20a613029 Update Javadocs release token
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-26 14:33:01 +09:00
AlphaKR93
fca7f237b6 Updated Upstream (Paper, Purpur) 2024-01-26 14:12:13 +09:00
AlphaKR93
1a296539b9 I forgot to add the configuration file 💀 2024-01-25 17:21:01 +09:00
AlphaKR93
8170f1f246 Port some SparklyPaper patches 2024-01-25 17:15:45 +09:00
AlphaKR93
e12e3db7ef Oops 2024-01-25 16:10:43 +09:00
AlphaKR93
04203941c1 Updated Upstream (Paper) 2024-01-25 16:00:44 +09:00
AlphaKR93
33db373ae2 Fix metrics 2024-01-25 15:43:55 +09:00
Alpha
67b1959f31 Change Javadocs release system
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-23 17:41:14 +09:00
Alpha
f16785b526 Change Javadocs Release
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-23 17:26:13 +09:00
Alpha
d9b45e9b07 :trollface:
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-23 17:21:03 +09:00
AlphaKR93
9d97d0d9bd Fix package publishing 2024-01-23 16:53:25 +09:00
AlphaKR93
71c863456f Update Upstream (Paper, Purpur) 2024-01-23 16:02:54 +09:00
AlphaKR93
c33c06589f Update Upstream (Paper, Purpur) 2024-01-23 15:53:06 +09:00
Alpha
ec6ce69526 I forgor 💀
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-20 00:35:20 +09:00
Alpha
9686a72d0d Update gradle.yml
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-20 00:22:24 +09:00
AlphaKR93
90de54692c I accidentally broke the patch 💀 2024-01-20 00:10:04 +09:00
Alpha
9a288453bc Update README.md
Signed-off-by: Alpha <dev@alpha93.kr>
2024-01-19 20:46:12 +09:00
AlphaKR93
db8e9122cb it builds!!! 2024-01-19 20:45:37 +09:00
AlphaKR93
63bd308315 Complete patches 2024-01-19 19:42:52 +09:00
AlphaKR93
707c138318 bump 2024-01-18 23:29:09 +09:00
AlphaKR93
bcb9a051af API, Generated API Patches done 2024-01-18 23:16:05 +09:00
AlphaKR93
2e182c5aaa Fix build, again 2024-01-18 19:42:16 +09:00
AlphaKR93
62fab39558 Fix load player on online mode 2024-01-18 19:13:39 +09:00
492 changed files with 47322 additions and 44853 deletions

View File

@@ -8,6 +8,8 @@ ij_any_block_comment_add_space = false
ij_any_block_comment_at_first_column = false
ij_any_line_comment_at_first_column = false
ij_any_line_comment_add_space = true
max_line_length = 120
ij_visual_guides = 16, 80
[*.tiny]
indent_style=tab
@@ -17,6 +19,7 @@ end_of_line=crlf
[*.yml]
indent_size=2
ij_visual_guides = 8, 80
[*.patch]
trim_trailing_whitespace=false
@@ -30,10 +33,7 @@ ij_java_imports_layout = *,|,$*
ij_java_generate_final_locals = true
ij_java_generate_final_parameters = true
[test-plugin/**/*.java]
ij_java_use_fq_class_names = false
[Paper-Server/src/main/resources/data/**/*.json]
[*-Server/src/main/resources/data/**/*.json]
indent_size = 2
[paper-api-generator/generated/**/*.java]

7
.gitattributes vendored Normal file
View File

@@ -0,0 +1,7 @@
* text=auto eol=lf
*.sh text eol=lf
gradlew text eol=lf
*.bat text eol=crlf
*.jar binary

View File

@@ -4,8 +4,10 @@ on:
push:
branches: [ "ver/*", "dev/*", "feat/**/*" ]
paths:
- "*.kt"
- "*.kts"
- "*.toml"
- "gradle-wrapper.*"
- "*.gradle.*"
workflow_dispatch:
jobs:
@@ -21,13 +23,13 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout action
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK ${{ matrix.java }} ${{ matrix.jdk }}
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: ${{ matrix.java }}
java-version: ${{ matrix.jdk }}

12
.github/workflows/release.yaml vendored Normal file
View File

@@ -0,0 +1,12 @@
name: Release Plazma
on:
push:
branches: [ "ver/*", "dev/*", "feat/**/*" ]
workflow_dispatch:
jobs:
release:
name: Release Plazma (${{ github.ref_name }})
uses: PlazmaMC/PlazmaBukkit/.github/workflows/global.yaml@main
secrets: inherit

View File

@@ -1,124 +0,0 @@
name: Release Plazma (1.20.2)
on:
push:
branches: [ "ver/*", "dev/*", "feat/**/*" ]
paths:
- "**.patch"
workflow_dispatch:
env:
ORG_NAME: PlazmaMC
MC_VERSION: 1.20.2
MAIN_BRANCH: ver/1.20.1
jobs:
release:
name: Release Plazma
strategy:
matrix:
base_jdk: [17]
os: [ubuntu-22.04]
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout javadocs
uses: actions/checkout@v4
if: github.ref_name == env.MAIN_BRANCH
with:
repository: PlazmaMC/Javadocs
path: javadoc
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
- name: Set up GraalVM ${{ matrix.base_jdk }}
uses: graalvm/setup-graalvm@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: ${{ matrix.base_jdk }}
version: latest
cache: 'gradle'
- name: Configure Git
run: git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
- name: Apply Patches
run: ./gradlew applyPatches --stacktrace
- name: Build
run: ./gradlew build --stacktrace
- name: Create Reobf Jar
run: ./gradlew createReobfPaperclipJar --stacktrace
- name: Create Mojmap Jar
run: ./gradlew createMojmapPaperclipJar --stacktrace
- name: Update Javadoc
continue-on-error: true
if: github.ref_name == env.MAIN_BRANCH
run: |
(cd Plazma-API/build/docs/javadoc && tar c .) | (cd javadoc && tar xf -)
cd javadoc
git add . && git commit -m "Update Javadocs"
git push
- name: Publish Packages
if: github.ref_name == env.MAIN_BRANCH
run: |
export GITHUB_USERNAME=${{ env.ORG_NAME }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew publish --stacktrace
- name: Upload Artifacts
if: "!startsWith(github.ref_name, 'ver/')"
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: |
build/libs
Plazma-API/build/docs/javadoc
- name: Get Release Number
if: startsWith(github.ref_name, 'ver/')
run: echo "RELEASE=$(git ls-remote --tags origin | grep "build/${{ env.MC_VERSION }}" | wc -l)" >> $GITHUB_ENV
- name: Release Artifacts
if: startsWith(github.ref_name, 'ver/')
uses: softprops/action-gh-release@v0.1.15
with:
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/${{ env.RELEASE }}
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
- name: Release Artifacts (Latest/Stable)
if: startsWith(github.ref_name, 'ver/')
uses: softprops/action-gh-release@v0.1.15
with:
name: "Build #${{ env.RELEASE }} for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar
- name: Release Artifacts (Latest/Development)
if: startsWith(github.ref_name, 'dev/')
uses: softprops/action-gh-release@v0.1.15
with:
name: "Development Build for ${{ env.MC_VERSION }}"
tag_name: build/${{ env.MC_VERSION }}/latest
target_commitish: ${{ github.ref_name }}
generate_release_notes: true
fail_on_unmatched_files: true
files: build/libs/*.jar

237
.gitignore vendored
View File

@@ -1,58 +1,211 @@
# JVM crash related
core.*
# Generated from https://gitignore.io/
### Paperweight ###
run/
paper-api/
paper-server/
purpur-api/
purpur-server/
plazma-api/build.gradle.kts
plazma-server/build.gradle.kts
plazma-server/src/minecraft/
### Git ###
# Created by git when using merge tools for conflicts
*.orig
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt
### Java ###
*.class
*.log
*.jar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
# Intellij
.idea/
*.iml
*.ipr
*.iws
out/
# Kotlin DSL
.kotlin/
# Eclipse
.classpath
.project
.settings/
# netbeans
nbproject/
nbactions.xml
# Gradle
!gradle-wrapper.jar
### Gradle ###
.gradle/
build/
*/build/
# we use maven!
build.xml
# Avoid ignore Gradle wrappper properties
!gradle-wrapper.jar
!gradle-wrapper.properties
# Maven
log/
target/
dependency-reduced-pom.xml
# Cache of project
.gradletasknamecache
# various other potential build files
# Java heap dump
*.hprof
### Eclipse ###
*.tmp
*.bak
*.swp
*~.nib
local.properties
bin/
tmp/
.project/
.metadata/
.settings/
.loadpath/
.recommenders/
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Java annotation processor (APT)
.factorypath
# Annotation Processing
.apt_generated/
.apt_generated_test/
### JetBrains ###
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# Ignore everything but code style settings and run configurations
.idea/
!.idea/codeStyles
!.idea/runConfigurations
# IntelliJ
out/
# Fleet
.fleet/
### NetBeans ###
**/nbproject/private/
**/nbproject/Makefile-*.mk
**/nbproject/Package-*.bash
nbbuild/
dist/
manifest.mf
nbdist/
.nb-gradle/
# Mac
.DS_Store/
.DS_Store
### Vim ###
# Swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]
# vim
.*.sw[a-p]
# Session
Session.vim
Sessionx.vim
# Linux temp files
# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~
### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
# Local History for Visual Studio Code
.history/
# Ignore all local history of files
.history
.ionide
### Linux ###
*~
# other stuff
run/
javadoc/
# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*
build-data/
*-API
*-MojangAPI
*-Server
*.jar
# KDE directory preferences
.directory
# Linux trash folder which might appear on any partition or disk
.Trash-*
# .nfs files are created when an open file is removed but is still being accessed
.nfs*
### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
# iCloud generated files
*.icloud
### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk

View File

@@ -1,23 +0,0 @@
The MIT License (MIT)
=====================
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the “Software”), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,38 +0,0 @@
<div align="center">
[![image](https://raw.githubusercontent.com/PlazmaMC/Plazma/main/src/resources/title-900.png)](https://github.com/PlazmaMC/Plazma)
### A Server Platform for Minecraft: Java Edition based on [Paper](https://github.com/PaperMC/Paper)
[![Discord](https://img.shields.io/discord/1083716853928558652?style=for-the-badge&logo=discord&logoColor=ffffff&label=DISCORD&color=5865F2&link=https%3A%2F%2Fdiscord.gg%2FMmfC52K8A8)](https://discord.gg/MmfC52K8A8)
[![Build Status](https://img.shields.io/github/actions/workflow/status/PlazmaMC/Plazma/build.yml?branch=ver/1.20.2&logo=GoogleAnalytics&style=for-the-badge&logoColor=ffffff)](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.2)
[![MC Version](https://img.shields.io/badge/MC-1.20.2-6047ff?&logo=Webpack&style=for-the-badge&logoColor=ffffff)](https://github.com/PlazmaMC/Plazma/releases/build/1.20.2/latest)
[![License](https://img.shields.io/github/license/PlazmaMC/Plazma?logo=github&style=flat-square&logoColor=ffffff)](LICENSE)
[![Downloads](https://img.shields.io/github/downloads/PlazmaMC/Plazma/total?label=Downloads&logo=data:image/png;base64,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&style=flat-square&color=green)](https://github.com/PlazmaMC/Plazma/releases)
[![Stargazers](https://img.shields.io/github/stars/PlazmaMC/Plazma?label=stars&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bxSIVh1YQcYhQnSyIiuimVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APE0clJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OMUDVLCOViAuZ7KrQ9YogwujDEGYkZupzopiE5/i6h4+vdzGe5X3uz9Gj5EwG+ATiWaYbFvEG8dSmpXPeJ46woqQQnxOPGnRB4keuyy6/cS447OeZESOdmieOEAuFNpbbmBUNlXiSOKqoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5zEAksYgkiBMioooQyLMRo1UgxkaL9uId/wPGL5JLJVQIjxwIqUCE5fvA/+N2tmZ8Yd5NCcaDzxbY/hoGuXaBRs+3vY9tunACBZ+BKa/krdWD6k/RaS4seAb3bwMV1S5P3gMsdoP9JlwzJkQI0/fk88H5G35QFwrdA95rbW3Mfpw9AmrpK3gAHh8BIgbLXPd4dbO/t3zPN/n4Ax9dyyerighsAAAAGYktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCBMVNjtc7/hFAAABIElEQVQ4y62SzS5DURSFv6smXkAUCRU0UdKYGNTPyCsYYOYFGGi8Ao9QM0PxCh6CgQ4qfiLpBFEjdKCfySaXtDch1uScs9Ze62TvcyAD6o66zV+gjqpvalsd61XXl5GxBySx3/3t7UPqi1pTD9VXdaRbbZIyDQLTwBSwBqzGGaABnAInwCXQSJLk/tO4orb8jra6nwo/CC6NlrqMOq421Y5aVSfUXJe2cqFVo7b5NdwIuVaf1IWM2cyrD+qdOvlTLERIS53pYi6FdqMWet2wGP1tdNE2Q1vK+gfDsdbDlFfzwV3Ems8KmAXegcd4hSvgVq0Bz6GV0ob+HgF1YAA4Cn4LWA9tLusHnscTHavFFF8MrqOeZQVU1HKGXlYr/Cc+AKuOI2h/Jrf7AAAAAElFTkSuQmCC&style=flat-square&color=green)](https://github.com/PlazmaMC/Plazma/stargazers)
[![Forks](https://img.shields.io/github/forks/PlazmaMC/Plazma?label=forks&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bxSIVh1YQcYhQnSyIiuimVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APE0clJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OMUDVLCOViAuZ7KrQ9YogwujDEGYkZupzopiE5/i6h4+vdzGe5X3uz9Gj5EwG+ATiWaYbFvEG8dSmpXPeJ46woqQQnxOPGnRB4keuyy6/cS447OeZESOdmieOEAuFNpbbmBUNlXiSOKqoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5zEAksYgkiBMioooQyLMRo1UgxkaL9uId/wPGL5JLJVQIjxwIqUCE5fvA/+N2tmZ8Yd5NCcaDzxbY/hoGuXaBRs+3vY9tunACBZ+BKa/krdWD6k/RaS4seAb3bwMV1S5P3gMsdoP9JlwzJkQI0/fk88H5G35QFwrdA95rbW3Mfpw9AmrpK3gAHh8BIgbLXPd4dbO/t3zPN/n4Ax9dyyerighsAAAAGYktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCBMVNCYN3/YeAAAA/UlEQVQ4y7WTQUoDQRBFf01czlJcxUyOINGjjAvFHMFzZGdygOwDwTtk6UZcqLlAxCAuMigug89FamIzdAIN+qGhq/6v6qrqbumvAJwBj8AHMAQs4DJgBHy65jSW4Bl4AaZsUAbcufumrnmquSzIcSzpTtLA7XbA1fuBa9qxCob8YgUUAdcFqoC/iSXIgLELOhG+49w4nM+2BTP7ljR3M4/MufbNzYxdN1E0Sm2ialZnsVIllZKOJF24eyLpXdKtmS1S3sYMmO3THOwJziUdbrbkZvaVcnILeAh6vweylAQ9D7z2BXCS0sJS0lrSpdtrSW+pn6sPLIFX4Er/hR9C0wl1FTBzNwAAAABJRU5ErkJggg==&style=flat-square&color=green)](https://github.com/PPlazmaMC/Plazma/network/members)
[![Watchers](https://img.shields.io/github/watchers/PlazmaMC/Plazma?label=watchers&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABhWlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9bxSIVh1YQcYhQnSyIiuimVShChVArtOpgcukXNGlIUlwcBdeCgx+LVQcXZ10dXAVB8APE0clJ0UVK/F9SaBHjwXE/3t173L0D/PUyU82OMUDVLCOViAuZ7KrQ9YogwujDEGYkZupzopiE5/i6h4+vdzGe5X3uz9Gj5EwG+ATiWaYbFvEG8dSmpXPeJ46woqQQnxOPGnRB4keuyy6/cS447OeZESOdmieOEAuFNpbbmBUNlXiSOKqoGuX7My4rnLc4q+Uqa96TvzCU01aWuU5zEAksYgkiBMioooQyLMRo1UgxkaL9uId/wPGL5JLJVQIjxwIqUCE5fvA/+N2tmZ8Yd5NCcaDzxbY/hoGuXaBRs+3vY9tunACBZ+BKa/krdWD6k/RaS4seAb3bwMV1S5P3gMsdoP9JlwzJkQI0/fk88H5G35QFwrdA95rbW3Mfpw9AmrpK3gAHh8BIgbLXPd4dbO/t3zPN/n4Ax9dyyerighsAAAAGYktHRAAAAAAAAPlDu38AAAAJcEhZcwAADdcAAA3XAUIom3gAAAAHdElNRQfmCBMVNw4TRw0nAAAA3UlEQVQ4y83SP04CURAG8I0lewHOwAFUaiwkdmAlp8CL4FHopfIvtOIJWE3opIBK489mQPKy6xYWOskkL9/MN/PNzMuyf2fIcYkZVuGzwPI68gle8Yl7jMIfAntBp4o8wAeecFgSP8I8cgZp8DwC12j8oLCBCd7R34ItbHCzT8ZZSC7QTYrcYo1WhjGWaCbdCt+2SGLN4IwPfnu07QjrkhG6oWKB0+TMd7sRAuzHYuqWmO8tsVd1xjmOS8htPEfORVWHTmweHnEVPg2sqPxIicxhFFjhLd7D2q/8J/YFHSJt9VSqQ08AAAAASUVORK5CYII=&style=flat-square&color=green)](https://github.com/PlazmaMC/Plazma/watchers)
</div>
[main]: https://github.com/PlazmaMC/Plazma
> [!IMPORTANT]
This is the branch for Plazma 1.20.2. If you want to know more about Plazma, please check the **[main branch][main]**.<br>
이곳은 플라즈마의 1.20.2용 분기입니다. 플라즈마에 대해 자세히 알고 싶다면 **[main 브랜치][main]** 를 확인해주세요.
## ⬇️ Downloads
> [!NOTE]
If you don't know about Mojmap or Bundler, download **Reobf Paperclip**<br>
Mojmap 또는 Bundler에 대해 잘 알지 못한다면, **Reobf Paperclip**을 사용하세요
<!--- LINKS --->
[paperReobf]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.2/latest/plazma-paperclip-1.20.2-R0.1-SNAPSHOT-reobf.jar
[paperMojmap]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.2/latest/plazma-paperclip-1.20.2-R0.1-SNAPSHOT-mojmap.jar
[bundlerReobf]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.2/latest/plazma-bundler-1.20.2-R0.1-SNAPSHOT-reobf.jar
[bundlerMojmap]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.2/latest/plazma-bundler-1.20.2-R0.1-SNAPSHOT-mojmap.jar
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |
|:-----------------------------:|:-----------------------:|:------------------------:|:-------------------------:|
| [Download][paperReobf] | [Download][paperMojmap] | [Download][bundlerReobf] | [Download][bundlerMojmap] |

View File

@@ -1,15 +0,0 @@
# You can use this file to import files from minecraft libraries into the project
# format:
# <artifactId> <fileName>
# both fully qualified and a file based syntax are accepted for <fileName>:
# authlib com/mojang/authlib/yggdrasil/YggdrasilGameProfileRepository.java
# datafixerupper com.mojang.datafixers.DataFixerBuilder
# datafixerupper com/mojang/datafixers/util/Either.java
# To import classes from the vanilla Minecraft jar use `minecraft` as the artifactId:
# minecraft net.minecraft.world.level.entity.LevelEntityGetterAdapter
# minecraft net/minecraft/world/level/entity/LevelEntityGetter.java
# To import minecraft data files, like the default chat type, use `mc_data` as the prefix:
# mc_data chat_type/chat.json
# mc_data dimension_type/overworld.json
#

View File

@@ -1,131 +1,85 @@
import io.papermc.paperweight.util.constants.PAPERCLIP_CONFIG
group = "org.plazmamc.plazma"
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
java
`maven-publish`
`kotlin-dsl`
`always-up-to-date`
alias(libs.plugins.shadow) apply false
alias(libs.plugins.paperweight)
id("io.papermc.paperweight.patcher") version "2.0.0-beta.14"
}
kotlin.jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
}
paperweight {
upstreams.register("purpur") {
repo = github("PurpurMC", "Purpur")
ref = providers.gradleProperty("purpurRef")
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/") {
content {
onlyForConfigurations(PAPERCLIP_CONFIG)
patchFile {
path = "purpur-server/build.gradle.kts"
outputFile = file("plazma-server/build.gradle.kts")
patchFile = file("plazma-server/build.gradle.kts.patch")
}
}
}
dependencies {
remapper(libs.remapper)
decompiler(libs.decompiler)
paperclip(libs.paperclip)
}
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))
publishing {
repositories {
maven {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/PlazmaMC/Plazma")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
publications.register<MavenPublication>("gpr") {
from(components["java"])
}
patchFile {
path = "purpur-api/build.gradle.kts"
outputFile = file("plazma-api/build.gradle.kts")
patchFile = file("plazma-api/build.gradle.kts.patch")
}
patchRepo("paperApi") {
upstreamPath = "paper-api"
patchesDir = file("plazma-api/paper-patches")
outputDir = file("paper-api")
}
patchDir("purpurApi") {
upstreamPath = "purpur-api"
excludes = listOf("build.gradle.kts", "build.gradle.kts.patch", "paper-patches")
patchesDir = file("plazma-api/purpur-patches")
outputDir = file("purpur-api")
}
}
}
subprojects {
apply(plugin = "java")
apply(plugin = "java-library")
apply(plugin = "maven-publish")
tasks {
withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(listOf("--add-modules=jdk.incubator.vector", "-Xmaxwarns", "1"))
options.encoding = Charsets.UTF_8.name()
options.release.set(17)
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
withType<Test> {
minHeapSize = "2g"
maxHeapSize = "2g"
extensions.configure<JavaPluginExtension> {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://ci.emc.gs/nexus/content/groups/aikar/")
maven("https://repo.aikar.co/content/groups/aikar")
maven("https://repo.md-5.net/content/repositories/releases/")
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
maven("https://jitpack.io")
maven("https://oss.sonatype.org/content/repositories/snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
}
}
tasks.withType<AbstractArchiveTask>().configureEach {
isPreserveFileTimestamps = false
isReproducibleFileOrder = true
}
tasks.withType<JavaCompile> {
options.encoding = Charsets.UTF_8.name()
options.release = 21
options.isFork = true
}
tasks.withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
tasks.withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
tasks.withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
}
paperweight {
serverProject.set(project(":plazma-server"))
remapRepo.set("https://maven.fabricmc.net/")
decompileRepo.set("https://files.minecraftforge.net/maven/")
usePaperUpstream(providers.gradleProperty("paperCommit")) {
withPaperPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("Plazma-API"))
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("Plazma-Server"))
extensions.configure<PublishingExtension> {
repositories {
/*
maven("https://repo.papermc.io/repository/maven-snapshots/") {
name = "paperSnapshots"
credentials(PasswordCredentials::class)
}
*/
}
}
}
alwaysUpToDate {
paperRepository.set("https://github.com/PaperMC/Paper")
paperBranch.set("master")
purpurRepository.set("https://github.com/PurpurMC/Purpur")
purpurBranch.set("ver/1.20.4")
pufferfishRepository.set("https://github.com/pufferfish-gg/Pufferfish")
pufferfishBranch.set("ver/1.20")
}
tasks {
generateDevelopmentBundle {
apiCoordinates.set("org.plazmamc.plazma:plazma-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
"https://papermc.io/repo/repository/maven-public/"
)
}
}

View File

@@ -1,33 +0,0 @@
plugins {
java
`kotlin-dsl`
id("com.github.johnrengelman.shadow") version "8.1.1"
}
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/")
}
kotlin.jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
}
dependencies {
shadow("io.papermc.paperweight:paperweight-patcher:1.5.11-SNAPSHOT")
}
tasks {
jar {
finalizedBy(shadowJar)
}
shadowJar {
archiveFileName.set("buildSrc.jar")
configurations = listOf(project.configurations["shadow"])
exclude("META-INF/gradle-plugins/io.papermc.paperweight.patcher.properties")
relocate("io.papermc.paperweight", "org.plazmamc.alwaysuptodate.internal.paperweight")
minimize()
}
}

View File

@@ -1,15 +0,0 @@
package org.plazmamc.alwaysuptodate
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.plazmamc.alwaysuptodate.tasks.*
class AlwaysUpToDate : Plugin<Project> {
override fun apply(target: Project) {
target.extensions.create("alwaysUpToDate", AlwaysUpToDateExtension::class.java)
target.tasks.register("updatePaper", PaperUpdateTask::class.java)
target.tasks.register("updatePurpur", PurpurUpdateTask::class.java)
}
}

View File

@@ -1,6 +0,0 @@
package org.plazmamc.alwaysuptodate
class AlwaysUpToDateException : Exception {
constructor(message: String) : super(message)
constructor(message: String, cause: Throwable?) : super(message, cause)
}

View File

@@ -1,16 +0,0 @@
package org.plazmamc.alwaysuptodate
import org.gradle.api.provider.Property
interface AlwaysUpToDateExtension {
val paperRepository: Property<String>
val paperBranch: Property<String>
val pufferfishRepository: Property<String>
val pufferfishBranch: Property<String>
val purpurRepository: Property<String>
val purpurBranch: Property<String>
}

View File

@@ -1,44 +0,0 @@
package org.plazmamc.alwaysuptodate.tasks
import io.papermc.paperweight.util.Git
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.get
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
import org.plazmamc.alwaysuptodate.utils.pathIO
import java.io.File
abstract class PaperUpdateTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
private val regex = "[a-z0-9]{40}\trefs/heads/${property.paperBranch}".toRegex()
private val git = Git(project.pathIO)
override fun init() {
outputs.upToDateWhen { check() }
}
private fun check(): Boolean {
val latestCommit = git("ls-remote", property.paperRepository.get()).readText()?.lines()
?.filterNot { regex.matches(it) }?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Paper commit")
val currentCommit = project.properties["paperCommit"] as String
return currentCommit == latestCommit
}
@TaskAction
fun update() {
if (check()) return
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), project.file("gradle.properties"))
}
}
fun updatePaperCommit(repo: String, branch: String, properties: File) {
val latestCommit = Git(properties.parentFile.toPath())("ls-remote", repo).readText()?.lines()
?.filterNot { "[a-z0-9]{40}\trefs/heads/$branch".toRegex().matches(it) }?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Paper commit")
properties.writeText(properties.readText().replace("paperCommit = .*".toRegex(), "paperCommit = $latestCommit"))
}

View File

@@ -1,157 +0,0 @@
package org.plazmamc.alwaysuptodate.tasks
import io.papermc.paperweight.util.*
import org.gradle.api.tasks.TaskAction
import org.gradle.kotlin.dsl.get
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
import org.plazmamc.alwaysuptodate.AlwaysUpToDateExtension
import org.plazmamc.alwaysuptodate.utils.Gradle
import org.plazmamc.alwaysuptodate.utils.addCommit
import org.plazmamc.alwaysuptodate.utils.clone
import org.plazmamc.alwaysuptodate.utils.pathIO
import java.nio.file.Path
import kotlin.io.path.createDirectories
import kotlin.io.path.exists
abstract class PurpurUpdateTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
private val pufferfishCommit = """
Pufferfish
Copyright (C) 2024 Pufferfish Studios LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
""".trimIndent()
private val purpurCommit = """
PurpurMC
Copyright (C) 2024 PurpurMC
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
""".trimIndent()
override fun init() {
outputs.upToDateWhen { check() }
}
private fun check(): Boolean {
val regex = "[a-z0-9]{40}\trefs/heads/${property.purpurBranch}".toRegex()
val latestCommit = Git(project.pathIO)("ls-remote", property.purpurRepository.get()).readText()?.lines()
?.filterNot { regex.matches(it) }?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
val currentCommit = project.properties["purpurCommit"] as String
return currentCommit == latestCommit
}
@TaskAction
fun update() {
if (check()) return
Git.checkForGit()
val dir = project.layout.cache.resolve("AlwaysUpToDate/UpdatePurpur")
if (dir.exists()) dir.toFile().deleteRecursively()
dir.createDirectories()
val git = Git(dir)
val pufferfish = git.clone("Pufferfish", property.pufferfishRepository.get(), property.pufferfishBranch.get(), dir)
val purpur = git.clone("Purpur", property.purpurRepository.get(), property.purpurBranch.get(), dir)
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), pufferfish.resolve("gradle.properties").toFile())
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), purpur.resolve("gradle.properties").toFile())
updatePaperCommit(property.paperRepository.get(), property.paperBranch.get(), project.file("gradle.properties"))
val purpurGradle = Gradle(purpur)
val purpurPatches = purpur.resolve("patches").also {
val puffefishPatches = pufferfish.resolve("patches").also { that -> that.toFile().deleteRecursively() }
copyPatch(it.resolve("server"), puffefishPatches.resolve("server"), "0001-Pufferfish-Server-Changes.patch")
copyPatch(it.resolve("api"), puffefishPatches.resolve("api"), "0001-Pufferfish-API-Changes.patch")
}
Gradle(pufferfish)("applyPatches").executeOut()
purpurGradle("applyPatches").executeOut()
pufferfish.resolve("pufferfish-server").also {
val dotGit = it.resolve(".git").toFile()
dotGit.deleteRecursively()
copySource(it)
val paper = pufferfish.resolve(".gradle/caches/paperweight/upstreams/paper/Paper-Server")
copySource(paper)
Git(paper)("add", ".").executeOut()
Git(paper)("commit", "-m", "Vanilla Sources", "--author=Vanilla <auto@mated.null>").executeOut()
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
Git(it).addCommit("Pufferfish Server Changes\n\n$pufferfishCommit", "--author=Kevin Raneri <kevin.raneri@gmail.com>")
val server = purpur.resolve("Purpur-Server")
copySource(server)
dotGit.copyRecursively(server.resolve(".git").toFile().also { that -> that.deleteRecursively() }, overwrite = true)
Git(server).addCommit("Purpur Server Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
}
with(purpur.resolve("Purpur-API")) {
pufferfish.resolve("pufferfish-api/.git").toFile()
.copyRecursively(resolve(".git").toFile().also { it.deleteRecursively() }, overwrite = true)
Git(this).addCommit("Purpur API Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
}
purpurGradle("rebuildPatches").executeOut()
project.layout.projectDirectory.path.resolve("patches").also {
with(purpurPatches.resolve("server")) {
val target = it.resolve("server")
copyPatch(this, target, "0001-Pufferfish-Server-Changes.patch")
copyPatch(this, target, "0002-Purpur-Server-Changes.patch")
}
with(purpurPatches.resolve("api")) {
val target = it.resolve("api")
copyPatch(this, target, "0001-Pufferfish-API-Changes.patch")
copyPatch(this, target, "0002-Purpur-API-Changes.patch")
}
}
}
private fun copySource(dir: Path) {
with(dir.resolve(".gradle/caches/paperweight/mc-dev-sources")) {
val target = dir.resolve("src/main")
resolve("net").toFile().copyRecursively(target.resolve("java/net").toFile(), overwrite = true)
resolve("data").toFile().copyRecursively(target.resolve("resources/data").toFile(), overwrite = true)
}
}
private fun copyPatch(from: Path, to: Path, name: String) {
with(from.resolve(name)) {
if (exists()) toFile().copyTo(to.resolve(name).toFile(), overwrite = true)
else from.toFile().walk().filter { it.name.endsWith(name.substring(4)) }.first().copyTo(to.resolve(name).toFile(), overwrite = true)
}
}
}

View File

@@ -1,14 +0,0 @@
package org.plazmamc.alwaysuptodate.tasks
import org.gradle.api.DefaultTask
abstract class Task : DefaultTask() {
protected open fun init() {
}
init {
this.init()
}
}

View File

@@ -1,18 +0,0 @@
package org.plazmamc.alwaysuptodate.utils
import io.papermc.paperweight.util.Git
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
import java.nio.file.Path
import kotlin.io.path.notExists
fun Git.clone(name: String, uri: String, branch: String, dir: Path): Path {
val target = dir.resolve(name)
this("clone", "--depth", "1", "--branch", branch, uri, target.toString()).executeSilently(silenceErr = true)
if (target.notExists()) throw AlwaysUpToDateException("Failed to clone repository")
return target
}
fun Git.addCommit(vararg args: String) {
this("add", ".").executeSilently(silenceErr = true)
this("commit", "-m", *args).executeSilently(silenceErr = true)
}

View File

@@ -1,27 +0,0 @@
package org.plazmamc.alwaysuptodate.utils
import io.papermc.paperweight.util.Command
import io.papermc.paperweight.util.directory
import org.plazmamc.alwaysuptodate.AlwaysUpToDateException
import java.nio.file.Path
import kotlin.io.path.notExists
class Gradle(private val repo: Path) {
init {
if (repo.resolve("gradle").notExists())
throw AlwaysUpToDateException("Git repository does not exist: $repo")
}
operator fun invoke(vararg args: String): Command {
val builder = ProcessBuilder("java", "-cp", "gradle/wrapper/gradle-wrapper.jar", "org.gradle.wrapper.GradleWrapperMain", *args, "--no-daemon", "--stacktrace").directory(repo)
val command = builder.command().joinToString(" ") { if (it.codePoints().anyMatch(Character::isWhitespace)) "\"$it\"" else it }
return try {
Command(builder, command)
} catch (e: Exception) {
throw AlwaysUpToDateException("Failed to execute command: $command", e)
}
}
}

View File

@@ -1,7 +0,0 @@
package org.plazmamc.alwaysuptodate.utils
import io.papermc.paperweight.util.path
import org.gradle.api.Project
import java.nio.file.Path
val Project.pathIO: Path get() = layout.projectDirectory.path

View File

@@ -1 +0,0 @@
implementation-class=org.plazmamc.alwaysuptodate.AlwaysUpToDate

13
fxapi
View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
# FixupAPI
PS1="$"
cd Plazma-API
git add .
git commit -m "fixup"
git format-patch -1
cd ../

13
fxsrv
View File

@@ -1,13 +0,0 @@
#!/usr/bin/env bash
# FixupServer
PS1="$"
cd Plazma-Server
git add .
git commit -m "fixup"
git format-patch -1
cd ../

View File

@@ -1,11 +1,10 @@
version = 1.20.2-R0.1-SNAPSHOT
mcVersion = 1.20.2
group=org.plazmamc.plazma
version=1.21.4-R0.1-SNAPSHOT
mcVersion=1.21.4
paperCommit = 931781c220b98dde0159c9a3c8dce06c3b2b1e13
purpurCommit = c46cb7ef66675e00a48e20c40febed7ff914f35d
pufferfishCommit = bc89152d4cd4bb0f9644da2fe10774df4cc25661
purpurRef=a9862d7ec77a2b7690e73e635a5829f1596be84e
org.gradle.caching = true
org.gradle.parallel = true
org.gradle.vfs.watch = false
org.gradle.jvmargs = -Xmx4G -Dfile.encoding=UTF-8 -Dgraal.CompilerConfiguration=community -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.WriteableCodeCache=true
org.gradle.configuration-cache=true
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.vfs.watch=false

View File

@@ -1,15 +1,2 @@
[versions]
shadow = "8.1.1"
paperweight = "1.5.10"
paperclip = "3.0.3"
decompiler = "2.0.627.2"
remapper = "0.3.0:fat"
[libraries]
remapper = { group = "net.fabricmc", name = "tiny-remapper", version.ref="remapper" }
decompiler = { group = "net.minecraftforge", name = "forgeflower", version.ref = "decompiler" }
paperclip = { group = "io.papermc", name = "paperclip", version.ref = "paperclip" }
[plugins]
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
paperweight = { id = "io.papermc.paperweight.patcher", version.ref = "paperweight" }
# This file was generated by the Gradle 'init' task.
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

Binary file not shown.

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

6
gradlew vendored
View File

@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

22
gradlew.bat vendored
View File

@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail

View File

@@ -1,29 +0,0 @@
[versions]
gson = "2.10.1"
joml = "1.10.5"
guava = "32.1.2-jre"
sentry = "5.4.0"
fastutil = "8.5.6"
findbugs = "1.3.9"
slf4j-api = "1.8.0-beta4"
bungeechat = "1.20-R0.1-deprecated+build.14"
json-simple = "1.1.1"
annotations = "24.0.1"
checkerqual = "3.21.0"
[libraries]
joml = { group = "org.joml", name = "joml", version.ref = "joml" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
guava = { group = "com.google.guava", name = "guava", version.ref = "guava" }
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
findbugs = { group = "com.google.code.findbugs", name = "jsr305", version.ref = "findbugs" }
slf4j-api = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
bungeechat = { group = "net.md-5", name = "bungeecord-chat", version.ref = "bungeechat" }
jsonsimple = { group = "com.googlecode.json-simple", name = "json-simple", version.ref = "json-simple" }
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
[bundles]
api = [ "guava", "gson", "bungeechat", "joml", "fastutil", "slf4j-api", "sentry" ]
annotations = [ "annotations", "checkerqual" ]

View File

@@ -1,45 +0,0 @@
[versions]
asm = "9.6"
log4j = "2.19.0"
mockito = "5.5.0"
jupiter = "5.10.0"
hamcrest = "2.2"
snakeyaml = "2.2"
adventure = "4.14.0"
commons-lang2 = "2.6"
commons-lang3 = "3.12.0"
maven-provider = "3.8.5"
maven-resolver = "1.7.3"
[libraries]
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "jupiter" }
hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrest" }
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
asm-head = { group = "org.ow2.asm", name = "asm", version.ref = "asm" }
asm-tree = { group = "org.ow2.asm", name = "asm-tree", version.ref = "asm" }
asm-commons = { group = "org.ow2.asm", name = "asm-commons", version.ref = "asm" }
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
log4j-core = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
log4j-iostreams = { group = "org.apache.logging.log4j", name = "log4j-iostreams", version.ref = "log4j" }
maven-provider = { group = "org.apache.maven", name = "maven-resolver-provider", version.ref = "maven-provider" }
maven-connector = { group = "org.apache.maven.resolver", name = "maven-resolver-connector-basic", version.ref = "maven-resolver" }
maven-transport = { group = "org.apache.maven.resolver", name = "maven-resolver-transport-http", version.ref = "maven-resolver" }
commons-lang2 = { group = "commons-lang", name = "commons-lang", version.ref = "commons-lang2" }
commons-lang3 = { group = "org.apache.commons", name = "commons-lang3", version.ref = "commons-lang3" }
adventure-bom = { group = "net.kyori", name = "adventure-bom", version.ref = "adventure" }
adventure-api = { group = "net.kyori", name = "adventure-api", version.ref = "adventure" }
adventure-slf4j = { group = "net.kyori", name = "adventure-text-logger-slf4j", version.ref = "adventure" }
adventure-minimessage = { group = "net.kyori", name = "adventure-text-minimessage", version.ref = "adventure" }
adventure-serializer-gson = { group = "net.kyori", name = "adventure-text-serializer-gson", version.ref = "adventure" }
adventure-serializer-ansi = { group = "net.kyori", name = "adventure-text-serializer-ansi", version.ref = "adventure" }
adventure-serializer-plain = { group = "net.kyori", name = "adventure-text-serializer-plain", version.ref = "adventure" }
adventure-serializer-legacy = { group = "net.kyori", name = "adventure-text-serializer-legacy", version.ref = "adventure" }
[bundles]
asm = [ "asm-head", "asm-commons" ]
test = [ "jupiter", "hamcrest", "mockito" ]
maven = [ "maven-connector", "maven-transport" ]
adventure = [ "adventure-api", "adventure-slf4j", "adventure-minimessage", "adventure-serializer-gson", "adventure-serializer-plain", "adventure-serializer-legacy" ]

View File

@@ -1,35 +0,0 @@
[versions]
ansi = "1.0.3"
jansi = "3.21.0"
rhino = "1.7.14"
mysql = "8.1.0"
sqlite = "3.42.0.1"
haproxy = "4.1.97.Final"
velocity = "3.1.2-SNAPSHOT"
disruptor = "3.4.4"
simpleyaml = "1.8.4"
classgraph = "4.8.47"
mapping-io = "0.5.0"
configurate = "4.2.0-SNAPSHOT"
terminal-appender = "1.3.0"
[libraries]
ansi = { group = "net.kyori", name = "ansi", version.ref = "ansi" }
mysql = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysql" }
jansi = { group = "org.jline", name = "jline-terminal-jansi", version.ref = "jansi" }
sqlite = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite" }
haproxy = { group = "io.netty", name = "netty-codec-haproxy", version.ref = "haproxy" }
velocity = { group = "com.velocitypowered", name = "velocity-native", version.ref = "velocity" }
disruptor = { group = "com.lmax", name = "disruptor", version.ref = "disruptor" }
mappingio = { group = "net.fabricmc", name = "mapping-io", version.ref = "mapping-io" }
classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraph" }
simpleyaml = { group = "com.github.carleslc.Simple-YAML", name = "Simple-Yaml", version.ref = "simpleyaml" }
configurate = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
rhino-runtime = { group = "org.mozilla", name = "rhino-runtime", version.ref = "rhino" }
terminal-appender = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="terminal-appender" }
[bundles]
runtime = [ "sqlite", "mysql", "disruptor" ]
implementation = [ "jansi", "terminal-appender", "ansi", "haproxy", "configurate", "mappingio", "rhino-engine", "rhino-runtime" ]

14
mkapi
View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
# PatchAPI <Patch Name>
PS1="$"
cd Plazma-API
git add .
git commit -m $1
cd ../
./gradlew rebuildAPIPatches

14
mksrv
View File

@@ -1,14 +0,0 @@
#!/usr/bin/env bash
# PatchServer <Patch Name>
PS1="$"
cd Plazma-Server
git add .
git commit -m $1
cd ../
./gradlew rebuildServerPatches

View File

@@ -1,527 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kevin Raneri <kevin.raneri@gmail.com>
Date: Sun, 26 Nov 2023 23:32:01 +0000
Subject: [PATCH] Pufferfish API Changes
Original: Kevin Raneri <kevin.raneri@gmail.com>
Copyright (C) 2023 Pufferfish Studios LLC
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/build.gradle.kts b/build.gradle.kts
index e827ee211e3c65dc68ac5867fd8476639df63645..b9c75a190dbd7a90ac5ef0fbc6e6fe34806acc4e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -47,6 +47,7 @@ dependencies {
apiAndDocs("net.kyori:adventure-text-logger-slf4j")
api("org.apache.logging.log4j:log4j-api:$log4jVersion")
api("org.slf4j:slf4j-api:$slf4jVersion")
+ api("io.sentry:sentry:5.4.0") // Pufferfish
implementation("org.ow2.asm:asm:9.4")
implementation("org.ow2.asm:asm-commons:9.4")
@@ -106,6 +107,13 @@ val generateApiVersioningFile by tasks.registering {
}
}
+// Pufferfish Start
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
+}
+// Pufferfish End
+
tasks.jar {
from(generateApiVersioningFile.map { it.outputs.files.singleFile }) {
into("META-INF/maven/${project.group}/${project.name}")
diff --git a/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
new file mode 100644
index 0000000000000000000000000000000000000000..10310fdd53de28efb8a8250f6d3b0c8eb08fb68a
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/sentry/SentryContext.java
@@ -0,0 +1,161 @@
+package gg.pufferfish.pufferfish.sentry;
+
+import com.google.gson.Gson;
+import java.lang.reflect.Field;
+import java.lang.reflect.Modifier;
+import java.util.Map;
+import java.util.TreeMap;
+import org.apache.logging.log4j.ThreadContext;
+import org.bukkit.command.Command;
+import org.bukkit.command.CommandSender;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Event;
+import org.bukkit.event.player.PlayerEvent;
+import org.bukkit.plugin.Plugin;
+import org.bukkit.plugin.RegisteredListener;
+import org.jetbrains.annotations.Nullable;
+
+public class SentryContext {
+
+ private static final Gson GSON = new Gson();
+
+ public static void setPluginContext(@Nullable Plugin plugin) {
+ if (plugin != null) {
+ ThreadContext.put("pufferfishsentry_pluginname", plugin.getName());
+ ThreadContext.put("pufferfishsentry_pluginversion", plugin.getDescription().getVersion());
+ }
+ }
+
+ public static void removePluginContext() {
+ ThreadContext.remove("pufferfishsentry_pluginname");
+ ThreadContext.remove("pufferfishsentry_pluginversion");
+ }
+
+ public static void setSenderContext(@Nullable CommandSender sender) {
+ if (sender != null) {
+ ThreadContext.put("pufferfishsentry_playername", sender.getName());
+ if (sender instanceof Player player) {
+ ThreadContext.put("pufferfishsentry_playerid", player.getUniqueId().toString());
+ }
+ }
+ }
+
+ public static void removeSenderContext() {
+ ThreadContext.remove("pufferfishsentry_playername");
+ ThreadContext.remove("pufferfishsentry_playerid");
+ }
+
+ public static void setEventContext(Event event, RegisteredListener registration) {
+ setPluginContext(registration.getPlugin());
+
+ try {
+ // Find the player that was involved with this event
+ Player player = null;
+ if (event instanceof PlayerEvent) {
+ player = ((PlayerEvent) event).getPlayer();
+ } else {
+ Class<? extends Event> eventClass = event.getClass();
+
+ Field playerField = null;
+
+ for (Field field : eventClass.getDeclaredFields()) {
+ if (field.getType().equals(Player.class)) {
+ playerField = field;
+ break;
+ }
+ }
+
+ if (playerField != null) {
+ playerField.setAccessible(true);
+ player = (Player) playerField.get(event);
+ }
+ }
+
+ if (player != null) {
+ setSenderContext(player);
+ }
+ } catch (Exception e) {} // We can't really safely log exceptions.
+
+ ThreadContext.put("pufferfishsentry_eventdata", GSON.toJson(serializeFields(event)));
+ }
+
+ public static void removeEventContext() {
+ removePluginContext();
+ removeSenderContext();
+ ThreadContext.remove("pufferfishsentry_eventdata");
+ }
+
+ private static Map<String, String> serializeFields(Object object) {
+ Map<String, String> fields = new TreeMap<>();
+ fields.put("_class", object.getClass().getName());
+ for (Field declaredField : object.getClass().getDeclaredFields()) {
+ try {
+ if (Modifier.isStatic(declaredField.getModifiers())) {
+ continue;
+ }
+
+ String fieldName = declaredField.getName();
+ if (fieldName.equals("handlers")) {
+ continue;
+ }
+ declaredField.setAccessible(true);
+ Object value = declaredField.get(object);
+ if (value != null) {
+ fields.put(fieldName, value.toString());
+ } else {
+ fields.put(fieldName, "<null>");
+ }
+ } catch (Exception e) {} // We can't really safely log exceptions.
+ }
+ return fields;
+ }
+
+ public static class State {
+
+ private Plugin plugin;
+ private Command command;
+ private String commandLine;
+ private Event event;
+ private RegisteredListener registeredListener;
+
+ public Plugin getPlugin() {
+ return plugin;
+ }
+
+ public void setPlugin(Plugin plugin) {
+ this.plugin = plugin;
+ }
+
+ public Command getCommand() {
+ return command;
+ }
+
+ public void setCommand(Command command) {
+ this.command = command;
+ }
+
+ public String getCommandLine() {
+ return commandLine;
+ }
+
+ public void setCommandLine(String commandLine) {
+ this.commandLine = commandLine;
+ }
+
+ public Event getEvent() {
+ return event;
+ }
+
+ public void setEvent(Event event) {
+ this.event = event;
+ }
+
+ public RegisteredListener getRegisteredListener() {
+ return registeredListener;
+ }
+
+ public void setRegisteredListener(RegisteredListener registeredListener) {
+ this.registeredListener = registeredListener;
+ }
+ }
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
new file mode 100644
index 0000000000000000000000000000000000000000..ab5fea0b03224bf249352ce340e94704ff713345
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
@@ -0,0 +1,40 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import jdk.incubator.vector.FloatVector;
+import jdk.incubator.vector.IntVector;
+import jdk.incubator.vector.VectorSpecies;
+
+/**
+ * Basically, java is annoying and we have to push this out to its own class.
+ */
+@Deprecated
+public class SIMDChecker {
+
+ @Deprecated
+ public static boolean canEnable(Logger logger) {
+ try {
+ if (SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19) {
+ return false;
+ } else {
+ SIMDDetection.testRun = true;
+
+ VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
+ VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
+
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + ISPEC.vectorBitSize() + " bits (int)");
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
+
+ if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
+ logger.log(Level.WARNING, "SIMD is not properly supported on this system!");
+ return false;
+ }
+
+ return true;
+ }
+ } catch (NoClassDefFoundError | Exception ignored) {} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
+ return false;
+ }
+
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
new file mode 100644
index 0000000000000000000000000000000000000000..a84889d3e9cfc4d7ab5f867820a6484c6070711b
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
@@ -0,0 +1,35 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.util.logging.Logger;
+
+@Deprecated
+public class SIMDDetection {
+
+ public static boolean isEnabled = false;
+ public static boolean versionLimited = false;
+ public static boolean testRun = false;
+
+ @Deprecated
+ public static boolean canEnable(Logger logger) {
+ try {
+ return SIMDChecker.canEnable(logger);
+ } catch (NoClassDefFoundError | Exception ignored) {
+ return false;
+ }
+ }
+
+ @Deprecated
+ public static int getJavaVersion() {
+ // https://stackoverflow.com/a/2591122
+ String version = System.getProperty("java.version");
+ if(version.startsWith("1.")) {
+ version = version.substring(2, 3);
+ } else {
+ int dot = version.indexOf(".");
+ if(dot != -1) { version = version.substring(0, dot); }
+ }
+ version = version.split("-")[0]; // Azul is stupid
+ return Integer.parseInt(version);
+ }
+
+}
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
new file mode 100644
index 0000000000000000000000000000000000000000..ae2464920c9412ac90b819a540ee58be0741465f
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/VectorMapPalette.java
@@ -0,0 +1,83 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.awt.Color;
+import jdk.incubator.vector.FloatVector;
+import jdk.incubator.vector.IntVector;
+import jdk.incubator.vector.VectorMask;
+import jdk.incubator.vector.VectorSpecies;
+import org.bukkit.map.MapPalette;
+
+@Deprecated
+public class VectorMapPalette {
+
+ private static final VectorSpecies<Integer> I_SPEC = IntVector.SPECIES_PREFERRED;
+ private static final VectorSpecies<Float> F_SPEC = FloatVector.SPECIES_PREFERRED;
+
+ @Deprecated
+ public static void matchColorVectorized(int[] in, byte[] out) {
+ int speciesLength = I_SPEC.length();
+ int i;
+ for (i = 0; i < in.length - speciesLength; i += speciesLength) {
+ float[] redsArr = new float[speciesLength];
+ float[] bluesArr = new float[speciesLength];
+ float[] greensArr = new float[speciesLength];
+ int[] alphasArr = new int[speciesLength];
+
+ for (int j = 0; j < speciesLength; j++) {
+ alphasArr[j] = (in[i + j] >> 24) & 0xFF;
+ redsArr[j] = (in[i + j] >> 16) & 0xFF;
+ greensArr[j] = (in[i + j] >> 8) & 0xFF;
+ bluesArr[j] = (in[i + j] >> 0) & 0xFF;
+ }
+
+ IntVector alphas = IntVector.fromArray(I_SPEC, alphasArr, 0);
+ FloatVector reds = FloatVector.fromArray(F_SPEC, redsArr, 0);
+ FloatVector greens = FloatVector.fromArray(F_SPEC, greensArr, 0);
+ FloatVector blues = FloatVector.fromArray(F_SPEC, bluesArr, 0);
+ IntVector resultIndex = IntVector.zero(I_SPEC);
+ VectorMask<Integer> modificationMask = VectorMask.fromLong(I_SPEC, 0xffffffff);
+
+ modificationMask = modificationMask.and(alphas.lt(128).not());
+ FloatVector bestDistances = FloatVector.broadcast(F_SPEC, Float.MAX_VALUE);
+
+ for (int c = 4; c < MapPalette.colors.length; c++) {
+ // We're using 32-bit floats here because it's 2x faster and nobody will know the difference.
+ // For correctness, the original algorithm uses 64-bit floats instead. Completely unnecessary.
+ FloatVector compReds = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getRed());
+ FloatVector compGreens = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getGreen());
+ FloatVector compBlues = FloatVector.broadcast(F_SPEC, MapPalette.colors[c].getBlue());
+
+ FloatVector rMean = reds.add(compReds).div(2.0f);
+ FloatVector rDiff = reds.sub(compReds);
+ FloatVector gDiff = greens.sub(compGreens);
+ FloatVector bDiff = blues.sub(compBlues);
+
+ FloatVector weightR = rMean.div(256.0f).add(2);
+ FloatVector weightG = FloatVector.broadcast(F_SPEC, 4.0f);
+ FloatVector weightB = FloatVector.broadcast(F_SPEC, 255.0f).sub(rMean).div(256.0f).add(2.0f);
+
+ FloatVector distance = weightR.mul(rDiff).mul(rDiff).add(weightG.mul(gDiff).mul(gDiff)).add(weightB.mul(bDiff).mul(bDiff));
+
+ // Now we compare to the best distance we've found.
+ // This mask contains a "1" if better, and a "0" otherwise.
+ VectorMask<Float> bestDistanceMask = distance.lt(bestDistances);
+ bestDistances = bestDistances.blend(distance, bestDistanceMask); // Update the best distances
+
+ // Update the result array
+ // We also AND with the modification mask because we don't want to interfere if the alpha value isn't large enough.
+ resultIndex = resultIndex.blend(c, bestDistanceMask.cast(I_SPEC).and(modificationMask)); // Update the results
+ }
+
+ for (int j = 0; j < speciesLength; j++) {
+ int index = resultIndex.lane(j);
+ out[i + j] = (byte) (index < 128 ? index : -129 + (index - 127));
+ }
+ }
+
+ // For the final ones, fall back to the regular method
+ for (; i < in.length; i++) {
+ out[i] = MapPalette.matchColor(new Color(in[i], true));
+ }
+ }
+
+}
diff --git a/src/main/java/org/bukkit/map/MapPalette.java b/src/main/java/org/bukkit/map/MapPalette.java
index c80faa079eca1564847070f0338fc98024639829..e632d51d3487eb4807243b6705999ad124466bf5 100644
--- a/src/main/java/org/bukkit/map/MapPalette.java
+++ b/src/main/java/org/bukkit/map/MapPalette.java
@@ -1,6 +1,7 @@
package org.bukkit.map;
import com.google.common.base.Preconditions;
+import gg.pufferfish.pufferfish.simd.SIMDDetection; // Pufferfish
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Image;
@@ -40,7 +41,7 @@ public final class MapPalette {
}
@NotNull
- static final Color[] colors = {
+ public static final Color[] colors = { // Pufferfish - public access
c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0), c(0, 0, 0, 0),
c(89, 125, 39), c(109, 153, 48), c(127, 178, 56), c(67, 94, 29),
c(174, 164, 115), c(213, 201, 140), c(247, 233, 163), c(130, 123, 86),
@@ -211,9 +212,15 @@ public final class MapPalette {
temp.getRGB(0, 0, temp.getWidth(), temp.getHeight(), pixels, 0, temp.getWidth());
byte[] result = new byte[temp.getWidth() * temp.getHeight()];
+ // Pufferfish start
+ if (!SIMDDetection.isEnabled) {
for (int i = 0; i < pixels.length; i++) {
result[i] = matchColor(new Color(pixels[i], true));
}
+ } else {
+ gg.pufferfish.pufferfish.simd.VectorMapPalette.matchColorVectorized(pixels, result);
+ }
+ // Pufferfish end
return result;
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index fc2dae69165776d08274e34a69962cc70445f411..899d67fa782fac639fe7fb096e05c551d75bd647 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -584,7 +584,9 @@ public final class SimplePluginManager implements PluginManager {
// Paper start
private void handlePluginException(String msg, Throwable ex, Plugin plugin) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, msg, ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerPluginEnableDisableException(msg, ex, plugin)));
}
// Paper end
@@ -654,9 +656,11 @@ public final class SimplePluginManager implements PluginManager {
));
}
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setEventContext(event, registration); // Pufferfish
// Paper start - error reporting
String msg = "Could not pass event " + event.getEventName() + " to " + registration.getPlugin().getDescription().getFullName();
server.getLogger().log(Level.SEVERE, msg, ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removeEventContext(); // Pufferfish
if (!(event instanceof com.destroystokyo.paper.event.server.ServerExceptionEvent)) { // We don't want to cause an endless event loop
callEvent(new com.destroystokyo.paper.event.server.ServerExceptionEvent(new com.destroystokyo.paper.exception.ServerEventException(msg, ex, registration.getPlugin(), registration.getListener(), event)));
}
diff --git a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
index eaefbb00e9993d54906cc8cf35cf753c0d6c7707..301e82369603f3dd6e6c1bd380da4bacacd7ef6c 100644
--- a/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/JavaPluginLoader.java
@@ -336,7 +336,13 @@ public final class JavaPluginLoader implements PluginLoader {
try {
jPlugin.setEnabled(true);
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, "Error occurred while enabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
+ // Paper start - Disable plugins that fail to load
+ this.server.getPluginManager().disablePlugin(jPlugin);
+ return;
+ // Paper end
}
// Perhaps abort here, rather than continue going, but as it stands,
@@ -361,7 +367,9 @@ public final class JavaPluginLoader implements PluginLoader {
try {
jPlugin.setEnabled(false);
} catch (Throwable ex) {
+ gg.pufferfish.pufferfish.sentry.SentryContext.setPluginContext(plugin); // Pufferfish
server.getLogger().log(Level.SEVERE, "Error occurred while disabling " + plugin.getDescription().getFullName() + " (Is it up to date?)", ex);
+ gg.pufferfish.pufferfish.sentry.SentryContext.removePluginContext(); // Pufferfish
}
if (cloader instanceof PluginClassLoader) {
diff --git a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
index f9b57b872780aa6b9b959494874b57c7a8ff0c53..90953bfc81168068a281be4d2d3942d5e7dd69ff 100644
--- a/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
+++ b/src/main/java/org/bukkit/plugin/java/PluginClassLoader.java
@@ -50,6 +50,8 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
private io.papermc.paper.plugin.provider.classloader.PluginClassLoaderGroup classLoaderGroup; // Paper
public io.papermc.paper.plugin.provider.entrypoint.DependencyContext dependencyContext; // Paper
+ private boolean closed = false; // Pufferfish
+
static {
ClassLoader.registerAsParallelCapable();
}
@@ -197,6 +199,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
throw new ClassNotFoundException(name);
}
+ public boolean _airplane_hasClass(@NotNull String name) { return this.classes.containsKey(name); } // Pufferfish
@Override
protected Class<?> findClass(String name) throws ClassNotFoundException {
if (name.startsWith("org.bukkit.") || name.startsWith("net.minecraft.")) {
@@ -204,7 +207,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
}
Class<?> result = classes.get(name);
- if (result == null) {
+ if (result == null && !this.closed) { // Pufferfish
String path = name.replace('.', '/').concat(".class");
JarEntry entry = jar.getJarEntry(path);
@@ -251,6 +254,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
this.setClass(name, result); // Paper
}
+ if (result == null) throw new ClassNotFoundException(name); // Pufferfish
return result;
}
@@ -265,6 +269,7 @@ public final class PluginClassLoader extends URLClassLoader implements io.paperm
// Paper end
super.close();
} finally {
+ this.closed = true; // Pufferfish
jar.close();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,115 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 14 Jan 2024 19:50:29 +0900
Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index 41d7b75e904b94073dfcd12b776a7759a963b66f..96974f191c13424d72839d85dfa2a6c29b9f4d1d 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,11 +9,13 @@ java {
withJavadocJar()
}
+/* // Plazma - Use libs.versions.toml
val annotationsVersion = "24.0.1"
val bungeeCordChatVersion = "1.20-R0.1"
val adventureVersion = "4.14.0"
val slf4jVersion = "1.8.0-beta4"
val log4jVersion = "2.17.1"
+ */ // Plazma - Use libs.versions.toml
val apiAndDocs: Configuration by configurations.creating {
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -28,15 +30,39 @@ configurations.api {
dependencies {
// api dependencies are listed transitively to API consumers
+ /* // Plazma - Use libs.versions.toml
api("com.google.guava:guava:32.1.2-jre")
api("com.google.code.gson:gson:2.10.1")
api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.14") // Paper
api("org.yaml:snakeyaml:2.2")
api("org.joml:joml:1.10.5")
+ */ // Plazma - Use libs.versions.toml
// Paper start
- api("com.googlecode.json-simple:json-simple:1.1.1") {
+ api(api.jsonsimple) { // Plazma - Use libs.versions.toml
isTransitive = false // includes junit
}
+ // Plazma start
+ implementation(common.bundles.asm)
+
+ compileOnly(api.findbugs)
+ compileOnly(common.bundles.maven)
+
+ compileOnly(api.annotations)
+ compileOnlyApi(api.checkerqual)
+ testCompileOnly(api.bundles.annotations)
+
+ testImplementation(common.asm.tree)
+ testImplementation(common.bundles.test)
+ testImplementation(common.commons.lang3)
+
+ api(api.bundles.api)
+ api(common.snakeyaml)
+ api(common.log4j.api)
+ api(common.maven.provider)
+ apiAndDocs(platform(common.adventure.bom))
+ apiAndDocs(common.bundles.adventure)
+ /*
+ // Plazma end
api("it.unimi.dsi:fastutil:8.5.6")
apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
apiAndDocs("net.kyori:adventure-api")
@@ -73,6 +99,7 @@ dependencies {
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.5.0")
testImplementation("org.ow2.asm:asm-tree:9.5")
+ */ // Plazma - Use libs.versions.toml
}
// Paper start
@@ -133,25 +160,27 @@ tasks.withType<Javadoc> {
options.use()
options.isDocFilesSubDirs = true
options.links(
- "https://guava.dev/releases/32.1.2-jre/api/docs/",
- "https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
- "https://javadoc.io/doc/org.jetbrains/annotations/$annotationsVersion/", // Paper - we don't want Java 5 annotations
+ // Plazma start - Use libs.versions.toml
+ "https://guava.dev/releases/${api.guava.orNull?.version}/api/docs/",
+ "https://javadoc.io/doc/org.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
+ "https://javadoc.io/doc/org.jetbrains/annotations/${api.annotations.orNull?.version}/", // Paper - we don't want Java 5 annotations
// "https://javadoc.io/doc/net.md-5/bungeecord-chat/$bungeeCordChatVersion/", // Paper - don't link to bungee chat
// Paper start - add missing javadoc links
- "https://javadoc.io/doc/org.joml/joml/1.10.5/index.html",
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.10.1",
+ "https://javadoc.io/doc/org.joml/joml/${api.joml.orNull?.version}/index.html",
+ "https://www.javadoc.io/doc/com.google.code.gson/gson/${api.gson.orNull?.version}",
// Paper end
// Paper start
- "https://jd.advntr.dev/api/$adventureVersion/",
- "https://jd.advntr.dev/text-minimessage/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-gson/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-legacy/$adventureVersion/",
- "https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
- "https://jd.advntr.dev/text-logger-slf4j/$adventureVersion/",
- "https://javadoc.io/doc/org.slf4j/slf4j-api/$slf4jVersion/",
- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/$log4jVersion/",
+ "https://jd.advntr.dev/api/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-minimessage/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-gson/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-legacy/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-serializer-plain/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/text-logger-slf4j/${common.adventure.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/${common.log4j.api.orNull?.version}/",
// Paper end
- "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/1.7.3", // Paper
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.maven.provider.orNull?.version}", // Paper
+ // Plazma end
)
options.tags("apiNote:a:API Note:")

View File

@@ -1,24 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <alphakr93@outlook.com>
Date: Thu, 22 Dec 2022 20:20:03 +0900
Subject: [PATCH] Plazma Configurations
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index dd99f53e3d559685a4b3a454a9e607c310fc6aff..3a3713573ba37530449f9254c0a7205530c9737a 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2202,6 +2202,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Purpur end
+ // Plazma start
+ @NotNull
+ public org.bukkit.configuration.file.YamlConfiguration getPlazmaConfig() {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ // Plazma end
+
/**
* Sends the component to the player
*

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 28 Sep 2023 12:21:36 +0900
Subject: [PATCH] Implement No Chat Reports
diff --git a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
index 2eb13c049fa917d41fa9ad17fdec9ec4c33701a8..5d50f83a76affc74f989870ca1bc8d7a75f3b2ba 100644
--- a/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
+++ b/src/main/java/org/bukkit/event/player/PlayerKickEvent.java
@@ -215,6 +215,8 @@ public class PlayerKickEvent extends PlayerEvent implements Cancellable {
* Fallback cause
*/
UNKNOWN,
+
+ NCR_NOT_INSTALLED, // Plazma - Implement No Chat Reports
}
// Paper end
}

View File

@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 14 Dec 2024 12:25:43 +0900
Subject: [PATCH] Add option to shoot fireball
diff --git a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
index 361db256296d776c27e601c923b2cdc61967122b..8a740bdd99b683255fdd7ebf81f28ceca8b030f8 100644
--- a/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
+++ b/src/main/java/org/bukkit/event/entity/CreatureSpawnEvent.java
@@ -224,6 +224,12 @@ public class CreatureSpawnEvent extends EntitySpawnEvent {
/**
* When an entity is missing a SpawnReason
*/
- DEFAULT
+ DEFAULT,
+ // Plazma start - Option to shoot fireballs
+ /*
+ * When a player shoots a fire charge
+ */
+ FIRE_CHARGE,
+ // Plazma end - Option to shoot fireballs
}
}

View File

@@ -0,0 +1,342 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 4 Nov 2024 16:04:55 +0900
Subject: [PATCH] Reduce allocations
diff --git a/src/main/java/io/papermc/paper/command/brigadier/BasicCommand.java b/src/main/java/io/papermc/paper/command/brigadier/BasicCommand.java
index c89d6c4c38e2390cb11ffba182f8741d3726cfd1..2451f466ae6f953b01ad2cbaeac7d163f09f1c5c 100644
--- a/src/main/java/io/papermc/paper/command/brigadier/BasicCommand.java
+++ b/src/main/java/io/papermc/paper/command/brigadier/BasicCommand.java
@@ -16,6 +16,17 @@ import org.jspecify.annotations.Nullable;
@FunctionalInterface
public interface BasicCommand {
+ // Plazma start - Reduce allocations
+ /**
+ * Executes the command with the given {@link CommandSourceStack} and arguments.
+ *
+ * @param commandSourceStack the commandSourceStack of the command
+ */
+ default void execute(CommandSourceStack commandSourceStack) {
+ this.execute(commandSourceStack, org.plazmamc.plazma.constants.Null.STRING);
+ }
+ // Plazma end - Reduce allocations
+
/**
* Executes the command with the given {@link CommandSourceStack} and arguments.
*
diff --git a/src/main/java/org/bukkit/Fluid.java b/src/main/java/org/bukkit/Fluid.java
index a3ff4fefaf50f3e99a69ba68cbe8e30c95dac5df..5bbecd907e222f9adcf726bccab63c9ef59f5c14 100644
--- a/src/main/java/org/bukkit/Fluid.java
+++ b/src/main/java/org/bukkit/Fluid.java
@@ -10,6 +10,7 @@ import org.jetbrains.annotations.NotNull;
* Represents a fluid type.
*/
public interface Fluid extends OldEnum<Fluid>, Keyed {
+ Fluid[] EMPTY_ARRAY = new Fluid[0]; // Plazma - Reduce allocations
/**
* No fluid.
@@ -57,6 +58,6 @@ public interface Fluid extends OldEnum<Fluid>, Keyed {
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Fluid[] values() {
- return Lists.newArrayList(Registry.FLUID).toArray(new Fluid[0]);
+ return Lists.newArrayList(Registry.FLUID).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/org/bukkit/attribute/Attribute.java b/src/main/java/org/bukkit/attribute/Attribute.java
index 521f035409ee61a9ad73d39bec938f2938892570..6e53135579426cb677bf34a0813db8268d550428 100644
--- a/src/main/java/org/bukkit/attribute/Attribute.java
+++ b/src/main/java/org/bukkit/attribute/Attribute.java
@@ -15,6 +15,7 @@ import org.jetbrains.annotations.NotNull;
* Types of attributes which may be present on an {@link Attributable}.
*/
public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
+ Attribute[] EMPTY_ARRAY = new Attribute[0]; // Plazma - Reduce allocations
/**
* Maximum health of an Entity.
@@ -170,6 +171,6 @@ public interface Attribute extends OldEnum<Attribute>, Keyed, Translatable, net.
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Attribute[] values() {
- return Lists.newArrayList(Registry.ATTRIBUTE).toArray(new Attribute[0]);
+ return Lists.newArrayList(Registry.ATTRIBUTE).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/org/bukkit/block/Biome.java b/src/main/java/org/bukkit/block/Biome.java
index 20fc2b30fdcdedb012dfe129e746d0b9e162fc36..ca97debfd1a204d15bf5f6c176612cccc2596537 100644
--- a/src/main/java/org/bukkit/block/Biome.java
+++ b/src/main/java/org/bukkit/block/Biome.java
@@ -21,6 +21,7 @@ import org.jetbrains.annotations.NotNull;
* which can be accessed via {@link Registry#BIOME}.
*/
public interface Biome extends OldEnum<Biome>, Keyed, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
+ Biome[] EMPTY_ARRAY = new Biome[0]; // Plazma - Reduce allocations
Biome OCEAN = getBiome("ocean");
Biome PLAINS = getBiome("plains");
@@ -125,7 +126,7 @@ public interface Biome extends OldEnum<Biome>, Keyed, net.kyori.adventure.transl
@NotNull
@Deprecated(since = "1.21.3", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Biome[] values() {
- return Lists.newArrayList(Registry.BIOME).toArray(new Biome[0]);
+ return Lists.newArrayList(Registry.BIOME).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
// Paper start
diff --git a/src/main/java/org/bukkit/block/banner/PatternType.java b/src/main/java/org/bukkit/block/banner/PatternType.java
index 24b58ed80f3dd7c6b35bb18071000af845d18ba4..13ad0ba6320acd054a665d1749871a14cfd1a520 100644
--- a/src/main/java/org/bukkit/block/banner/PatternType.java
+++ b/src/main/java/org/bukkit/block/banner/PatternType.java
@@ -12,6 +12,8 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public interface PatternType extends OldEnum<PatternType>, Keyed {
+ PatternType[] EMPTY_ARRAY = new PatternType[0]; // Plazma - Reduce allocations
+
PatternType BASE = getType("base");
PatternType SQUARE_BOTTOM_LEFT = getType("square_bottom_left");
PatternType SQUARE_BOTTOM_RIGHT = getType("square_bottom_right");
@@ -140,6 +142,6 @@ public interface PatternType extends OldEnum<PatternType>, Keyed {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static PatternType[] values() {
- return Lists.newArrayList(Registry.BANNER_PATTERN).toArray(new PatternType[0]);
+ return Lists.newArrayList(Registry.BANNER_PATTERN).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/org/bukkit/command/Command.java b/src/main/java/org/bukkit/command/Command.java
index 74384a56eebbce41d431db2507c55eddbcf50a41..ef3afe91312de1d0fb38d985e0421ceae59d7e57 100644
--- a/src/main/java/org/bukkit/command/Command.java
+++ b/src/main/java/org/bukkit/command/Command.java
@@ -58,6 +58,19 @@ public abstract class Command {
this.activeAliases = new ArrayList<String>(aliases);
}
+ // Plazma start - Reduce allocations
+ /**
+ * Executes the command, returning its success
+ *
+ * @param sender Source object which is executing this command
+ * @param commandLabel The alias of the command used
+ * @return true if the command was successful, otherwise false
+ */
+ public boolean execute(@NotNull CommandSender sender, @NotNull String commandLabel) {
+ return this.execute(sender, commandLabel, org.plazmamc.plazma.constants.Null.STRING);
+ }
+ // Plazma end - Reduce allocations
+
/**
* Executes the command, returning its success
*
diff --git a/src/main/java/org/bukkit/enchantments/Enchantment.java b/src/main/java/org/bukkit/enchantments/Enchantment.java
index a824ac90e78d3d7f90b01397270e54422d88e8b9..95df10ad8a53942de435cec7db57c1bb496097dc 100644
--- a/src/main/java/org/bukkit/enchantments/Enchantment.java
+++ b/src/main/java/org/bukkit/enchantments/Enchantment.java
@@ -15,6 +15,8 @@ import org.jetbrains.annotations.Nullable;
* The various type of enchantments that may be added to armour or weapons
*/
public abstract class Enchantment implements Keyed, Translatable, net.kyori.adventure.translation.Translatable { // Paper - Adventure translations
+ private static final Enchantment[] EMPTY_ARRAY = new Enchantment[0]; // Plazma - Reduce allocations
+
/**
* Provides protection against environmental damage
*/
@@ -536,6 +538,6 @@ public abstract class Enchantment implements Keyed, Translatable, net.kyori.adve
@NotNull
@Deprecated(since = "1.20.3")
public static Enchantment[] values() {
- return Lists.newArrayList(Registry.ENCHANTMENT).toArray(new Enchantment[0]);
+ return Lists.newArrayList(Registry.ENCHANTMENT).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/org/bukkit/entity/Cat.java b/src/main/java/org/bukkit/entity/Cat.java
index fca4671c6976aee9e981ef344244f9322651d0c9..7dc1744fba576683155e7970832794c05ceff768 100644
--- a/src/main/java/org/bukkit/entity/Cat.java
+++ b/src/main/java/org/bukkit/entity/Cat.java
@@ -51,6 +51,7 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
* Represents the various different cat types there are.
*/
interface Type extends OldEnum<Type>, Keyed {
+ Type[] EMPTY_ARRAY = new Type[0]; // Plazma - Reduce allocations
Type TABBY = getType("tabby");
Type BLACK = getType("black");
@@ -89,7 +90,7 @@ public interface Cat extends Tameable, Sittable, io.papermc.paper.entity.CollarC
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Type[] values() {
- return Lists.newArrayList(Registry.CAT_VARIANT).toArray(new Type[0]);
+ return Lists.newArrayList(Registry.CAT_VARIANT).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/org/bukkit/entity/Frog.java b/src/main/java/org/bukkit/entity/Frog.java
index f661a6b4797dd814a197e9245bcb2ddf2fca773f..58bf414cd753299abc54c45b3036d3fdbf9170dc 100644
--- a/src/main/java/org/bukkit/entity/Frog.java
+++ b/src/main/java/org/bukkit/entity/Frog.java
@@ -49,6 +49,7 @@ public interface Frog extends Animals {
* Represents the variant of a frog - ie its color.
*/
interface Variant extends OldEnum<Variant>, Keyed {
+ Variant[] EMPTY_ARRAY = new Variant[0]; // Plazma - Reduce allocations
/**
* Temperate (brown-orange) frog.
@@ -88,7 +89,7 @@ public interface Frog extends Animals {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Variant[] values() {
- return Lists.newArrayList(Registry.FROG_VARIANT).toArray(new Variant[0]);
+ return Lists.newArrayList(Registry.FROG_VARIANT).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
}
}
diff --git a/src/main/java/org/bukkit/entity/Villager.java b/src/main/java/org/bukkit/entity/Villager.java
index 9c722a762c88a88bb5ef18c3b9eab8b371360dac..127bc2aab7fb36df206d53f3e6042bb6c920878e 100644
--- a/src/main/java/org/bukkit/entity/Villager.java
+++ b/src/main/java/org/bukkit/entity/Villager.java
@@ -170,6 +170,7 @@ public interface Villager extends AbstractVillager {
* in.
*/
interface Type extends OldEnum<Type>, Keyed {
+ Type[] EMPTY_ARRAY = new Type[0]; // Plazma - Reduce allocations
Type DESERT = getType("desert");
Type JUNGLE = getType("jungle");
@@ -204,7 +205,7 @@ public interface Villager extends AbstractVillager {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Type[] values() {
- return Lists.newArrayList(Registry.VILLAGER_TYPE).toArray(new Type[0]);
+ return Lists.newArrayList(Registry.VILLAGER_TYPE).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
}
@@ -213,6 +214,7 @@ public interface Villager extends AbstractVillager {
* Villagers have different trading options depending on their profession,
*/
interface Profession extends OldEnum<Profession>, Keyed, net.kyori.adventure.translation.Translatable {
+ Profession[] EMPTY_ARRAY = new Profession[0]; // Plazma - Reduce allocations
Profession NONE = getProfession("none");
/**
@@ -311,7 +313,7 @@ public interface Villager extends AbstractVillager {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Profession[] values() {
- return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(new Profession[0]);
+ return Lists.newArrayList(Registry.VILLAGER_PROFESSION).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
// Paper start
diff --git a/src/main/java/org/bukkit/map/MapCursor.java b/src/main/java/org/bukkit/map/MapCursor.java
index 7f5682c80ff25142e7c8fa14e03b4a62fc5c01d3..5fbcdf637b1e0162276e668d9ebe4a8648a29b8a 100644
--- a/src/main/java/org/bukkit/map/MapCursor.java
+++ b/src/main/java/org/bukkit/map/MapCursor.java
@@ -286,6 +286,7 @@ public final class MapCursor {
* resource pack.
*/
public interface Type extends OldEnum<Type>, Keyed {
+ Type[] EMPTY_ARRAY = new Type[0]; // Plazma - Reduce allocations
Type PLAYER = getType("player");
Type FRAME = getType("frame");
@@ -387,7 +388,7 @@ public final class MapCursor {
@NotNull
@Deprecated(since = "1.21", forRemoval = true) @org.jetbrains.annotations.ApiStatus.ScheduledForRemoval(inVersion = "1.22") // Paper - will be removed via asm-utils
static Type[] values() {
- return Lists.newArrayList(Registry.MAP_DECORATION_TYPE).toArray(new Type[0]);
+ return Lists.newArrayList(Registry.MAP_DECORATION_TYPE).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/org/bukkit/plugin/SimplePluginManager.java b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
index 2f8d3b7a5b25e323f892d2ec5eb7c3412a816ea4..22e358f7a83d84745c32ff9f04d79d51d8d92131 100644
--- a/src/main/java/org/bukkit/plugin/SimplePluginManager.java
+++ b/src/main/java/org/bukkit/plugin/SimplePluginManager.java
@@ -47,6 +47,7 @@ import org.jetbrains.annotations.Nullable;
@Deprecated(forRemoval = true) // Paper - This implementation may be replaced in a future version of Paper.
// Plugins may still reflect into this class to modify permission logic for the time being.
public final class SimplePluginManager implements PluginManager {
+ public static final Plugin[] EMPTY_PLUGIN = new Plugin[0]; // Plazma - Reduce allocations
private final Server server;
private final Map<Pattern, PluginLoader> fileAssociations = new HashMap<Pattern, PluginLoader>();
private final List<Plugin> plugins = new ArrayList<Plugin>();
@@ -133,7 +134,7 @@ public final class SimplePluginManager implements PluginManager {
this.server.getLogger().log(Level.SEVERE, "Plugin loading error!", e);
}
}
- return pluginList.toArray(new Plugin[0]);
+ return pluginList.toArray(EMPTY_PLUGIN); // Plazma - Reduce allocations
}
Preconditions.checkArgument(directory != null, "Directory cannot be null");
Preconditions.checkArgument(directory.isDirectory(), "Directory must be a directory");
diff --git a/src/main/java/org/bukkit/potion/PotionEffectType.java b/src/main/java/org/bukkit/potion/PotionEffectType.java
index e4cfdc80c9e49fc7992183022bdf2f36aae0d95a..0cd7987e935e2b7ede759af3db9af04366930e19 100644
--- a/src/main/java/org/bukkit/potion/PotionEffectType.java
+++ b/src/main/java/org/bukkit/potion/PotionEffectType.java
@@ -19,6 +19,7 @@ import org.jetbrains.annotations.Nullable;
*/
public abstract class PotionEffectType implements Keyed, Translatable, net.kyori.adventure.translation.Translatable, io.papermc.paper.world.flag.FeatureDependant { // Paper - implement Translatable & feature flag API
private static final BiMap<Integer, PotionEffectType> ID_MAP = HashBiMap.create();
+ private static final PotionEffectType[] EMPTY_ARRAY = new PotionEffectType[0]; // Plazma - Reduce allocations
/**
* Increases movement speed.
@@ -358,7 +359,7 @@ public abstract class PotionEffectType implements Keyed, Translatable, net.kyori
@NotNull
@Deprecated(since = "1.20.3")
public static PotionEffectType[] values() {
- return Lists.newArrayList(Registry.EFFECT).toArray(new PotionEffectType[0]);
+ return Lists.newArrayList(Registry.EFFECT).toArray(EMPTY_ARRAY); // Plazma - Reduce allocations
}
// Paper start
diff --git a/src/main/java/org/plazmamc/plazma/Constants.java b/src/main/java/org/plazmamc/plazma/Constants.java
new file mode 100644
index 0000000000000000000000000000000000000000..137f4f511998828476c2ac408a9a76289a44d071
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/Constants.java
@@ -0,0 +1,7 @@
+package org.plazmamc.plazma;
+
+public interface Constants {
+
+ int[] ZERO_INT_ARRAY = new int[]{0};
+
+}
diff --git a/src/main/java/org/plazmamc/plazma/constants/Null.java b/src/main/java/org/plazmamc/plazma/constants/Null.java
new file mode 100644
index 0000000000000000000000000000000000000000..6018a9230d0d92e23f09cc5b5cc042446bed9962
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/constants/Null.java
@@ -0,0 +1,25 @@
+package org.plazmamc.plazma.constants;
+
+import net.md_5.bungee.api.chat.BaseComponent;
+import java.net.URL;
+import java.util.concurrent.CompletableFuture;
+import java.util.regex.Pattern;
+
+public interface Null {
+
+ byte[] BYTE = new byte[0];
+ short[] SHORT = new short[0];
+ int[] INT = new int[0];
+ long[] LONG = new long[0];
+
+ Object[] OBJECT = new Object[0];
+ String[] STRING = new String[0];
+ URL[] URL = new URL[0];
+ Pattern[] REGEX = new Pattern[0];
+
+ BaseComponent[] COMPONENT = new BaseComponent[0];
+
+ @SuppressWarnings("rawtypes")
+ CompletableFuture[] FUTURE = new CompletableFuture[0];
+
+}

View File

@@ -0,0 +1,91 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Mon, 10 Jun 2024 12:27:08 -0300
Subject: [PATCH] Add ClientboundPacketPreDispatchEvent
diff --git a/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java b/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..9a279ad0b0f9b63f5f3a37977076e0bb805cd56d
--- /dev/null
+++ b/src/main/java/net/sparklypower/sparklypaper/event/packet/ClientboundPacketPreDispatchEvent.java
@@ -0,0 +1,79 @@
+package net.sparklypower.sparklypaper.event.packet;
+
+import org.bukkit.entity.Player;
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Called before a packet is dispatched to a connection.
+ * <p>
+ * Compared to other solutions like ProtocolLib, this has the advantage that this is called eariler on the packet sending cycle, before the packet is added to the packet queue, allowing for
+ * main thread access of resources without worrying about race conditions.
+ * <p>
+ * The asynchronously state of this event is undefined, the event may be called on an async or on a sync thread, depending on where the packet was sent.
+ */
+public class ClientboundPacketPreDispatchEvent extends Event implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private boolean isCancelled = false;
+ private final Player player;
+ private Object packet;
+
+ public ClientboundPacketPreDispatchEvent(boolean isAsync, @Nullable Player player, @NotNull Object packet) {
+ super(isAsync);
+ this.player = player;
+ this.packet = packet;
+ }
+
+ /**
+ * Gets the player associated with this packet.
+ * <p>
+ * Depending on which phase the packet is from, the player may be null
+ *
+ * @return the player associated with this packet
+ */
+ @Nullable
+ public Player getPlayer() {
+ return player;
+ }
+
+ /**
+ * Gets the packet associated with this event.
+ *
+ * @return the packet associated with this event
+ */
+ @NotNull
+ public Object getPacket() {
+ return packet;
+ }
+
+ /**
+ * Sets the packet associated with this event.
+ */
+ public void setPacket(@NotNull Object packet) {
+ this.packet = packet;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return isCancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.isCancelled = cancel;
+ }
+}

View File

@@ -0,0 +1,76 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Mon, 10 Jun 2024 14:38:59 -0300
Subject: [PATCH] Add PlayerBlockDestroySpeedEvent
diff --git a/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java b/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..d5e097dad04ed62088aade42ba59866029369326
--- /dev/null
+++ b/src/main/java/net/sparklypower/sparklypaper/event/block/PlayerBlockDestroySpeedEvent.java
@@ -0,0 +1,64 @@
+package net.sparklypower.sparklypaper.event.block;
+
+import org.bukkit.block.Block;
+import org.bukkit.entity.Player;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.bukkit.event.block.BlockEvent;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when the block destroy speed is calculated for a block that a player is breaking.
+ * <p>
+ * Useful for custom blocks to override a server side block destroy speed to fix desynchronization issues between the server and the client. (Example: Chiseled bookshelves on the server side that are overriden by target blocks on the client side)
+ * <p>
+ * Keep in mind that you should use this event to synchronize the block destroy speed between the server and the client! Not keeping both destroy speeds in sync will cause desync issues!
+ */
+public class PlayerBlockDestroySpeedEvent extends BlockEvent {
+ private static final HandlerList handlers = new HandlerList();
+ private final Player player;
+ private float destroySpeed;
+
+ public PlayerBlockDestroySpeedEvent(@NotNull Player player, @NotNull Block block, float destroySpeed) {
+ super(block);
+ this.player = player;
+ this.destroySpeed = destroySpeed;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+
+ /**
+ * Gets the Player that is breaking the block involved in this event.
+ *
+ * @return The Player that is breaking the block involved in this event
+ */
+ @NotNull
+ public Player getPlayer() {
+ return player;
+ }
+
+ /**
+ * Gets the block destroy speed of the block involved in this event.
+ *
+ * @return the block destroy speed of the block involved in this event.
+ */
+ public float getDestroySpeed() {
+ return destroySpeed;
+ }
+
+ /**
+ * Sets the block destroy speed of the block involved in this event.
+ */
+ public void setDestroySpeed(float destroySpeed) {
+ this.destroySpeed = destroySpeed;
+ }
+}

View File

@@ -0,0 +1,83 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Tue, 25 Jun 2024 02:54:47 -0300
Subject: [PATCH] Add CraftItemRecipeEvent
Used when a player OR a crafter block crafts an item, as an alternative to PrepareItemCraftEvent and CraftItemEvent, because both events are not triggered when a item is crafted from a crafter
diff --git a/src/main/java/net/sparklypower/sparklypaper/event/inventory/CraftItemRecipeEvent.java b/src/main/java/net/sparklypower/sparklypaper/event/inventory/CraftItemRecipeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..129e5244fd0928fc21d9aa7d4bc28e89c1408be0
--- /dev/null
+++ b/src/main/java/net/sparklypower/sparklypaper/event/inventory/CraftItemRecipeEvent.java
@@ -0,0 +1,70 @@
+package net.sparklypower.sparklypaper.event.inventory;
+
+import org.bukkit.event.Cancellable;
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.bukkit.inventory.*;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Called when the recipe of an Item is completed inside a crafting matrix.
+ *
+ * This is an alternate version of [org.bukkit.event.inventory.CraftItemEvent], where this one is called for player crafting items and crafters.
+ */
+public class CraftItemRecipeEvent extends Event implements Cancellable {
+ private static final HandlerList handlers = new HandlerList();
+ private final Recipe recipe;
+ private final ItemStack @Nullable [] matrix;
+ private ItemStack result;
+ private boolean isCancelled = false;
+
+ public CraftItemRecipeEvent(@NotNull ItemStack @Nullable [] matrix, @NotNull Recipe recipe, @Nullable ItemStack result) {
+ this.matrix = matrix;
+ this.recipe = recipe;
+ this.result = result;
+ }
+
+ public void setResult(@Nullable ItemStack result) {
+ this.result = result;
+ }
+
+ @Nullable
+ public ItemStack getResult() {
+ return result;
+ }
+
+ /**
+ * @return A copy of the current recipe on the crafting matrix.
+ */
+ @NotNull
+ public Recipe getRecipe() {
+ return recipe;
+ }
+
+ public @Nullable ItemStack[] getCraftingMatrix() {
+ return matrix;
+ }
+
+ @Override
+ public boolean isCancelled() {
+ return isCancelled;
+ }
+
+ @Override
+ public void setCancelled(boolean cancel) {
+ this.isCancelled = cancel;
+ }
+
+ @NotNull
+ @Override
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}
+

View File

@@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Mon, 10 Jun 2024 12:22:15 -0300
Subject: [PATCH] Add ClientboundPacketPreDispatchEvent
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 3e550f8e7cd4f4e16f499a8a2a4b95420270f07a..3bcff05a99662c28cc490579162a1f05b55b1cda 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -450,6 +450,18 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
return;
}
+ // SparklyPaper start - Add ClientboundPacketPreDispatchEvent
+ net.minecraft.server.level.ServerPlayer serverPlayer = this.getPlayer();
+ org.bukkit.craftbukkit.entity.CraftPlayer craftPlayer = null;
+ if (serverPlayer != null)
+ craftPlayer = serverPlayer.getBukkitEntity();
+ net.sparklypower.sparklypaper.event.packet.ClientboundPacketPreDispatchEvent event = new net.sparklypower.sparklypaper.event.packet.ClientboundPacketPreDispatchEvent(!org.bukkit.Bukkit.isPrimaryThread(), craftPlayer, packet);
+ org.bukkit.Bukkit.getPluginManager().callEvent(event);
+ if (event.isCancelled())
+ return;
+ packet = (Packet<?>) event.getPacket();
+ // SparklyPaper end
+
packet.onPacketDispatch(this.getPlayer());
if (connected && (InnerUtil.canSendImmediate(this, packet)
|| (io.papermc.paper.util.MCUtil.isMainThread() && packet.isReady() && this.pendingActions.isEmpty()

View File

@@ -0,0 +1,43 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Mon, 10 Jun 2024 14:39:10 -0300
Subject: [PATCH] Add PlayerBlockDestroySpeedEvent
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index 99fd67a78539133adf78d65e2c520ff3dd260301..96640ae707c9babe1c4f4895f39d4d7cfc71a765 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -336,6 +336,14 @@ public abstract class BlockBehaviour implements FeatureElement {
protected float getDestroyProgress(BlockState state, Player player, BlockGetter world, BlockPos pos) {
float f = state.getDestroySpeed(world, pos);
+ // SparklyPaper start - Add PlayerBlockDestroySpeedEvent
+ // *Technically* it seems that all getDestroyProgress calls use a LevelAccessor, but anyway...
+ if (world instanceof LevelAccessor) {
+ net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerBlockDestroySpeedEvent(player, (LevelAccessor) world, pos, f);
+ f = event.getDestroySpeed();
+ }
+ // SparklyPaper end
+
if (f == -1.0F) {
return 0.0F;
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index e37aaf77f94b97b736cc20ef070cefdff0400188..a46f0c810ee2b9679c0530e5e6d3505b3d1f661c 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -2271,4 +2271,13 @@ public class CraftEventFactory {
return event;
}
// Paper end - add EntityFertilizeEggEvent
+
+ // SparklyPaper start - add PlayerBlockDestroySpeedEvent
+ public static net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent callPlayerBlockDestroySpeedEvent(net.minecraft.world.entity.player.Player player, LevelAccessor world, BlockPos blockPos, float destroySpeed) {
+ org.bukkit.block.Block block = CraftBlock.at(world, blockPos);
+ net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent event = new net.sparklypower.sparklypaper.event.block.PlayerBlockDestroySpeedEvent((Player) player.getBukkitEntity(), block, destroySpeed);
+ event.callEvent();
+ return event;
+ }
+ // SparklyPaper end
}

View File

@@ -0,0 +1,80 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MrPowerGamerBR <git@mrpowergamerbr.com>
Date: Tue, 25 Jun 2024 02:52:32 -0300
Subject: [PATCH] Add CraftItemRecipeEvent
Used when a player OR a crafter block crafts an item, as an alternative to PrepareItemCraftEvent and CraftItemEvent, because both events are not triggered when a item is crafted from a crafter
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index b5d5dbc50a7b8c40739a15f164ffd08fdc534f9c..01a67fde6c823cac52a6b09720f09acc825d3f86 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -3218,6 +3218,21 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
} else {
event = new CraftItemEvent(recipe, inventory, type, packet.getSlotNum(), click, action);
}
+ // SparklyPaper start - add CraftItemRecipeEvent
+ // We will pigback a bit on the current implementation
+ net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent craftItemRecipeEvent = new net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent(
+ ((CraftingInventory) top).getMatrix(), // We cannot use the top inventory directly because (it seems) that the first slot is the "result" slot
+ recipe,
+ event.getCurrentItem()
+ );
+ if (craftItemRecipeEvent.callEvent()) {
+ event.setCurrentItem(craftItemRecipeEvent.getResult());
+ } else {
+ event.setCancelled(true);
+ cancelled = true;
+ event.setCurrentItem(craftItemRecipeEvent.getResult());
+ }
+ // SparklyPaper end
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
index 0e609b1e3abd50b415d8376dc550375a8a0251b6..8dbac20e32b70879eeee1c3563948e36c2eae342 100644
--- a/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/CrafterBlock.java
@@ -203,6 +203,13 @@ public class CrafterBlock extends BaseEntityBlock {
}
itemstack = CraftItemStack.asNMSCopy(event.getResult());
// CraftBukkit end
+ // SparklyPaper - add CraftItemRecipeEvent
+ net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent sparklyEvent = org.bukkit.craftbukkit.event.CraftEventFactory.callCraftItemRecipeEvent(crafterblockentity, recipeholder.toBukkitRecipe(), itemstack);
+ if (sparklyEvent.isCancelled()) {
+ return;
+ }
+ itemstack = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(sparklyEvent.getResult());
+ // SparklyPaper end
if (itemstack.isEmpty()) {
world.levelEvent(1050, pos, 0);
} else {
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index a46f0c810ee2b9679c0530e5e6d3505b3d1f661c..85926a55066ac793b2e4cfe3502f9ab201df91a3 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -1471,6 +1471,24 @@ public class CraftEventFactory {
Bukkit.getPluginManager().callEvent(crafterCraftEvent);
return crafterCraftEvent;
}
+
+ // SparklyPaper start - add CraftItemRecipeEvent
+ public static net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent callCraftItemRecipeEvent(net.minecraft.world.inventory.CraftingContainer container, Recipe recipe, ItemStack result) {
+ org.bukkit.inventory.ItemStack[] matrix = new org.bukkit.inventory.ItemStack[container.getItems().size()];
+ int i = 0;
+ for (ItemStack item : container.getItems()) {
+ matrix[i] = CraftItemStack.asCraftMirror(item);
+ i++;
+ }
+ org.bukkit.inventory.ItemStack bukkitResult = CraftItemStack.asCraftMirror(result);
+
+ net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent event = new net.sparklypower.sparklypaper.event.inventory.CraftItemRecipeEvent(matrix, recipe, bukkitResult);
+ Bukkit.getPluginManager().callEvent(event);
+
+ return event;
+ }
+ // SparklyPaper end
+
// Paper start
@Deprecated
public static com.destroystokyo.paper.event.entity.ProjectileCollideEvent callProjectileCollideEvent(Entity entity, EntityHitResult position) {

View File

@@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Wed, 6 Sep 2023 15:04:25 +0900
Subject: [PATCH] Optimize-spigot-event-bus
Subject: [PATCH] Optimize Spigot event bus
diff --git a/src/main/java/org/bukkit/event/Event.java b/src/main/java/org/bukkit/event/Event.java
index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..45b8ee1945202cc673905aab5c90985c01cb205e 100644
index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..f1b3559bf9d2023ca59330c65e6e34714759dd9d 100644
--- a/src/main/java/org/bukkit/event/Event.java
+++ b/src/main/java/org/bukkit/event/Event.java
@@ -14,7 +14,7 @@ import org.jetbrains.annotations.NotNull;
@@ -48,7 +48,7 @@ index 8ec56cd6b8e0f5c5dd8c7c88b4671e18dcf109d0..45b8ee1945202cc673905aab5c90985c
+ public final @NotNull net.kyori.adventure.util.TriState asynchronous() {
+ return this.async;
+ }
+ // Plazma end
+ // Plazma end - Optimize Spigot event bus
+
// Paper start
/**

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <blake.galbreath@gmail.com>
Date: Sun, 5 May 2019 12:58:19 -0500
Subject: [PATCH] LivingEntity safeFallDistance
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index b777e530122549455dcce6fac8d4a151c1c0af42..57a3e330043077f042a284c99e2631e1582cb32c 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1447,4 +1447,24 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setBodyYaw(float bodyYaw);
// Paper end - body yaw API
+
+ // Purpur start
+ /**
+ * Gets the distance (in blocks) this entity can safely fall without taking damage
+ *
+ * @return Safe fall distance
+ * @deprecated use {@link org.bukkit.attribute.Attribute#GENERIC_SAFE_FALL_DISTANCE} instead
+ */
+ @Deprecated
+ float getSafeFallDistance();
+
+ /**
+ * Set the distance (in blocks) this entity can safely fall without taking damage
+ *
+ * @param safeFallDistance Safe fall distance
+ * @deprecated use {@link org.bukkit.attribute.Attribute#GENERIC_SAFE_FALL_DISTANCE} instead
+ */
+ @Deprecated
+ void setSafeFallDistance(float safeFallDistance);
+ // Purpur end
}

View File

@@ -0,0 +1,24 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
Date: Mon, 17 Aug 2020 21:50:32 -0500
Subject: [PATCH] LivingEntity#broadcastItemBreak
diff --git a/src/main/java/org/bukkit/entity/LivingEntity.java b/src/main/java/org/bukkit/entity/LivingEntity.java
index 5c29956c6db53440322330ff723c7087193641f1..e1079c5c4be99e75a646c090189678dd131f210e 100644
--- a/src/main/java/org/bukkit/entity/LivingEntity.java
+++ b/src/main/java/org/bukkit/entity/LivingEntity.java
@@ -1447,4 +1447,13 @@ public interface LivingEntity extends Attributable, Damageable, ProjectileSource
*/
void setBodyYaw(float bodyYaw);
// Paper end - body yaw API
+
+ // Purpur start
+ /**
+ * Play item break animation for the item in specified equipment slot
+ *
+ * @param slot Equipment slot to play break animation for
+ */
+ void broadcastItemBreak(@NotNull org.bukkit.inventory.EquipmentSlot slot);
+ // Purpur end
}

View File

@@ -0,0 +1,204 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Racci <tangentmoons@gmail.com>
Date: Fri, 3 Dec 2021 23:48:26 +1100
Subject: [PATCH] Potion NamespacedKey
diff --git a/src/main/java/org/bukkit/potion/PotionEffect.java b/src/main/java/org/bukkit/potion/PotionEffect.java
index c8ab330ef171795d08fa201cf8320703c7f1c66b..93e2ea220dc03c122f82af65d5e9fda5b582290c 100644
--- a/src/main/java/org/bukkit/potion/PotionEffect.java
+++ b/src/main/java/org/bukkit/potion/PotionEffect.java
@@ -33,6 +33,7 @@ public class PotionEffect implements ConfigurationSerializable {
private static final String AMBIENT = "ambient";
private static final String PARTICLES = "has-particles";
private static final String ICON = "has-icon";
+ private static final String KEY = "namespacedKey"; // Purpur
private final int amplifier;
private final int duration;
private final PotionEffectType type;
@@ -40,6 +41,7 @@ public class PotionEffect implements ConfigurationSerializable {
private final boolean particles;
private final boolean icon;
private final PotionEffect hiddenEffect; // Paper
+ @Nullable private final NamespacedKey key; // Purpur
/**
* Creates a potion effect.
@@ -50,11 +52,12 @@ public class PotionEffect implements ConfigurationSerializable {
* @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
* @param particles the particle status, see {@link PotionEffect#hasParticles()}
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
* @param hiddenEffect the hidden PotionEffect
* @hidden Internal-- hidden effects are only shown internally
*/
@org.jetbrains.annotations.ApiStatus.Internal // Paper
- public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect) { // Paper
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable PotionEffect hiddenEffect, @Nullable NamespacedKey key) { // Paper // Purpur
Preconditions.checkArgument(type != null, "effect type cannot be null");
this.type = type;
this.duration = duration;
@@ -62,6 +65,7 @@ public class PotionEffect implements ConfigurationSerializable {
this.ambient = ambient;
this.particles = particles;
this.icon = icon;
+ this.key = key; // Purpur
// Paper start
this.hiddenEffect = hiddenEffect;
}
@@ -77,10 +81,27 @@ public class PotionEffect implements ConfigurationSerializable {
* @param icon the icon status, see {@link PotionEffect#hasIcon()}
*/
public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon) {
- this(type, duration, amplifier, ambient, particles, icon, null);
+ this(type, duration, amplifier, ambient, particles, icon, null, null); // Purpur
// Paper end
}
+ // Purpur start
+ /**
+ * Creates a potion effect.
+ * @param type effect type
+ * @param duration measured in ticks, see {@link
+ * PotionEffect#getDuration()}
+ * @param amplifier the amplifier, see {@link PotionEffect#getAmplifier()}
+ * @param ambient the ambient status, see {@link PotionEffect#isAmbient()}
+ * @param particles the particle status, see {@link PotionEffect#hasParticles()}
+ * @param icon the icon status, see {@link PotionEffect#hasIcon()}
+ * @param key the namespacedKey, see {@link PotionEffect#getKey()}
+ */
+ public PotionEffect(@NotNull PotionEffectType type, int duration, int amplifier, boolean ambient, boolean particles, boolean icon, @Nullable NamespacedKey key) {
+ this(type, duration, amplifier, ambient, particles, icon, null, key);
+ }
+ // Purpur end
+
/**
* Creates a potion effect with no defined color.
*
@@ -126,33 +147,33 @@ public class PotionEffect implements ConfigurationSerializable {
* @param map the map to deserialize from
*/
public PotionEffect(@NotNull Map<String, Object> map) {
- this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT)); // Paper
+ this(getEffectType(map), getInt(map, DURATION), getInt(map, AMPLIFIER), getBool(map, AMBIENT, false), getBool(map, PARTICLES, true), getBool(map, ICON, getBool(map, PARTICLES, true)), (PotionEffect) map.get(HIDDEN_EFFECT), getKey(map)); // Paper // Purpur - getKey
}
// Paper start
@NotNull
public PotionEffect withType(@NotNull PotionEffectType type) {
- return new PotionEffect(type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withDuration(int duration) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withAmplifier(int amplifier) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withAmbient(boolean ambient) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withParticles(boolean particles) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
@NotNull
public PotionEffect withIcon(boolean icon) {
- return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon);
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key); // Purpur - add key
}
/**
@@ -169,6 +190,13 @@ public class PotionEffect implements ConfigurationSerializable {
}
// Paper end
+ // Purpur start
+ @NotNull
+ public PotionEffect withKey(@Nullable NamespacedKey key) {
+ return new PotionEffect(this.type, duration, amplifier, ambient, particles, icon, key);
+ }
+ // Purpur end
+
@NotNull
private static PotionEffectType getEffectType(@NotNull Map<?, ?> map) {
PotionEffectType effect;
@@ -201,6 +229,17 @@ public class PotionEffect implements ConfigurationSerializable {
return def;
}
+ // Purpur start
+ @Nullable
+ private static NamespacedKey getKey(@NotNull Map<?, ?> map) {
+ Object key = map.get(KEY);
+ if (key instanceof String stringKey) {
+ return NamespacedKey.fromString(stringKey);
+ }
+ return null;
+ }
+ // Purpur end
+
@Override
@NotNull
public Map<String, Object> serialize() {
@@ -215,6 +254,11 @@ public class PotionEffect implements ConfigurationSerializable {
if (this.hiddenEffect != null) {
builder.put(HIDDEN_EFFECT, this.hiddenEffect);
}
+ // Purpur start
+ if (key != null) {
+ builder.put(KEY, key.toString());
+ }
+ // Purpur end
return builder.build();
// Paper end
}
@@ -243,7 +287,7 @@ public class PotionEffect implements ConfigurationSerializable {
return false;
}
PotionEffect that = (PotionEffect) obj;
- return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect); // Paper
+ return this.type.equals(that.type) && this.ambient == that.ambient && this.amplifier == that.amplifier && this.duration == that.duration && this.particles == that.particles && this.icon == that.icon && java.util.Objects.equals(this.hiddenEffect, that.hiddenEffect) && this.key == that.key; // Paper // Purpur - add key
}
/**
@@ -339,6 +383,24 @@ public class PotionEffect implements ConfigurationSerializable {
return icon;
}
+
+ // Purpur start
+ /**
+ * @return if the key isn't the default namespacedKey
+ */
+ public boolean hasKey() {
+ return key != null;
+ }
+
+ /**
+ * @return the key attached to the potion
+ */
+ @Nullable
+ public NamespacedKey getKey() {
+ return key;
+ }
+ // Purpur end
+
@Override
public int hashCode() {
int hash = 1;
@@ -354,6 +416,6 @@ public class PotionEffect implements ConfigurationSerializable {
@Override
public String toString() {
- return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + '}'; // Paper
+ return "PotionEffect{" + "amplifier=" + amplifier + ", duration=" + duration + ", type=" + type + ", ambient=" + ambient + ", particles=" + particles + ", icon=" + icon + ", hiddenEffect=" + hiddenEffect + ", key=" + key + '}'; // Paper // Purpur - add key
}
}

View File

@@ -0,0 +1,60 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MelnCat <melncatuwu@gmail.com>
Date: Sat, 24 Sep 2022 10:50:33 -0700
Subject: [PATCH] Add item packet serialize event
diff --git a/src/main/java/org/purpurmc/purpur/event/packet/NetworkItemSerializeEvent.java b/src/main/java/org/purpurmc/purpur/event/packet/NetworkItemSerializeEvent.java
new file mode 100644
index 0000000000000000000000000000000000000000..c0da73d2ea83a6055e34894ba1c7506fc8667712
--- /dev/null
+++ b/src/main/java/org/purpurmc/purpur/event/packet/NetworkItemSerializeEvent.java
@@ -0,0 +1,48 @@
+package org.purpurmc.purpur.event.packet;
+
+import org.bukkit.event.Event;
+import org.bukkit.event.HandlerList;
+import org.bukkit.inventory.ItemStack;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Called when an item is about to be written to a packet.
+ */
+public class NetworkItemSerializeEvent extends Event {
+ private ItemStack itemStack;
+
+ public NetworkItemSerializeEvent(@NotNull ItemStack itemStack) {
+ super(!org.bukkit.Bukkit.isPrimaryThread());
+ this.itemStack = itemStack;
+ }
+
+ /**
+ * @return The item that is about to be serialized. Not mutable
+ */
+ @NotNull
+ public ItemStack getItemStack() {
+ return itemStack;
+ }
+
+ /**
+ * Sets the item that will be serialized.
+ *
+ * @param itemStack The item
+ */
+ public void setItemStack(@Nullable ItemStack itemStack) {
+ this.itemStack = itemStack;
+ }
+
+ private static final HandlerList handlers = new HandlerList();
+
+ @NotNull
+ public HandlerList getHandlers() {
+ return handlers;
+ }
+
+ @NotNull
+ public static HandlerList getHandlerList() {
+ return handlers;
+ }
+}

View File

@@ -0,0 +1,44 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Meln Cat <melncatuwu@gmail.com>
Date: Mon, 2 Oct 2023 17:42:19 -0700
Subject: [PATCH] Add hover lines API
diff --git a/src/main/java/org/bukkit/inventory/ItemFactory.java b/src/main/java/org/bukkit/inventory/ItemFactory.java
index 98a970a6582dca22e719a31559c7becea4725cb2..1cd2962ceb4fa0a0a3e28a09fa4ccef5802cd5c4 100644
--- a/src/main/java/org/bukkit/inventory/ItemFactory.java
+++ b/src/main/java/org/bukkit/inventory/ItemFactory.java
@@ -353,4 +353,14 @@ public interface ItemFactory {
*/
@NotNull ItemStack enchantWithLevels(@NotNull ItemStack itemStack, @org.jetbrains.annotations.Range(from = 1, to = 30) int levels, boolean allowTreasure, @NotNull java.util.Random random);
// Paper end - enchantWithLevels API
+
+ // Purpur start
+ /**
+ * Returns the lines of text shown when hovering over an item
+ * @param itemStack The ItemStack
+ * @param advanced Whether advanced tooltips are shown
+ * @return the list of Components
+ */
+ @NotNull java.util.List<net.kyori.adventure.text.@NotNull Component> getHoverLines(@NotNull ItemStack itemStack, boolean advanced);
+ // Purpur end
}
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java
index 6e9b4cbc81878616b1c48add5db534286d267b05..e497575b2f44bb8b3bb6fdda3ae2f5247cbb4679 100644
--- a/src/main/java/org/bukkit/inventory/ItemStack.java
+++ b/src/main/java/org/bukkit/inventory/ItemStack.java
@@ -1644,5 +1644,14 @@ public class ItemStack implements Cloneable, ConfigurationSerializable, Translat
}
return random.nextInt(unbreaking + 1) > 0;
}
+
+ /**
+ * Returns the lines of text shown when hovering over the item
+ * @param advanced Whether advanced tooltips are shown
+ * @return the list of Components
+ */
+ public @NotNull List<net.kyori.adventure.text.@NotNull Component> getHoverLines(boolean advanced) {
+ return Bukkit.getItemFactory().getHoverLines(this, advanced);
+ }
// Purpur end
}

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,78 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 14 Jan 2024 19:51:19 +0900
Subject: [PATCH] Build system changes
diff --git a/build.gradle.kts b/build.gradle.kts
index f083d422678f5fd21825439944af888fbdc9bf3c..e30b51ed329f0c66a2329da45996ef0fc0db8ffb 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -19,6 +19,7 @@ dependencies {
exclude("io.papermc.paper", "paper-api")
}
// Purpur end
+ /* // Plazma - Use libs.versions.toml
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
@@ -46,9 +47,32 @@ dependencies {
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
// Paper start - Use Velocity cipher
- implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
+ // Plazma start - Use libs.versions.toml
+ */
+ implementation(common.snakeyaml)
+ implementation(common.bundles.asm)
+ implementation(common.commons.lang2)
+ implementation(common.adventure.serializer.ansi)
+ implementation(common.log4j.core)
+ implementation(common.log4j.iostreams)
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core)
+ runtimeOnly(log4jPlugins.output)
+ alsoShade(log4jPlugins.output)
+
+ implementation(server.ansi)
+ implementation(server.bundles.implementation)
+ implementation(server.velocity) {
+ // Plazma end
isTransitive = false
}
+
+ runtimeOnly(common.bundles.maven)
+ runtimeOnly(common.maven.provider)
+ runtimeOnly(server.bundles.runtime)
+
+ testImplementation(common.bundles.test)
+ testImplementation(server.classgraph)
+ /* // Plazma - Use libs.versions.toml
// Paper end
runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
@@ -57,19 +81,22 @@ dependencies {
// Pufferfish start
implementation("org.yaml:snakeyaml:1.32")
- implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") {
+ */ // Plazma - Use libs.versions.toml
+ implementation(server.simpleyaml) { // Plazma - Use libs.versions.toml
exclude(group="org.yaml", module="snakeyaml")
}
// Pufferfish end
- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
+ //implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur // Plazma - Use libs.versions.toml
+ //implementation("org.mozilla:rhino-engine:1.7.14") // Purpur // Plazma - Use libs.versions.toml
implementation("dev.omega24:upnp4j:1.0") // Purpur
+ /* // Plazma - Use libs.versions.toml
testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
testImplementation("org.hamcrest:hamcrest:2.2")
testImplementation("org.mockito:mockito-core:5.5.0")
+ */ // Plazma - Use libs.versions.toml
}
val craftbukkitPackageVersion = "1_20_R2" // Paper

View File

@@ -1,60 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: IPECTER <ipectert@gmail.com>
Date: Tue, 30 May 2023 12:12:29 +0900
Subject: [PATCH] MC Dev fixes
diff --git a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
index 733134401fcba393053c7a2dfa1d0d44f8f79ff5..79fba35fc74723529bff7d8fdcca7de6407fb5ad 100644
--- a/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
+++ b/src/main/java/net/minecraft/util/datafix/fixes/LeavesFix.java
@@ -71,14 +71,14 @@ public class LeavesFix extends DataFix {
return this.fixTypeEverywhereTyped("Leaves fix", type, (typed) -> {
return typed.updateTyped(opticFinder, (typedx) -> {
int[] is = new int[]{0};
- Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed) -> {
- Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed.getAllTyped(opticFinder3).stream().map((typedx) -> {
- return new LeavesFix.LeavesSection(typedx, this.getInputSchema());
+ Typed<?> typed2 = typedx.updateTyped(opticFinder2, (typed2x) -> { // Plazma - decompile fix
+ Int2ObjectMap<LeavesFix.LeavesSection> int2ObjectMap = new Int2ObjectOpenHashMap<>(typed2x.getAllTyped(opticFinder3).stream().map((typedx2) -> { // Plazma - decompile fix
+ return new LeavesFix.LeavesSection(typedx2, this.getInputSchema()); // Plazma - decompile fix
}).collect(Collectors.toMap(LeavesFix.Section::getIndex, (leavesSection) -> {
return leavesSection;
})));
if (int2ObjectMap.values().stream().allMatch(LeavesFix.Section::isSkippable)) {
- return typed;
+ return typed2x; // Plazma - decompile fix
} else {
List<IntSet> list = Lists.newArrayList();
@@ -134,8 +134,8 @@ public class LeavesFix extends DataFix {
}
}
- return typed.updateTyped(opticFinder3, (typedx) -> {
- return int2ObjectMap.get(typedx.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx);
+ return typed.updateTyped(opticFinder3, (typedx2) -> { // Plazma - decompile fix
+ return int2ObjectMap.get(typedx2.get(DSL.remainderFinder()).get("Y").asInt(0)).write(typedx2); // Plazma - decompile fix
});
}
});
@@ -298,8 +298,8 @@ public class LeavesFix extends DataFix {
throw new IllegalStateException("Block state type is not what was expected.");
} else {
Optional<List<Pair<String, Dynamic<?>>>> optional = typed.getOptional(this.paletteFinder);
- this.palette = optional.map((list) -> {
- return list.stream().map(Pair::getSecond).collect(Collectors.toList());
+ this.palette = (List) optional.map((list) -> { // Plazma - decompile fix
+ return (List) list.stream().map(Pair::getSecond).collect(Collectors.toList()); // Plazma - decompile fix
}).orElse(ImmutableList.of());
Dynamic<?> dynamic = typed.get(DSL.remainderFinder());
this.index = dynamic.get("Y").asInt(0);
@@ -321,7 +321,7 @@ public class LeavesFix extends DataFix {
public Typed<?> write(Typed<?> typed) {
return this.isSkippable() ? typed : typed.update(DSL.remainderFinder(), (dynamic) -> {
return dynamic.set("BlockStates", dynamic.createLongList(Arrays.stream(this.storage.getRaw())));
- }).set(this.paletteFinder, this.palette.stream().map((dynamic) -> {
+ }).set(this.paletteFinder, (List) this.palette.stream().map((dynamic) -> { // Plazma - decompile fix
return Pair.of(References.BLOCK_STATE.typeName(), dynamic);
}).collect(Collectors.toList()));
}

View File

@@ -1,430 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <alphakr93@outlook.com>
Date: Wed, 21 Dec 2022 19:31:24 +0900
Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts
index e30b51ed329f0c66a2329da45996ef0fc0db8ffb..d91928799014596de519d1a1b3f1bb0a80ac925c 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -14,7 +14,7 @@ val alsoShade: Configuration by configurations.creating
dependencies {
// Purpur start
- implementation(project(":purpur-api"))
+ implementation(project(":plazma-api"))
implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
exclude("io.papermc.paper", "paper-api")
}
@@ -120,7 +120,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
- "Implementation-Version" to "git-Purpur-$implementationVersion", // Pufferfish // Purpur
+ "Implementation-Version" to "git-Plazma-$implementationVersion", // Pufferfish // Purpur
"Implementation-Vendor" to date, // Paper
"Specification-Title" to "Bukkit",
"Specification-Version" to project.version,
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 8cde30544e14f8fc2dac32966ae3c21f8cf3a551..7d80d2cf5d607d6051e99e4b08bc1b76098a79da 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -593,7 +593,7 @@ public class Metrics {
boolean logFailedRequests = config.getBoolean("logFailedRequests", false);
// Only start Metrics, if it's enabled in the config
if (config.getBoolean("enabled", true)) {
- Metrics metrics = new Metrics("Purpur", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur
+ Metrics metrics = new Metrics("Plazma", serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur // Plazma
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
@@ -603,7 +603,7 @@ public class Metrics {
metrics.addCustomChart(new Metrics.SingleLineChart("players", () -> Bukkit.getOnlinePlayers().size()));
metrics.addCustomChart(new Metrics.SimplePie("online_mode", () -> Bukkit.getOnlineMode() ? "online" : (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() ? "bungee" : "offline"))); // Purpur
- metrics.addCustomChart(new Metrics.SimplePie("purpur_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur
+ metrics.addCustomChart(new Metrics.SimplePie("plazma_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Plazma
metrics.addCustomChart(new Metrics.DrilldownPie("java_version", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index 462a6eed350fd660ddaf25d567bb6e97b77d0b2b..fec95437c1ad602f64c4d4d02c276199f27babbd 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -20,7 +20,7 @@ import java.util.stream.StreamSupport;
public class PaperVersionFetcher implements VersionFetcher {
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
// Purpur start
- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
+ private static final String DOWNLOAD_PAGE = "https://github.com/PlazmaMC/Plazma/releases"; // Plazma
private static int distance = -2; public int distance() { return distance; }
// Purpur end
private static @Nullable String mcVer;
@@ -33,8 +33,8 @@ public class PaperVersionFetcher implements VersionFetcher {
@Nonnull
@Override
public Component getVersionMessage(@Nonnull String serverVersion) {
- String[] parts = serverVersion.substring("git-Purpur-".length()).split("[-\\s]"); // Purpur
- final Component updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", "ver/" + getMinecraftVersion(), parts[0]); // Purpur
+ String[] parts = serverVersion.substring("git-Plazma-".length()).split("[-\\s]"); // Purpur // Plazma
+ final Component updateMessage = getUpdateStatusMessage("PlazmaMC/Plazma", "ver/" + getMinecraftVersion(), parts[0]); // Purpur // Plazma
final Component history = getHistory();
return history != null ? Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()), history, updateMessage) : updateMessage; // Purpur
@@ -47,7 +47,7 @@ public class PaperVersionFetcher implements VersionFetcher {
String result = matcher.group();
mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-'
} else {
- org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Purpur!"); // Purpur
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Plazma!"); // Purpur // Plazma
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
}
@@ -57,6 +57,7 @@ public class PaperVersionFetcher implements VersionFetcher {
}
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
+ /* // Plazma - Disable CI Checking
//int distance; // Purpur - use field
try {
int jenkinsBuild = Integer.parseInt(versionInfo);
@@ -65,6 +66,11 @@ public class PaperVersionFetcher implements VersionFetcher {
versionInfo = versionInfo.replace("\"", "");
distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
}
+ // Plazma start - Disable CI Checking
+ */
+ versionInfo = versionInfo.replace("\"", ""); // Plazma
+ distance = fetchDistanceFromGitHub(repo, branch, versionInfo); // Plazma
+ // Plazma end
switch (distance) {
case -1:
@@ -83,6 +89,7 @@ public class PaperVersionFetcher implements VersionFetcher {
}
}
+ /* // Plazma - Disable CI Checking
private static int fetchDistanceFromSiteApi(int jenkinsBuild, @Nullable String siteApiVersion) {
if (siteApiVersion == null) { return -1; }
try {
@@ -102,6 +109,7 @@ public class PaperVersionFetcher implements VersionFetcher {
return -1;
}
}
+ */ // Plazma - Disable CI Checking
// Contributed by Techcable <Techcable@outlook.com> in GH-65
private static int fetchDistanceFromGitHub(@Nonnull String repo, @Nonnull String branch, @Nonnull String hash) {
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
index 3cb56595822799926a8141e60a42f5d1edfc6de5..19d1d136fc28d6c114f6bc44c6450d2df51c3cb9 100644
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
@@ -17,7 +17,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
@Override
protected LineReader buildReader(LineReaderBuilder builder) {
builder
- .appName("Purpur") // Purpur
+ .appName("Plazma") // Purpur // Plazma
.variable(LineReader.HISTORY_FILE, java.nio.file.Paths.get(".console_history"))
.completer(new ConsoleCommandCompleter(this.server))
.option(LineReader.Option.COMPLETE_IN_WORD, true);
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
index ed3527612315e6e0649182ce4e1ae2834b0918a9..ae02c029f0169d30a34d4a4e65ea6cb4fa498111 100644
--- a/src/main/java/net/minecraft/CrashReport.java
+++ b/src/main/java/net/minecraft/CrashReport.java
@@ -35,7 +35,7 @@ public class CrashReport {
io.papermc.paper.util.StacktraceDeobfuscator.INSTANCE.deobfuscateThrowable(cause); // Paper
this.title = message;
this.exception = cause;
- this.systemReport.setDetail("CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit
+ this.systemReport.setDetail("Plazma Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma
}
public String getTitle() {
@@ -125,7 +125,7 @@ public class CrashReport {
stringbuilder.append("---- Minecraft Crash Report ----\n");
// Purpur start
stringbuilder.append("// ");
- stringbuilder.append("// DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!");
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO PLAZMA INSTEAD!"); // Plazma
// Purpur end
stringbuilder.append("// ");
stringbuilder.append(CrashReport.getErrorComment());
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index ec268189b19b6fa5c4521f96ce211a531db35ec5..ce45a93fe835fd1ea4411c78df430aaa903c83c3 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -108,6 +108,18 @@ public class Main {
*/ // CraftBukkit end
try {
+ // Plazma start - Branding
+ System.out.println("""
+ \033[38;2;236;61;151m┏\033[38;2;236;61;157m━\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m━\033[38;2;239;63;187m┓\033[38;2;239;63;193m \033[38;2;239;64;200m┏\033[38;2;240;64;206m━\033[38;2;240;64;212m┓\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m \033[38;2;232;67;243m┏\033[38;2;227;67;244m━\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m━\033[38;2;205;69;245m┓\033[38;2;200;69;246m \033[38;2;195;69;246m┏\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┏\033[38;2;147;73;249m━\033[38;2;141;73;250m━\033[38;2;136;74;250m┓\033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m┏\033[38;2;109;76;252m━\033[38;2;104;76;252m━\033[38;2;99;77;252m┓\033[38;2;94;77;253m \033[38;2;88;77;253m┏\033[38;2;83;78;253m━\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m━\033[38;2;80;97;255m┓\033[38;2;80;103;255m\s
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m┏\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m┓\033[38;2;239;63;187m┗\033[38;2;239;63;193m┓\033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┏\033[38;2;232;67;243m┛\033[38;2;227;67;244m┏\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┓\033[38;2;205;69;245m┗\033[38;2;200;69;246m┓\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m┓\033[38;2;173;71;247m \033[38;2;168;71;248m \033[38;2;163;72;248m┏\033[38;2;157;72;249m┛\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m \033[38;2;136;74;250m┗\033[38;2;131;74;250m┓\033[38;2;125;74;251m \033[38;2;120;75;251m┏\033[38;2;115;75;251m┛\033[38;2;109;76;252m \033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┏\033[38;2;88;77;253m┛\033[38;2;83;78;253m┏\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┓\033[38;2;80;97;255m┗\033[38;2;80;103;255m┓
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m┗\033[38;2;237;62;163m━\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m┛\033[38;2;239;63;187m┏\033[38;2;239;63;193m┛\033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┗\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┛\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m \033[38;2;189;70;246m \033[38;2;184;70;247m┏\033[38;2;179;70;247m┛\033[38;2;173;71;247m \033[38;2;168;71;248m┏\033[38;2;163;72;248m┛\033[38;2;157;72;249m \033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┏\033[38;2;136;74;250m┓\033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m┏\033[38;2;109;76;252m┓\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┗\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┛\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┏\033[38;2;237;62;169m━\033[38;2;238;62;175m━\033[38;2;238;63;181m━\033[38;2;239;63;187m┛\033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┃\033[38;2;241;65;218m \033[38;2;241;65;224m \033[38;2;242;65;230m \033[38;2;242;66;236m \033[38;2;242;66;242m \033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┏\033[38;2;221;67;244m━\033[38;2;216;68;244m━\033[38;2;211;68;245m┓\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m \033[38;2;189;70;246m┏\033[38;2;184;70;247m┛\033[38;2;179;70;247m \033[38;2;173;71;247m┏\033[38;2;168;71;248m┛\033[38;2;163;72;248m \033[38;2;157;72;249m \033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m┗\033[38;2;131;74;250m┓\033[38;2;125;74;251m \033[38;2;120;75;251m┏\033[38;2;115;75;251m┛\033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┏\033[38;2;78;79;254m━\033[38;2;79;85;254m━\033[38;2;79;91;254m┓\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ \033[38;2;236;61;151m┃\033[38;2;236;61;157m \033[38;2;237;62;163m┃\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┃\033[38;2;240;64;206m \033[38;2;240;64;212m┗\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┓\033[38;2;237;66;243m┃\033[38;2;232;67;243m \033[38;2;227;67;244m┃\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┃\033[38;2;205;69;245m \033[38;2;200;69;246m┃\033[38;2;195;69;246m┏\033[38;2;189;70;246m┛\033[38;2;184;70;247m \033[38;2;179;70;247m \033[38;2;173;71;247m┗\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┓\033[38;2;152;72;249m┃\033[38;2;147;73;249m \033[38;2;141;73;250m┃\033[38;2;136;74;250m \033[38;2;131;74;250m┗\033[38;2;125;74;251m━\033[38;2;120;75;251m┛\033[38;2;115;75;251m \033[38;2;109;76;252m┃\033[38;2;104;76;252m \033[38;2;99;77;252m┃\033[38;2;94;77;253m┃\033[38;2;88;77;253m \033[38;2;83;78;253m┃\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┃\033[38;2;80;97;255m \033[38;2;80;103;255m┃
+ \033[38;2;236;61;151m┗\033[38;2;236;61;157m━\033[38;2;237;62;163m┛\033[38;2;237;62;169m \033[38;2;238;62;175m \033[38;2;238;63;181m \033[38;2;239;63;187m \033[38;2;239;63;193m \033[38;2;239;64;200m┗\033[38;2;240;64;206m━\033[38;2;240;64;212m━\033[38;2;241;65;218m━\033[38;2;241;65;224m━\033[38;2;242;65;230m━\033[38;2;242;66;236m━\033[38;2;242;66;242m┛\033[38;2;237;66;243m┗\033[38;2;232;67;243m━\033[38;2;227;67;244m┛\033[38;2;221;67;244m \033[38;2;216;68;244m \033[38;2;211;68;245m┗\033[38;2;205;69;245m━\033[38;2;200;69;246m┛\033[38;2;195;69;246m┗\033[38;2;189;70;246m━\033[38;2;184;70;247m━\033[38;2;179;70;247m━\033[38;2;173;71;247m━\033[38;2;168;71;248m━\033[38;2;163;72;248m━\033[38;2;157;72;249m┛\033[38;2;152;72;249m┗\033[38;2;147;73;249m━\033[38;2;141;73;250m┛\033[38;2;136;74;250m \033[38;2;131;74;250m \033[38;2;125;74;251m \033[38;2;120;75;251m \033[38;2;115;75;251m \033[38;2;109;76;252m┗\033[38;2;104;76;252m━\033[38;2;99;77;252m┛\033[38;2;94;77;253m┗\033[38;2;88;77;253m━\033[38;2;83;78;253m┛\033[38;2;78;79;254m \033[38;2;79;85;254m \033[38;2;79;91;254m┗\033[38;2;80;97;255m━\033[38;2;80;103;255m┛
+ """);
+ if (org.plazmamc.plazma.Options.iKnowWhatIAmDoing)
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
+ // Plazma end
// Paper start
if (Boolean.getBoolean("Paper.isRunDev")) {
net.minecraft.server.packs.VanillaPackResourcesBuilder.developmentConfig = builder -> {
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index b61c4d1ebb9c15a7ecd7bec5eb864851c053fb7e..b4d5bca6e3a39186a988098fb5d4cae97a776e79 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -913,7 +913,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
if (!isSameThread()) {
- MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PURPUR)"); // Purpur
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PLAZMA)"); // Purpur // Plazma
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
try {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index cda4544ae96a4fcb5c6c4483df67a59f1b53fd27..fe82a20efb2b130a568bc06aec5b86d3082062a3 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -58,7 +58,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
public final boolean onlineMode = this.get("online-mode", true);
public final boolean preventProxyConnections = this.get("prevent-proxy-connections", false);
public final String serverIp = this.get("server-ip", "");
- public final String serverName = this.get("server-name", "Unknown Server"); // Purpur
+ public final String serverName = this.get("server-name", "Plazma Server"); // Purpur // Plazma
public final boolean spawnAnimals = this.get("spawn-animals", true);
public final boolean spawnNpcs = this.get("spawn-npcs", true);
public final boolean pvp = this.get("pvp", true);
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
index be7b3fe2dc84493dcde9e185717b0b7c7c2e9822..cfdaa744ff40c8a171ca9b36b305b326fc57c32c 100644
--- a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
+++ b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
@@ -56,7 +56,7 @@ public class MinecraftServerGui extends JComponent {
;
}
- final JFrame jframe = new JFrame("Purpur Minecraft server"); // Purpur
+ final JFrame jframe = new JFrame("Plazma Minecraft server"); // Purpur // Plazma
final MinecraftServerGui servergui = new MinecraftServerGui(server);
jframe.setDefaultCloseOperation(2);
@@ -64,7 +64,7 @@ public class MinecraftServerGui extends JComponent {
jframe.pack();
jframe.setLocationRelativeTo((Component) null);
jframe.setVisible(true);
- jframe.setName("Purpur Minecraft server"); // Paper // Purpur
+ jframe.setName("Plazma Minecraft server"); // Paper // Purpur // Plazma
// Paper start - Add logo as frame image
try {
@@ -76,7 +76,7 @@ public class MinecraftServerGui extends JComponent {
jframe.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent windowevent) {
if (!servergui.isClosing.getAndSet(true)) {
- jframe.setTitle("Purpur Minecraft server - shutting down!"); // Purpur
+ jframe.setTitle("Plazma Minecraft server - shutting down!"); // Purpur // Plazma
server.halt(true);
servergui.runFinalizers();
}
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 25540a7f5631acd856726cdb44bace9be7dab401..36a1ac09bec7b4139d1cd44e6ecda72fc30fa8c4 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1323,7 +1323,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
TickingBlockEntity tickingblockentity = (TickingBlockEntity) this.blockEntityTickers.get(this.tileTickPosition);
// Spigot start
if (tickingblockentity == null) {
- this.getCraftServer().getLogger().severe("Spigot has detected a null entity and has removed it, preventing a crash");
+ this.getCraftServer().getLogger().severe("Plazma has detected a null entity and has removed it, preventing a crash"); // Plazma
tilesThisCycle--;
continue;
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
index db571f658f636cdda1dcdbaffa0c4da67fae11ad..0ba8a251bf1f5a7a6f27823686bf0d636feba769 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -153,7 +153,7 @@ public class RegionFileStorage implements AutoCloseable {
// Paper start
private static void printOversizedLog(String msg, Path file, int x, int z) {
- org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PAPER - You may ask for help on Discord, but do not file an issue. These error messages can not be removed.");
+ org.apache.logging.log4j.LogManager.getLogger().fatal(msg + " (" + file.toString().replaceAll(".+[\\\\/]", "") + " - " + x + "," + z + ") Go clean it up to remove this message. /minecraft:tp " + (x<<4)+" 128 "+(z<<4) + " - DO NOT REPORT THIS TO PLAZMA - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Plazma
}
private static final int DEFAULT_SIZE_THRESHOLD = 1024 * 8;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index a8a887236c68567816badc0620833755c84a4b03..09c292e22788fdf48b639265f24595e14aceba7a 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -269,7 +269,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
- private final String serverName = "Purpur"; // Paper // Pufferfish // Purpur
+ private final String serverName = "Plazma"; // Paper // Pufferfish // Purpur // Plazma
private final String serverVersion;
private final String bukkitVersion = Versioning.getBukkitVersion();
private final Logger logger = Logger.getLogger("Minecraft");
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index d41f9c4a3c992b5dadacb4fcb1107235fff79fa8..49d0cd1275c6bf5165e4880dc322bc93ad3848f3 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -141,7 +141,7 @@ public class Main {
this.acceptsAll(Main.asList("noconsole"), "Disables the console");
- this.acceptsAll(Main.asList("v", "version"), "Show the CraftBukkit Version");
+ this.acceptsAll(Main.asList("v", "version"), "Show the Plazma Version"); // Plazma - Rebranding
this.acceptsAll(Main.asList("demo"), "Demo mode");
@@ -192,7 +192,7 @@ public class Main {
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
.ofType(String.class)
- .defaultsTo("Unknown Server")
+ .defaultsTo("Plazma Server") // Plazma - Rebranding
.describedAs("Name");
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 9c94fd78cbd0d3ef0c4dd3678262126b6ed2847b..653ba98a1b69f25b781f8794c7d2ae8c5445cfa6 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -912,7 +912,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return EntityCategory.WATER;
}
- throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Purpur."); // Purpur
+ throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Plazma."); // Purpur // Plazma
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 7902c649a54fccbb13531c01e052df87ec4a424a..e8f50fdd7791fa8acc6eccdef40349845696b357 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -501,7 +501,7 @@ public class CraftScheduler implements BukkitScheduler {
this.parsePending();
} else {
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Purpur"); // Paper // Purpur
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Plazma"); // Paper // Purpur // Plazma
// We don't need to parse pending
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
}
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
index 99597258e8e88cd9e2c901c4ac3ff7faeeabee2b..0e695ea608c4e4770f5491d54ad47616d4e857c6 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -8,22 +8,25 @@ import java.util.logging.Logger;
import org.bukkit.Bukkit;
public final class Versioning {
- public static String getBukkitVersion() {
- String result = "Unknown-Version";
-
- InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.purpurmc.purpur/purpur-api/pom.properties"); // Pufferfish // Purpur
+ // Plazma start
+ public static String version = "Unknown-Version";
+ static {
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties");
Properties properties = new Properties();
if (stream != null) {
try {
properties.load(stream);
- result = properties.getProperty("version");
+ version = properties.getProperty("version");
} catch (IOException ex) {
- Logger.getLogger(Versioning.class.getName()).log(Level.SEVERE, "Could not get Bukkit version!", ex);
+ Logger.getLogger(Versioning.class.getName()).log(Level.SEVERE, "Could not get Plazma version!", ex);
}
}
+ }
- return result;
+ public static String getBukkitVersion() {
+ return version;
}
+ // Plazma end
}
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
new file mode 100644
index 0000000000000000000000000000000000000000..a858b7ddef7f6877c0b92f4150e0dd37bea121aa
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -0,0 +1,7 @@
+package org.plazmamc.plazma;
+
+public interface Options {
+
+ boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing");
+
+}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 3633574e112f217b412217dd243a631dc4e9c40c..d0d31002562e728fa1a6c9bc81baa4534f11d365 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -231,7 +231,7 @@ public class PurpurConfig {
deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
}
- public static String serverModName = "Purpur";
+ public static String serverModName = "Plazma"; // Plazma
private static void serverModName() {
serverModName = getString("settings.server-mod-name", serverModName);
}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 5fc8cc40ab627eba0b2110c73d31af213a935733..969ac1b2f824af361beec4afa00b15f13f6868ce 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -155,14 +155,14 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
if (isLongTimeout) {
// Paper end
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Purpur bug." ); // Paper // Purpur
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Plazma bug." ); // Paper // Purpur // Plazma
log.log( Level.SEVERE, "If you see a plugin in the Server thread dump below, then please report it to that author" );
log.log( Level.SEVERE, "\t *Especially* if it looks like HTTP or MySQL operations are occurring" );
log.log( Level.SEVERE, "If you see a world save or edit, then it means you did far more than your server can handle at once" );
log.log( Level.SEVERE, "\t If this is the case, consider increasing timeout-time in spigot.yml but note that this will replace the crash with LARGE lag spikes" );
- log.log( Level.SEVERE, "If you are unsure or still think this is a Purpur bug, please report this to https://github.com/PurpurMC/Purpur/issues" ); // Purpur
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Plazma bug, please report this to https://github.com/PlazmaMC/Plazma/issues" ); // Purpur // Plazma
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
- log.log( Level.SEVERE, "Purpur version: " + Bukkit.getServer().getVersion() ); // Purpur
+ log.log( Level.SEVERE, "Plazma version: " + Bukkit.getServer().getVersion() ); // Purpur // Plazma
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
@@ -185,12 +185,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
// Paper end
} else
{
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Plazma
log.log(Level.SEVERE, "The server has not responded for " + (currentTime - lastTick) / 1000 + " seconds! Creating thread dump");
}
// Paper end - Different message for short timeout
log.log( Level.SEVERE, "------------------------------" );
- log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Purpur!):" ); // Paper // Purpur
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Plazma!):" ); // Paper // Purpur // Plazma
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
this.dumpTickingInfo(); // Paper - log detailed tick information
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
@@ -206,7 +206,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
WatchdogThread.dumpThread( thread, log );
}
} else {
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PLAZMA - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Plazma
}
log.log( Level.SEVERE, "------------------------------" );

View File

@@ -1,333 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <alphakr93@gmail.com>
Date: Fri, 10 Mar 2023 22:08:56 +0900
Subject: [PATCH] Rebrand Logo
diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png
index 518591dd83289e041a16e2c2e7d7e7640d4b2e1b..278de5d47a7802ab89d9ae39c1560ef87d6d6fc4 100644
GIT binary patch
literal 7999
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
E0k}Z_!T<mO
literal 9260
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
HqBZh=dic2S

File diff suppressed because it is too large Load Diff

View File

@@ -1,71 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 10:47:05 +0900
Subject: [PATCH] Setup basic configuration sections
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 69c4d9cb0532621018f6cd99916c409fc150ab7e..5875aae8d7d0146ef9903d8b4bc2b673a615fd98 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -23,4 +23,23 @@ public class GlobalConfiguration extends ConfigurationPart {
@Setting(Configuration.VERSION_FIELD)
int version = VERSION;
+ public Player player;
+ public class Player extends ConfigurationPart {
+
+
+ }
+
+ @Setting("world-generation")
+ public WorldGeneration worldgen;
+ public class WorldGeneration extends ConfigurationPart {
+
+
+ }
+
+ public Miscellaneous misc;
+ public class Miscellaneous extends ConfigurationPart {
+
+
+ }
+
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 842fb520a2d638aaa5bd0a7198190dbe3ecbe14c..a372b5be3b1da5868d3766a8ba58997a48118581 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -19,4 +19,32 @@ public class WorldConfigurations extends ConfigurationPart {
@Setting(Configuration.VERSION_FIELD)
int version = VERSION;
+ public Miscellaneous misc;
+ public class Miscellaneous extends ConfigurationPart {
+
+
+ }
+
+ public Entity entity;
+ public class Entity extends ConfigurationPart {
+
+ public Phantom phantom;
+ public class Phantom extends ConfigurationPart {
+
+
+ }
+
+ }
+
+ public Structure structure;
+ public class Structure extends ConfigurationPart {
+
+ public NetherPortal netherPortal;
+ public class NetherPortal extends ConfigurationPart {
+
+
+ }
+
+ }
+
}

View File

@@ -1,18 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 10:13:14 +0900
Subject: [PATCH] Always agree EULA on development mode
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index ce45a93fe835fd1ea4411c78df430aaa903c83c3..9b8bdffbbfe45c6712d0f4da3643424fa94fc69e 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -178,6 +178,7 @@ public class Main {
// Spigot Start
boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
+ eulaAgreed = eulaAgreed || Boolean.getBoolean("Paper.isRunDev"); // Plazma
if ( eulaAgreed )
{
System.err.println( "You have used the Spigot command line EULA agreement flag." );

View File

@@ -1,69 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 10:26:26 +0900
Subject: [PATCH] Add more metrics
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index 7d80d2cf5d607d6051e99e4b08bc1b76098a79da..f006c867ad0765e0f52a629729ab131acec5c2fc 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -636,16 +636,52 @@ public class Metrics {
return map;
}));
+ // Plazma start
+ metrics.addCustomChart(new DrilldownPie("datapacks", () -> {
+ int datapacks = Bukkit.getDatapackManager().getEnabledPacks().size();
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(datapacks), 1);
+
+ if (datapacks == 0) return Collections.singletonMap("0", entry);
+ else if (datapacks <= 5) return Collections.singletonMap("1-5", entry);
+ else if (datapacks <= 10) return Collections.singletonMap("6-10", entry);
+ else if (datapacks <= 25) return Collections.singletonMap("11-25", entry);
+ else if (datapacks <= 50) return Collections.singletonMap("26-50", entry);
+ else return Collections.singletonMap("50+", entry);
+ }));
+
+ List<Plugin> plugins = Arrays.stream(Bukkit.getPluginManager().getPlugins()).toList();
+
+ metrics.addCustomChart(new DrilldownPie("plugins", () -> {
+ int pluginCount = (int) plugins.stream().filter(Plugin::isEnabled).count();
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(pluginCount), 1);
+
+ if (pluginCount == 0) return Collections.singletonMap("0", entry);
+ else if (pluginCount <= 5) return Collections.singletonMap("1-5", entry);
+ else if (pluginCount <= 10) return Collections.singletonMap("6-10", entry);
+ else if (pluginCount <= 25) return Collections.singletonMap("11-25", entry);
+ else if (pluginCount <= 50) return Collections.singletonMap("26-50", entry);
+ else return Collections.singletonMap("50+", entry);
+ }));
+
+ metrics.addCustomChart(new DrilldownPie("disabled_plugins", () -> {
+ int disabled = (int) plugins.stream().filter(java.util.function.Predicate.not(Plugin::isEnabled)).count();
+ Map<String, Integer> entry = Collections.singletonMap(String.valueOf(disabled), 1);
+
+ if (disabled == 0) return Collections.singletonMap("0 \uD83D\uDE0E", entry); // :sunglasses:
+ else if (disabled <= 5) return Collections.singletonMap("1-5", entry);
+ else if (disabled <= 10) return Collections.singletonMap("6-10", entry);
+ else if (disabled <= 25) return Collections.singletonMap("11-25", entry);
+ else if (disabled <= 50) return Collections.singletonMap("26-50", entry);
+ else if (disabled <= 100) return Collections.singletonMap("50-100 \uD83D\uDE2D", entry); // :cry:
+ else return Collections.singletonMap("101+ \uD83D\uDC80", entry); // :skull:
+ }));
+ // Plazma end
+
metrics.addCustomChart(new Metrics.DrilldownPie("legacy_plugins", () -> {
Map<String, Map<String, Integer>> map = new HashMap<>();
// count legacy plugins
- int legacy = 0;
- for (Plugin plugin : Bukkit.getPluginManager().getPlugins()) {
- if (CraftMagicNumbers.isLegacy(plugin.getDescription())) {
- legacy++;
- }
- }
+ int legacy = (int) plugins.stream().filter(p -> CraftMagicNumbers.isLegacy(p.getDescription())).count(); // Plazma
// insert real value as lower dimension
Map<String, Integer> entry = new HashMap<>();

View File

@@ -1,96 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 10:40:49 +0900
Subject: [PATCH] Tweak console logging
diff --git a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
index e4fd372a1d585887287253a02531cd192929377b..6624fb97404c3032d60167e3fb108dcfcd066784 100644
--- a/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
+++ b/src/main/java/io/papermc/paper/adventure/ChatProcessor.java
@@ -355,7 +355,7 @@ public final class ChatProcessor {
private void sendToServer(final ChatType.Bound chatType, final @Nullable Function<Audience, net.minecraft.network.chat.Component> msgFunction) {
final PlayerChatMessage toConsoleMessage = msgFunction == null ? ChatProcessor.this.message : ChatProcessor.this.message.withUnsignedContent(msgFunction.apply(ChatProcessor.this.server.console));
- ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage) ? null : "Not Secure");
+ ChatProcessor.this.server.logChatMessage(toConsoleMessage.decoratedContent(), chatType, (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix || ChatProcessor.this.server.getPlayerList().verifyChatTrusted(toConsoleMessage)) ? null : "Not Secure"); // Plazma - Tweak console logging
}
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 00fbcb941fe393197619762722eb51d62fb073c2..770b959d9e51ef0645415d5a0d7d79b7031abd66 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -180,16 +180,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("To start the server with more ram, launch it as \"java -Xmx1024M -Xms1024M -jar minecraft_server.jar\"");
}
- // Paper start - detect running as root
- if (io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
- DedicatedServer.LOGGER.warn("****************************");
- DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
- DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
- DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
- DedicatedServer.LOGGER.warn("****************************");
- }
- // Paper end
-
DedicatedServer.LOGGER.info("Loading properties");
DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties();
@@ -319,6 +309,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
String proxyFlavor = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "Velocity" : "BungeeCord";
String proxyLink = (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.velocity.enabled) ? "https://docs.papermc.io/velocity/security" : "http://www.spigotmc.org/wiki/firewall-guide/";
// Paper end
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.offlineWarnings) // Plazma - Tweak console logging
if (!this.usesAuthentication()) {
DedicatedServer.LOGGER.warn("**** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!");
DedicatedServer.LOGGER.warn("The server will make no attempt to authenticate usernames. Beware.");
@@ -335,6 +326,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("To change this, set \"online-mode\" to \"true\" in the server.properties file.");
}
+ // Plazma - Moved down - Tweak console logging
+ // Paper start - detect running as root
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.rootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
+ DedicatedServer.LOGGER.warn("****************************");
+ DedicatedServer.LOGGER.warn("YOU ARE RUNNING THIS SERVER AS AN ADMINISTRATIVE OR ROOT USER. THIS IS NOT ADVISED.");
+ DedicatedServer.LOGGER.warn("YOU ARE OPENING YOURSELF UP TO POTENTIAL RISKS WHEN DOING THIS.");
+ DedicatedServer.LOGGER.warn("FOR MORE INFORMATION, SEE https://madelinemiller.dev/blog/root-minecraft-server/");
+ DedicatedServer.LOGGER.warn("****************************");
+ }
+ // Paper end
+ // Plazma end
if (!OldUsersConverter.serverReadyAfterUserconversion(this)) {
return false;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 182acaad79e14e5e120094916a0d295a4584de7a..e8de78f8b7c90a719e10c483991f45a7886256be 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1462,6 +1462,7 @@ public abstract class PlayerList {
public void broadcastChatMessage(PlayerChatMessage message, Predicate<ServerPlayer> shouldSendFiltered, @Nullable ServerPlayer sender, ChatType.Bound params, @Nullable Function<net.kyori.adventure.audience.Audience, Component> unsignedFunction) {
// Paper end
boolean flag = this.verifyChatTrusted(message);
+ flag = flag || org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix; // Plazma - Tweak console logging
this.server.logChatMessage((unsignedFunction == null ? message.decoratedContent() : unsignedFunction.apply(this.server.console)), params, flag ? null : "Not Secure"); // Paper
OutgoingChatMessage outgoingchatmessage = OutgoingChatMessage.create(message);
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 5875aae8d7d0146ef9903d8b4bc2b673a615fd98..51413e828500792cc493b836bb1460a394ff4f75 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -42,4 +42,13 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+ public ConsoleLogs consoleLogs;
+ public class ConsoleLogs extends ConfigurationPart {
+
+ public boolean offlineWarnings = true;
+ public boolean rootUserWarnings = true;
+ public boolean notSecurePrefix = true;
+
+ }
+
}

View File

@@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 10:49:05 +0900
Subject: [PATCH] Add option to allow any usernames
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 3dcccca8ede9b203c24ba29b2020a583297b895c..dd707019fb9b2c46d706311862fea91b84793ff9 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -160,6 +160,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleHello(ServerboundHelloPacket packet) {
Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.allowAnyUsername) // Plazma - Add option to allow any usernames
Validate.validState(ServerLoginPacketListenerImpl.isValidUsername(packet.name()), "Invalid characters in username", new Object[0]);
// Paper start - validate usernames
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode() && io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 51413e828500792cc493b836bb1460a394ff4f75..c85f1a01c951f85c2347eba18a896e87c4c8b368 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -26,6 +26,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Player player;
public class Player extends ConfigurationPart {
+ public boolean allowAnyUsername = false;
}

View File

@@ -1,52 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 18:29:51 +0900
Subject: [PATCH] Add some missing Pufferfish configurations
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index bcc3458afac5ece9637df63b9d02c445aa0a4ef9..0ee7a663988bbcc37d72da690fa9372ca1d14425 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -168,10 +168,12 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
return dimensions.height - 0.1F * this.getScale();
}
+ private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations
@Override
protected void customServerAiStep() {
//this.level().getProfiler().push("camelBrain"); // Purpur
Brain<Camel> brain = (Brain<Camel>) this.getBrain(); // Paper - decompile fix
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
brain.tick((ServerLevel)this.level(), this);
//this.level().getProfiler().pop(); // Purpur
//this.level().getProfiler().push("camelActivityUpdate"); // Purpur
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index 795c93352dfa69fad0e034a8377eceb6dc1e81da..e743b4891c1e56f82d40f798e456a701b0efbc73 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -527,9 +527,11 @@ public class Sniffer extends Animal {
return Brain.provider(SnifferAi.MEMORY_TYPES, SnifferAi.SENSOR_TYPES);
}
+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
@Override
protected void customServerAiStep() {
//this.level().getProfiler().push("snifferBrain"); // Purpur
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
this.getBrain().tick((ServerLevel) this.level(), this);
//this.level().getProfiler().popPush("snifferActivityUpdate"); // Purpur
SnifferAi.updateActivity(this);
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index 66d47c1613532189e761c0f48d893652c17fe240..8a5d8f9ad1bd94ca53c1ffd1872275c07a52f0b7 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -319,7 +319,7 @@ public class Warden extends Monster implements VibrationSystem {
ServerLevel worldserver = (ServerLevel) this.level();
//worldserver.getProfiler().push("wardenBrain"); // Purpur
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Plazma
this.getBrain().tick(worldserver, this);
//this.level().getProfiler().pop(); // Purpur
super.customServerAiStep();

View File

@@ -1,19 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 25 Mar 2023 00:52:11 +0900
Subject: [PATCH] Add missing purpur configuration options
Subject: [PATCH] Add missing Purpur configuration options
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
index c783ce59ea766e6c46a3313628b961f27e01ee8b..3f36eedeae4b94ca684c57f4ec8d2d1ab5c51aae 100644
index 67ff60909dee395d42619c310bafc381b9bfce5d..42fc51827240f9f0091e006fa84a17c2fb51dddd 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/Allay.java
@@ -150,6 +150,23 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
protected void registerGoals() {
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
@@ -162,6 +162,18 @@ public class Allay extends PathfinderMob implements InventoryCarrier, VibrationS
this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(this.level().purpurConfig.allayMaxHealth);
this.getAttribute(Attributes.SCALE).setBaseValue(this.level().purpurConfig.allayScale);
}
+
+ // Plazma start
+ // Plazma start - Add missing purpur configuration options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level().purpurConfig.allayTakeDamageFromWater;
@@ -23,25 +23,20 @@ index c783ce59ea766e6c46a3313628b961f27e01ee8b..3f36eedeae4b94ca684c57f4ec8d2d1a
+ public boolean isAlwaysExperienceDropper() {
+ return level().purpurConfig.allayAlwaysDropExp;
+ }
+
+ @Override
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.allayMaxHealth);
+ }
+ // Plazma end
// Purpur end
+ // Plazma end - Add missing purpur configuration options
// Purpur end - Configurable entity base attributes
@Override
protected Brain.Provider<Allay> brainProvider() {
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index cd9129bb5049c13f08c58b8581d511b59a5bb1b5..bcc3458afac5ece9637df63b9d02c445aa0a4ef9 100644
index 36f8bb5cf25566784e11988c91e1c7409f1ac5c8..d364866de67341e4a781b4f2bf3e7c187ee2bc8c 100644
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
@@ -95,6 +95,18 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
@@ -99,6 +99,18 @@ public class Camel extends AbstractHorse {
public int getPurpurBreedTime() {
return this.level().purpurConfig.camelBreedingTicks;
}
+
+ // Plazma start
+ // Plazma start - Add missing purpur configuration options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level().purpurConfig.camelTakeDamageFromWater;
@@ -51,20 +46,20 @@ index cd9129bb5049c13f08c58b8581d511b59a5bb1b5..bcc3458afac5ece9637df63b9d02c445
+ public boolean isAlwaysExperienceDropper() {
+ return level().purpurConfig.camelAlwaysDropExp;
+ }
+ // Plazma end
// Purpur end
+ // Plazma end - Add missing purpur configuration options
// Purpur end - Make entity breeding times configurable
@Override
public void addAdditionalSaveData(CompoundTag nbt) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
index 9417ce67cc231d5bfa6813f78ec27196eed423c8..4e471e4a259a64c44da5ab450f0137691428ff6a 100644
index d09aa48e20c9a6e0d465b93e3759556638041394..70772863011ce270bceaf679ea3776fb36d4f0b9 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Frog.java
@@ -136,6 +136,23 @@ public class Frog extends Animal implements VariantHolder<FrogVariant> {
@@ -163,6 +163,23 @@ public class Frog extends Animal implements VariantHolder<Holder<FrogVariant>> {
public float getJumpPower() {
return (getRider() != null && isControllable()) ? level().purpurConfig.frogRidableJumpHeight * this.getBlockJumpFactor() : super.getJumpPower();
}
+
+ // Plazma start
+ // Plazma start - Add missing purpur configuration options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level().purpurConfig.frogTakeDamageFromWater;
@@ -79,20 +74,20 @@ index 9417ce67cc231d5bfa6813f78ec27196eed423c8..4e471e4a259a64c44da5ab450f013769
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.frogMaxHealth);
+ }
+ // Plazma end
// Purpur end
+ // Plazma end - Add missing purpur configuration options
// Purpur end - Ridables
public int getPurpurBreedTime() {
// Purpur start - Make entity breeding times configurable
diff --git a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
index 6b012bea26e8ef0c04571f43da67f6e108188830..7c816b879d47a1b8a480f4237d1ff0e11df4c98e 100644
index 33429a9afeefce9238969b2894d0a9c033baca51..fee263bd88c19188f6ec8017893dfc12bdd15737 100644
--- a/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
+++ b/src/main/java/net/minecraft/world/entity/animal/frog/Tadpole.java
@@ -87,6 +87,23 @@ public class Tadpole extends AbstractFish {
@@ -93,6 +93,23 @@ public class Tadpole extends AbstractFish {
protected void registerGoals() {
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
}
+
+ // Plazma start
+ // Plazma start - Add missing purpur configuration options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level().purpurConfig.tadpoleTakeDamageFromWater;
@@ -107,20 +102,20 @@ index 6b012bea26e8ef0c04571f43da67f6e108188830..7c816b879d47a1b8a480f4237d1ff0e1
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.tadpoleMaxHealth);
+ }
+ // Plazma end
// Purpur end
+ // Plazma end - Add missing purpur configuration options
// Purpur end - Ridables
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
index dcb10e2ea1e0c7d0479adae5bc2ff57ece172aad..795c93352dfa69fad0e034a8377eceb6dc1e81da 100644
index 3fa391b638062196675d102b8731a96a51df8e15..86988932dc79e9ca33998044995187709ad5373b 100644
--- a/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
+++ b/src/main/java/net/minecraft/world/entity/animal/sniffer/Sniffer.java
@@ -106,6 +106,18 @@ public class Sniffer extends Animal {
public boolean isControllable() {
return level().purpurConfig.snifferControllable;
@@ -119,6 +119,18 @@ public class Sniffer extends Animal {
public int getPurpurBreedTime() {
return this.level().purpurConfig.snifferBreedingTicks;
}
+
+ // Plazma start
+ // Plazma start - Add missing purpur configuration options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level().purpurConfig.snifferTakeDamageFromWater;
@@ -130,20 +125,20 @@ index dcb10e2ea1e0c7d0479adae5bc2ff57ece172aad..795c93352dfa69fad0e034a8377eceb6
+ public boolean isAlwaysExperienceDropper() {
+ return level().purpurConfig.snifferAlwaysDropExp;
+ }
+ // Plazma end
// Purpur end
+ // Plazma end - Add missing purpur configuration options
// Purpur end - Make entity breeding times configurable
@Override
protected void defineSynchedData(SynchedEntityData.Builder builder) {
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
index 5e66c2bd3807619cadee5b7081d93d21886e2806..66d47c1613532189e761c0f48d893652c17fe240 100644
index 74011f1ab7e48490109ad93d658bba216eef9e80..5313f4c1ca76b120c0eb6beddc993b562f79344e 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/Warden.java
@@ -146,6 +146,23 @@ public class Warden extends Monster implements VibrationSystem {
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur
@@ -151,6 +151,23 @@ public class Warden extends Monster implements VibrationSystem {
this.goalSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
this.targetSelector.addGoal(0, new org.purpurmc.purpur.entity.ai.HasRider(this)); // Purpur - Ridables
}
+
+ // Plazma start
+ // Plazma start - Add missing purpur configuration options
+ @Override
+ public boolean isSensitiveToWater() {
+ return level().purpurConfig.wardenTakeDamageFromWater;
@@ -158,89 +153,94 @@ index 5e66c2bd3807619cadee5b7081d93d21886e2806..66d47c1613532189e761c0f48d893652
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.wardenMaxHealth);
+ }
+ // Plazma end
// Purpur end
+ // Plazma end - Add missing purpur configuration options
// Purpur end - Ridables
@Override
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
index d70c1206df96b03c031399049a65e6a765d80347..e885d2f21cfbf1fd1c61b29e34f3f51a9decfe88 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
@@ -41,7 +41,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
@@ -305,7 +322,7 @@ public class Warden extends Monster implements VibrationSystem {
ProfilerFiller gameprofilerfiller = Profiler.get();
public ChestBoat(EntityType<? extends Boat> type, Level world) {
super(type, world);
gameprofilerfiller.push("wardenBrain");
- if (this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Pufferfish // Plazma - Add missing Purpur configurations
this.getBrain().tick(world, this);
gameprofilerfiller.pop();
super.customServerAiStep(world);
diff --git a/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java b/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
index 1f4cc08e84a23213bb9786ea09ad77caeec2d336..f888f1dd2e3c228b0a370fe920b63d547bbba571 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/AbstractChestBoat.java
@@ -46,7 +46,7 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto
public AbstractChestBoat(EntityType<? extends AbstractChestBoat> type, Level world, Supplier<Item> itemSupplier) {
super(type, world, itemSupplier);
- this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
+ this.itemStacks = NonNullList.withSize(org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // Plazma
+ this.itemStacks = NonNullList.withSize(org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // Plazma - Add missing purpur configuration options
}
public ChestBoat(Level world, double d0, double d1, double d2) {
@@ -160,7 +160,7 @@ public class ChestBoat extends Boat implements HasCustomInventoryScreen, Contain
@Override
@@ -142,7 +142,7 @@ public abstract class AbstractChestBoat extends AbstractBoat implements HasCusto
@Override
public int getContainerSize() {
- return 27;
+ return org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9; // Plazma
+ return org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9; // Plazma - Add missing purpur configuration options
}
@Override
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index f9f7664e4a6a4e24dcb3b8da0a807a984a698429..22e74b716d29ecfe75bd49234bef861cd97cb79e 100644
index f29059798c9dc642187b4939dd917ee15cbe120d..7a482099a69759659038e10632e7dd4626c187a1 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -329,6 +329,7 @@ public class PurpurConfig {
@@ -331,6 +331,7 @@ public class PurpurConfig {
}
public static int barrelRows = 3;
+ public static int chestBoatRows = 3; // Plazma
+ public static int chestBoatRows = 3; // Plazma - Add missing purpur configuration options
public static boolean enderChestSixRows = false;
public static boolean enderChestPermissionRows = false;
public static boolean cryingObsidianValidForPortalFrame = false;
@@ -369,6 +370,7 @@ public class PurpurConfig {
@@ -373,6 +374,7 @@ public class PurpurConfig {
case 1 -> 9;
default -> 27;
});
+ chestBoatRows = getInt("settings.blocks.chest_boat.rows", chestBoatRows); // Plazma
+ chestBoatRows = getInt("settings.blocks.chest_boat.rows", chestBoatRows); // Plazma - Add missing purpur configuration options
enderChestSixRows = getBoolean("settings.blocks.ender_chest.six-rows", enderChestSixRows);
org.bukkit.event.inventory.InventoryType.ENDER_CHEST.setDefaultSize(enderChestSixRows ? 54 : 27);
enderChestPermissionRows = getBoolean("settings.blocks.ender_chest.use-permissions-for-rows", enderChestPermissionRows);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index 9cb79d203b6ec345d719cd488d2cce8f877fe2bd..fc30f2dcf7227f7cd087b2e5b8d3dc73e18405c6 100644
index 43ad38dadfe14b3dd0565c536b276eb3f9dbd813..474bab426175d8dece524faeffd8977a6e1bb074 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1115,7 +1115,15 @@ public class PurpurWorldConfig {
public boolean allayRidableInWater = true;
@@ -1144,7 +1144,13 @@ public class PurpurWorldConfig {
public boolean allayControllable = true;
public List<String> allayRespectNBT = new ArrayList<>();
public double allayMaxHealth = 20.0D;
public double allayScale = 1.0D;
+ // Plazma start - Add missing purpur config options
+ public double allayMaxHealth = 20.0D;
+ public boolean allayTakeDamageFromWater = false;
+ public boolean allayAlwaysDropExp = false;
private void allaySettings() {
+ allayMaxHealth = getDouble("mobs.allay.max-health", allayMaxHealth);
+ allayTakeDamageFromWater = getBoolean("mobs.allay.take-damage-from-water", allayTakeDamageFromWater);
+ allayAlwaysDropExp = getBoolean("mobs.allay.always-drop-exp", allayAlwaysDropExp);
+ // Plazma end
+ // Plazma end - Add missing purpur configuration options
allayRidable = getBoolean("mobs.allay.ridable", allayRidable);
allayRidableInWater = getBoolean("mobs.allay.ridable-in-water", allayRidableInWater);
allayControllable = getBoolean("mobs.allay.controllable", allayControllable);
@@ -1234,7 +1242,15 @@ public class PurpurWorldConfig {
@@ -1299,7 +1305,13 @@ public class PurpurWorldConfig {
public double camelMovementSpeedMin = 0.09D;
public double camelMovementSpeedMax = 0.09D;
public int camelBreedingTicks = 6000;
+ // Plazma start - Add missing purpur config options
+ //public boolean camelRidableInWater = false;
+ public boolean camelTakeDamageFromWater = false;
+ public boolean camelAlwaysDropExp = false;
private void camelSettings() {
+ //camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
+ camelTakeDamageFromWater = getBoolean("mobs.camel.takes-damage-from-water", camelTakeDamageFromWater);
+ camelAlwaysDropExp = getBoolean("mobs.camel.always-drop-exp", camelAlwaysDropExp);
+ // Plazma end
+ // Plazma end - Add missing purpur configuration options
camelRidableInWater = getBoolean("mobs.camel.ridable-in-water", camelRidableInWater);
camelMaxHealthMin = getDouble("mobs.camel.attributes.max_health.min", camelMaxHealthMin);
camelMaxHealthMax = getDouble("mobs.camel.attributes.max_health.max", camelMaxHealthMax);
@@ -1662,7 +1678,15 @@ public class PurpurWorldConfig {
@@ -1764,7 +1776,15 @@ public class PurpurWorldConfig {
public boolean frogControllable = true;
public float frogRidableJumpHeight = 0.65F;
public int frogBreedingTicks = 6000;
@@ -252,13 +252,13 @@ index 9cb79d203b6ec345d719cd488d2cce8f877fe2bd..fc30f2dcf7227f7cd087b2e5b8d3dc73
+ frogMaxHealth = getDouble("mobs.frog.attributes.max_health", frogMaxHealth);
+ frogTakeDamageFromWater = getBoolean("mobs.frog.takes-damage-from-water", frogTakeDamageFromWater);
+ frogAlwaysDropExp = getBoolean("mobs.frog.always-drop-exp", frogAlwaysDropExp);
+ // Plazma end
+ // Plazma end - Add missing purpur configuration options
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
@@ -2617,7 +2641,13 @@ public class PurpurWorldConfig {
public boolean snifferControllable = true;
@@ -2776,7 +2796,13 @@ public class PurpurWorldConfig {
public double snifferMaxHealth = 14.0D;
public double snifferScale = 1.0D;
public int snifferBreedingTicks = 6000;
+ // Plazma start - Add missing purpur config options
+ public boolean snifferTakeDamageFromWater = false;
@@ -266,11 +266,11 @@ index 9cb79d203b6ec345d719cd488d2cce8f877fe2bd..fc30f2dcf7227f7cd087b2e5b8d3dc73
private void snifferSettings() {
+ snifferTakeDamageFromWater = getBoolean("mobs.sniffer.takes-damage-from-water", snifferTakeDamageFromWater);
+ snifferAlwaysDropExp = getBoolean("mobs.sniffer.always-drop-exp", snifferAlwaysDropExp);
+ // Plazma end
+ // Plazma end - Add missing purpur configuration options
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
@@ -2716,7 +2746,15 @@ public class PurpurWorldConfig {
@@ -2884,7 +2910,15 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = true;
public boolean tadpoleControllable = true;
@@ -282,11 +282,11 @@ index 9cb79d203b6ec345d719cd488d2cce8f877fe2bd..fc30f2dcf7227f7cd087b2e5b8d3dc73
+ tadpoleMaxHealth = getDouble("mobs.tadpole.attributes.max_health", tadpoleMaxHealth);
+ tadpoleTakeDamageFromWater = getBoolean("mobs.tadpole.takes-damage-from-water", tadpoleTakeDamageFromWater);
+ tadpoleAlwaysDropExp = getBoolean("mobs.tadpole.always-drop-exp", tadpoleAlwaysDropExp);
+ // Plazma end
+ // Plazma end - Add missing purpur configuration options
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
@@ -2926,7 +2964,15 @@ public class PurpurWorldConfig {
@@ -3116,7 +3150,15 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false;
public boolean wardenRidableInWater = true;
public boolean wardenControllable = true;
@@ -298,7 +298,7 @@ index 9cb79d203b6ec345d719cd488d2cce8f877fe2bd..fc30f2dcf7227f7cd087b2e5b8d3dc73
+ wardenMaxHealth = getDouble("mobs.warden.attributes.max_health", wardenMaxHealth);
+ wardenTakeDamageFromWater = getBoolean("mobs.warden.takes-damage-from-water", wardenTakeDamageFromWater);
+ wardenAlwaysDropExp = getBoolean("mobs.warden.always-drop-exp", wardenAlwaysDropExp);
+ // Plazma end
+ // Plazma end - Add missing purpur configuration options
wardenRidable = getBoolean("mobs.warden.ridable", wardenRidable);
wardenRidableInWater = getBoolean("mobs.warden.ridable-in-water", wardenRidableInWater);
wardenControllable = getBoolean("mobs.warden.controllable", wardenControllable);

View File

@@ -1,930 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 17:52:52 +0900
Subject: [PATCH] Completely remove Mojang Profiler
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 389322d3ca9b1f3789271936a7e6c60bd7c27893..6ca87960654becdc7fd7d9b8465a140c0db2b8b9 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -113,16 +113,16 @@ import net.minecraft.util.Unit;
import net.minecraft.util.datafix.DataFixers;
import net.minecraft.util.profiling.EmptyProfileResults;
import net.minecraft.util.profiling.ProfileResults;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.util.profiling.ResultField;
-import net.minecraft.util.profiling.SingleTickProfiler;
+//import net.minecraft.util.profiling.SingleTickProfiler; // Plazma - Completely remove profiler
import net.minecraft.util.profiling.jfr.JvmProfiler;
import net.minecraft.util.profiling.jfr.callback.ProfiledDuration;
-import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder;
-import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder;
-import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder;
-import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider;
-import net.minecraft.util.profiling.metrics.storage.MetricsPersister;
+//import net.minecraft.util.profiling.metrics.profiling.ActiveMetricsRecorder; // Plazma - Completely remove profiler
+//import net.minecraft.util.profiling.metrics.profiling.InactiveMetricsRecorder; // Plazma - Completely remove profiler
+//import net.minecraft.util.profiling.metrics.profiling.MetricsRecorder; // Plazma - Completely remove profiler
+//import net.minecraft.util.profiling.metrics.profiling.ServerMetricsSamplersProvider; // Plazma - Completely remove profiler
+//import net.minecraft.util.profiling.metrics.storage.MetricsPersister; // Plazma - Completely remove profiler
import net.minecraft.util.thread.ReentrantBlockableEventLoop;
import net.minecraft.world.Difficulty;
import net.minecraft.world.RandomSequences;
@@ -214,11 +214,11 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public LevelStorageSource.LevelStorageAccess storageSource;
public final PlayerDataStorage playerDataStorage;
private final List<Runnable> tickables = Lists.newArrayList();
- private MetricsRecorder metricsRecorder;
- private ProfilerFiller profiler;
- private Consumer<ProfileResults> onMetricsRecordingStopped;
- private Consumer<Path> onMetricsRecordingFinished;
- private boolean willStartRecordingMetrics;
+ //private MetricsRecorder metricsRecorder; // Plazma - Completely remove profiler
+ //private ProfilerFiller profiler; // Plazma - Completely remove profiler
+ //private Consumer<ProfileResults> onMetricsRecordingStopped; // Plazma - Completely remove profiler
+ //private Consumer<Path> onMetricsRecordingFinished; // Plazma - Completely remove profiler
+ //private boolean willStartRecordingMetrics; // Plazma - Completely remove profiler
@Nullable
private MinecraftServer.TimeProfiler debugCommandProfiler;
private boolean debugCommandProfilerDelayStart;
@@ -2302,10 +2302,12 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
}
+ /* // Plazma - Completely remove profiler
public ProfilerFiller getProfiler() {
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
return this.profiler;
}
+ */ // Plazma - Completely remove profiler
public abstract boolean isSingleplayerOwner(GameProfile profile);
@@ -2542,6 +2544,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
// CraftBukkit end
+ /* // Plazma - Completely remove profiler
private void startMetricsRecordingTick() {
if (false && this.willStartRecordingMetrics) { // Purpur
this.metricsRecorder = ActiveMetricsRecorder.createStarted(new ServerMetricsSamplersProvider(Util.timeSource, this.isDedicatedServer()), Util.timeSource, Util.ioPool(), new MetricsPersister("server"), this.onMetricsRecordingStopped, (path) -> {
@@ -2557,6 +2560,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//this.metricsRecorder.startTick(); // Purpur
//this.profiler.startTick(); // Purpur
}
+ */ // Plazma - Completely remove profiler
private void endMetricsRecordingTick() {
//this.profiler.endTick(); // Purpur
diff --git a/src/main/java/net/minecraft/server/ServerAdvancementManager.java b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
index 8189c549edd14a351fc5e75be23da7378bbd3532..8c44b54aa6b3db4f52d0d6ad7f3d341f11b293f7 100644
--- a/src/main/java/net/minecraft/server/ServerAdvancementManager.java
+++ b/src/main/java/net/minecraft/server/ServerAdvancementManager.java
@@ -22,7 +22,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
import net.minecraft.util.GsonHelper;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.world.level.storage.loot.LootDataManager;
import org.slf4j.Logger;
@@ -39,7 +39,7 @@ public class ServerAdvancementManager extends SimpleJsonResourceReloadListener {
this.lootData = conditionManager;
}
- protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
+ protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove profiler
Builder<ResourceLocation, AdvancementHolder> builder = ImmutableMap.builder();
prepared.forEach((minecraftkey, jsonelement) -> {
diff --git a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
index 975422a57b83a31e63a600bb4ff9c4e2baaf6da7..6783dc11a321c244296e84223c51cd1a489a9b96 100644
--- a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
+++ b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
@@ -25,7 +25,7 @@ import net.minecraft.server.packs.resources.PreparableReloadListener;
import net.minecraft.server.packs.resources.Resource;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.tags.TagLoader;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.Vec2;
import net.minecraft.world.phys.Vec3;
@@ -62,7 +62,7 @@ public class ServerFunctionLibrary implements PreparableReloadListener {
}
@Override
- public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
+ public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
CompletableFuture<Map<ResourceLocation, List<TagLoader.EntryWithSource>>> completableFuture = CompletableFuture.supplyAsync(() -> {
return this.tagsLoader.load(manager);
}, prepareExecutor);
diff --git a/src/main/java/net/minecraft/server/ServerFunctionManager.java b/src/main/java/net/minecraft/server/ServerFunctionManager.java
index 097ac55028d66ef9ab430ff5dd103db6e3b99fc7..2993e9f326c43ef3f06d5e332899f9fad1f03718 100644
--- a/src/main/java/net/minecraft/server/ServerFunctionManager.java
+++ b/src/main/java/net/minecraft/server/ServerFunctionManager.java
@@ -19,7 +19,7 @@ import net.minecraft.commands.FunctionInstantiationException;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.world.level.GameRules;
public class ServerFunctionManager {
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 3771caa73b0b41428f3d629aca1f562df7bcfaff..a88f6bbed191b6fd3ef2da625df45520331cf7d7 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -68,7 +68,7 @@ import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.server.network.ServerPlayerConnection;
import net.minecraft.util.CsvOutput;
import net.minecraft.util.Mth;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.util.thread.BlockableEventLoop;
import net.minecraft.util.thread.ProcessorHandle;
import net.minecraft.util.thread.ProcessorMailbox;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index 43a46feb5fb4bf23d71bc4f6c08caa93b1959ffc..16c2db8fbfcaf15efb94c04e1bb2508e85812690 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -24,7 +24,7 @@ import net.minecraft.core.SectionPos;
import net.minecraft.network.protocol.Packet;
import net.minecraft.server.level.progress.ChunkProgressListener;
import net.minecraft.util.VisibleForDebug;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.util.thread.BlockableEventLoop;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.ai.village.poi.PoiManager;
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index e46207a250a5456589da06fd5fad2a385ef7d4a5..9301ec8142fbf5c5112cac75aef1b8e35737ce43 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -77,7 +77,7 @@ import net.minecraft.util.Mth;
import net.minecraft.util.ProgressListener;
import net.minecraft.util.RandomSource;
import net.minecraft.util.Unit;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.util.valueproviders.IntProvider;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.DifficultyInstance;
@@ -694,15 +694,15 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
// Objects.requireNonNull(minecraftserver); // CraftBukkit - decompile error
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), minecraftserver::getProfiler, false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(org.plazmamc.plazma.configurations.PlazmaConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma
+ super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), /*minecraftserver::getProfiler,*/ false, flag, i, minecraftserver.getMaxChainedNeighborUpdates(), gen, biomeProvider, env, spigotConfig -> minecraftserver.paperConfigurations.createWorldConfig(io.papermc.paper.configuration.PaperConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(org.plazmamc.plazma.configurations.PlazmaConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess())), executor); // Paper - Async-Anti-Xray - Pass executor // Plazma // Plazma - Completely remove profiler
this.pvpMode = minecraftserver.isPvpAllowed();
this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
// CraftBukkit end
this.players = Lists.newArrayList();
this.entityTickList = new EntityTickList();
- this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
- this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded, this.getProfilerSupplier());
+ this.blockTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded); //, this.getProfilerSupplier()); // Plazma - Completely remove profiler
+ this.fluidTicks = new LevelTicks<>(this::isPositionTickingWithEntitiesLoaded); //, this.getProfilerSupplier()); // Plazma - Completely remove profiler
this.navigatingMobs = new ObjectOpenHashSet();
this.blockEvents = new ObjectLinkedOpenHashSet();
this.blockEventsToReschedule = new ArrayList(64);
diff --git a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
index 828196decc89e7e03f88c4a3208ee1ab2bb69242..c0088e0e566abb928c8dcd6f819d82cc1122589b 100644
--- a/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
+++ b/src/main/java/net/minecraft/server/packs/resources/PreparableReloadListener.java
@@ -2,10 +2,10 @@ package net.minecraft.server.packs.resources;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
public interface PreparableReloadListener {
- CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor);
+ CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor); // Plazma - Completely remove profiler
default String getName() {
return this.getClass().getSimpleName();
diff --git a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
index 7383c7d3820dce06108eaafd236a7c6c06a10a42..4e1f4e026cd7c566468a58b2ea232d5dee80b86f 100644
--- a/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
+++ b/src/main/java/net/minecraft/server/packs/resources/ResourceManagerReloadListener.java
@@ -3,11 +3,11 @@ package net.minecraft.server.packs.resources;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
import net.minecraft.util.Unit;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
public interface ResourceManagerReloadListener extends PreparableReloadListener {
@Override
- default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
+ default CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
return synchronizer.wait(Unit.INSTANCE).thenRunAsync(() -> {
//applyProfiler.startTick(); // Purpur
//applyProfiler.push("listener"); // Purpur
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
index 9cc09f0415a09299102dbcf022326944368ea033..2e9e63f3ee6268cafa3b90666cf31019e7341dbb 100644
--- a/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleJsonResourceReloadListener.java
@@ -11,7 +11,7 @@ import java.util.Map;
import net.minecraft.resources.FileToIdConverter;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.GsonHelper;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import org.slf4j.Logger;
public abstract class SimpleJsonResourceReloadListener extends SimplePreparableReloadListener<Map<ResourceLocation, JsonElement>> {
@@ -25,7 +25,7 @@ public abstract class SimpleJsonResourceReloadListener extends SimplePreparableR
}
@Override
- protected Map<ResourceLocation, JsonElement> prepare(ResourceManager resourceManager, ProfilerFiller profilerFiller) {
+ protected Map<ResourceLocation, JsonElement> prepare(ResourceManager resourceManager/*, ProfilerFiller profilerFiller*/) { // Plazma - Completely remove Profiler
Map<ResourceLocation, JsonElement> map = new HashMap<>();
scanDirectory(resourceManager, this.directory, this.gson, map);
return map;
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
index 7ab57748b2f2aea1003d9b7e70e76c372aa1e432..7de117e0464a24da632d134870554fd11e1b87ca 100644
--- a/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
+++ b/src/main/java/net/minecraft/server/packs/resources/SimplePreparableReloadListener.java
@@ -2,19 +2,19 @@ package net.minecraft.server.packs.resources;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Executor;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
public abstract class SimplePreparableReloadListener<T> implements PreparableReloadListener {
@Override
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
return CompletableFuture.supplyAsync(() -> {
- return this.prepare(manager, prepareProfiler);
+ return this.prepare(manager/*, prepareProfiler*/); // Plazma - Completely remove profiler
}, prepareExecutor).thenCompose(synchronizer::wait).thenAcceptAsync((prepared) -> {
- this.apply(prepared, manager, applyProfiler);
+ this.apply(prepared, manager/*, applyProfiler*/); // Plazma - Completely remove profiler
}, applyExecutor);
}
- protected abstract T prepare(ResourceManager manager, ProfilerFiller profiler);
+ protected abstract T prepare(ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove profiler
- protected abstract void apply(T prepared, ResourceManager manager, ProfilerFiller profiler);
+ protected abstract void apply(T prepared, ResourceManager manager/*, ProfilerFiller profiler*/); // Plazma - Completely remove profiler
}
diff --git a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
index de2ecc7c69fb870f843f60596115866214267ee4..05a731dec4aec1d3cf61a761bda018cc8c46afde 100644
--- a/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
+++ b/src/main/java/net/minecraft/server/packs/resources/SimpleReloadInstance.java
@@ -26,7 +26,7 @@ public class SimpleReloadInstance<S> implements ReloadInstance {
public static SimpleReloadInstance<Void> of(ResourceManager manager, List<PreparableReloadListener> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) {
return new SimpleReloadInstance<>(prepareExecutor, applyExecutor, manager, reloaders, (synchronizer, resourceManager, reloader, prepare, apply) -> {
- return reloader.reload(synchronizer, resourceManager, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE, prepareExecutor, apply);
+ return reloader.reload(synchronizer, resourceManager/*, InactiveProfiler.INSTANCE, InactiveProfiler.INSTANCE*/, prepareExecutor, apply); // Plazma - Completely remove Profiler
}, initialStage);
}
diff --git a/src/main/java/net/minecraft/tags/TagManager.java b/src/main/java/net/minecraft/tags/TagManager.java
index 60ed9413c32d91ce33583cc24998d08869d07a23..67c0d8f7294e18c7b2107b82219bc106608a21f0 100644
--- a/src/main/java/net/minecraft/tags/TagManager.java
+++ b/src/main/java/net/minecraft/tags/TagManager.java
@@ -14,7 +14,7 @@ import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.PreparableReloadListener;
import net.minecraft.server.packs.resources.ResourceManager;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
public class TagManager implements PreparableReloadListener {
private static final Map<ResourceKey<? extends Registry<?>>, String> CUSTOM_REGISTRY_DIRECTORIES = Map.of(Registries.BLOCK, "tags/blocks", Registries.ENTITY_TYPE, "tags/entity_types", Registries.FLUID, "tags/fluids", Registries.GAME_EVENT, "tags/game_events", Registries.ITEM, "tags/items");
@@ -35,7 +35,7 @@ public class TagManager implements PreparableReloadListener {
}
@Override
- public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
+ public CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager/*, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler*/, Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
List<? extends CompletableFuture<? extends TagManager.LoadResult<?>>> list = this.registryAccess.registries().map((registry) -> {
return this.createLoader(manager, prepareExecutor, registry);
}).toList();
diff --git a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java b/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
deleted file mode 100644
index c6c30d99399c5cde2b0ec2f320d81d952b422d78..0000000000000000000000000000000000000000
--- a/src/main/java/net/minecraft/util/profiling/ActiveProfiler.java
+++ /dev/null
@@ -1,208 +0,0 @@
-package net.minecraft.util.profiling;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.mojang.logging.LogUtils;
-import it.unimi.dsi.fastutil.longs.LongArrayList;
-import it.unimi.dsi.fastutil.longs.LongList;
-import it.unimi.dsi.fastutil.objects.Object2LongMap;
-import it.unimi.dsi.fastutil.objects.Object2LongMaps;
-import it.unimi.dsi.fastutil.objects.Object2LongOpenHashMap;
-import it.unimi.dsi.fastutil.objects.ObjectArraySet;
-import java.time.Duration;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.function.IntSupplier;
-import java.util.function.LongSupplier;
-import java.util.function.Supplier;
-import javax.annotation.Nullable;
-import net.minecraft.Util;
-import net.minecraft.util.profiling.metrics.MetricCategory;
-import org.apache.commons.lang3.tuple.Pair;
-import org.slf4j.Logger;
-
-public class ActiveProfiler implements ProfileCollector {
- private static final long WARNING_TIME_NANOS = Duration.ofMillis(100L).toNanos();
- private static final Logger LOGGER = LogUtils.getLogger();
- private final List<String> paths = Lists.newArrayList();
- private final LongList startTimes = new LongArrayList();
- private final Map<String, ActiveProfiler.PathEntry> entries = Maps.newHashMap();
- private final IntSupplier getTickTime;
- private final LongSupplier getRealTime;
- private final long startTimeNano;
- private final int startTimeTicks;
- private String path = "";
- private boolean started;
- @Nullable
- private ActiveProfiler.PathEntry currentEntry;
- private final boolean warn;
- private final Set<Pair<String, MetricCategory>> chartedPaths = new ObjectArraySet<>();
-
- public ActiveProfiler(LongSupplier timeGetter, IntSupplier tickGetter, boolean checkTimeout) {
- this.startTimeNano = timeGetter.getAsLong();
- this.getRealTime = timeGetter;
- this.startTimeTicks = tickGetter.getAsInt();
- this.getTickTime = tickGetter;
- this.warn = checkTimeout;
- }
-
- @Override
- public void startTick() {
- if (this.started) {
- LOGGER.error("Profiler tick already started - missing endTick()?");
- } else {
- this.started = true;
- this.path = "";
- this.paths.clear();
- //this.push("root"); // Purpur
- }
- }
-
- @Override
- public void endTick() {
- if (!this.started) {
- LOGGER.error("Profiler tick already ended - missing startTick()?");
- } else {
- //this.pop(); // Purpur
- this.started = false;
- if (!this.path.isEmpty()) {
- LOGGER.error("Profiler tick ended before path was fully popped (remainder: '{}'). Mismatched push/pop?", LogUtils.defer(() -> {
- return ProfileResults.demanglePath(this.path);
- }));
- }
-
- }
- }
-
- @Override
- public void push(String location) {
- if (!this.started) {
- LOGGER.error("Cannot push '{}' to profiler if profiler tick hasn't started - missing startTick()?", (Object)location);
- } else {
- if (!this.path.isEmpty()) {
- this.path = this.path + "\u001e";
- }
-
- this.path = this.path + location;
- this.paths.add(this.path);
- this.startTimes.add(Util.getNanos());
- this.currentEntry = null;
- }
- }
-
- @Override
- public void push(Supplier<String> locationGetter) {
- //this.push(locationGetter.get()); // Purpur
- }
-
- @Override
- public void markForCharting(MetricCategory type) {
- this.chartedPaths.add(Pair.of(this.path, type));
- }
-
- @Override
- public void pop() {
- if (!this.started) {
- LOGGER.error("Cannot pop from profiler if profiler tick hasn't started - missing startTick()?");
- } else if (this.startTimes.isEmpty()) {
- LOGGER.error("Tried to pop one too many times! Mismatched push() and pop()?");
- } else {
- long l = Util.getNanos();
- long m = this.startTimes.removeLong(this.startTimes.size() - 1);
- this.paths.remove(this.paths.size() - 1);
- long n = l - m;
- ActiveProfiler.PathEntry pathEntry = this.getCurrentEntry();
- pathEntry.accumulatedDuration += n;
- ++pathEntry.count;
- pathEntry.maxDuration = Math.max(pathEntry.maxDuration, n);
- pathEntry.minDuration = Math.min(pathEntry.minDuration, n);
- if (this.warn && n > WARNING_TIME_NANOS) {
- LOGGER.warn("Something's taking too long! '{}' took aprox {} ms", LogUtils.defer(() -> {
- return ProfileResults.demanglePath(this.path);
- }), LogUtils.defer(() -> {
- return (double)n / 1000000.0D;
- }));
- }
-
- this.path = this.paths.isEmpty() ? "" : this.paths.get(this.paths.size() - 1);
- this.currentEntry = null;
- }
- }
-
- @Override
- public void popPush(String location) {
- //this.pop(); // Purpur
- //this.push(location); // Purpur
- }
-
- @Override
- public void popPush(Supplier<String> locationGetter) {
- //this.pop(); // Purpur
- //this.push(locationGetter); // Purpur
- }
-
- private ActiveProfiler.PathEntry getCurrentEntry() {
- if (this.currentEntry == null) {
- this.currentEntry = this.entries.computeIfAbsent(this.path, (k) -> {
- return new ActiveProfiler.PathEntry();
- });
- }
-
- return this.currentEntry;
- }
-
- @Override
- public void incrementCounter(String marker, int num) {
- this.getCurrentEntry().counters.addTo(marker, (long)num);
- }
-
- @Override
- public void incrementCounter(Supplier<String> markerGetter, int num) {
- this.getCurrentEntry().counters.addTo(markerGetter.get(), (long)num);
- }
-
- @Override
- public ProfileResults getResults() {
- return new FilledProfileResults(this.entries, this.startTimeNano, this.startTimeTicks, this.getRealTime.getAsLong(), this.getTickTime.getAsInt());
- }
-
- @Nullable
- @Override
- public ActiveProfiler.PathEntry getEntry(String name) {
- return this.entries.get(name);
- }
-
- @Override
- public Set<Pair<String, MetricCategory>> getChartedPaths() {
- return this.chartedPaths;
- }
-
- public static class PathEntry implements ProfilerPathEntry {
- long maxDuration = Long.MIN_VALUE;
- long minDuration = Long.MAX_VALUE;
- long accumulatedDuration;
- long count;
- final Object2LongOpenHashMap<String> counters = new Object2LongOpenHashMap<>();
-
- @Override
- public long getDuration() {
- return this.accumulatedDuration;
- }
-
- @Override
- public long getMaxDuration() {
- return this.maxDuration;
- }
-
- @Override
- public long getCount() {
- return this.count;
- }
-
- @Override
- public Object2LongMap<String> getCounters() {
- return Object2LongMaps.unmodifiable(this.counters);
- }
- }
-}
diff --git a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java b/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
deleted file mode 100644
index 863343a87fe34d72f04af89d75268b477b2adc7a..0000000000000000000000000000000000000000
--- a/src/main/java/net/minecraft/util/profiling/ProfilerFiller.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package net.minecraft.util.profiling;
-
-import java.util.function.Supplier;
-import net.minecraft.util.profiling.metrics.MetricCategory;
-
-public interface ProfilerFiller {
- String ROOT = "root";
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void startTick();
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void endTick();
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void push(String location);
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void push(Supplier<String> locationGetter);
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void pop();
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void popPush(String location);
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void popPush(Supplier<String> locationGetter);
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void markForCharting(MetricCategory type);
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- default void incrementCounter(String marker) {
- //this.incrementCounter(marker, 1); // Purpur
- }
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void incrementCounter(String marker, int num);
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- default void incrementCounter(Supplier<String> markerGetter) {
- //this.incrementCounter(markerGetter, 1); // Purpur
- }
-
- @io.papermc.paper.annotation.DoNotUse // Purpur
- void incrementCounter(Supplier<String> markerGetter, int num);
-
- static ProfilerFiller tee(final ProfilerFiller a, final ProfilerFiller b) {
- if (a == InactiveProfiler.INSTANCE) {
- return b;
- } else {
- return b == InactiveProfiler.INSTANCE ? a : new ProfilerFiller() {
- @Override
- public void startTick() {
- //a.startTick(); // Purpur
- //b.startTick(); // Purpur
- }
-
- @Override
- public void endTick() {
- //a.endTick(); // Purpur
- //b.endTick(); // Purpur
- }
-
- @Override
- public void push(String location) {
- //a.push(location); // Purpur
- //b.push(location); // Purpur
- }
-
- @Override
- public void push(Supplier<String> locationGetter) {
- //a.push(locationGetter); // Purpur
- //b.push(locationGetter); // Purpur
- }
-
- @Override
- public void markForCharting(MetricCategory type) {
- //a.markForCharting(type); // Purpur
- //b.markForCharting(type); // Purpur
- }
-
- @Override
- public void pop() {
- //a.pop(); // Purpur
- //b.pop(); // Purpur
- }
-
- @Override
- public void popPush(String location) {
- //a.popPush(location); // Purpur
- //b.popPush(location); // Purpur
- }
-
- @Override
- public void popPush(Supplier<String> locationGetter) {
- //a.popPush(locationGetter); // Purpur
- //b.popPush(locationGetter); // Purpur
- }
-
- @Override
- public void incrementCounter(String marker, int num) {
- //a.incrementCounter(marker, num); // Purpur
- //b.incrementCounter(marker, num); // Purpur
- }
-
- @Override
- public void incrementCounter(Supplier<String> markerGetter, int num) {
- //a.incrementCounter(markerGetter, num); // Purpur
- //b.incrementCounter(markerGetter, num); // Purpur
- }
- };
- }
- }
-}
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index 80c03bd4e5d7e20bb8a4e14af5620f5c57a05fd4..aeae6117b398b84d5c8ecaa175a72867416ff166 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -147,8 +147,8 @@ public abstract class Mob extends LivingEntity implements Targeting {
this.pathfindingMalus = Maps.newEnumMap(BlockPathTypes.class);
this.restrictCenter = BlockPos.ZERO;
this.restrictRadius = -1.0F;
- this.goalSelector = new GoalSelector(world.getProfilerSupplier());
- this.targetSelector = new GoalSelector(world.getProfilerSupplier());
+ this.goalSelector = new GoalSelector(); //world.getProfilerSupplier()); // Plazma - Completely remove profiler
+ this.targetSelector = new GoalSelector(); //world.getProfilerSupplier()); // Plazma - Completely remove profiler
this.lookControl = new org.purpurmc.purpur.controller.LookControllerWASD(this); // Purpur
this.moveControl = new org.purpurmc.purpur.controller.MoveControllerWASD(this); // Purpur
this.jumpControl = new JumpControl(this);
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
index 02978315bc2b828cc603ce7478408f3f82c249c2..4f9b19c45afd6b26833ba892a90d3a9559d5d859 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/GoalSelector.java
@@ -11,7 +11,7 @@ import java.util.Set;
import java.util.function.Predicate;
import java.util.function.Supplier;
import java.util.stream.Stream;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import org.slf4j.Logger;
public class GoalSelector {
@@ -29,7 +29,7 @@ public class GoalSelector {
};
private final Map<Goal.Flag, WrappedGoal> lockedFlags = new EnumMap<>(Goal.Flag.class);
private final Set<WrappedGoal> availableGoals = Sets.newLinkedHashSet();
- private final Supplier<ProfilerFiller> profiler;
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
private final EnumSet<Goal.Flag> disabledFlags = EnumSet.noneOf(Goal.Flag.class); // Paper unused, but dummy to prevent plugins from crashing as hard. Theyll need to support paper in a special case if this is super important, but really doesn't seem like it would be.
private final com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<net.minecraft.world.entity.ai.goal.Goal.Flag> goalTypes = new com.destroystokyo.paper.util.set.OptimizedSmallEnumSet<>(Goal.Flag.class); // Paper - remove streams from pathfindergoalselector
private int tickCount;
@@ -37,9 +37,11 @@ public class GoalSelector {
private int curRate;
private static final Goal.Flag[] GOAL_FLAG_VALUES = Goal.Flag.values(); // Paper - remove streams from pathfindergoalselector
+ /* // Plazma - Completely remove profiler
public GoalSelector(Supplier<ProfilerFiller> profiler) {
this.profiler = profiler;
}
+ */ // Plazma - Completely remove profiler
public void addGoal(int priority, Goal goal) {
this.availableGoals.add(new WrappedGoal(priority, goal));
diff --git a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
index 388363948595247471fa4c3c6801fc493d61c0d0..6851ee45b5b41cf549a8aed14d95545b0d120414 100644
--- a/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
+++ b/src/main/java/net/minecraft/world/item/crafting/RecipeManager.java
@@ -31,7 +31,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
import net.minecraft.util.GsonHelper;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.world.Container;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
@@ -51,7 +51,7 @@ public class RecipeManager extends SimpleJsonResourceReloadListener {
super(RecipeManager.GSON, "recipes");
}
- protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager, ProfilerFiller profiler) {
+ protected void apply(Map<ResourceLocation, JsonElement> prepared, ResourceManager manager/*, ProfilerFiller profiler*/) { // Plazma - Completely remove Profiler
this.hasErrors = false;
// CraftBukkit start - SPIGOT-5667 make sure all types are populated and mutable
Map<RecipeType<?>, Object2ObjectLinkedOpenHashMap<ResourceLocation, RecipeHolder<?>>> map1 = Maps.newHashMap();
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index af4eb54d99b67d059534e5e55e952aa41bb87bc7..412dd103bad498c3c93b7a3ab98f834944d514eb 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -39,7 +39,7 @@ import net.minecraft.sounds.SoundSource;
import net.minecraft.util.AbortableIterationConsumer;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.damagesource.DamageSources;
@@ -137,7 +137,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
private final ResourceKey<DimensionType> dimensionTypeId;
private final Holder<DimensionType> dimensionTypeRegistration;
public final WritableLevelData levelData;
- private final Supplier<ProfilerFiller> profiler;
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
public final boolean isClientSide;
private final WorldBorder worldBorder;
private final BiomeManager biomeManager;
@@ -262,7 +262,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
//protected final io.papermc.paper.util.math.ThreadUnsafeRandom randomTickRandom = new io.papermc.paper.util.math.ThreadUnsafeRandom(java.util.concurrent.ThreadLocalRandom.current().nextLong()); public net.minecraft.util.RandomSource getThreadUnsafeRandom() { return this.randomTickRandom; } // Pufferfish - move thread unsafe random initialization // Pufferfish - getter // Purpur - dont break ABI
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, Supplier<ProfilerFiller> supplier, boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.WorldConfigurations> plazmaWorldConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma
+ protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, /*Supplier<ProfilerFiller> supplier,*/ boolean flag, boolean flag1, long i, int j, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider, org.bukkit.World.Environment env, java.util.function.Function<org.spigotmc.SpigotWorldConfig, io.papermc.paper.configuration.WorldConfiguration> paperWorldConfigCreator, java.util.function.Function<org.spigotmc.SpigotWorldConfig, org.plazmamc.plazma.configurations.WorldConfigurations> plazmaWorldConfigurationCreator, java.util.concurrent.Executor executor) { // Paper - Async-Anti-Xray - Pass executor // Plazma //- Completely remove profiler
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
this.plazmaConfig = plazmaWorldConfigurationCreator.apply(this.spigotConfig); // Plazma
@@ -279,7 +279,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
}
// CraftBukkit end
- this.profiler = supplier;
+ //this.profiler = supplier; // Plazma - Completely remove profiler
this.levelData = worlddatamutable;
this.dimensionTypeRegistration = holder;
this.dimensionTypeId = (ResourceKey) holder.unwrapKey().orElseThrow(() -> {
@@ -1833,6 +1833,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return false;
}
+ /* // Plazma - Completely remove profiler
public ProfilerFiller getProfiler() {
if (true || gg.pufferfish.pufferfish.PufferfishConfig.disableMethodProfiler) return net.minecraft.util.profiling.InactiveProfiler.INSTANCE; // Pufferfish // Purpur
return (ProfilerFiller) this.profiler.get();
@@ -1841,6 +1842,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public Supplier<ProfilerFiller> getProfilerSupplier() {
return this.profiler;
}
+ */ // Plazma - Completely remove profiler
@Override
public BiomeManager getBiomeManager() {
diff --git a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
index 0f1025495237aebe30132ace0832aa5718d6f9bb..0226280bbdb9d63831d93f980ee117da1eac08aa 100644
--- a/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
+++ b/src/main/java/net/minecraft/world/level/PathNavigationRegion.java
@@ -8,7 +8,7 @@ import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.SectionPos;
import net.minecraft.core.registries.Registries;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.biome.Biome;
@@ -155,7 +155,9 @@ public class PathNavigationRegion implements BlockGetter, CollisionGetter {
return this.level.getHeight();
}
+ /* // Plazma - Completely remove profiler
public ProfilerFiller getProfiler() {
return this.level.getProfiler();
}
+ */ // Plazma - Completely remove profiler
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index 66656c4cf157228c9f52b33b358713ef0172f9ff..a8a360b794cec35b9f7ab137aaf35fba1d610f26 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -25,7 +25,7 @@ import net.minecraft.network.FriendlyByteBuf;
import net.minecraft.network.protocol.game.ClientboundLevelChunkPacketData;
import net.minecraft.server.level.FullChunkStatus;
import net.minecraft.server.level.ServerLevel;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.Level;
@@ -455,7 +455,7 @@ public class LevelChunk extends ChunkAccess {
}
if (LightEngine.hasDifferentLightProperties(this, blockposition, iblockdata1, iblockdata)) {
- ProfilerFiller gameprofilerfiller = this.level.getProfiler();
+ //ProfilerFiller gameprofilerfiller = this.level.getProfiler(); // Plazma - Completely remove profiler
//gameprofilerfiller.push("updateSkyLightSources"); // Purpur
// Paper - starlight - remove skyLightSources
diff --git a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
index a8af51a25b0f99c3a64d9150fdfcd6b818aa7581..b9689131a7a46b46c0b75b86f2bb163d7de74921 100644
--- a/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
+++ b/src/main/java/net/minecraft/world/level/pathfinder/PathFinder.java
@@ -12,7 +12,7 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import javax.annotation.Nullable;
import net.minecraft.core.BlockPos;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.util.profiling.metrics.MetricCategory;
import net.minecraft.world.entity.Mob;
import net.minecraft.world.level.PathNavigationRegion;
@@ -44,7 +44,7 @@ public class PathFinder {
map.add(new java.util.AbstractMap.SimpleEntry<>(this.nodeEvaluator.getGoal(pos.getX(), pos.getY(), pos.getZ()), pos));
}
// Paper end
- Path path = this.findPath(world.getProfiler(), node, map, followRange, distance, rangeMultiplier);
+ Path path = this.findPath(/*world.getProfiler(), */node, map, followRange, distance, rangeMultiplier); // Plazma - Completely remove profiler
this.nodeEvaluator.done();
return path;
}
@@ -52,7 +52,7 @@ public class PathFinder {
@Nullable
// Paper start - optimize collection
- private Path findPath(ProfilerFiller profiler, Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) {
+ private Path findPath(/*ProfilerFiller profiler, */Node startNode, List<Map.Entry<Target, BlockPos>> positions, float followRange, int distance, float rangeMultiplier) { // Plazma - Completely remove profiler
//profiler.push("find_path"); // Purpur
//profiler.markForCharting(MetricCategory.PATH_FINDING); // Purpur
// Set<Target> set = positions.keySet();
diff --git a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
index 08f5239d5eea9133340ec9e1a3a7d8d5e792ced0..ad306d5d69b2bd6ac4ddbdd13dd0a34c9c4cc4f5 100644
--- a/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
+++ b/src/main/java/net/minecraft/world/level/storage/loot/LootDataManager.java
@@ -19,7 +19,7 @@ import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.packs.resources.PreparableReloadListener;
import net.minecraft.server.packs.resources.ResourceManager;
import net.minecraft.server.packs.resources.SimpleJsonResourceReloadListener;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler // Plazma - Completely remove profiler
import net.minecraft.world.level.storage.loot.parameters.LootContextParamSets;
import org.bukkit.craftbukkit.CraftLootTable;
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
@@ -36,7 +36,7 @@ public class LootDataManager implements PreparableReloadListener, LootDataResolv
public LootDataManager() {}
@Override
- public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler, Executor prepareExecutor, Executor applyExecutor) {
+ public final CompletableFuture<Void> reload(PreparableReloadListener.PreparationBarrier synchronizer, ResourceManager manager, /*ProfilerFiller prepareProfiler, ProfilerFiller applyProfiler,*/ Executor prepareExecutor, Executor applyExecutor) { // Plazma - Completely remove profiler
Map<LootDataType<?>, Map<ResourceLocation, ?>> map = new HashMap();
CompletableFuture<?>[] acompletablefuture = (CompletableFuture[]) LootDataType.values().map((lootdatatype) -> {
return LootDataManager.scheduleElementParse(lootdatatype, manager, prepareExecutor, map);
diff --git a/src/main/java/net/minecraft/world/ticks/LevelTicks.java b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
index 0043c0087896a6df6910b0500da37d84b287c901..17a5928afade7e477cda34365dc8c72c52a6b758 100644
--- a/src/main/java/net/minecraft/world/ticks/LevelTicks.java
+++ b/src/main/java/net/minecraft/world/ticks/LevelTicks.java
@@ -23,7 +23,7 @@ import net.minecraft.Util;
import net.minecraft.core.BlockPos;
import net.minecraft.core.SectionPos;
import net.minecraft.core.Vec3i;
-import net.minecraft.util.profiling.ProfilerFiller;
+//import net.minecraft.util.profiling.ProfilerFiller; // Plazma - Completely remove profiler
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.levelgen.structure.BoundingBox;
@@ -32,7 +32,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
return ScheduledTick.INTRA_TICK_DRAIN_ORDER.compare(a.peek(), b.peek());
};
private final LongPredicate tickCheck;
- private final Supplier<ProfilerFiller> profiler;
+ //private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove profiler
private final Long2ObjectMap<LevelChunkTicks<T>> allContainers = new Long2ObjectOpenHashMap<>();
private final Long2LongMap nextTickForContainer = Util.make(new Long2LongOpenHashMap(), (map) -> {
map.defaultReturnValue(Long.MAX_VALUE);
@@ -48,9 +48,9 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
};
- public LevelTicks(LongPredicate tickingFutureReadyPredicate, Supplier<ProfilerFiller> profilerGetter) {
+ public LevelTicks(LongPredicate tickingFutureReadyPredicate/*, Supplier<ProfilerFiller> profilerGetter*/) { // Plazma - Completely remove profiler
this.tickCheck = tickingFutureReadyPredicate;
- this.profiler = profilerGetter;
+ //this.profiler = profilerGetter; // Plazma - Completely remove profiler
}
public void addContainer(ChunkPos pos, LevelChunkTicks<T> scheduler) {
@@ -88,7 +88,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
public void tick(long time, int maxTicks, BiConsumer<BlockPos, T> ticker) {
//ProfilerFiller profilerFiller = this.profiler.get(); // Purpur
//profilerFiller.push("collect"); // Purpur
- this.collectTicks(time, maxTicks, null); // Purpur
+ this.collectTicks(time, maxTicks); // Purpur // Plazma - Completely remove profiler
//profilerFiller.popPush("run"); // Purpur
//profilerFiller.incrementCounter("ticksToRun", this.toRunThisTick.size()); // Purpur
this.runCollectedTicks(ticker);
@@ -97,7 +97,7 @@ public class LevelTicks<T> implements LevelTickAccess<T> {
//profilerFiller.pop(); // Purpur
}
- private void collectTicks(long time, int maxTicks, ProfilerFiller profiler) {
+ private void collectTicks(long time, int maxTicks/*, ProfilerFiller profiler*/) { // Plazma - Completely remove profiler
this.sortContainersToTick(time);
//profiler.incrementCounter("containersToTick", this.containersToTick.size()); // Purpur
this.drainContainers(time, maxTicks);

View File

@@ -1,63 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 11:27:51 +0900
Subject: [PATCH] Add option to change nether portal size
diff --git a/src/main/java/net/minecraft/world/level/portal/PortalShape.java b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
index e7554ec800f321e4e34c926c53f2375a8c3aa979..fc3c0ea41563995b1b115271cda4e9ca76245c4e 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
@@ -100,7 +100,7 @@ public class PortalShape {
private int calculateWidth() {
int i = this.getDistanceUntilEdgeAboveFrame(this.bottomLeft, this.rightDir);
- return i >= 2 && i <= 21 ? i : 0;
+ return i >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.min() && i <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.max() ? i : 0; // Plazma - Configurable nether portal size
}
private int getDistanceUntilEdgeAboveFrame(BlockPos pos, Direction direction) {
@@ -133,7 +133,7 @@ public class PortalShape {
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
int i = this.getDistanceUntilTop(blockposition_mutableblockposition);
- return i >= 3 && i <= 21 && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0;
+ return i >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.min() && i <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.max() && this.hasTopFrame(blockposition_mutableblockposition, i) ? i : 0; // Plazma - Configurable nether portal size
}
private boolean hasTopFrame(BlockPos.MutableBlockPos pos, int height) {
@@ -187,7 +187,7 @@ public class PortalShape {
}
public boolean isValid() {
- return this.bottomLeft != null && this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
+ return this.bottomLeft != null && this.width >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.min() && this.width <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.width.max() && this.height >= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.min() && this.height <= this.level.getMinecraftWorld().plazmaConfig().structure.netherPortal.height.max(); // Plazma - Configurable nether portal size
}
// CraftBukkit start - return boolean
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index a372b5be3b1da5868d3766a8ba58997a48118581..d79410cc8b6054e5d3297b3e768fb232f97062e4 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -42,6 +42,21 @@ public class WorldConfigurations extends ConfigurationPart {
public NetherPortal netherPortal;
public class NetherPortal extends ConfigurationPart {
+ public Width width;
+ public class Width extends ConfigurationPart {
+
+ int min = 2; public int min() { return Math.max(this.min, 1); }
+ int max = 21; public int max() { return Math.max(this.min, this.max); }
+
+ }
+
+ public Height height;
+ public class Height extends ConfigurationPart {
+
+ int min = 3; public int min() { return Math.max(this.min, 2); }
+ int max = 21; public int max() { return Math.max(this.min, this.max); }
+
+ }
}

View File

@@ -1,333 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 21:18:22 +0900
Subject: [PATCH] Reduce create random instance
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 6ca87960654becdc7fd7d9b8465a140c0db2b8b9..cda99102949ae9d722c347e0dd610dfff625b5b8 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -228,7 +228,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private ServerStatus status;
@Nullable
private ServerStatus.Favicon statusIcon;
- private final RandomSource random;
+ private final RandomSource random; public RandomSource random() { return this.random; } // Plazma - expose random
public final DataFixer fixerUpper;
private String localIp;
private int port;
diff --git a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
index f5bc3497831877e0c2b7dc1cbd8abe3a67d7695b..e27867a95d49531507de63be09604d476a0e43e5 100644
--- a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
+++ b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
@@ -65,7 +65,7 @@ public class SpreadPlayersCommand {
if (maxY < j) {
throw SpreadPlayersCommand.ERROR_INVALID_MAX_HEIGHT.create(maxY, j);
} else {
- RandomSource randomsource = RandomSource.create();
+ RandomSource randomsource = worldserver.plazmaConfig().misc.reduceRandom ? worldserver.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
double d0 = (double) (center.x - maxRange);
double d1 = (double) (center.y - maxRange);
double d2 = (double) (center.x + maxRange);
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
index 7b72be8dcaf3fc5c7151c847faa2dfc75ef9eeb7..9a818c8f1450d31d29fd72cda45a14eec9034615 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -449,7 +449,7 @@ public class ServerPlayer extends Player {
long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
int j1 = this.getCoprime(i1);
- int k1 = RandomSource.create().nextInt(i1);
+ int k1 = (worldserver.plazmaConfig().misc.reduceRandom ? worldserver.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
for (int l1 = 0; l1 < i1; ++l1) {
int i2 = (k1 + j1 * l1) % i1;
@@ -486,7 +486,7 @@ public class ServerPlayer extends Player {
long l = k * k;
int i1 = l > 2147483647L ? Integer.MAX_VALUE : (int) l;
int j1 = this.getCoprime(i1);
- int k1 = RandomSource.create().nextInt(i1);
+ int k1 = (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()).nextInt(i1); // Plazma - Reduce create random instance
for (int l1 = 0; l1 < i1; ++l1) {
int i2 = (k1 + j1 * l1) % i1;
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index dd707019fb9b2c46d706311862fea91b84793ff9..05ef30ecdb68d1d254246431e7d5cecf9a38427e 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -70,7 +70,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
this.serverId = "";
this.server = server;
this.connection = connection;
- this.challenge = Ints.toByteArray(RandomSource.create().nextInt());
+ this.challenge = Ints.toByteArray((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? server.random() : RandomSource.create()).nextInt()); // Plazma - Reduce create random instance
}
@Override
diff --git a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
index 1ef089dbf83de35d875c00efdf468c397be56978..832c3fa9f6f6706c48d5744e15d3c748edafe8a4 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
@@ -349,7 +349,7 @@ public class QueryThreadGs4 extends GenericThread {
this.identBytes[2] = bs[5];
this.identBytes[3] = bs[6];
this.ident = new String(this.identBytes, StandardCharsets.UTF_8);
- this.challenge = RandomSource.create().nextInt(16777216);
+ this.challenge = (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create()).nextInt(16777216); // Plazma - Reduce create random instance
this.challengeBytes = String.format(Locale.ROOT, "\t%s%d\u0000", this.ident, this.challenge).getBytes(StandardCharsets.UTF_8);
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
index fe3ab3d388f0481fb0db06b7f730f868dbf8e8a5..57d4eec19146f2ec36c8f99a4c77f2a20aa7cd09 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/ShufflingList.java
@@ -15,7 +15,7 @@ import net.minecraft.util.RandomSource;
public class ShufflingList<U> implements Iterable<U> {
public final List<ShufflingList.WeightedEntry<U>> entries; // Paper - public
- private final RandomSource random = RandomSource.create();
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma
private final boolean isUnsafe; // Paper
public ShufflingList() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
index 7094701d213c73ba47ace806962244c10fdf4dda..590c26307374edd65a2e22de18d12f34addcef64 100644
--- a/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
+++ b/src/main/java/net/minecraft/world/entity/ai/sensing/Sensor.java
@@ -8,7 +8,7 @@ import net.minecraft.world.entity.ai.memory.MemoryModuleType;
import net.minecraft.world.entity.ai.targeting.TargetingConditions;
public abstract class Sensor<E extends LivingEntity> {
- private static final RandomSource RANDOM = RandomSource.createThreadSafe();
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.createThreadSafe(); // Plazma - Reduce create random instance
private static final int DEFAULT_SCAN_RATE = 20;
protected static final int TARGETING_RANGE = 16;
private static final TargetingConditions TARGET_CONDITIONS = TargetingConditions.forNonCombat().range(16.0D);
diff --git a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
index ece82743df21f0b776382821ad75dee96d0a0748..44db438185d1ffb1adea09ba5f1cf4515a113700 100644
--- a/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
+++ b/src/main/java/net/minecraft/world/entity/monster/warden/AngerManagement.java
@@ -32,7 +32,7 @@ public class AngerManagement {
@VisibleForTesting
protected static final int MAX_ANGER = 150;
private static final int DEFAULT_ANGER_DECREASE = 1;
- private int conversionDelay = Mth.randomBetweenInclusive(RandomSource.create(), 0, 2);
+ private int conversionDelay = Mth.randomBetweenInclusive((org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create()), 0, 2); // Plazma - Reduce create random instance
int highestAnger;
private static final Codec<Pair<UUID, Integer>> SUSPECT_ANGER_PAIR = RecordCodecBuilder.create((instance) -> {
return instance.group(UUIDUtil.CODEC.fieldOf("uuid").forGetter(Pair::getFirst), ExtraCodecs.NON_NEGATIVE_INT.fieldOf("anger").forGetter(Pair::getSecond)).apply(instance, Pair::of);
diff --git a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
index a5443f92786427c42092aec8350e7ab37704db7a..0383c9e75a12c5832cf69daf14b8037365c43cfb 100644
--- a/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
+++ b/src/main/java/net/minecraft/world/entity/npc/WanderingTraderSpawner.java
@@ -32,7 +32,7 @@ public class WanderingTraderSpawner implements CustomSpawner {
private static final int SPAWN_CHANCE_INCREASE = 25;
private static final int SPAWN_ONE_IN_X_CHANCE = 10;
private static final int NUMBER_OF_SPAWN_ATTEMPTS = 10;
- private final RandomSource random = RandomSource.create();
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - reduce create random instace
private final ServerLevelData serverLevelData;
private int tickDelay;
private int spawnDelay;
diff --git a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
index a2093158e57d5f43c4afa66386481b82b3c4c3c4..2b75115caf82b9c4ccdd813b98af569e80ac2629 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -86,7 +86,7 @@ public class FishingHook extends Projectile {
private FishingHook(EntityType<? extends FishingHook> type, Level world, int luckOfTheSeaLevel, int lureLevel) {
super(type, world);
- this.syncronizedRandom = RandomSource.create();
+ this.syncronizedRandom = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instance
this.openWater = true;
this.currentState = FishingHook.FishHookState.FLYING;
this.noCulling = true;
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
index eaa2943b667967f93f28d9d794d702fdaeb670ec..689a4ee7b3f136b14e8e56709cac7d2da89c8efd 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -109,7 +109,7 @@ public class Raid {
public Raid(int id, ServerLevel world, BlockPos pos) {
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
- this.random = RandomSource.create();
+ this.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
this.waveSpawnPos = Optional.empty();
this.id = id;
this.level = world;
@@ -123,7 +123,7 @@ public class Raid {
public Raid(ServerLevel world, CompoundTag nbt) {
this.raidEvent = new ServerBossEvent(Raid.RAID_NAME_COMPONENT, BossEvent.BossBarColor.RED, BossEvent.BossBarOverlay.NOTCHED_10);
- this.random = RandomSource.create();
+ this.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
this.waveSpawnPos = Optional.empty();
this.level = world;
this.id = nbt.getInt("Id");
diff --git a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
index d604b7ec46f08993647979ed220a84842e3fe325..b0b6580a08b15dbfc542ee1fd9e5b6737f8af004 100644
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
@@ -97,7 +97,7 @@ public class EnchantmentMenu extends AbstractContainerMenu {
}
// Purpur end
};
- this.random = RandomSource.create();
+ this.random = playerInventory.player.level().plazmaConfig().misc.reduceRandom ? playerInventory.player.level().random : RandomSource.create(); // Plazma - Reduce create random instace
this.enchantmentSeed = DataSlot.standalone();
this.costs = new int[3];
this.enchantClue = new int[]{-1, -1, -1};
diff --git a/src/main/java/net/minecraft/world/level/Explosion.java b/src/main/java/net/minecraft/world/level/Explosion.java
index ef9b1687dd2dfda5398523140aecc678b4690642..130a41387a2546b31019ad918849b2c283ed09d9 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -82,7 +82,7 @@ public class Explosion {
}
public Explosion(Level world, @Nullable Entity entity, @Nullable DamageSource damageSource, @Nullable ExplosionDamageCalculator behavior, double x, double y, double z, float power, boolean createFire, Explosion.BlockInteraction destructionType) {
- this.random = RandomSource.create();
+ this.random = world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create(); // Plazma - Reduce create random instace
this.toBlow = new ObjectArrayList();
this.hitPlayers = Maps.newHashMap();
this.level = world;
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 412dd103bad498c3c93b7a3ab98f834944d514eb..7a7f417c2a0af73a35297274b8ddd6ac581901ae 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -124,16 +124,16 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final Thread thread;
private final boolean isDebug;
private int skyDarken;
- protected int randValue = RandomSource.create().nextInt();
protected final int addend = 1013904223;
protected float oRainLevel;
public float rainLevel;
protected float oThunderLevel;
public float thunderLevel;
public final RandomSource random = RandomSource.create();
+ protected int randValue = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? random.nextInt() : RandomSource.create().nextInt(); // Plazma - Reduce create random instace
/** @deprecated */
@Deprecated
- private final RandomSource threadSafeRandom = RandomSource.createThreadSafe();
+ private final RandomSource threadSafeRandom = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.ignoreThreadSafeRandom ? random : RandomSource.createThreadSafe(); // Plazma - Reduce create random instace
private final ResourceKey<DimensionType> dimensionTypeId;
private final Holder<DimensionType> dimensionTypeRegistration;
public final WritableLevelData levelData;
diff --git a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
index b7370e64fd0d50e8725d7d5afc30af2e8bc8455d..9ec2a60c8240f7a3e4cd7944d070156dbf55ac2c 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/EnchantmentTableBlockEntity.java
@@ -22,7 +22,7 @@ public class EnchantmentTableBlockEntity extends BlockEntity implements Nameable
public float rot;
public float oRot;
public float tRot;
- private static final RandomSource RANDOM = RandomSource.create();
+ private static final RandomSource RANDOM = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - Reduce create random instace
private Component name;
private int lapis = 0; // Purpur
diff --git a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
index 7291e4056b8e46ab59b71818388ac55fbb12993f..b847f59c5d3e0d7ccb22eaa5d9068082db5ba9a4 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/TheEndGatewayBlockEntity.java
@@ -368,7 +368,7 @@ public class TheEndGatewayBlockEntity extends TheEndPortalBlockEntity {
}
private static void spawnGatewayPortal(ServerLevel world, BlockPos pos, EndGatewayConfiguration config) {
- Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), RandomSource.create(), pos);
+ Feature.END_GATEWAY.place(config, world, world.getChunkSource().getGenerator(), (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instance
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
index f8cd23fb6ea7909b8f30bd21d3f2c7bcc483ef21..3a4044271e23faf4c5271237aba700103f6df830 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
@@ -221,7 +221,7 @@ public class ChunkGeneratorStructureState {
List<CompletableFuture<ChunkPos>> list = new ArrayList(j);
int k = placement.spread();
HolderSet<Biome> holderset = placement.preferredBiomes();
- RandomSource randomsource = RandomSource.create();
+ RandomSource randomsource = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.getServer().random() : RandomSource.create(); // Plazma - Reduce create random instace
// Paper start
if (this.conf.strongholdSeed != null && structureSetEntry.is(net.minecraft.world.level.levelgen.structure.BuiltinStructureSets.STRONGHOLDS)) {
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java b/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
index 18fce94f0d4b9d28e3afec61c7578f672973a71f..c98d65c146213bdf530916b8ec371e0b0b8f23e7 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/DragonRespawnAnimation.java
@@ -62,7 +62,7 @@ public enum DragonRespawnAnimation {
world.explode((Entity)null, (double)((float)endSpike.getCenterX() + 0.5F), (double)endSpike.getHeight(), (double)((float)endSpike.getCenterZ() + 0.5F), 5.0F, Level.ExplosionInteraction.BLOCK);
SpikeConfiguration spikeConfiguration = new SpikeConfiguration(true, ImmutableList.of(endSpike), new BlockPos(0, 128, 0));
- Feature.END_SPIKE.place(spikeConfiguration, world, world.getChunkSource().getGenerator(), RandomSource.create(), new BlockPos(endSpike.getCenterX(), 45, endSpike.getCenterZ()));
+ Feature.END_SPIKE.place(spikeConfiguration, world, world.getChunkSource().getGenerator(), (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()), new BlockPos(endSpike.getCenterX(), 45, endSpike.getCenterZ())); // Plazma - Reduce create random instance
}
} else if (bl) {
fight.setRespawnStage(SUMMONING_DRAGON);
diff --git a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
index c1ff2e15bc5da1a642872ac0fdcdc457e8abb063..c8b29f79725bb9ccec5b48476e242609a452402c 100644
--- a/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
+++ b/src/main/java/net/minecraft/world/level/dimension/end/EndDragonFight.java
@@ -472,7 +472,7 @@ public class EndDragonFight {
this.level.registryAccess().registry(Registries.CONFIGURED_FEATURE).flatMap((iregistry) -> {
return iregistry.getHolder(EndFeatures.END_GATEWAY_DELAYED);
}).ifPresent((holder_c) -> {
- ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), pos);
+ ((ConfiguredFeature) holder_c.value()).place(this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaConfig().misc.reduceRandom ? this.level.getRandom() : RandomSource.create()), pos); // Plazma - Reduce create random instace
});
}
@@ -490,7 +490,7 @@ public class EndDragonFight {
this.portalLocation = this.portalLocation.atY(this.level.getMinBuildHeight() + 1);
}
// Paper end
- if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), RandomSource.create(), this.portalLocation)) {
+ if (worldgenendtrophy.place(FeatureConfiguration.NONE, this.level, this.level.getChunkSource().getGenerator(), (this.level.plazmaConfig().misc.reduceRandom ? this.level.getRandom() : RandomSource.create()), this.portalLocation)) { // Plazma - Reduce create random instace
int i = Mth.positiveCeilDiv(4, 16);
this.level.getChunkSource().chunkMap.waitForLightBeforeSending(new ChunkPos(this.portalLocation), i);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
index c13cdbaf7abdf120a3969f8e887b4c3b78989c9c..5bb9bfbad85a115bf32955c2abc89edc2e7a6e43 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
@@ -14,11 +14,12 @@ import org.bukkit.inventory.meta.FireworkMeta;
public class CraftFirework extends CraftProjectile implements Firework {
- private final Random random = new Random();
+ private final net.minecraft.util.RandomSource random; // Plazma - Reduce create random instance
//private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item.
public CraftFirework(CraftServer server, FireworkRocketEntity entity) {
super(server, entity);
+ this.random = this.getHandle().level().plazmaConfig().misc.reduceRandom ? this.getHandle().level().getRandom() : net.minecraft.util.RandomSource.create(); // Plazma - Reduce create random instance
// Paper Start - Expose firework item directly
// ItemStack item = this.getHandle().getEntityData().get(FireworkRocketEntity.DATA_ID_FIREWORKS_ITEM);
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index c85f1a01c951f85c2347eba18a896e87c4c8b368..d88208cb454d1042440803c817d99c5dcb775330 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -40,6 +40,8 @@ public class GlobalConfiguration extends ConfigurationPart {
public Miscellaneous misc;
public class Miscellaneous extends ConfigurationPart {
+ public boolean reduceRandom = OPTIMIZE;
+ public boolean ignoreThreadSafeRandom = false;
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index d79410cc8b6054e5d3297b3e768fb232f97062e4..e9850b634c4e9bbebea6534690632b067b69b0b6 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -22,6 +22,7 @@ public class WorldConfigurations extends ConfigurationPart {
public Miscellaneous misc;
public class Miscellaneous extends ConfigurationPart {
+ public boolean reduceRandom = OPTIMIZE;
}

View File

@@ -1,32 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 22:11:15 +0900
Subject: [PATCH] Apply various optimizations
[REFERENCE PATCHES]
Akarin - Swaps the predicate order of collision
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index a13e6d41584a55e3e17d55d568b23f48082750ef..23eb620351ee08cac97e0408f1fc6cee33f036d0 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2139,8 +2139,9 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
public void playerTouch(Player player) {}
public void push(Entity entity) {
+ if (entity.noPhysics || this.noPhysics) return; // Plazma
if (!this.isPassengerOfSameVehicle(entity)) {
- if (!entity.noPhysics && !this.noPhysics) {
+ //if (!entity.noPhysics && !this.noPhysics) { // Plazma - moved up
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
@@ -2169,7 +2170,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
}
}
- }
+ //} // Plazma
}
}

View File

@@ -1,29 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 27 Sep 2023 22:13:07 +0900
Subject: [PATCH] Avoid double I/O operation on load player file
diff --git a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
index 36af81f0957d17e170d229059c66f4eb4539dfeb..b4b74bff0579b919266e91464b36c9381342b677 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -56,7 +56,8 @@ public class PlayerDataStorage {
File file = new File(this.playerDir, player.getStringUUID() + ".dat");
// Spigot Start
boolean usingWrongFile = false;
- if ( org.bukkit.Bukkit.getOnlineMode() && !file.exists() ) // Paper - Check online mode first
+ boolean isNormalFile = file.exists() && file.isFile(); // Plazma - Avoid double I/O operation
+ if ( org.bukkit.Bukkit.getOnlineMode() && isNormalFile ) // Paper - Check online mode first // Plazma - Avoid double I/O operation
{
file = new File( this.playerDir, java.util.UUID.nameUUIDFromBytes( ( "OfflinePlayer:" + player.getScoreboardName() ).getBytes( "UTF-8" ) ).toString() + ".dat");
if ( file.exists() )
@@ -67,7 +68,7 @@ public class PlayerDataStorage {
}
// Spigot End
- if (file.exists() && file.isFile()) {
+ if (isNormalFile) { // Plazma - Avoid double I/O operation
nbttagcompound = NbtIo.readCompressed(file);
}
// Spigot Start

View File

@@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 12:03:06 +0900
Subject: [PATCH] Don't refresh LootTable for non player interaction
diff --git a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
index 02364a148b347e3669275553004391e31d77c0b5..cd2d3707c8e4a313ad15958b2f926be6e05bcd4d 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/RandomizableContainerBlockEntity.java
@@ -70,6 +70,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
}
public void unpackLootTable(@Nullable Player player) {
+ if (player == null && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.refreshLootTableForNonPlayerInteraction) return; // Plazma
if (this.level != null && this.lootableData.shouldReplenish(player) && this.level.getServer() != null) { // Paper - don't unpack loot table if not in world
LootTable lootTable = this.level.getServer().getLootData().getLootTable(this.lootTable);
if (player instanceof ServerPlayer) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index d88208cb454d1042440803c817d99c5dcb775330..c687f448761a591900ae5ebad9c8dfca572e9b31 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -42,6 +42,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean reduceRandom = OPTIMIZE;
public boolean ignoreThreadSafeRandom = false;
+ public boolean refreshLootTableForNonPlayerInteraction = !OPTIMIZE;
}

View File

@@ -1,30 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 12:07:06 +0900
Subject: [PATCH] Don't load chunks to spawn phantom
diff --git a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
index f74c5eda91a3d521763ec7bc33f23e0c62458cc2..49a8a81c586908278d1e3cbd51dea307540f28ec 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -71,6 +71,7 @@ public class PhantomSpawner implements CustomSpawner {
if (randomsource.nextInt(j) >= world.paperConfig().entities.behavior.playerInsomniaStartTicks) { // Paper
BlockPos blockposition1 = blockposition.above(20 + randomsource.nextInt(15)).east(-10 + randomsource.nextInt(21)).south(-10 + randomsource.nextInt(21));
+ if (!world.plazmaConfig().entity.phantom.loadChunksToSpawn && !world.hasChunkAt(blockposition1)) continue; // Plazma
BlockState iblockdata = world.getBlockState(blockposition1);
FluidState fluid = world.getFluidState(blockposition1);
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index e9850b634c4e9bbebea6534690632b067b69b0b6..036c0b12553ae203e8c73d44dc2e3d625b812af5 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -32,6 +32,7 @@ public class WorldConfigurations extends ConfigurationPart {
public Phantom phantom;
public class Phantom extends ConfigurationPart {
+ public boolean loadChunksToSpawn = !OPTIMIZE;
}

View File

@@ -1,31 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 5 Nov 2023 12:16:14 +0900
Subject: [PATCH] Add option to disable moved to quickly check for specific
players
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index a7e82f95db5c6c054175192f019072006a3ef31f..21def42f813f00c9fbc9c920b9ba61efc5928ef6 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1439,6 +1439,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !this.player.isFallFlying())) {
float f2 = this.player.isFallFlying() ? 300.0F : 100.0F;
+ if (!this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.checkSpectatorMovedToQuickly && this.player.isSpectator())) // Plazma
if (d10 - d9 > Math.max(f2, Math.pow((double) (org.spigotmc.SpigotConfig.movedTooQuicklyMultiplier * (float) i * speed), 2)) && !this.isSingleplayerOwner()) {
// CraftBukkit end
// Paper start - Add fail move event
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index c687f448761a591900ae5ebad9c8dfca572e9b31..f3cf7634a5fd470e7fb295ae1f88e14f0c4a0d1d 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -27,6 +27,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public class Player extends ConfigurationPart {
public boolean allowAnyUsername = false;
+ public boolean checkSpectatorMovedToQuickly = !OPTIMIZE;
}

View File

@@ -1,152 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 28 Sep 2023 11:47:50 +0900
Subject: [PATCH] Implement No Chat Reports
Implemented: 62fbdef42dfbfec551d8324b7084c4ccf248bab7
diff --git a/src/main/java/net/minecraft/network/FriendlyByteBuf.java b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
index 40f51062624161892c780ddae05e22859e2cd021..b0b515b8ebeffe25a760d7d6faa87cbc1a585b2d 100644
--- a/src/main/java/net/minecraft/network/FriendlyByteBuf.java
+++ b/src/main/java/net/minecraft/network/FriendlyByteBuf.java
@@ -139,9 +139,13 @@ public class FriendlyByteBuf extends ByteBuf {
public <T> void writeJsonWithCodec(Codec<T> codec, T value) {
DataResult<JsonElement> dataresult = codec.encodeStart(JsonOps.INSTANCE, value);
- this.writeUtf(FriendlyByteBuf.GSON.toJson((JsonElement) Util.getOrThrow(dataresult, (s) -> {
- return new EncoderException("Failed to encode: " + s + " " + value);
- })));
+ // Plazma start - Implement No Chat Reports
+ JsonElement element = Util.getOrThrow(dataresult, s -> new EncoderException("Failed to encode: " + s + " " + value));
+ if (codec == net.minecraft.network.protocol.status.ServerStatus.CODEC
+ && org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.queryData())
+ element.getAsJsonObject().addProperty("preventsChatReports", true);
+ this.writeUtf(GSON.toJson(element));
+ // Plazma end
}
public <T> void writeId(IdMap<T> registry, T value) {
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
index b8c1f3b9afddc87d56541c8af63cffecfcdd2653..4f0d6ac849dda74c9180fa03d97d389cc4554b46 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatCommandPacket.java
@@ -24,4 +24,13 @@ public record ServerboundChatCommandPacket(String command, Instant timeStamp, lo
public void handle(ServerGamePacketListener listener) {
listener.handleChatCommand(this);
}
+
+ // Plazma start - Implement No Chat Reports
+ @Override
+ public ArgumentSignatures argumentSignatures() {
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled)
+ return ArgumentSignatures.EMPTY;
+ return this.argumentSignatures;
+ }
+ // Plazma end
}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
index d1d2fc0c57523c1abf1e8bfec913c78927c3dafc..b32e17ef1d7d65f2e3cf4fb5471d8182b3ba892f 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatPacket.java
@@ -25,4 +25,12 @@ public record ServerboundChatPacket(String message, Instant timeStamp, long salt
public void handle(ServerGamePacketListener listener) {
listener.handleChat(this);
}
+
+ // Plazma start - Implement No Chat Reports
+ @Override
+ public @Nullable MessageSignature signature() {
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return null;
+ return this.signature;
+ }
+ // Plazma end
}
diff --git a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
index 9d6db4a378036559efab91c8b7dcf2a6b0c2cce6..4d9f73add791cef03cc7aeaf1598a73c2195809a 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket.java
@@ -16,6 +16,15 @@ public record ServerboundChatSessionUpdatePacket(RemoteChatSession.Data chatSess
@Override
public void handle(ServerGamePacketListener listener) {
+ // Plazma start - Implement No Chat Reports
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.requireModInstallation()) {
+ ((net.minecraft.server.network.ServerGamePacketListenerImpl) listener).disconnect(
+ net.kyori.adventure.text.minimessage.MiniMessage.miniMessage().deserialize(org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.requireModInstallation.message),
+ org.bukkit.event.player.PlayerKickEvent.Cause.NCR_NOT_INSTALLED
+ );
+ return;
+ }
+ // Plazma end
listener.handleChatSessionUpdate(this);
}
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 770b959d9e51ef0645415d5a0d7d79b7031abd66..82670c8bc74cbb208a91cec433498b823e86ce2e 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -682,6 +682,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@Override
public boolean enforceSecureProfile() {
DedicatedServerProperties dedicatedserverproperties = this.getProperties();
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return false; // Plazma - Implement No Chat Reports
// Paper start - fix secure profile with proxy online mode
return dedicatedserverproperties.enforceSecureProfile
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index b19c59a87d4136da583a0b687f6b27fef3456f09..b54372c32845d2bc340951c0ea88d480efc1dd6a 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -262,6 +262,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
public void send(Packet<?> packet, @Nullable PacketSendListener callbacks) {
+ // Plazma start - Implement No Chat Reports
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.convertToSystemMessage()
+ && packet instanceof net.minecraft.network.protocol.game.ClientboundPlayerChatPacket p) {
+ this.send(new net.minecraft.network.protocol.game.ClientboundSystemChatPacket(null, Component.Serializer.toJson(p.chatType().resolve(this.player.level().registryAccess()).get().decorate(p.unsignedContent() != null ? p.unsignedContent() : Component.literal(p.body().content()))), false), null);
+ return;
+ }
+ // Plazma end
// CraftBukkit start
if (packet == null || this.processedDisconnect) { // Spigot
return;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index e8de78f8b7c90a719e10c483991f45a7886256be..0ff64fc50768a4bed9c871fed1089753912b89d2 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1493,6 +1493,7 @@ public abstract class PlayerList {
}
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().noChatReports.enabled) return true; // Plazma - Implement No Chat Reports
return message.hasSignature() && !message.hasExpiredServer(Instant.now());
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index f3cf7634a5fd470e7fb295ae1f88e14f0c4a0d1d..5dafbe4ca74071e25ce79128ca08c7bfebb778d5 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -56,4 +56,22 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+ public NoChatReports noChatReports;
+ public class NoChatReports extends ConfigurationPart {
+
+ public boolean enabled = false;
+ boolean queryData = true; public boolean queryData() { return this.enabled && this.queryData; }
+ boolean convertToSystemMessage = true; public boolean convertToSystemMessage() { return this.enabled && this.convertToSystemMessage; }
+ public boolean requireModInstallation() { return this.enabled && this.requireModInstallation.enabled; }
+
+ public RequireModInstallation requireModInstallation;
+ public class RequireModInstallation extends ConfigurationPart {
+
+ boolean enabled = false;
+ public String message = "You do not have No Chat Reports, and this server is configured to require it on client!";
+
+ }
+
+ }
+
}

View File

@@ -1,28 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 6 Nov 2023 10:39:01 +0900
Subject: [PATCH] Improve biome temperature cache
diff --git a/src/main/java/net/minecraft/world/level/biome/Biome.java b/src/main/java/net/minecraft/world/level/biome/Biome.java
index ed439b7e94646141c93a7dd3704d1cdeb5c27e16..642fd0e06f9ab53b4ef2cafe1dc3321a3fd7ee9e 100644
--- a/src/main/java/net/minecraft/world/level/biome/Biome.java
+++ b/src/main/java/net/minecraft/world/level/biome/Biome.java
@@ -67,7 +67,7 @@ public final class Biome {
private final MobSpawnSettings mobSettings;
private final BiomeSpecialEffects specialEffects;
// Pufferfish start - use our cache
- private final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> {
+ private static final ThreadLocal<gg.airplane.structs.Long2FloatAgingCache> temperatureCache = ThreadLocal.withInitial(() -> { // Plazma - Improve biome temperature cache
return Util.make(() -> {
/*
Long2FloatLinkedOpenHashMap long2FloatLinkedOpenHashMap = new Long2FloatLinkedOpenHashMap(1024, 0.25F) {
@@ -125,7 +125,7 @@ public final class Biome {
public float getTemperature(BlockPos blockPos) {
long l = blockPos.asLong();
// Pufferfish start
- gg.airplane.structs.Long2FloatAgingCache cache = this.temperatureCache.get();
+ gg.airplane.structs.Long2FloatAgingCache cache = temperatureCache.get(); // Plazma - Improve biome temperature cache
float f = cache.getValue(l);
if (!Float.isNaN(f)) {
return f;

View File

@@ -1,34 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 6 Nov 2023 11:36:08 +0900
Subject: [PATCH] Configurable entity sensor tick
diff --git a/src/main/java/net/minecraft/world/entity/Mob.java b/src/main/java/net/minecraft/world/entity/Mob.java
index aeae6117b398b84d5c8ecaa175a72867416ff166..c9df97eebe3635009737be83a28f36d291fcce79 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -936,10 +936,10 @@ public abstract class Mob extends LivingEntity implements Targeting {
}
// Paper end
//this.level().getProfiler().push("sensing"); // Purpur
- this.sensing.tick();
//this.level().getProfiler().pop(); // Purpur
int i = this.level().getServer().getTickCount() + this.getId();
+ if (i % this.level().plazmaConfig().entity.sensorTick == 0) this.sensing.tick(); // Plazma - Configurable entity sensor tick
if (i % 2 != 0 && this.tickCount > 1) {
//this.level().getProfiler().push("targetSelector"); // Purpur
if (this.targetSelector.inactiveTick(this.activatedPriority, false)) // Pufferfish - use this to alternate ticking
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 909a74c19501d9440f3d2435b6514d738efcfc05..b036b54d551c892cc48d0a6816382bce5e38efd4 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -30,6 +30,7 @@ public class WorldConfigurations extends ConfigurationPart {
public class Entity extends ConfigurationPart {
public boolean ignoreUselessPackets = OPTIMIZE;
+ public int sensorTick = 1;
public Phantom phantom;
public class Phantom extends ConfigurationPart {

View File

@@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Tue, 7 Nov 2023 15:32:24 +0900
Subject: [PATCH] Configurable cave lava sea level
This patch also fix MC-237017.
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
index 58609a0911c4e32b6f80f050cd3d23f70ad75b1b..2db6c1b9530b4b082ef6f6ec17c542ba8ad7fa5f 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -72,6 +72,15 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
}
private static Aquifer.FluidPicker createFluidPicker(NoiseGeneratorSettings settings) {
+ // Plazma start
+ if (true) {
+ org.plazmamc.plazma.configurations.GlobalConfiguration config = org.plazmamc.plazma.configurations.GlobalConfiguration.get();
+ return (x, y, z) -> new Aquifer.FluidStatus(
+ config.worldgen.caveLavaSeaLevel.useCustomSeaLevel ? config.worldgen.caveLavaSeaLevel.customSeaLevel : settings.seaLevel(),
+ config.worldgen.caveLavaSeaLevel.customSeaLevel(settings)
+ );
+ }
+ // Plazma end
Aquifer.FluidStatus aquifer_b = new Aquifer.FluidStatus(-54, Blocks.LAVA.defaultBlockState());
int i = settings.seaLevel();
Aquifer.FluidStatus aquifer_b1 = new Aquifer.FluidStatus(i, settings.defaultFluid());
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 5dafbe4ca74071e25ce79128ca08c7bfebb778d5..3cfb9357d0c61e84488c2c60f073fa12df942b8e 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -35,6 +35,25 @@ public class GlobalConfiguration extends ConfigurationPart {
public WorldGeneration worldgen;
public class WorldGeneration extends ConfigurationPart {
+ public CaveLavaSeaLevel caveLavaSeaLevel;
+ public class CaveLavaSeaLevel extends ConfigurationPart {
+
+ public boolean useCustomSeaLevel = false;
+ public int customSeaLevel = -54;
+ String customSeaBlock = "default";
+
+ public net.minecraft.world.level.block.state.BlockState customSeaLevel(net.minecraft.world.level.levelgen.NoiseGeneratorSettings settings) {
+ if (this.customSeaBlock.equalsIgnoreCase("default")) return settings.defaultFluid();
+ return net.minecraft.core.registries.BuiltInRegistries.BLOCK
+ .getOptional(new net.minecraft.resources.ResourceLocation(this.customSeaBlock))
+ .orElseGet(() -> {
+ PlazmaConfigurations.LOGGER.warn("Invalid custom sea level block: " + this.customSeaBlock, ", defaulting to lava");
+ return net.minecraft.world.level.block.Blocks.LAVA;
+ })
+ .defaultBlockState();
+ }
+
+ }
}

View File

@@ -1,57 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 4 Dec 2023 23:12:47 +0900
Subject: [PATCH] Optimise state lookup more
diff --git a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
index 57d0cd3ad6f972e986c72a57f1a6e36003f190c2..50d97c5ab33f33b81dbafd7cf42da5afd9856eeb 100644
--- a/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
+++ b/src/main/java/io/papermc/paper/util/table/ZeroCollidingReferenceStateTable.java
@@ -17,6 +17,7 @@ public final class ZeroCollidingReferenceStateTable {
protected final StateHolder<?, ?> this_state;
protected long[] index_table;
+ public long[] index_table() { return this.index_table; } // Plazma - Getter
protected StateHolder<?, ?>[][] value_table;
public ZeroCollidingReferenceStateTable(final StateHolder<?, ?> state, final Map<Property<?>, Comparable<?>> this_map) {
diff --git a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
index 5f285d190186a2ff5a61d05070593e1d633dd79a..669c42f1598e2a06bb0b95aa0bc413911346f3ff 100644
--- a/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
+++ b/src/main/java/net/minecraft/world/level/block/state/StateHolder.java
@@ -114,6 +114,12 @@ public abstract class StateHolder<O, S> {
}
public <T extends Comparable<T>, V extends T> S trySetValue(Property<T> property, V value) {
+ // Plazma start - Optimise state lookup more
+ final S ret = (S) this.optimisedTable.get(property, value);
+ if (ret == null) throw new IllegalArgumentException("Cannot set property " + property + " to " + value + " on " + this.owner + ", it is not an allowed value");
+ return ret;
+ /*
+ // Plazma end
Comparable<?> comparable = this.values.get(property);
if (comparable != null && !comparable.equals(value)) {
S object = this.neighbours.get(property, value);
@@ -125,10 +131,11 @@ public abstract class StateHolder<O, S> {
} else {
return (S)this;
}
+ */ // Plazma - Optimise state lookup more
}
public void populateNeighbours(Map<Map<Property<?>, Comparable<?>>, S> states) {
- if (this.neighbours != null) {
+ if (this.optimisedTable.index_table() != null) { // Plazma - optimise state lookup
throw new IllegalStateException();
} else {
Table<Property<?>, Comparable<?>, S> table = HashBasedTable.create();
@@ -143,7 +150,7 @@ public abstract class StateHolder<O, S> {
}
}
- this.neighbours = (Table<Property<?>, Comparable<?>, S>)(table.isEmpty() ? table : ArrayTable.create(table)); this.optimisedTable.loadInTable((Table)this.neighbours, this.values); // Paper - optimise state lookup
+ this.optimisedTable.loadInTable((Table) (table.isEmpty() ? table : ArrayTable.create(table)), this.values); // Plazma - Optimize state lookup more
}
}

View File

@@ -1,41 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 4 Dec 2023 23:15:43 +0900
Subject: [PATCH] Suppress errors from dirty attributes
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index e2dcdc9f317a4ab1a9b30e482607dc041abb7035..085dfb2cf8596f5f0be4b1bf9a3cbe1a0e9b2967 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -395,7 +395,8 @@ public class ServerEntity {
}
if (this.entity instanceof LivingEntity) {
- Set<AttributeInstance> set = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes();
+ Set<AttributeInstance> attributes = ((LivingEntity) this.entity).getAttributes().getDirtyAttributes(); // Plazma - Suppress errors from dirty attributes
+ final Set<AttributeInstance> set = this.level.plazmaConfig().entity.suppressErrorsFromDirtyAttributes ? Collections.synchronizedSet(attributes) : attributes; // Plazma - Suppress errors from dirty attributes
if (!set.isEmpty()) {
// CraftBukkit start - Send scaled max health
@@ -406,7 +407,7 @@ public class ServerEntity {
this.broadcastAndSend(new ClientboundUpdateAttributesPacket(this.entity.getId(), set));
}
- set.clear();
+ attributes.clear(); // Plazma - Suppress errors from dirty attributes
}
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 459cba838468b95547b2a515c497fcbb7bd45718..b1293935e55fcb1c45224e5bda9be8d1045ff4e8 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -31,6 +31,7 @@ public class WorldConfigurations extends ConfigurationPart {
public boolean ignoreUselessPackets = OPTIMIZE;
public int sensorTick = 1;
+ public boolean suppressErrorsFromDirtyAttributes = OPTIMIZE;
public Phantom phantom;
public class Phantom extends ConfigurationPart {

File diff suppressed because it is too large Load Diff

View File

@@ -1,18 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 10 Jan 2024 18:11:03 +0900
Subject: [PATCH] Improve SwingTime ticking
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 7fdb4d5eb1ab6c45c88ca18112d5b1b26bfd5947..57b1f741609193eced5e5ab1d45f18bea005eeb7 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2602,6 +2602,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void updateSwingTime() {
+ if (!this.swinging && this.swingTime == 0) return; // Plazma - de-sisyphus :skull:
int i = this.getCurrentSwingDuration();
if (this.swinging) {

File diff suppressed because it is too large Load Diff

View File

@@ -8,70 +8,60 @@ Subject: [PATCH] Optimize default configurations
- AkiraDevelopment/SimplyMC
- YouHaveTrouble/minecraft-exploits-and-how-to-fix-them
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index c867796f6..ecced2072 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -181,7 +222,7 @@ public class WorldConfiguration extends ConfigurationPart {
@MergeMap
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
@MergeMap
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
@MergeMap
public Reference2IntMap<MobCategory> ticksPerSpawn = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index 9ca1494497ae53e56b1f81fda51b0b8bd02a6d03..97b1366d25537d68469e95ac101b1b8cf9fdc997 100644
index 3ff4f092a59242a8cb930c084915a774db881652..66f797f5205b9b259cc6f6cfd710293fc73cdf59 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -64,7 +64,7 @@ public class PufferfishConfig {
@@ -61,7 +61,7 @@ public class PufferfishConfig {
getString("info.version", "1.0");
setComment("info",
"Pufferfish Configuration",
- "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host",
+ //"Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Nope
+ // "Check out Pufferfish Host for maximum performance server hosting: https://pufferfish.host", // Plazma - Sponsorblock
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
@@ -211,7 +211,7 @@ public class PufferfishConfig {
@@ -216,7 +216,7 @@ public class PufferfishConfig {
public static int maxProjectileLoadsPerTick;
public static int maxProjectileLoadsPerProjectile;
private static void projectileLoading() {
- maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick.");
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
+ maxProjectileLoadsPerTick = getInt("projectile.max-loads-per-tick", plazma.Config.optimize() ? 8 : 10, "Controls how many chunks are allowed", "to be sync loaded by projectiles in a tick."); // Plazma - Optimize default configurations
maxProjectileLoadsPerProjectile = getInt("projectile.max-loads-per-projectile", 10, "Controls how many chunks a projectile", "can load in its lifetime before it gets", "automatically removed.");
setComment("projectile", "Optimizes projectile settings");
@@ -225,7 +225,7 @@ public class PufferfishConfig {
@@ -230,12 +230,12 @@ public class PufferfishConfig {
public static int activationDistanceMod;
private static void dynamicActivationOfBrains() throws IOException {
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()); // Purpur // Plazma - Optimize default configurations
- dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", false); // Purpur - Fix pufferfish issues
+ dearEnabled = getBoolean("dab.enabled", "activation-range.enabled", plazma.Config.optimize()); // Purpur - Fix pufferfish issues // Plazma - Optimize default configurations
startDistance = getInt("dab.start-distance", "activation-range.start-distance", 12,
"This value determines how far away an entity has to be",
"from the player to start being effected by DEAR.");
@@ -233,7 +233,7 @@ public class PufferfishConfig {
maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
startDistanceSquared = startDistance * startDistance;
- maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", 20,
+ maximumActivationPrio = getInt("dab.max-tick-freq", "activation-range.max-tick-freq", plazma.Config.optimize() ? 7 : 8, // Plazma - Optimize default configurations
"This value defines how often in ticks, the furthest entity",
"will get their pathfinders and behaviors ticked. 20 = 1s");
- activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
+ activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 7 : 8, // Plazma - Optimize default configurations
"This value defines how much distance modifies an entity's",
"tick frequency. freq = (distanceToPlayer^2) / (2^value)",
"If you want further away entities to tick less often, use 7.",
@@ -253,8 +253,18 @@ public class PufferfishConfig {
public static Map<String, Integer> projectileTimeouts;
private static void projectileTimeouts() {
// Set some defaults
+ // Plazma start - Optimize default configurations
+ if (org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize()) {
+ getInt("entity_timeouts.ARROW", 200);
+ getInt("entity_timeouts.EGG", 200);
+ getInt("entity_timeouts.ENDER_PEARL", 200);
+ getInt("entity_timeouts.SNOWBALL", 200);
+ getInt("entity_timeouts.LLAMA_SPIT", 200);
+ } else {
+ // Plazma end
getInt("entity_timeouts.SNOWBALL", -1);
getInt("entity_timeouts.LLAMA_SPIT", -1);
+ } // Plazma
setComment("entity_timeouts",
"These values define a entity's maximum lifespan. If an",
"entity is in this list and it has survived for longer than",
activationDistanceMod = getInt("dab.activation-dist-mod", "activation-range.activation-dist-mod", 8,
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index a6f58b3457b7477015c5c6d969e7d83017dd3fa1..85e56d726eb7780811e0a990e1ef7d3ec767e36d 100644
index 088b8fe5d144807f4da1e85b2fa34dfd21286f8c..8c3c7987a269733a0f530e8f22c3f1a005de21ac 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -155,7 +155,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -148,7 +148,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public class Watchdog extends ConfigurationPart {
public int earlyWarningEvery = 5000;
@@ -80,7 +70,7 @@ index a6f58b3457b7477015c5c6d969e7d83017dd3fa1..85e56d726eb7780811e0a990e1ef7d3e
}
public SpamLimiter spamLimiter;
@@ -193,7 +193,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -188,7 +188,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Commands commands;
public class Commands extends ConfigurationPart {
@@ -89,16 +79,16 @@ index a6f58b3457b7477015c5c6d969e7d83017dd3fa1..85e56d726eb7780811e0a990e1ef7d3e
public boolean fixTargetSelectorTagCompletion = true;
public boolean timeCommandAffectsAllWorlds = false;
}
@@ -242,7 +242,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -253,7 +253,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public BookSize bookSize;
public class BookSize extends ConfigurationPart {
- public int pageMax = 2560; // TODO this appears to be a duplicate setting with one above
+ public int pageMax = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1024 : 2560; // TODO this appears to be a duplicate setting with one above // Plazma - Optimize default configurations
- public IntOr.Disabled pageMax = new IntOr.Disabled(OptionalInt.of(2560)); // TODO this appears to be a duplicate setting with one above
+ public IntOr.Disabled pageMax = new IntOr.Disabled(OptionalInt.of(org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1024 : 2560)); // TODO this appears to be a duplicate setting with one above // Plazma - Optimize default configurations
public double totalMultiplier = 0.98D; // TODO this should probably be merged into the above inner class
}
public boolean resolveSelectorsInBooks = false;
@@ -253,7 +253,15 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -264,7 +264,15 @@ public class GlobalConfiguration extends ConfigurationPart {
public class PacketLimiter extends ConfigurationPart {
public Component kickMessage = Component.translatable("disconnect.exceeded_packet_rate", NamedTextColor.RED);
public PacketLimit allPackets = new PacketLimit(7.0, 500.0, PacketLimit.ViolateAction.KICK);
@@ -115,7 +105,7 @@ index a6f58b3457b7477015c5c6d969e7d83017dd3fa1..85e56d726eb7780811e0a990e1ef7d3e
@ConfigSerializable
public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) {
@@ -321,7 +329,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -332,7 +340,7 @@ public class GlobalConfiguration extends ConfigurationPart {
executor.setMaximumPoolSize(_chatExecutorMaxSize);
}
}
@@ -125,10 +115,10 @@ index a6f58b3457b7477015c5c6d969e7d83017dd3fa1..85e56d726eb7780811e0a990e1ef7d3e
public boolean loadPermissionsYmlBeforePlugins = true;
@Constraints.Min(4)
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced85101f6e 100644
index 82210667376fd466d5d4cdcb56b62f6165bd5cde..3c6e9ec236bfd851700ce7fae2599b725ec899eb 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -96,12 +96,32 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -103,12 +103,32 @@ public class WorldConfiguration extends ConfigurationPart {
public class AntiXray extends ConfigurationPart {
public boolean enabled = false;
@@ -142,35 +132,35 @@ index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced
- public List<Block> hiddenBlocks = List.of(
+ // Plazma start - Optimize default configurations
+ public List<Block> hiddenBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? List.of(
+ //<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed">
+ Blocks.AIR,
+ Blocks.COPPER_ORE,
+ Blocks.DEEPSLATE_COPPER_ORE,
+ Blocks.RAW_COPPER_BLOCK,
+ Blocks.IRON_ORE,
+ Blocks.DEEPSLATE_IRON_ORE,
+ Blocks.RAW_IRON_BLOCK,
+ Blocks.GOLD_ORE,
+ Blocks.DEEPSLATE_GOLD_ORE,
+ Blocks.RAW_GOLD_BLOCK,
+ Blocks.REDSTONE_ORE,
+ Blocks.DEEPSLATE_REDSTONE_ORE,
+ Blocks.LAPIS_ORE,
+ Blocks.DEEPSLATE_LAPIS_ORE,
+ Blocks.DIAMOND_ORE,
+ Blocks.DEEPSLATE_DIAMOND_ORE
+ //</editor-fold>
+ //<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed">
+ Blocks.AIR,
+ Blocks.COPPER_ORE,
+ Blocks.DEEPSLATE_COPPER_ORE,
+ Blocks.RAW_COPPER_BLOCK,
+ Blocks.IRON_ORE,
+ Blocks.DEEPSLATE_IRON_ORE,
+ Blocks.RAW_IRON_BLOCK,
+ Blocks.GOLD_ORE,
+ Blocks.DEEPSLATE_GOLD_ORE,
+ Blocks.RAW_GOLD_BLOCK,
+ Blocks.REDSTONE_ORE,
+ Blocks.DEEPSLATE_REDSTONE_ORE,
+ Blocks.LAPIS_ORE,
+ Blocks.DEEPSLATE_LAPIS_ORE,
+ Blocks.DIAMOND_ORE,
+ Blocks.DEEPSLATE_DIAMOND_ORE
+ //</editor-fold>
+ ) : List.of(
//<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed">
Blocks.COPPER_ORE,
Blocks.DEEPSLATE_COPPER_ORE,
@@ -128,7 +148,28 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -135,7 +155,28 @@ public class WorldConfiguration extends ConfigurationPart {
Blocks.ENDER_CHEST
//</editor-fold>
);
- public List<Block> replacementBlocks = List.of(Blocks.STONE, Blocks.OAK_PLANKS, Blocks.DEEPSLATE);
+ public List<Block> replacementBlocks = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? List.of(
+ //<editor-fold desc="Anti-Xray Hidden Blocks" defaultstate="collapsed">
+ //<editor-fold desc="Anti-Xray Replacement Blocks" defaultstate="collapsed">
+ Blocks.CHEST,
+ Blocks.AMETHYST_BLOCK,
+ Blocks.ANDESITE,
@@ -194,14 +184,14 @@ index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced
}
}
@@ -152,14 +193,14 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -157,14 +198,14 @@ public class WorldConfiguration extends ConfigurationPart {
public ArmorStands armorStands;
public class ArmorStands extends ConfigurationPart {
- public boolean doCollisionEntityLookups = true;
- public boolean tick = true;
+ public boolean doCollisionEntityLookups = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
+ public boolean tick = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
+ public boolean doCollisionEntityLookups = !org.plazmamc.plazma.Options.AGGRESSIVE; // Plazma - Optimize default configurations
+ public boolean tick = !org.plazmamc.plazma.Options.AGGRESSIVE; // Plazma - Optimize default configurations
}
public Markers markers;
@@ -212,16 +202,7 @@ index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced
}
public Sniffer sniffer;
@@ -182,7 +223,7 @@ public class WorldConfiguration extends ConfigurationPart {
@MergeMap
public Reference2IntMap<MobCategory> spawnLimits = Util.make(new Reference2IntOpenHashMap<>(NaturalSpawner.SPAWNING_CATEGORIES.length), map -> Arrays.stream(NaturalSpawner.SPAWNING_CATEGORIES).forEach(mobCategory -> map.put(mobCategory, -1)));
@MergeMap
- public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), category.getDespawnDistance())));
+ public Map<MobCategory, DespawnRange> despawnRanges = Arrays.stream(MobCategory.values()).collect(Collectors.toMap(Function.identity(), category -> new DespawnRange(category.getNoDespawnDistance(), org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? (net.minecraft.server.MinecraftServer.getServer().server.getSimulationDistance() * 16) + 8 : category.getDespawnDistance()))); // Plazma - Optimize default configurations
@ConfigSerializable
public record DespawnRange(@Required int soft, @Required int hard) {
@@ -381,7 +422,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -415,7 +456,7 @@ public class WorldConfiguration extends ConfigurationPart {
public class Environment extends ConfigurationPart {
public boolean disableThunder = false;
public boolean disableIceAndSnow = false;
@@ -230,16 +211,16 @@ index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced
public boolean disableExplosionKnockback = false;
public boolean generateFlatBedrock = false;
public FrostedIce frostedIce;
@@ -433,7 +474,7 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -471,7 +512,7 @@ public class WorldConfiguration extends ConfigurationPart {
public Fixes fixes;
public class Fixes extends ConfigurationPart {
- public boolean fixItemsMergingThroughWalls = false;
+ public boolean fixItemsMergingThroughWalls = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize(); // Plazma - Optimize default configurations
public boolean disableUnloadedChunkEnderpearlExploit = true;
public boolean disableUnloadedChunkEnderpearlExploit = false;
public boolean preventTntFromMovingInWater = false;
public boolean splitOverstackedLoot = true;
@@ -460,9 +501,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -499,9 +540,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Collisions extends ConfigurationPart {
public boolean onlyPlayersCollide = false;
public boolean allowVehicleCollisions = true;
@@ -251,7 +232,7 @@ index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced
public boolean allowPlayerCrammingDamage = false;
}
@@ -470,18 +511,41 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -509,18 +550,41 @@ public class WorldConfiguration extends ConfigurationPart {
public class Chunks extends ConfigurationPart {
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
@@ -301,7 +282,7 @@ index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced
});
public boolean flushRegionsOnSave = false;
}
@@ -496,9 +560,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -535,9 +599,9 @@ public class WorldConfiguration extends ConfigurationPart {
public TickRates tickRates;
public class TickRates extends ConfigurationPart {
@@ -313,18 +294,18 @@ index 071d3877e386a0c7c4d2f2e8ddd06e0765c49d0d..79e2a6806311c402e481c5b29cbd3ced
public int wetFarmland = 1;
public int dryFarmland = 1;
public Table<EntityType<?>, String, Integer> sensor = Util.make(HashBasedTable.create(), table -> table.put(EntityType.VILLAGER, "secondarypoisensor", 40));
@@ -525,9 +589,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -571,9 +635,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Misc extends ConfigurationPart {
public int lightQueueSize = 20;
- public boolean updatePathfindingOnBlockUpdate = true;
+ public boolean updatePathfindingOnBlockUpdate = !org.plazmamc.plazma.Options.aggressiveOptimize; // Plazma - Optimize default configurations
+ public boolean updatePathfindingOnBlockUpdate = !org.plazmamc.plazma.Options.AGGRESSIVE; // Plazma - Optimize default configurations
public boolean showSignClickCommandFailureMsgsToPlayer = false;
- public RedstoneImplementation redstoneImplementation = RedstoneImplementation.VANILLA;
+ public RedstoneImplementation redstoneImplementation = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? RedstoneImplementation.ALTERNATE_CURRENT : RedstoneImplementation.VANILLA; // Plazma - Optimize default configurations
public AlternateCurrentUpdateOrder alternateCurrentUpdateOrder = AlternateCurrentUpdateOrder.HORIZONTAL_FIRST_OUTWARD;
public boolean disableEndCredits = false;
public float maxLeashDistance = 10f;
public boolean disableSprintInterruptionOnAttack = false;
public DoubleOr.Default maxLeashDistance = DoubleOr.Default.USE_DEFAULT;
diff --git a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java b/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357d9c7d62a 100644
--- a/src/main/java/io/papermc/paper/configuration/type/fallback/ArrowDespawnRate.java
@@ -338,10 +319,10 @@ index 24763d3d270c29c95e0b3e85111145234f660a62..80ddc627e02e3c749e6b074afa93d357
}
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 9b8bdffbbfe45c6712d0f4da3643424fa94fc69e..84eca01450db5b737c676cab2439d041141c323d 100644
index fc378b08c10c7f670be93d52937c7642b986ed0d..9a436132faa04efbf25d8be9d5488e13f2111dac 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -163,7 +163,7 @@ public class Main {
@@ -166,7 +166,7 @@ public class Main {
File configFile = (File) optionset.valueOf("bukkit-settings");
YamlConfiguration configuration = YamlConfiguration.loadConfiguration(configFile);
configuration.options().copyDefaults(true);
@@ -351,10 +332,10 @@ index 9b8bdffbbfe45c6712d0f4da3643424fa94fc69e..84eca01450db5b737c676cab2439d041
File commandFile = (File) optionset.valueOf("commands-settings");
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index fe82a20efb2b130a568bc06aec5b86d3082062a3..8dddcacec38bf2d5d79ce7fc0f26a2cced5d271d 100644
index 8f7e922ceca286b1a590181c301fbe9bff55c024..3dd5c7441bb300ca17d717af37edbefb89db4b2f 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -131,14 +131,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -132,14 +132,14 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.spawnMonsters = this.get("spawn-monsters", true);
this.useNativeTransport = this.get("use-native-transport", true);
this.enableCommandBlock = this.get("enable-command-block", false);
@@ -373,20 +354,20 @@ index fe82a20efb2b130a568bc06aec5b86d3082062a3..8dddcacec38bf2d5d79ce7fc0f26a2cc
this.maxPlayers = this.get("max-players", 20);
this.networkCompressionThreshold = this.get("network-compression-threshold", 256);
this.broadcastRconToOps = this.get("broadcast-rcon-to-ops", true);
@@ -146,7 +146,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
@@ -147,7 +147,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.maxWorldSize = this.get("max-world-size", (integer) -> {
return Mth.clamp(integer, 1, 29999984);
}, 29999984);
- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - hide behind flag
+ this.syncChunkWrites = this.get("sync-chunk-writes", Boolean.getBoolean("Paper.enable-sync-chunk-writes")); // Paper - hide behind flag // Plazma - Optimize default configurations
- this.syncChunkWrites = this.get("sync-chunk-writes", true) && Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag
+ this.syncChunkWrites = Boolean.getBoolean("Paper.enable-sync-chunk-writes"); // Paper - Hide sync chunk writes behind flag // Plazma - Completely remove this setting
this.regionFileComression = this.get("region-file-compression", "deflate");
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
this.enableStatus = this.get("enable-status", true);
this.hideOnlinePlayers = this.get("hide-online-players", false);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 6537ae98dc4086f2b6668810425f80c19ef57734..da483bdf81efa62b36b6a10dacc7821b43dd18b7 100644
index 090cb821a43ccfea21a990580e47b592df9d030f..4177a12d333925dd7f3422861847119f344a441b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -433,7 +433,7 @@ public final class CraftServer implements Server {
@@ -449,7 +449,7 @@ public final class CraftServer implements Server {
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
this.configuration.options().copyDefaults(true);
@@ -396,29 +377,41 @@ index 6537ae98dc4086f2b6668810425f80c19ef57734..da483bdf81efa62b36b6a10dacc7821b
if (!this.configuration.isString("aliases")) {
legacyAlias = this.configuration.getConfigurationSection("aliases");
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index a858b7ddef7f6877c0b92f4150e0dd37bea121aa..eab5ea835a524482f8cc043c7be190a835335ed2 100644
index 5d41bd4d4b86ca0c7c03d3ac6e75b3f1f1abe73b..c608770ea0df26859a09b794e93292f4aa6881b4 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -3,5 +3,6 @@ package org.plazmamc.plazma;
public interface Options {
@@ -7,5 +7,6 @@ public interface Options {
boolean iKnowWhatIAmDoing = Boolean.getBoolean("Plazma.iKnowWhatIAmDoing");
+ boolean aggressiveOptimize = Boolean.getBoolean("Plazma.aggressiveOptimize");
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
+ boolean AGGRESSIVE = getBoolean("Plazma.aggressiveOptimize") && !NO_OPTIMIZE;
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
index 09053b4ccf268fd204c81dbb8d4f10fa9edcad5f..93f67f125b3674e645cfdae27e579e12d31a236e 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
@@ -35,6 +35,15 @@ public class PlazmaConfigurations extends Configurations<GlobalConfiguration, Wo
static final String WORLD_CONFIG_FILE_NAME = "plazma-world.yml";
static final boolean OPTIMIZE = !Options.NO_OPTIMIZE;
+ static {
+ if (Options.AGGRESSIVE) {
+ LOGGER.warn("Aggressive configuration optimization is enabled. It can greatly affect gameplay.");
+ } else if (OPTIMIZE) {
+ LOGGER.warn("Default configuration optimization is enabled. It may have some impact on gameplay.");
+ LOGGER.warn("To disable default configuration optimization, type \"-DPlazma.disableConfigOptimization\" before the -jar in the server startup command.");
+ }
+ }
+
private static final String HEADER_START = """
#### ENGLISH ####
This is the %s configuration file for Plazma.
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index d0d31002562e728fa1a6c9bc81baa4534f11d365..f9f7664e4a6a4e24dcb3b8da0a807a984a698429 100644
index 7690441b5059ae6c7ca8519875ea8a515c5c5e93..f29059798c9dc642187b4939dd917ee15cbe120d 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -49,6 +49,7 @@ public class PurpurConfig {
+ "join us in our Discord guild.\n"
+ "\n"
+ "Website: https://purpurmc.org \n"
+ + "Vanilla Food Properties: https://gist.github.com/BillyGalbreath/4fdfba991bd020e814eabf5143e3b225 \n" // Plazma
+ "Docs: https://purpurmc.org/docs \n";
private static File CONFIG_FILE;
public static YamlConfiguration config;
@@ -241,7 +242,7 @@ public class PurpurConfig {
@@ -244,7 +244,7 @@ public class PurpurConfig {
laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold);
}
@@ -427,7 +420,7 @@ index d0d31002562e728fa1a6c9bc81baa4534f11d365..f9f7664e4a6a4e24dcb3b8da0a807a98
private static void useAlternateKeepAlive() {
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
}
@@ -481,7 +482,7 @@ public class PurpurConfig {
@@ -491,7 +491,7 @@ public class PurpurConfig {
}
public static boolean useUPnP = false;
@@ -437,10 +430,10 @@ index d0d31002562e728fa1a6c9bc81baa4534f11d365..f9f7664e4a6a4e24dcb3b8da0a807a98
private static void networkSettings() {
useUPnP = getBoolean("settings.network.upnp-port-forwarding", useUPnP);
diff --git a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
index b9d1117885a8dd15f207e55ce5e402d8cefe0226..9cb79d203b6ec345d719cd488d2cce8f877fe2bd 100644
index 0d5a0e14cbaacc63eeced78a6c28cc64ad918522..43ad38dadfe14b3dd0565c536b276eb3f9dbd813 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -425,7 +425,7 @@ public class PurpurWorldConfig {
@@ -426,7 +426,7 @@ public class PurpurWorldConfig {
public boolean idleTimeoutTargetPlayer = true;
public String playerDeathExpDropEquation = "expLevel * 7";
public int playerDeathExpDropMax = 100;
@@ -449,7 +442,7 @@ index b9d1117885a8dd15f207e55ce5e402d8cefe0226..9cb79d203b6ec345d719cd488d2cce8f
public boolean teleportOnNetherCeilingDamage = false;
public boolean totemOfUndyingWorksInInventory = false;
public boolean playerFixStuckPortal = false;
@@ -3070,7 +3070,7 @@ public class PurpurWorldConfig {
@@ -3271,7 +3271,7 @@ public class PurpurWorldConfig {
public boolean zombieJockeyOnlyBaby = true;
public double zombieJockeyChance = 0.05D;
public boolean zombieJockeyTryExistingChickens = true;
@@ -459,23 +452,23 @@ index b9d1117885a8dd15f207e55ce5e402d8cefe0226..9cb79d203b6ec345d719cd488d2cce8f
public boolean zombieTakeDamageFromWater = false;
public boolean zombieAlwaysDropExp = false;
diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java
index f9b8e2bc039f1a37e47f84909c8785f3ef530284..576e82d2cf933b307b7374b60d864e98be4afcb2 100644
index 2c408fa4abcbe1171c58aee8799c8cf7867d0f0a..aadad0a1e3c7e20b0ab97095ee6e6fb7dbfbd234 100644
--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java
+++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java
@@ -150,14 +150,14 @@ public class SpigotWorldConfig
public double itemMerge;
private void itemMerge()
{
- this.itemMerge = this.getDouble("merge-radius.item", 2.5 );
+ this.itemMerge = this.getDouble("merge-radius.item", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 3.5 : 2.5 ); // Plazma - Optimize default configurations
- this.itemMerge = this.getDouble("merge-radius.item", 0.5 );
+ this.itemMerge = this.getDouble("merge-radius.item", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 3.5 : 0.5); // Plazma - Optimize default configurations
this.log( "Item Merge Radius: " + this.itemMerge );
}
public double expMerge;
private void expMerge()
{
- this.expMerge = this.getDouble("merge-radius.exp", 3.0 );
+ this.expMerge = this.getDouble("merge-radius.exp", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4.0 : 3.0 ); // Plazma - Optimize default configurations
- this.expMerge = this.getDouble("merge-radius.exp", -1 );
+ this.expMerge = this.getDouble("merge-radius.exp", org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4.0 : -1); // Plazma - Optimize default configurations
this.log( "Experience Merge Radius: " + this.expMerge );
}
@@ -488,47 +481,58 @@ index f9b8e2bc039f1a37e47f84909c8785f3ef530284..576e82d2cf933b307b7374b60d864e98
this.log( "Mob Spawn Range: " + this.mobSpawnRange );
}
@@ -207,26 +207,26 @@ public class SpigotWorldConfig
@@ -207,27 +207,29 @@ public class SpigotWorldConfig
this.log( "Item Despawn Rate: " + this.itemDespawnRate );
}
- public int animalActivationRange = 32;
- public int monsterActivationRange = 32;
+ public int animalActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32; // Plazma - Optimize default configurations
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 24 : 32; // Plazma - Optimize default configurations
public int raiderActivationRange = 48;
- public int raiderActivationRange = 64;
- public int miscActivationRange = 16;
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16; // Plazma - Optimize default configurations
// Paper start
- // Paper start
- public int flyingMonsterActivationRange = 32;
- public int waterActivationRange = 16;
- public int villagerActivationRange = 32;
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 48 : 32; // Plazma - Optimize default configurations
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16; // Plazma - Optimize default configurations
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32; // Plazma - Optimize default configurations
public int wakeUpInactiveAnimals = 4;
public int wakeUpInactiveAnimalsEvery = 60*20;
- public int wakeUpInactiveAnimals = 4;
- public int wakeUpInactiveAnimalsEvery = 60*20;
- public int wakeUpInactiveAnimalsFor = 5*20;
- public int wakeUpInactiveMonsters = 8;
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 40 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 8; // Plazma - Optimize default configurations
public int wakeUpInactiveMonstersEvery = 20*20;
- public int wakeUpInactiveMonstersEvery = 20*20;
- public int wakeUpInactiveMonstersFor = 5*20;
- public int wakeUpInactiveVillagers = 4;
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 4; // Plazma - Optimize default configurations
public int wakeUpInactiveVillagersEvery = 30*20;
- public int wakeUpInactiveVillagersEvery = 30*20;
- public int wakeUpInactiveVillagersFor = 5*20;
- public int wakeUpInactiveFlying = 8;
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 20 : 100; // Plazma - Optimize default configurations
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 8; // Plazma - Optimize default configurations
public int wakeUpInactiveFlyingEvery = 10*20;
- public int wakeUpInactiveFlyingEvery = 10*20;
- public int wakeUpInactiveFlyingFor = 5*20;
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100; // Plazma - Optimize default configurations
public int villagersWorkImmunityAfter = 5*20;
- public int villagersWorkImmunityAfter = 5*20;
+ // Plazma start - Optimize default configurations
+ public int animalActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32;
+ public int monsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 24 : 32;
+ public int raiderActivationRange = 64; // diff on changes
+ public int miscActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16;
+ // Paper start // diff on changes
+ public int flyingMonsterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 48 : 32;
+ public int waterActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 8 : 16;
+ public int villagerActivationRange = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 16 : 32;
+ public int wakeUpInactiveAnimals = 4; // diff on changes
+ public int wakeUpInactiveAnimalsEvery = 1200;
+ public int wakeUpInactiveAnimalsFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 40 : 100;
+ public int wakeUpInactiveMonsters = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 4 : 8;
+ public int wakeUpInactiveMonstersEvery = 400;
+ public int wakeUpInactiveMonstersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100;
+ public int wakeUpInactiveVillagers = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 4;
+ public int wakeUpInactiveVillagersEvery = 600;
+ public int wakeUpInactiveVillagersFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 20 : 100;
+ public int wakeUpInactiveFlying = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 1 : 8;
+ public int wakeUpInactiveFlyingEvery = 200;
+ public int wakeUpInactiveFlyingFor = org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? 60 : 100;
+ public int villagersWorkImmunityAfter = 100;
+ // Plazma end - Optimize default configurations
public int villagersWorkImmunityFor = 20;
public boolean villagersActiveForPanic = true;
@@ -299,7 +299,7 @@ public class SpigotWorldConfig
// Paper end
@@ -299,7 +301,7 @@ public class SpigotWorldConfig
{
this.set( "ticks-per.hopper-check", 1 );
}
@@ -537,7 +541,7 @@ index f9b8e2bc039f1a37e47f84909c8785f3ef530284..576e82d2cf933b307b7374b60d864e98
this.hopperAmount = this.getInt( "hopper-amount", 1 );
this.hopperCanLoadChunks = this.getBoolean( "hopper-can-load-chunks", false );
this.log( "Hopper Transfer: " + this.hopperTransfer + " Hopper Check: " + this.hopperCheck + " Hopper Amount: " + this.hopperAmount + " Hopper Can Load Chunks: " + this.hopperCanLoadChunks );
@@ -309,7 +309,7 @@ public class SpigotWorldConfig
@@ -309,7 +311,7 @@ public class SpigotWorldConfig
public int tridentDespawnRate;
private void arrowDespawnRate()
{

View File

@@ -0,0 +1,196 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 15 May 2024 16:13:17 +0900
Subject: [PATCH] Add an option to apply the configuration to the vanilla
default
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 8c3c7987a269733a0f530e8f22c3f1a005de21ac..20def77109eb9cd98a7677e73b4316544be86283 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -88,7 +88,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Component flyingVehicle = Component.translatable("multiplayer.disconnect.flying");
}
- public Component noPermission = Component.text("I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.", NamedTextColor.RED);
+ public Component noPermission = org.plazmamc.plazma.Options.VANILLAIZE ? Component.translatable("command.unknown.command") : Component.text("I'm sorry, but you do not have permission to perform this command. Please contact the server administrators if you believe that this is in error.", NamedTextColor.RED);
public boolean useDisplayNameInQuitMessage = false;
}
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 4177a12d333925dd7f3422861847119f344a441b..15527e902484496a6804c879d1de589bed3f8713 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -449,7 +449,19 @@ public final class CraftServer implements Server {
this.configuration = YamlConfiguration.loadConfiguration(this.getConfigFile());
this.configuration.options().copyDefaults(true);
- this.configuration.setDefaults(YamlConfiguration.loadConfiguration(new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(org.plazmamc.plazma.configurations.PlazmaConfigurations.optimize() ? "configurations/bukkit_optimized.yml" : "configurations/bukkit.yml"), Charsets.UTF_8))); // Plazma - Optimize default configurations
+ // Plazma start - Add an option to apply the configuration to the vanilla default
+ String configPath;
+ if (org.plazmamc.plazma.Options.NO_OPTIMIZE) {
+ if (org.plazmamc.plazma.Options.VANILLAIZE) configPath = "configurations/bukkit_vanillaized.yml";
+ else configPath = "configurations/bukkit.yml";
+ } else {
+ if (org.plazmamc.plazma.Options.VANILLAIZE) configPath = "configurations/bukkit_optimized_vanillaized.yml";
+ else configPath = "configurations/bukkit_optimized.yml";
+ }
+ this.configuration.setDefaults(YamlConfiguration.loadConfiguration(
+ new InputStreamReader(this.getClass().getClassLoader().getResourceAsStream(configPath), Charsets.UTF_8)
+ )); // Plazma - Optimize default configurations
+ // Plazma end - Add an option to apply the configuration to the vanilla default
ConfigurationSection legacyAlias = null;
if (!this.configuration.isString("aliases")) {
legacyAlias = this.configuration.getConfigurationSection("aliases");
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index c608770ea0df26859a09b794e93292f4aa6881b4..063b71b3043a69a90130a81686b6a5f1e5f22fd1 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -8,5 +8,7 @@ public interface Options {
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
boolean AGGRESSIVE = getBoolean("Plazma.aggressiveOptimize") && !NO_OPTIMIZE;
+ boolean VANILLAIZE = getBoolean("Plazma.vanillaize") && !AGGRESSIVE;
+ boolean USE_VANILLA = getBoolean("Plazma.useVanillaConfiguration") && !AGGRESSIVE && NO_OPTIMIZE;
}
diff --git a/src/main/java/org/spigotmc/SpigotConfig.java b/src/main/java/org/spigotmc/SpigotConfig.java
index 4dbb109d0526afee99b9190fc256585121aac9b5..3835a7aa3e3c60a6f50f1d6e781f280ea8a83fb3 100644
--- a/src/main/java/org/spigotmc/SpigotConfig.java
+++ b/src/main/java/org/spigotmc/SpigotConfig.java
@@ -193,8 +193,8 @@ public class SpigotConfig
public static String whitelistMessage;
public static String unknownCommandMessage;
public static String serverFullMessage;
- public static String outdatedClientMessage = "Outdated client! Please use {0}";
- public static String outdatedServerMessage = "Outdated server! I\'m still on {0}";
+ public static String outdatedClientMessage = org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:multiplayer.disconnect.outdated_client>" : "Outdated client! Please use {0}";
+ public static String outdatedServerMessage = org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:multiplayer.disconnect.outdated_server>" : "Outdated server! I'm still on {0}";
private static String transform(String s)
{
return ChatColor.translateAlternateColorCodes( '&', s ).replaceAll( "\\\\n", "\n" );
@@ -207,9 +207,9 @@ public class SpigotConfig
SpigotConfig.set( "messages.outdated-server", SpigotConfig.outdatedServerMessage );
}
- SpigotConfig.whitelistMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.whitelist", "You are not whitelisted on this server!" ) );
- SpigotConfig.unknownCommandMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.unknown-command", "Unknown command. Type \"/help\" for help." ) );
- SpigotConfig.serverFullMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.server-full", "The server is full!" ) );
+ SpigotConfig.whitelistMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.whitelist", org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:multiplayer.disconnect.not_whitelisted>" : "You are not whitelisted on this server!" ) ); // Plazma - Add an option to apply the configuration to the vanilla default
+ SpigotConfig.unknownCommandMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.unknown-command", org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:command.unknown.command>" : "Unknown command. Type \"/help\" for help." ) );
+ SpigotConfig.serverFullMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.server-full", org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:multiplayer.disconnect.server_full>" : "The server is full!" ) );
SpigotConfig.outdatedClientMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.outdated-client", SpigotConfig.outdatedClientMessage ) );
SpigotConfig.outdatedServerMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.outdated-server", SpigotConfig.outdatedServerMessage ) );
}
@@ -223,7 +223,7 @@ public class SpigotConfig
SpigotConfig.timeoutTime = SpigotConfig.getInt( "settings.timeout-time", SpigotConfig.timeoutTime );
SpigotConfig.restartOnCrash = SpigotConfig.getBoolean( "settings.restart-on-crash", SpigotConfig.restartOnCrash );
SpigotConfig.restartScript = SpigotConfig.getString( "settings.restart-script", SpigotConfig.restartScript );
- SpigotConfig.restartMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.restart", "Server is restarting" ) );
+ SpigotConfig.restartMessage = SpigotConfig.transform( SpigotConfig.getString( "messages.restart", org.plazmamc.plazma.Options.VANILLAIZE ? "<lang:disconnect.quitting>" : "Server is restarting" ) );
SpigotConfig.commands.put( "restart", new RestartCommand( "restart" ) );
// WatchdogThread.doStart( SpigotConfig.timeoutTime, SpigotConfig.restartOnCrash ); // Paper - moved to after paper config initialization
}
diff --git a/src/main/resources/configurations/bukkit_optimized_vanillaized.yml b/src/main/resources/configurations/bukkit_optimized_vanillaized.yml
new file mode 100644
index 0000000000000000000000000000000000000000..b7ed456b0172caebdf5b548052ff2ae688377020
--- /dev/null
+++ b/src/main/resources/configurations/bukkit_optimized_vanillaized.yml
@@ -0,0 +1,45 @@
+# This is the main configuration file for Bukkit.
+# As you can see, there's actually not that much to configure without any plugins.
+# For a reference for any variable inside this file, check out the Bukkit Wiki at
+# https://www.spigotmc.org/go/bukkit-yml
+#
+# If you need help on this file, feel free to join us on Discord or leave a message
+# on the forums asking for advice.
+#
+# Discord: https://www.spigotmc.org/go/discord
+# Forums: https://www.spigotmc.org/
+# Bug tracker: https://www.spigotmc.org/go/bugs
+
+
+settings:
+ allow-end: true
+ warn-on-overload: true
+ permissions-file: permissions.yml
+ update-folder: update
+ plugin-profiling: false
+ connection-throttle: 4000
+ query-plugins: true
+ deprecated-verbose: default
+ shutdown-message: <lang:multiplayer.disconnect.server_shutdown>
+ minimum-api: none
+ use-map-color-cache: true
+spawn-limits:
+ monsters: 20
+ animals: 5
+ water-animals: 2
+ water-ambient: 2
+ water-underground-creature: 3
+ axolotls: 3
+ ambient: 1
+chunk-gc:
+ period-in-ticks: 400
+ticks-per:
+ animal-spawns: 400
+ monster-spawns: 10
+ water-spawns: 400
+ water-ambient-spawns: 400
+ water-underground-creature-spawns: 400
+ axolotl-spawns: 400
+ ambient-spawns: 400
+ autosave: 6000
+aliases: now-in-commands.yml
diff --git a/src/main/resources/configurations/bukkit_vanillaized.yml b/src/main/resources/configurations/bukkit_vanillaized.yml
new file mode 100644
index 0000000000000000000000000000000000000000..22fe392b9970bb82db293d638b0dd5727bd60e5a
--- /dev/null
+++ b/src/main/resources/configurations/bukkit_vanillaized.yml
@@ -0,0 +1,45 @@
+# This is the main configuration file for Bukkit.
+# As you can see, there's actually not that much to configure without any plugins.
+# For a reference for any variable inside this file, check out the Bukkit Wiki at
+# https://www.spigotmc.org/go/bukkit-yml
+#
+# If you need help on this file, feel free to join us on Discord or leave a message
+# on the forums asking for advice.
+#
+# Discord: https://www.spigotmc.org/go/discord
+# Forums: https://www.spigotmc.org/
+# Bug tracker: https://www.spigotmc.org/go/bugs
+
+
+settings:
+ allow-end: true
+ warn-on-overload: true
+ permissions-file: permissions.yml
+ update-folder: update
+ plugin-profiling: false
+ connection-throttle: 4000
+ query-plugins: true
+ deprecated-verbose: default
+ shutdown-message: <lang:multiplayer.disconnect.server_shutdown>
+ minimum-api: none
+ use-map-color-cache: true
+spawn-limits:
+ monsters: 70
+ animals: 10
+ water-animals: 5
+ water-ambient: 20
+ water-underground-creature: 5
+ axolotls: 5
+ ambient: 15
+chunk-gc:
+ period-in-ticks: 600
+ticks-per:
+ animal-spawns: 400
+ monster-spawns: 1
+ water-spawns: 1
+ water-ambient-spawns: 1
+ water-underground-creature-spawns: 1
+ axolotl-spawns: 1
+ ambient-spawns: 1
+ autosave: 6000
+aliases: now-in-commands.yml

View File

@@ -1,29 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Tue, 5 Dec 2023 13:29:28 +0900
Subject: [PATCH] Add Entity spawn deadlock timer
Subject: [PATCH] Add entity spawn deadlock timer
[REFERENCE]
- AbsolemJackdaw/FixMySpawnR
diff --git a/src/main/java/net/minecraft/world/level/BaseSpawner.java b/src/main/java/net/minecraft/world/level/BaseSpawner.java
index 914564a528c360f352927e7681ab2e31ed365b21..090643e977257a097a99a3f54d1d73b995cfd82a 100644
index 79a8e5dd1d189c4eaf93999925ea0790eb6ce368..ac3b0f95926aba8e99375f74dfca9d83ca1fbd57 100644
--- a/src/main/java/net/minecraft/world/level/BaseSpawner.java
+++ b/src/main/java/net/minecraft/world/level/BaseSpawner.java
@@ -46,6 +46,8 @@ public abstract class BaseSpawner {
@@ -50,6 +50,8 @@ public abstract class BaseSpawner {
public int requiredPlayerRange = 16;
public int spawnRange = 4;
private int tickDelay = 0; // Paper
+ private int blockExistsTick = 0; // Plazma - Implement FixMySpawnR
+ private boolean blockLockedByTime = false; // Plazma - Implement FixMySpawnR
// Paper start - ported from 1.20.3 Fix MC-259321
static <B, T extends B> net.minecraft.world.level.entity.EntityTypeTest<B, T> forExactClass(Class<T> clazz) {
return new net.minecraft.world.level.entity.EntityTypeTest<>() {
@@ -97,6 +99,17 @@ public abstract class BaseSpawner {
private int tickDelay = 0; // Paper - Configurable mob spawner tick rate
+ private int blockExistsTick = 0; // Plazma - Add entity spawn deadlock timer
+ private boolean blockLockedByTime = false; // Plazma - Add entity spawn deadlock timer
public BaseSpawner() {}
@@ -85,6 +87,17 @@ public abstract class BaseSpawner {
}
public void serverTick(ServerLevel world, BlockPos pos) {
+ // Plazma start - Implement FixMySpawnR
+ // Plazma start - Add entity spawn deadlock timer
+ if (world.plazmaConfig().entity.spawnDeadlockTimer.enabled) {
+ if (!this.blockLockedByTime) {
+ if (this.blockExistsTick > world.plazmaConfig().entity.spawnDeadlockTimer.timerTimeout)
@@ -33,38 +33,38 @@ index 914564a528c360f352927e7681ab2e31ed365b21..090643e977257a097a99a3f54d1d73b9
+
+ if (blockLockedByTime && world.getBestNeighborSignal(pos) > 0) return;
+ }
+ // Plazma end
+ // Plazma end - Add entity spawn deadlock timer
if (spawnCount <= 0 || maxNearbyEntities <= 0) return; // Paper - Ignore impossible spawn tick
// Paper start - Configurable mob spawner tick rate
if (spawnDelay > 0 && --tickDelay > 0) return;
@@ -301,6 +314,12 @@ public abstract class BaseSpawner {
if (nbt.contains("SpawnRange", 99)) {
@@ -290,6 +303,13 @@ public abstract class BaseSpawner {
this.spawnRange = nbt.getShort("SpawnRange");
}
+ // Plazma start - Implement FixMySpawnR
+ // Plazma start - Add entity spawn deadlock timer
+ if (nbt.contains("Plazma.SpawnerTicks", 99)) {
+ this.blockExistsTick = nbt.getInt("Plazma.SpawnerTicks");
+ this.blockLockedByTime = nbt.getBoolean("Plazma.SpawnerLocked");
+ }
+ // Plazma end
+ // Plazma end - Add entity spawn deadlock timer
+
this.displayEntity = null;
}
@@ -330,6 +349,9 @@ public abstract class BaseSpawner {
@@ -318,6 +338,8 @@ public abstract class BaseSpawner {
}));
}
+ nbt.putInt("Plazma.SpawnerTicks", this.blockExistsTick); // Plazma - Implement FixMySpawnR
+ nbt.putBoolean("Plazma.SpawnerLocked", this.blockLockedByTime); // Plazma - Implement FixMySpawnR
+
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).result().orElseThrow());
+ nbt.putInt("Plazma.SpawnerTicks", this.blockExistsTick); // Plazma - Add entity spawn deadlock timer
+ nbt.putBoolean("Plazma.SpawnerLocked", this.blockLockedByTime); // Plazma - Add entity spawn deadlock timer
nbt.put("SpawnPotentials", (Tag) SpawnData.LIST_CODEC.encodeStart(NbtOps.INSTANCE, this.spawnPotentials).getOrThrow());
return nbt;
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index b1293935e55fcb1c45224e5bda9be8d1045ff4e8..e5e0b0f0bd3b2249dc1db029682b8957b0addcac 100644
index a371893777a2c2d1de22e7d52f2fd3f55b82d74d..d366e8755ba91c329164c16659f6b07245577fba 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -54,6 +54,14 @@ public class WorldConfigurations extends ConfigurationPart {
@@ -51,6 +51,14 @@ public class WorldConfigurations extends ConfigurationPart {
}
@@ -78,4 +78,4 @@ index b1293935e55fcb1c45224e5bda9be8d1045ff4e8..e5e0b0f0bd3b2249dc1db029682b8957
+
}
public Structure structure;
public Block block;

View File

@@ -288,10 +288,10 @@ index 0000000000000000000000000000000000000000..d11579075e653868a43fe826bdf9b41d
+
+}
diff --git a/src/main/java/net/minecraft/util/random/WeightedRandomList.java b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
index 1bcb5a58b945cdb3dc94efb314d7ba41fbb38e07..34beb1b0af10877b3388e6f44913253eb51e7a51 100644
index ef44047c3ea850fe52370b8176efbdf0515d20d6..30efa8704c1ae94027272602687cbc4a2bc8a772 100644
--- a/src/main/java/net/minecraft/util/random/WeightedRandomList.java
+++ b/src/main/java/net/minecraft/util/random/WeightedRandomList.java
@@ -8,10 +8,10 @@ import net.minecraft.util.RandomSource;
@@ -10,10 +10,10 @@ import net.minecraft.util.RandomSource;
public class WeightedRandomList<E extends WeightedEntry> {
private final int totalWeight;
@@ -300,7 +300,7 @@ index 1bcb5a58b945cdb3dc94efb314d7ba41fbb38e07..34beb1b0af10877b3388e6f44913253e
WeightedRandomList(List<? extends E> entries) {
- this.items = ImmutableList.copyOf(entries);
+ this.items = entries.size() > 4 ? ImmutableList.copyOf(entries) : java.util.Collections.unmodifiableList(new me.jellysquid.mods.lithium.common.util.collections.HashedReferenceList<>(entries));// Plazma - Lithium: collections.mob_spawning
+ this.items = entries.size() > 4 ? ImmutableList.copyOf(entries) : java.util.Collections.unmodifiableList(new me.jellysquid.mods.lithium.common.util.collections.HashedReferenceList<>(entries)); // Plazma - Lithium: collections.mob_spawning
this.totalWeight = WeightedRandom.getTotalWeight(entries);
}

View File

@@ -0,0 +1,182 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 29 Apr 2024 14:49:37 +0900
Subject: [PATCH] Implement FreedomChat
ocelotpotpie/FreedomChat
Copyright (C) 2022-2024 ocelotpotpie, Licensed under GNU GPL v3.0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 32ebee3620b5ec1ff57b92a581fb2d7f5dfe17cf..214bd8084182ebd0d36cf9ddfac4411a5dce78be 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -697,6 +697,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// Paper start - Add setting for proxy online mode status
return dedicatedserverproperties.enforceSecureProfile
&& io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
+ && !org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.freedomChat.enabled // Plazma - Implement FreedomChat
&& this.services.canValidateProfileKeys();
// Paper end - Add setting for proxy online mode status
}
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index 459eea7dae68afdf7e1443f29f6f8d0c68668b74..aead28160c7a5067340ec80a833eafcab1817d67 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -135,6 +135,7 @@ public abstract class PlayerList {
private static final Logger LOGGER = LogUtils.getLogger();
private static final int SEND_PLAYER_INFO_INTERVAL = 600;
private static final SimpleDateFormat BAN_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
+ private static final ru.bk.oharass.freedomchat.FreedomChat FREEDOM_HANDLER = new ru.bk.oharass.freedomchat.FreedomChat(); // Plazma - Implement FreedomChat
private final MinecraftServer server;
public final List<ServerPlayer> players = new java.util.concurrent.CopyOnWriteArrayList(); // CraftBukkit - ArrayList -> CopyOnWriteArrayList: Iterator safety
private final Map<UUID, ServerPlayer> playersByUUID = Maps.newHashMap();
@@ -285,6 +286,7 @@ public abstract class PlayerList {
// CraftBukkit - Moved message to after join
// PlayerList.LOGGER.info("{}[{}] logged in with entity id {} at ({}, {}, {})", new Object[]{entityplayer.getName().getString(), s1, entityplayer.getId(), entityplayer.getX(), entityplayer.getY(), entityplayer.getZ()});
LevelData worlddata = worldserver1.getLevelData();
+ connection.channel.pipeline().addAfter("packet_handler", "freedom_handler", FREEDOM_HANDLER); // Plazma - Implement FreedomChat
player.loadGameTypes((CompoundTag) optional.orElse(null)); // CraftBukkit - decompile error
ServerGamePacketListenerImpl playerconnection = new ServerGamePacketListenerImpl(this.server, connection, player, clientData);
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 5450d2a784511122a8236d30485f6b1f798822f3..a0b1239e302f0366743949a895a0539348817077 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -45,6 +45,15 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean checkSpectatorMovedToQuickly = !OPTIMIZE;
+ public FreedomChat freedomChat;
+ public class FreedomChat extends ConfigurationPart {
+
+ public boolean enabled = false;
+ public boolean rewriteChat = true;
+ public boolean noChatReports = true;
+
+ }
+
}
@Setting("world-generation")
diff --git a/src/main/java/ru/bk/oharass/freedomchat/FreedomChat.java b/src/main/java/ru/bk/oharass/freedomchat/FreedomChat.java
new file mode 100644
index 0000000000000000000000000000000000000000..49290983ef6b63bbacdef30f774ce683228e5755
--- /dev/null
+++ b/src/main/java/ru/bk/oharass/freedomchat/FreedomChat.java
@@ -0,0 +1,103 @@
+package ru.bk.oharass.freedomchat;
+
+import com.mojang.serialization.Codec;
+import com.mojang.serialization.codecs.RecordCodecBuilder;
+import io.netty.buffer.ByteBuf;
+import io.netty.channel.ChannelHandler;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.handler.codec.MessageToByteEncoder;
+import net.minecraft.network.FriendlyByteBuf;
+import net.minecraft.network.RegistryFriendlyByteBuf;
+import net.minecraft.network.chat.CommonComponents;
+import net.minecraft.network.chat.Component;
+import net.minecraft.network.chat.ComponentSerialization;
+import net.minecraft.network.codec.StreamCodec;
+import net.minecraft.network.protocol.Packet;
+import net.minecraft.network.protocol.game.ClientGamePacketListener;
+import net.minecraft.network.protocol.game.ClientboundPlayerChatPacket;
+import net.minecraft.network.protocol.game.ClientboundSystemChatPacket;
+import net.minecraft.network.protocol.game.GameProtocols;
+import net.minecraft.network.protocol.status.ClientboundStatusResponsePacket;
+import net.minecraft.network.protocol.status.ServerStatus;
+import net.minecraft.server.MinecraftServer;
+
+import java.util.Objects;
+import java.util.Optional;
+
+import static org.plazmamc.plazma.configurations.GlobalConfiguration.get;
+
+@ChannelHandler.Sharable
+public class FreedomChat extends MessageToByteEncoder<Packet<?>> {
+
+ private static final StreamCodec<ByteBuf, Packet<? super ClientGamePacketListener>> CODEC = GameProtocols.CLIENTBOUND_TEMPLATE
+ .bind(RegistryFriendlyByteBuf.decorator(MinecraftServer.getServer().registryAccess())).codec();
+
+ @Override
+ public boolean acceptOutboundMessage(final Object msg) {
+ return get().player.freedomChat.rewriteChat && msg instanceof ClientboundPlayerChatPacket
+ || get().player.freedomChat.noChatReports && msg instanceof ClientboundStatusResponsePacket;
+ }
+
+ @Override
+ protected void encode(
+ final ChannelHandlerContext context, final Packet<?> packet, final ByteBuf byteBuf
+ ) throws Exception {
+ final FriendlyByteBuf buf = new FriendlyByteBuf(byteBuf);
+
+ switch (packet) {
+ case ClientboundPlayerChatPacket chat -> encodeChat(context, chat, buf);
+ case ClientboundStatusResponsePacket data -> encodeQuery(context, data, buf);
+ default -> {}
+ }
+ }
+
+ private static void encodeChat(
+ final ChannelHandlerContext ignored, final ClientboundPlayerChatPacket packet, final FriendlyByteBuf byteBuf
+ ) {
+ final Component content = Objects.requireNonNullElseGet(
+ packet.unsignedContent(),
+ () -> Component.literal(packet.body().content())
+ );
+
+ CODEC.encode(byteBuf, new ClientboundSystemChatPacket(packet.chatType().decorate(content), false));
+ }
+
+ private static void encodeQuery(
+ final ChannelHandlerContext ignored, final ClientboundStatusResponsePacket packet, final FriendlyByteBuf byteBuf
+ ) {
+ byteBuf.writeVarInt(0x00);
+ byteBuf.writeJsonWithCodec(NCRMetadata.CODEC, NCRMetadata.from(packet.status()));
+ }
+
+ private record NCRMetadata(
+ Component description,
+ Optional<ServerStatus.Players> players,
+ Optional<ServerStatus.Version> version,
+ Optional<ServerStatus.Favicon> favicon,
+ boolean enforcesSecureChat,
+ boolean preventsChatReports
+ ) {
+
+ private static final Codec<NCRMetadata> CODEC = RecordCodecBuilder.create(instance -> instance.group(
+ ComponentSerialization.CODEC.lenientOptionalFieldOf("description", CommonComponents.EMPTY).forGetter(NCRMetadata::description),
+ ServerStatus.Players.CODEC.lenientOptionalFieldOf("players").forGetter(NCRMetadata::players),
+ ServerStatus.Version.CODEC.lenientOptionalFieldOf("version").forGetter(NCRMetadata::version),
+ ServerStatus.Favicon.CODEC.lenientOptionalFieldOf("favicon").forGetter(NCRMetadata::favicon),
+ Codec.BOOL.lenientOptionalFieldOf("enforcesSecureChat", true).forGetter(NCRMetadata::enforcesSecureChat),
+ Codec.BOOL.lenientOptionalFieldOf("preventsChatReports", false).forGetter(NCRMetadata::preventsChatReports)
+ ).apply(instance, NCRMetadata::new));
+
+ private static NCRMetadata from(final ServerStatus status) {
+ return new NCRMetadata(
+ status.description(),
+ status.players(),
+ status.version(),
+ status.favicon(),
+ status.enforcesSecureChat() && !get().player.freedomChat.enabled,
+ get().player.freedomChat.noChatReports
+ );
+ }
+
+ }
+
+}

View File

@@ -0,0 +1,373 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 26 Oct 2024 12:33:57 +0900
Subject: [PATCH] Implement Rail Optimazition
Based on EasterGhost/RailOptimization, Original by FxMorin.
Copyright (C) 2024 EasterGhost, Licensed under GPL v3.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/ca/fxco/railoptimization/RailLogic.java b/src/main/java/ca/fxco/railoptimization/RailLogic.java
new file mode 100644
index 0000000000000000000000000000000000000000..6c0a70c8902623991977c19a1c649488c9ad4afa
--- /dev/null
+++ b/src/main/java/ca/fxco/railoptimization/RailLogic.java
@@ -0,0 +1,302 @@
+package ca.fxco.railoptimization;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.core.Direction;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.Block;
+import net.minecraft.world.level.block.PoweredRailBlock;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.block.state.properties.RailShape;
+
+import java.util.HashMap;
+
+import static net.minecraft.world.level.block.PoweredRailBlock.POWERED;
+import static net.minecraft.world.level.block.PoweredRailBlock.SHAPE;
+import static net.minecraft.world.level.redstone.ExperimentalRedstoneUtils.initialOrientation;
+
+public class RailLogic {
+
+ private static final Direction[] EAST_WEST_DIR = new Direction[]{Direction.WEST, Direction.EAST};
+ private static final Direction[] NORTH_SOUTH_DIR = new Direction[]{Direction.SOUTH, Direction.NORTH};
+
+ private static final int UPDATE_FORCE_PLACE = Block.UPDATE_MOVE_BY_PISTON | Block.UPDATE_KNOWN_SHAPE | Block.UPDATE_CLIENTS;
+
+ public static void customUpdateState(PoweredRailBlock self, BlockState state, Level level, BlockPos pos) {
+ boolean shouldBePowered = level.hasNeighborSignal(pos) ||
+ self.findPoweredRailSignal(level, pos, state, true, 0) ||
+ self.findPoweredRailSignal(level, pos, state, false, 0);
+ if (shouldBePowered == state.getValue(POWERED)) return;
+
+ RailShape railShape = state.getValue(SHAPE);
+ if (railShape.isSlope()) {
+ level.setBlock(pos, state.setValue(POWERED, shouldBePowered), 3);
+ level.updateNeighborsAtExceptFromFacing(pos.below(), self, Direction.UP, initialOrientation(level, Direction.DOWN, Direction.UP));
+ level.updateNeighborsAtExceptFromFacing(pos.above(), self, Direction.DOWN, initialOrientation(level, Direction.UP, Direction.DOWN)); //isAscending
+ return;
+ }
+
+ if (shouldBePowered) powerLane(self, level, pos, state, railShape);
+ else dePowerLane(self, level, pos, state, railShape);
+ }
+
+ private static void giveShapeUpdate(Level level, BlockState state, BlockPos pos, BlockPos fromPos, Direction direction) {
+ BlockState oldState = level.getBlockState(pos);
+ Block.updateOrDestroy(
+ oldState,
+ oldState.updateShape(level, level, pos, direction.getOpposite(), fromPos, state, level.getRandom()),
+ level,
+ pos,
+ Block.UPDATE_CLIENTS & -34,
+ 0
+ );
+ }
+
+ private static boolean findPoweredRailSignalFaster(PoweredRailBlock self, Level level, BlockPos pos, boolean bl, int distance, RailShape shape, HashMap<BlockPos,Boolean> checkedPos) {
+ BlockState blockState = level.getBlockState(pos);
+ if (checkedPos.containsKey(pos) && checkedPos.get(pos))
+ return level.hasNeighborSignal(pos) || findPoweredRailSignalFaster(self, level, pos, blockState, bl, distance + 1, checkedPos);
+
+ if (!blockState.is(self)) return false;
+
+ RailShape railShape = blockState.getValue(SHAPE);
+ if (shape == RailShape.EAST_WEST && (railShape == RailShape.NORTH_SOUTH || railShape == RailShape.ASCENDING_NORTH || railShape == RailShape.ASCENDING_SOUTH) ||
+ shape == RailShape.NORTH_SOUTH && (railShape == RailShape.EAST_WEST || railShape == RailShape.ASCENDING_EAST || railShape == RailShape.ASCENDING_WEST)) {
+ return false;
+ }
+
+ if (!blockState.getValue(POWERED)) return false;
+
+ return level.hasNeighborSignal(pos) ||
+ findPoweredRailSignalFaster(self, level, pos, blockState, bl, distance + 1, checkedPos);
+ }
+
+ private static boolean findPoweredRailSignalFaster(PoweredRailBlock self, Level level, BlockPos pos, BlockState state, boolean bl, int distance, HashMap<BlockPos, Boolean> checkedPos) {
+ if (distance >= level.purpurConfig.railActivationRange) return false;
+
+ int x = pos.getX();
+ int y = pos.getY();
+ int z = pos.getZ();
+ boolean bl2 = true;
+ RailShape railShape = state.getValue(SHAPE);
+
+ switch (railShape.ordinal()) {
+ case 0 -> {
+ if (bl) ++z;
+ else --z;
+ }
+ case 1 -> {
+ if (bl) --x;
+ else ++x;
+ }
+ case 2 -> {
+ if (bl) {
+ --x;
+ } else {
+ ++x;
+ ++y;
+ bl2 = false;
+ }
+ railShape = RailShape.EAST_WEST;
+ }
+ case 3 -> {
+ if (bl) {
+ --x;
+ ++y;
+ bl2 = false;
+ } else {
+ ++x;
+ }
+ railShape = RailShape.EAST_WEST;
+ }
+ case 4 -> {
+ if (bl) {
+ ++z;
+ } else {
+ --z;
+ ++y;
+ bl2 = false;
+ }
+ railShape = RailShape.NORTH_SOUTH;
+ }
+ case 5 -> {
+ if (bl) {
+ ++z;
+ ++y;
+ bl2 = false;
+ } else {
+ --z;
+ }
+ railShape = RailShape.NORTH_SOUTH;
+ }
+ }
+ return findPoweredRailSignalFaster(self, level, new BlockPos(x, y, z), bl, distance, railShape, checkedPos) ||
+ (bl2 && findPoweredRailSignalFaster(self, level, new BlockPos(x, y - 1, z), bl, distance, railShape, checkedPos));
+ }
+
+ private static void powerLane(PoweredRailBlock self, Level level, BlockPos pos, BlockState state, RailShape shape) {
+ level.setBlock(pos, state.setValue(POWERED, true), UPDATE_FORCE_PLACE);
+ HashMap<BlockPos,Boolean> checkedPos = new HashMap<>();
+ checkedPos.put(pos, true);
+ int[] count = new int[2];
+ if (shape == RailShape.NORTH_SOUTH) { //Order: +z, -z
+ for (int i = 0; i < NORTH_SOUTH_DIR.length; ++i) {
+ setRailPositionsPower(self, level, pos, checkedPos, count, i, NORTH_SOUTH_DIR[i]);
+ }
+ updateRailsNS(self, level, pos, state, count);
+ } else if (shape == RailShape.EAST_WEST) { //Order: -x, +x
+ for (int i = 0; i < EAST_WEST_DIR.length; ++i) {
+ setRailPositionsPower(self, level, pos, checkedPos, count, i, EAST_WEST_DIR[i]);
+ }
+ updateRailsEW(self, level, pos, state, count);
+ }
+ }
+
+ private static void dePowerLane(PoweredRailBlock self, Level level, BlockPos pos, BlockState state, RailShape shape) {
+ level.setBlock(pos, state.setValue(POWERED, false), UPDATE_FORCE_PLACE);
+ int[] count = new int[2];
+ if (shape == RailShape.NORTH_SOUTH) { //Order: +z, -z
+ for (int i = 0; i < NORTH_SOUTH_DIR.length; ++i) {
+ setRailPositionsDePower(self, level, pos, count, i, NORTH_SOUTH_DIR[i]);
+ }
+ updateRailsNS(self, level, pos, state, count);
+ } else if (shape == RailShape.EAST_WEST) { //Order: -x, +x
+ for (int i = 0; i < EAST_WEST_DIR.length; ++i) {
+ setRailPositionsDePower(self, level, pos, count, i, EAST_WEST_DIR[i]);
+ }
+ updateRailsEW(self, level, pos, state, count);
+ }
+ }
+
+ private static void setRailPositionsPower(PoweredRailBlock self, Level level, BlockPos pos, HashMap<BlockPos, Boolean> checkedPos, int[] count, int i, Direction dir) {
+ for (int z = 1; z < level.purpurConfig.railActivationRange; z++) {
+ BlockPos newPos = pos.relative(dir, z);
+ BlockState state = level.getBlockState(newPos);
+
+ if (checkedPos.containsKey(newPos)) {
+ if (!checkedPos.get(newPos)) break;
+ count[i]++;
+ continue;
+ }
+
+ if (!state.is(self) || state.getValue(POWERED) || !(
+ level.hasNeighborSignal(newPos) ||
+ findPoweredRailSignalFaster(self, level, newPos, state, true, 0, checkedPos) ||
+ findPoweredRailSignalFaster(self, level, newPos, state, false, 0, checkedPos)
+ )) {
+ checkedPos.put(newPos,false);
+ break;
+ }
+
+ checkedPos.put(newPos,true);
+ level.setBlock(newPos, state.setValue(POWERED, true), UPDATE_FORCE_PLACE);
+ count[i]++;
+ }
+ }
+
+ private static void setRailPositionsDePower(PoweredRailBlock self, Level level, BlockPos pos, int[] count, int i, Direction dir) {
+ for (int z = 1; z < level.purpurConfig.railActivationRange; z++) {
+ BlockPos newPos = pos.relative(dir, z);
+ BlockState state = level.getBlockState(newPos);
+ if (!state.is(self) || !state.getValue(POWERED) || level.hasNeighborSignal(newPos) ||
+ self.findPoweredRailSignal(level, newPos, state, true, 0) ||
+ self.findPoweredRailSignal(level, newPos, state, false, 0)) break;
+ level.setBlock(newPos, state.setValue(POWERED, false), UPDATE_FORCE_PLACE);
+ count[i]++;
+ }
+ }
+
+ private static void shapeUpdateEnd(PoweredRailBlock self, Level level, BlockPos pos, BlockState state, int endPos, Direction direction, int currentPos, BlockPos blockPos) {
+ if (currentPos != endPos) return;
+
+ BlockPos newPos = pos.relative(direction, currentPos+1);
+ giveShapeUpdate(level, state, newPos, pos, direction);
+
+ BlockState blockState = level.getBlockState(blockPos);
+ if (blockState.is(self) && blockState.getValue(SHAPE).isSlope()) giveShapeUpdate(level, state, newPos.above(), pos, direction);
+ }
+
+ private static void neighborUpdateEnd(PoweredRailBlock self, Level level, BlockPos pos, int endPos, Direction dir, Block block, int currentPos, BlockPos blockPos) {
+ if (currentPos != endPos) return;
+
+ BlockPos newPos = pos.relative(dir, currentPos+1);
+ level.neighborChanged(newPos, block, null); // TODO: Orientation
+
+ BlockState blockState = level.getBlockState(blockPos);
+ if (blockState.is(self) && blockState.getValue(SHAPE).isSlope()) level.neighborChanged(newPos.above(), block, null); // TODO: Orientation
+ }
+
+ private static void updateRailsNeighborEW(PoweredRailBlock self, Level level, BlockPos pos, int c, Block block, Direction dir, int[] count, int countAmt) {
+ BlockPos pos1 = pos.relative(dir, c);
+ if (c == 0 && count[1] == 0) level.neighborChanged(pos1.relative(dir.getOpposite()), block, null); // TODO: Orientation
+ neighborUpdateEnd(self, level, pos, countAmt, dir, block, c, pos1);
+ level.neighborChanged(pos1.below(), block, null); // TODO: Orientation
+ level.neighborChanged(pos1.above(), block, null); // TODO: Orientation
+ level.neighborChanged(pos1.north(), block, null); // TODO: Orientation
+ level.neighborChanged(pos1.south(), block, null); // TODO: Orientation
+ BlockPos pos2 = pos.relative(dir, c).below();
+ level.neighborChanged(pos2.below(), block, null); // TODO: Orientation
+ level.neighborChanged(pos2.north(), block, null); // TODO: Orientation
+ level.neighborChanged(pos2.south(), block, null); // TODO: Orientation
+ if (c == countAmt) level.neighborChanged(pos.relative(dir, c + 1).below(), block, null); // TODO: Orientation
+ if (c == 0 && count[1] == 0) level.neighborChanged(pos1.relative(dir.getOpposite()).below(), block, null); // TODO: Orientation
+ }
+
+ private static void updateRailsSectionEW(PoweredRailBlock self, Level level, BlockPos pos, int c, BlockState mainState, Direction dir, int[] count, int countAmt) {
+ BlockPos blockPos = pos.relative(dir, c);
+ if (c == 0 && count[1] == 0) giveShapeUpdate(level, mainState, blockPos.relative(dir.getOpposite()), pos, dir.getOpposite());
+ shapeUpdateEnd(self, level, pos, mainState, countAmt, dir, c, blockPos);
+ giveShapeUpdate(level, mainState, blockPos.below(), pos, Direction.DOWN);
+ giveShapeUpdate(level, mainState, blockPos.above(), pos, Direction.UP);
+ giveShapeUpdate(level, mainState, blockPos.north(), pos, Direction.NORTH);
+ giveShapeUpdate(level, mainState, blockPos.south(), pos, Direction.SOUTH);
+ }
+
+ private static void updateRailsNeighborNS(PoweredRailBlock self, Level level, BlockPos pos, int c, Block block, Direction dir, int[] count, int countAmt) {
+ BlockPos pos1 = pos.relative(dir,c);
+ level.neighborChanged(pos1.west(), block, null); // TODO: Orientation
+ level.neighborChanged(pos1.east(), block, null); // TODO: Orientation
+ level.neighborChanged(pos1.below(), block, null); // TODO: Orientation
+ level.neighborChanged(pos1.above(), block, null); // TODO: Orientation
+ neighborUpdateEnd(self, level, pos, countAmt, dir, block, c, pos1);
+ if (c == 0 && count[1] == 0) level.neighborChanged(pos1.relative(dir.getOpposite()), block, null); // TODO: Orientation
+ BlockPos pos2 = pos.relative(dir,c).below();
+ level.neighborChanged(pos2.west(), block, null); // TODO: Orientation
+ level.neighborChanged(pos2.east(), block, null); // TODO: Orientation
+ level.neighborChanged(pos2.below(), block, null); // TODO: Orientation
+ if (c == countAmt) level.neighborChanged(pos.relative(dir,c + 1).below(), block, null); // TODO: Orientation
+ if (c == 0 && count[1] == 0) level.neighborChanged(pos1.relative(dir.getOpposite()).below(), block, null); // TODO: Orientation
+ }
+
+ private static void updateRailsSectionNS(PoweredRailBlock self, Level level, BlockPos pos, int c, BlockState state, Direction dir, int[] count, int countAmt) {
+ BlockPos blockPos = pos.relative(dir, c);
+ giveShapeUpdate(level, state, blockPos.west(), pos, Direction.WEST);
+ giveShapeUpdate(level, state, blockPos.east(), pos, Direction.EAST);
+ giveShapeUpdate(level, state, blockPos.below(), pos, Direction.DOWN);
+ giveShapeUpdate(level, state, blockPos.above(), pos, Direction.UP);
+ shapeUpdateEnd(self, level, pos, state, countAmt, dir, c, blockPos);
+ if (c == 0 && count[1] == 0) giveShapeUpdate(level, state, blockPos.relative(dir.getOpposite()), pos, dir.getOpposite());
+ }
+
+ private static void updateRailsEW(PoweredRailBlock self, Level level, BlockPos pos, BlockState state, int[] count) {
+ for (int i = 0; i < EAST_WEST_DIR.length; ++i) {
+ int countAmt = count[i];
+ if (i == 1 && countAmt == 0) continue;
+ Direction dir = EAST_WEST_DIR[i];
+ Block block = state.getBlock();
+ for (int c = countAmt; c >= i; c--) updateRailsNeighborEW(self, level, pos, c, block, dir, count, countAmt);
+ for (int c = countAmt; c >= i; c--) updateRailsSectionEW(self, level, pos, c, state, dir, count, countAmt);
+ }
+ }
+
+ private static void updateRailsNS(PoweredRailBlock self, Level level, BlockPos pos, BlockState state, int[] count) {
+ for (int i = 0; i < NORTH_SOUTH_DIR.length; ++i) {
+ int countAmt = count[i];
+ if (i == 1 && countAmt == 0) continue;
+ Direction dir = NORTH_SOUTH_DIR[i];
+ Block block = state.getBlock();
+ for (int c = countAmt; c >= i; c--) updateRailsNeighborNS(self, level, pos, c, block, dir, count, countAmt);
+ for (int c = countAmt; c >= i; c--) updateRailsSectionNS(self, level, pos, c, state, dir, count, countAmt);
+ }
+ }
+
+}
diff --git a/src/main/java/net/minecraft/world/level/block/PoweredRailBlock.java b/src/main/java/net/minecraft/world/level/block/PoweredRailBlock.java
index bd14c08defe8afc5ceca59d16a5b1dbad178f594..99dc44c569b6003b271ce2ea3f80cb194173ff95 100644
--- a/src/main/java/net/minecraft/world/level/block/PoweredRailBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/PoweredRailBlock.java
@@ -29,7 +29,7 @@ public class PoweredRailBlock extends BaseRailBlock {
this.registerDefaultState((BlockState) ((BlockState) ((BlockState) ((BlockState) this.stateDefinition.any()).setValue(PoweredRailBlock.SHAPE, RailShape.NORTH_SOUTH)).setValue(PoweredRailBlock.POWERED, false)).setValue(PoweredRailBlock.WATERLOGGED, false));
}
- protected boolean findPoweredRailSignal(Level world, BlockPos pos, BlockState state, boolean flag, int distance) {
+ public boolean findPoweredRailSignal(Level world, BlockPos pos, BlockState state, boolean flag, int distance) { // Plazma - protected -> public
if (distance >= world.purpurConfig.railActivationRange) { // Purpur
return false;
} else {
@@ -117,6 +117,12 @@ public class PoweredRailBlock extends BaseRailBlock {
@Override
protected void updateState(BlockState state, Level world, BlockPos pos, Block neighbor) {
+ // Plazma start - Optimize powered rail processing
+ if (world.plazmaConfig().block.rail.useFasterSignalSearch) {
+ ca.fxco.railoptimization.RailLogic.customUpdateState(this, state, world, pos);
+ return;
+ }
+ // Plazma end - Optimize powered rail processing
boolean flag = (Boolean) state.getValue(PoweredRailBlock.POWERED);
boolean flag1 = world.hasNeighborSignal(pos) || this.findPoweredRailSignal(world, pos, state, true, 0) || this.findPoweredRailSignal(world, pos, state, false, 0);
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 9cfab16b9cdf40ccb709c0af66c406954560c0ef..0e27e4a1f767842d1dcd2ed235a6a45f120bf32e 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -72,6 +72,13 @@ public class WorldConfigurations extends ConfigurationPart {
}
+ public Rail rail;
+ public class Rail extends ConfigurationPart {
+
+ public boolean useFasterSignalSearch = OPTIMIZE;
+
+ }
+
}
public Item item;

View File

@@ -0,0 +1,847 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 26 Oct 2024 18:30:26 +0900
Subject: [PATCH] Configurable RandomSource factory/provider
Xorshift Random: https://gist.github.com/Xyene/4637619
Based on AnOpenSauceDev/FastRandom
Copyright (C) 2024 AnOpenSauceDev
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
diff --git a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
index 861bff267cb397e13e8e1c79bd0776b130c6e5da..266e56f2c2e6d8b760209b5d58c58333af5bd0c1 100644
--- a/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
+++ b/src/main/java/com/destroystokyo/paper/loottable/PaperLootableInventoryData.java
@@ -21,7 +21,7 @@ import org.checkerframework.framework.qual.DefaultQualifier;
@DefaultQualifier(NonNull.class)
public class PaperLootableInventoryData {
- private static final Random RANDOM = new Random();
+ private static final Random RANDOM = java.util.concurrent.ThreadLocalRandom.current(); // Plazma - reduce creating random instance
private long lastFill = -1;
private long nextRefill = -1;
diff --git a/src/main/java/com/github/anopensaucedev/fasterrandom/util/math/random/RandomGeneratorRandom.java b/src/main/java/com/github/anopensaucedev/fasterrandom/util/math/random/RandomGeneratorRandom.java
new file mode 100644
index 0000000000000000000000000000000000000000..a060fdbdc4daaffd9aafc707dc567cb56067d1e2
--- /dev/null
+++ b/src/main/java/com/github/anopensaucedev/fasterrandom/util/math/random/RandomGeneratorRandom.java
@@ -0,0 +1,115 @@
+package com.github.anopensaucedev.fasterrandom.util.math.random;
+
+import com.google.common.annotations.VisibleForTesting;
+import net.minecraft.core.BlockPos;
+import net.minecraft.util.Mth;
+import net.minecraft.world.level.levelgen.BitRandomSource;
+import net.minecraft.world.level.levelgen.PositionalRandomFactory;
+import net.minecraft.util.RandomSource;
+import org.jspecify.annotations.NonNull;
+
+import java.util.random.RandomGenerator;
+import java.util.random.RandomGeneratorFactory;
+
+public class RandomGeneratorRandom implements BitRandomSource {
+ private static final @NonNull RandomGeneratorFactory<RandomGenerator.SplittableGenerator> FACTORY = RandomGeneratorFactory.of(org.plazmamc.plazma.Options.RANDOM_ALGOL);
+ private static final int INT_BITS = 48;
+ private static final long SEED_MASK = 0xFFFFFFFFFFFFL;
+ private static final long MULTIPLIER = 25214903917L;
+ private static final long INCREMENT = 11L;
+
+ private long seed;
+ private RandomGenerator.SplittableGenerator randomGenerator;
+
+ public RandomGeneratorRandom(long seed) {
+ this.seed = seed;
+ this.randomGenerator = FACTORY.create(seed);
+ }
+
+ @Override
+ public @NonNull RandomSource fork() {
+ return new RandomGeneratorRandom(this.nextLong());
+ }
+
+ @Override
+ public @NonNull PositionalRandomFactory forkPositional() {
+ return new RandomGeneratorRandomFactory(this.nextLong());
+ }
+
+ @Override
+ public void setSeed(long seed) {
+ this.seed = seed;
+ this.randomGenerator = FACTORY.create(seed);
+ }
+
+ @Override
+ public int next(int bits) {
+ // >>> instead of Mojang's >> fixes MC-239059
+ return (int) ((seed * MULTIPLIER + INCREMENT & SEED_MASK) >>> INT_BITS - bits);
+ }
+
+ @Override
+ public int nextInt() {
+ return randomGenerator.nextInt();
+ }
+
+ @Override
+ public int nextInt(int bound) {
+ return randomGenerator.nextInt(bound);
+ }
+
+ @Override
+ public long nextLong() {
+ return randomGenerator.nextLong();
+ }
+
+ @Override
+ public boolean nextBoolean() {
+ return randomGenerator.nextBoolean();
+ }
+
+ @Override
+ public float nextFloat() {
+ return randomGenerator.nextFloat();
+ }
+
+ @Override
+ public double nextDouble() {
+ return randomGenerator.nextDouble();
+ }
+
+ @Override
+ public double nextGaussian() {
+ return randomGenerator.nextGaussian();
+ }
+
+ private record RandomGeneratorRandomFactory(long seed) implements PositionalRandomFactory {
+ @SuppressWarnings("deprecation")
+ @Override
+ public @NonNull RandomSource at(int x, int y, int z) {
+ return new RandomGeneratorRandom(Mth.getSeed(x, y, z) ^ this.seed);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public @NonNull RandomSource at(final @NonNull BlockPos pos) {
+ return new RandomGeneratorRandom(Mth.getSeed(pos.getX(), pos.getY(), pos.getZ()) ^ this.seed);
+ }
+
+ @Override
+ public @NonNull RandomSource fromHashOf(@NonNull String seed) {
+ return new RandomGeneratorRandom((long) seed.hashCode() ^ this.seed);
+ }
+
+ @Override
+ public @NonNull RandomSource fromSeed(final long seed) {
+ return new RandomGeneratorRandom(seed);
+ }
+
+ @Override
+ @VisibleForTesting
+ public void parityConfigString(@NonNull StringBuilder info) {
+ info.append("RandomGeneratorRandom$RandomGeneratorRandomFactory{").append(this.seed).append("}");
+ }
+ }
+}
diff --git a/src/main/java/net/minecraft/util/RandomSource.java b/src/main/java/net/minecraft/util/RandomSource.java
index 252aef3ffe0fecd47ebea1ed7df48e14fa873eb9..f73f8faac05f90c646a23fadf3da565938a4f788 100644
--- a/src/main/java/net/minecraft/util/RandomSource.java
+++ b/src/main/java/net/minecraft/util/RandomSource.java
@@ -10,18 +10,39 @@ import net.minecraft.world.level.levelgen.ThreadSafeLegacyRandomSource;
public interface RandomSource {
@Deprecated
double GAUSSIAN_SPREAD_FACTOR = 2.297;
+ // Plazma start - Implement RandomGenerator support
+ java.util.function.LongFunction<RandomSource> FACTORY = switch (org.plazmamc.plazma.Options.RANDOM_FACTORY) {
+ case "legacy" -> LegacyRandomSource::new;
+ case "xoroshiro" -> net.minecraft.world.level.levelgen.XoroshiroRandomSource::new;
+ case "xorshift" -> org.plazmamc.plazma.util.random.XorshiftRandomSource::new;
+ case "secure" -> org.plazmamc.plazma.util.random.SecureRandomSource::new;
+ case "generator" -> {
+ try {
+ java.util.random.RandomGeneratorFactory.of(org.plazmamc.plazma.Options.RANDOM_ALGOL).create();
+ yield com.github.anopensaucedev.fasterrandom.util.math.random.RandomGeneratorRandom::new;
+ } catch (IllegalArgumentException ignored) {
+ net.minecraft.server.MinecraftServer.LOGGER.error("Your JDK does not support RandomGenerator! Update JDK or remove \"-DPlazma.randomSourceFactory\" from the startup flag");
+ net.minecraft.server.MinecraftServer.LOGGER.warn("Falling back to legacy random");
+ yield LegacyRandomSource::new;
+ }
+ }
+ default -> throw new IllegalArgumentException("Invalid RandomSource: " + org.plazmamc.plazma.Options.RANDOM_FACTORY + ". Valid RandomSources are: legacy, xoroshiro, xorshift, generator");
+ };
+ @org.jspecify.annotations.Nullable RandomSource SHARED = org.plazmamc.plazma.Options.SHARED_RANDOM ? create() : null;
+ // Plazma end - Implement RandomGenerator support
static RandomSource create() {
- return create(RandomSupport.generateUniqueSeed());
+ return SHARED == null ? create(RandomSupport.generateUniqueSeed()) : SHARED; // Plazma - Configurable RandomSource
}
@Deprecated
static RandomSource createThreadSafe() {
+ if (org.plazmamc.plazma.Options.NO_THREAD_SAFE) return create(); // Plazma - Configurable RandomSource
return new ThreadSafeLegacyRandomSource(RandomSupport.generateUniqueSeed());
}
static RandomSource create(long seed) {
- return new LegacyRandomSource(seed);
+ return org.plazmamc.plazma.Options.IGNORE_SEED ? create() : FACTORY.apply(seed); // Plazma - Configurable RandomSource
}
static RandomSource createNewThreadLocalInstance() {
diff --git a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
index 27a6de70530c2a1cbe2f77a7fb493038121710ea..bbe093f7d5e0dc8e875f237058aa74c739967dd9 100644
--- a/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
+++ b/src/main/java/net/minecraft/world/entity/monster/piglin/PiglinAi.java
@@ -395,7 +395,7 @@ public class PiglinAi {
}
private static boolean wantsToDance(LivingEntity piglin, LivingEntity target) {
- return target.getType() != EntityType.HOGLIN ? false : RandomSource.create(piglin.level().getGameTime()).nextFloat() < 0.1F;
+ return target.getType() != EntityType.HOGLIN ? false : (org.plazmamc.plazma.Options.SHARED_RANDOM ? piglin.random.nextFloat() : RandomSource.create(piglin.level().getGameTime()).nextFloat()) < 0.1F; // Plazma - reduce creating random instance
}
protected static boolean wantsToPickup(Piglin piglin, ItemStack stack) {
diff --git a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
index 0e4c17c7246093d7fdb64a8f98536a84a8cfd978..0147a7be5fd147ffa9bd42a90e85a324bc317a81 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/StructureBlockEntity.java
@@ -343,7 +343,7 @@ public class StructureBlockEntity extends BlockEntity {
}
public static RandomSource createRandom(long seed) {
- return seed == 0L ? RandomSource.create(Util.getMillis()) : RandomSource.create(seed);
+ return seed == 0L ? RandomSource.create() : RandomSource.create(seed); // Plazma - reduce creating random instance
}
public boolean placeStructureIfSameSize(ServerLevel world) {
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructurePlaceSettings.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructurePlaceSettings.java
index f1e0d3d7b1f458fcce83cf67762a16309123cdcb..6a8d5948f127ea87a0b4554ece4ad2c4c49a47c6 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructurePlaceSettings.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructurePlaceSettings.java
@@ -120,7 +120,7 @@ public class StructurePlaceSettings {
}
public RandomSource getRandom(@Nullable BlockPos pos) {
- return this.random != null ? this.random : (pos == null ? RandomSource.create(Util.getMillis()) : RandomSource.create(Mth.getSeed(pos)));
+ return this.random != null ? this.random : (pos == null ? RandomSource.create() : RandomSource.create(Mth.getSeed(pos))); // Plazma - reduce creating random instance
}
public boolean isIgnoreEntities() {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 5d7af6c1ec557d2a2813b87a64b8c8a99d2f87e0..deddf588826dda9b15beff3acf20be56837d240b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -289,7 +289,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
}
// Paper end
- private static final Random rand = new Random();
+ private static final Random rand = java.util.concurrent.ThreadLocalRandom.current(); // Plazma - reduce creating random instance
public CraftWorld(ServerLevel world, ChunkGenerator gen, BiomeProvider biomeProvider, Environment env) {
this.world = world;
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
index 759b6e54db93792c9862b1f1625118ac6fa49d7a..e81fa9aefc76af906ed1b6903f416f4d123689f5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFirework.java
@@ -14,7 +14,7 @@ import org.bukkit.inventory.meta.FireworkMeta;
public class CraftFirework extends CraftProjectile implements Firework {
- private final Random random = new Random();
+ private final net.minecraft.util.RandomSource random = net.minecraft.util.RandomSource.create(); // Plazma - Configurable RandomSource
//private CraftItemStack item; // Paper - Remove usage, not accurate representation of current item.
public CraftFirework(CraftServer server, FireworkRocketEntity entity) {
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index e7092aeb5abce5aa5f9bd434adc6acd4e43dec13..5673e587247d0cd644e694ca68bdbb340676a73d 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -11,5 +11,10 @@ public interface Options {
boolean VANILLAIZE = getBoolean("Plazma.vanillaize") && !AGGRESSIVE;
boolean USE_VANILLA = getBoolean("Plazma.useVanillaConfiguration") && !AGGRESSIVE && NO_OPTIMIZE;
boolean VANILLA_ICO = getBoolean("Plazma.useVanillaFavicon");
+ String RANDOM_FACTORY = getProperty("Plazma.randomSourceFactory", "legacy");
+ String RANDOM_ALGOL = getProperty("Plazma.randomSourceAlgorithm", "L64X128MixRandom");
+ boolean SHARED_RANDOM = getBoolean("Plazma.sharedRandomSource");
+ boolean IGNORE_SEED = getBoolean("Plazma.ignoreSeed") && SHARED_RANDOM;
+ boolean NO_THREAD_SAFE = getBoolean("Plazma.overrideThreadSafeRandom");
}
diff --git a/src/main/java/org/plazmamc/plazma/util/random/SecureRandomSource.java b/src/main/java/org/plazmamc/plazma/util/random/SecureRandomSource.java
new file mode 100644
index 0000000000000000000000000000000000000000..5d08f040a05df5d24f4bf9747177c1720fe246fe
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/util/random/SecureRandomSource.java
@@ -0,0 +1,100 @@
+package org.plazmamc.plazma.util.random;
+
+import com.google.common.annotations.VisibleForTesting;
+import net.minecraft.core.BlockPos;
+import net.minecraft.util.Mth;
+import net.minecraft.util.RandomSource;
+import net.minecraft.world.level.levelgen.PositionalRandomFactory;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NonNull;
+import java.security.SecureRandom;
+
+public class SecureRandomSource implements RandomSource {
+
+ private final SecureRandom random = new SecureRandom();
+
+ public SecureRandomSource(long seed) {
+ this.setSeed(seed);
+ }
+
+ @Override
+ public @NotNull RandomSource fork() {
+ return new SecureRandomSource(this.nextLong());
+ }
+
+ @Override
+ public @NotNull PositionalRandomFactory forkPositional() {
+ return new SecureRandomSourceFactory(this.nextLong());
+ }
+
+ @Override
+ public void setSeed(final long seed) {
+ this.random.setSeed(seed);
+ }
+
+ @Override
+ public int nextInt() {
+ return this.random.nextInt();
+ }
+
+ @Override
+ public int nextInt(final int bound) {
+ return this.random.nextInt(bound);
+ }
+
+ @Override
+ public long nextLong() {
+ return this.random.nextLong();
+ }
+
+ @Override
+ public boolean nextBoolean() {
+ return this.random.nextBoolean();
+ }
+
+ @Override
+ public float nextFloat() {
+ return this.random.nextFloat();
+ }
+
+ @Override
+ public double nextDouble() {
+ return this.random.nextDouble();
+ }
+
+ @Override
+ public double nextGaussian() {
+ return this.random.nextGaussian();
+ }
+
+ private record SecureRandomSourceFactory(long seed) implements PositionalRandomFactory {
+ @SuppressWarnings("deprecation")
+ @Override
+ public @NonNull RandomSource at(int x, int y, int z) {
+ return new SecureRandomSource(Mth.getSeed(x, y, z) ^ this.seed);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public @NonNull RandomSource at(final @NonNull BlockPos pos) {
+ return new SecureRandomSource(Mth.getSeed(pos.getX(), pos.getY(), pos.getZ()) ^ this.seed);
+ }
+
+ @Override
+ public @NonNull RandomSource fromHashOf(@NonNull String seed) {
+ return new SecureRandomSource((long) seed.hashCode() ^ this.seed);
+ }
+
+ @Override
+ public @NonNull RandomSource fromSeed(final long seed) {
+ return new SecureRandomSource(seed);
+ }
+
+ @Override
+ @VisibleForTesting
+ public void parityConfigString(@NonNull StringBuilder info) {
+ info.append("SecureRandomSource$SecureRandomSourceFactory{").append(this.seed).append("}");
+ }
+ }
+
+}
diff --git a/src/main/java/org/plazmamc/plazma/util/random/XorshiftRandom.java b/src/main/java/org/plazmamc/plazma/util/random/XorshiftRandom.java
new file mode 100644
index 0000000000000000000000000000000000000000..d9f08546997adb7e4f9b70ce913a4e92eced3a95
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/util/random/XorshiftRandom.java
@@ -0,0 +1,391 @@
+package org.plazmamc.plazma.util.random;
+
+import java.util.Random;
+
+/**
+ * A random number generator based on the simple and fast xor-shift pseudo
+ * random number generator (RNG) specified in:
+ * Marsaglia, George. (2003). <a href="https://web.archive.org/web/20070211044403/http://www.jstatsoft.org/v08/i14/xorshift.pdf">Xorshift RNGs.</a>
+ * Translated from: <a href="https://web.archive.org/web/20230919193645/https://www.codeproject.com/Articles/9187/A-fast-equivalent-for-System-Random">A fast equivalent for System.Random</a>.
+ * Original Code from: <a href="https://gist.github.com/Xyene/4637619">Xyene/Random.java</a>
+ */
+@SuppressWarnings("SuspiciousNameCombination")
+public class XorshiftRandom extends Random {
+ final double REAL_UNIT_INT = 1.0 / (0x7FFFFFFFL);
+ final double REAL_UNIT_UINT = 1.0 / (0xFFFFFFFFL);
+ final long Y = 842502087L, Z = 3579807591L, W = 273326509L;
+ long x, y, z, w;
+
+ public XorshiftRandom() {
+ seed((int) System.currentTimeMillis());
+ }
+
+ @Override
+ public void setSeed(long seed) {
+ seed((int) seed);
+ }
+
+ public void seed(int seed) {
+ // The only stipulation stated for the xorshift RNG is that at least one of
+ // the seeds x,y,z,w is non-zero. We fulfill that requirement by only allowing
+ // resetting of the x seed
+ x = seed;
+ y = Y;
+ z = Z;
+ w = W;
+ }
+
+ long boolBuffer;
+ int boolBufferBits = 0;
+
+ @Override
+ public boolean nextBoolean() {
+ if (boolBufferBits == 0) {
+ boolBuffer = nextUInt();
+ boolBufferBits = 32;
+ }
+ boolBuffer >>= 1;
+ boolean bit = (boolBuffer & 1) == 0;
+ --boolBufferBits;
+ return bit;
+ }
+
+ @Override
+ public void nextBytes(byte[] buffer) {
+ // Fill up the bulk of the buffer in chunks of 4 bytes at a time.
+ long x = this.x, y = this.y, z = this.z, w = this.w;
+ int i = 0;
+ long t;
+ for (int bound = buffer.length - 3; i < bound; ) {
+ // Generate 4 bytes.
+ // Increased performance is achieved by generating 4 random bytes per loop.
+ // Also note that no mask needs to be applied to zero out the higher order bytes before
+ // casting because the cast ignores thos bytes. Thanks to Stefan Trosch黷z for pointing this out.
+ t = (x ^ (x << 11));
+ x = y;
+ y = z;
+ z = w;
+ w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
+
+ buffer[i++] = (byte) w;
+ buffer[i++] = (byte) (w >> 8);
+ buffer[i++] = (byte) (w >> 16);
+ buffer[i++] = (byte) (w >> 24);
+ }
+
+ // Fill up any remaining bytes in the buffer.
+ if (i < buffer.length) {
+ // Generate 4 bytes.
+ t = (x ^ (x << 11));
+ x = y;
+ y = z;
+ z = w;
+ w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));
+
+ buffer[i++] = (byte) w;
+ if (i < buffer.length) {
+ buffer[i++] = (byte) (w >> 8);
+ if (i < buffer.length) {
+ buffer[i++] = (byte) (w >> 16);
+ if (i < buffer.length) {
+ buffer[i] = (byte) (w >> 24);
+ }
+ }
+ }
+ }
+ this.x = x;
+ this.y = y;
+ this.z = z;
+ this.w = w;
+ }
+
+ @Override
+ public double nextDouble() {
+ long t = (x ^ (x << 11));
+ x = y;
+ y = z;
+ z = w;
+
+ // Here we can gain a 2x speed improvement by generating a value that can be cast to
+ // an int instead of the more easily available uint. If we then explicitly cast to an
+ // int the compiler will then cast the int to a double to perform the multiplication,
+ // this final cast is a lot faster than casting from a uint to a double. The extra cast
+ // to an int is very fast (the allocated bits remain the same) and so the overall effect
+ // of the extra cast is a significant performance improvement.
+ //
+ // Also note that the loss of one bit of precision is equivalent to what occurs within
+ // System.Random.
+ return (REAL_UNIT_INT * (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)))));
+ }
+
+ public double random() {
+ return nextDouble();
+ }
+
+ @Override
+ public float nextFloat() {
+ return (float) nextDouble();
+ }
+
+ @Override
+ public int nextInt() {
+ long t = (x ^ (x << 11));
+ x = y;
+ y = z;
+ z = w;
+ return (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))));
+ }
+
+ @Override
+ public int nextInt(int upperBound) {
+ if (upperBound < 0)
+ throw new IllegalArgumentException("upperBound must be >=0");
+
+ long t = (x ^ (x << 11));
+ x = y;
+ y = z;
+ z = w;
+
+ return (int) ((REAL_UNIT_INT * (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))))) * upperBound);
+ }
+
+ public int nextInt(int lowerBound, int upperBound) {
+ if (lowerBound > upperBound)
+ throw new IllegalArgumentException("upperBound must be >=lowerBound");
+
+ long t = (x ^ (x << 11));
+ x = y;
+ y = z;
+ z = w;
+
+ // The explicit int cast before the first multiplication gives better performance.
+ // See comments in NextDouble.
+ int range = upperBound - lowerBound;
+ if (range < 0) {
+ // If range is <0 then an overflow has occured and must resort to using long integer arithmetic instead (slower).
+ // We also must use all 32 bits of precision, instead of the normal 31, which again is slower.
+ return lowerBound + (int) ((REAL_UNIT_UINT * (double) (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)))) * (double) ((long) upperBound - (long) lowerBound));
+ }
+ // 31 bits of precision will suffice if range<=int.MaxValue. This allows us to cast to an int and gain
+ // a little more performance.
+ return lowerBound + (int) ((REAL_UNIT_INT * (double) (int) (0x7FFFFFFF & (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))))) * (double) range);
+ }
+
+ public long nextUInt() {
+ long t = (x ^ (x << 11));
+ x = y;
+ y = z;
+ z = w;
+ return (w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))) & (0xFFFFFFFFL);
+ }
+
+ @Override
+ public long nextLong() {
+ return nextUInt() << 32 + nextUInt();
+ }
+
+ double gaussNext;
+ boolean hasGaussNext;
+ final double TWOPI = Math.PI * 2;
+
+ /**
+ * Get a random number in the range [min, max) or [min, max] depending on rounding.
+ *
+ * @param min Low bound
+ * @param max High bound
+ * @return A uniformly distributed double
+ */
+ public double uniform(double min, double max) {
+ return min + (max - min) * nextDouble();
+ }
+
+ /**
+ * Triangular distribution.
+ * <p/>
+ * Continuous distribution bounded by given lower and upper limits,
+ * and having a given mode value in-between.
+ * See: <a href="http://en.wikipedia.org/wiki/Triangular_distribution">Triangular distribution</a>
+ *
+ * @param low Low bound
+ * @param high High bound
+ * @param mode Mode
+ * @return A number from the triangular distribution specified
+ */
+ public double triangular(int low, int high, int mode) {
+ double u = nextDouble();
+ double c = (double) (mode - low) / (high - low);
+ if (u > c) {
+ u = 1.0 - u;
+ c = 1.0 - c;
+ int k = low;
+ low = high;
+ high = k;
+ }
+ return low + (high - low) * Math.sqrt(u * c);
+ }
+
+ /**
+ * Gaussian distribution, mean is 0 and standard deviation is 1.
+ * <p/>
+ * mu is the mean, and sigma is the standard deviation.
+ *
+ * @return A double in Gaussian distribution
+ */
+ public double gauss() {
+ return nextGaussian();
+ }
+
+ /**
+ * Gaussian distribution, with user-specified mean and standard deviation.
+ * <p/>
+ * mu is the mean, and sigma is the standard deviation.
+ *
+ * @return A double in Gaussian distribution
+ */
+ public double gauss(double mu, double sigma) {
+ return mu + sigma * nextGaussian();
+ }
+
+ public double gaussUnsigned(double mu, double sigma) {
+ double out = gauss(mu, sigma);
+ return out > 1 ? out : 1;
+ }
+
+ /**
+ * Log normal distribution.
+ * <p/>
+ * If you take the natural logarithm of this distribution, you'll get a
+ * normal distribution with mean mu and standard deviation sigma.
+ * mu can have any value, and sigma must be greater than zero.
+ *
+ * @param mu Mean
+ * @param sigma Standard deviation
+ * @return A number from the log normal distribution specified
+ */
+ public double logNormal(double mu, double sigma) {
+ return Math.exp(gauss(mu, sigma));
+ }
+
+ /**
+ * Exponential distribution.
+ * <p/>
+ * lambda is 1.0 divided by the desired mean. It should be
+ * nonzero. Returned values range from 0 to positive infinity
+ * if lambda is positive, and from negative infinity to 0
+ * if lambda is negative.
+ *
+ * @param lambda A non-zero value
+ */
+ public double exponential(double lambda) {
+ return -Math.log(1.0 - random()) / lambda;
+ }
+
+ /**
+ * Circular data distribution.
+ * <p/>
+ * If kappa is equal to zero, this distribution reduces
+ * to a uniform random angle over the range 0 to 2*pi.
+ *
+ * @param mu the mean angle, expressed in radians between 0 and 2*pi.
+ * @param kappa the concentration parameter, which must be greater than or
+ * equal to zero.
+ * @return A number from the circular data distribution specified
+ */
+ public double circularData(double mu, double kappa) {
+ if (kappa <= 1e-6)
+ return TWOPI * nextDouble();
+
+ double a = 1.0 + Math.sqrt(1.0 + 4.0 * kappa * kappa);
+ double b = (a - Math.sqrt(2.0 * a)) / (2.0 * kappa);
+ double r = (1.0 + b * b) / (2.0 * b);
+ double u1, u2, u3, f, c, z, theta = 0;
+
+ while (true) {
+ u1 = nextDouble();
+
+ z = Math.cos(Math.PI * u1);
+ f = (1.0 + r * z) / (r + z);
+ c = kappa * (r - f);
+
+ u2 = nextDouble();
+
+ if (u2 < c * (2.0 - c) || u2 <= c * Math.exp(1.0 - c))
+ break;
+
+ u3 = nextDouble();
+ if (u3 > 0.5)
+ theta = (mu % TWOPI) + Math.acos(f);
+ else
+ theta = (mu % TWOPI) - Math.acos(f);
+ }
+ return theta;
+ }
+
+
+ final double LOG4 = Math.log(4);
+ final double SG_MAGICCONST = 1.0 + Math.log(4.5);
+
+ /**
+ * Gamma distribution. Not the gamma function!
+ * Conditions on the parameters are alpha > 0 and beta > 0.
+ * <p/>
+ * The probability distribution function is:
+ * pdf(x) = (x ** (alpha - 1) * math.exp(-x / beta)) / (math.gamma(alpha) * beta ** alpha)
+ *
+ * @param alpha Alpha
+ * @param beta Beta
+ * @return A number from the gamma distribution specified
+ */
+ public double gamma(double alpha, double beta) {
+ if (alpha <= 0.0 || beta <= 0.0)
+ throw new IllegalArgumentException("alpha and beta must be > 0.0");
+
+ if (alpha > 1.0) {
+ double ainv = Math.sqrt(2.0 * alpha - 1.0);
+ double bbb = alpha - LOG4;
+ double ccc = alpha + ainv;
+ double u1, u2, v, x, z, r;
+
+ while (true) {
+ u1 = random();
+ if (!(1e-7 < u1 && u1 < .9999999))
+ continue;
+ u2 = 1.0 - random();
+ v = Math.log(u1 / (1.0 - u1)) / ainv;
+ x = alpha * Math.exp(v);
+ z = u1 * u1 * u2;
+ r = bbb + ccc * v - x;
+ if (r + SG_MAGICCONST - 4.5 * z >= 0.0 || r >= Math.log(z))
+ return x * beta;
+ }
+ } else if (alpha == 1.0) {
+ // exponential(1)
+ double u;
+ u = random();
+ while (u <= 1e-7)
+ u = random();
+ return -Math.log(u) * beta;
+ } else {
+ // alpha is between 0 and 1 (exclusive)
+ // Uses ALGORITHM GS of Statistical Computing -Kennedy & Gentle
+
+ double u, b, p, x, u1;
+ while (true) {
+ u = random();
+ b = (Math.E + alpha) / Math.E;
+ p = b * u;
+ if (p <= 1.0)
+ x = Math.pow(p, (1.0 / alpha));
+ else
+ x = -Math.log((b - p) / alpha);
+ u1 = random();
+ if (p > 1.0) {
+ if (u1 <= Math.pow(x, (alpha - 1.0)))
+ break;
+ } else if (u1 <= Math.exp(-x))
+ break;
+ }
+ return x * beta;
+ }
+ }
+}
diff --git a/src/main/java/org/plazmamc/plazma/util/random/XorshiftRandomSource.java b/src/main/java/org/plazmamc/plazma/util/random/XorshiftRandomSource.java
new file mode 100644
index 0000000000000000000000000000000000000000..646e9689f17211112f8d253099fb075666d942e9
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/util/random/XorshiftRandomSource.java
@@ -0,0 +1,56 @@
+package org.plazmamc.plazma.util.random;
+
+import com.google.common.annotations.VisibleForTesting;
+import net.minecraft.core.BlockPos;
+import net.minecraft.util.Mth;
+import net.minecraft.util.RandomSource;
+import net.minecraft.world.level.levelgen.PositionalRandomFactory;
+import org.jspecify.annotations.NonNull;
+
+public class XorshiftRandomSource extends XorshiftRandom implements RandomSource {
+
+ public XorshiftRandomSource(long seed) {
+ this.setSeed(seed);
+ }
+
+ @Override
+ public @NonNull RandomSource fork() {
+ return new XorshiftRandomSource(this.nextLong());
+ }
+
+ @Override
+ public @NonNull PositionalRandomFactory forkPositional() {
+ return new XorshiftRandomSourceFactory(this.nextLong());
+ }
+
+ private record XorshiftRandomSourceFactory(long seed) implements PositionalRandomFactory {
+ @SuppressWarnings("deprecation")
+ @Override
+ public @NonNull RandomSource at(int x, int y, int z) {
+ return new XorshiftRandomSource(Mth.getSeed(x, y, z) ^ this.seed);
+ }
+
+ @SuppressWarnings("deprecation")
+ @Override
+ public @NonNull RandomSource at(final @NonNull BlockPos pos) {
+ return new XorshiftRandomSource(Mth.getSeed(pos.getX(), pos.getY(), pos.getZ()) ^ this.seed);
+ }
+
+ @Override
+ public @NonNull RandomSource fromHashOf(@NonNull String seed) {
+ return new XorshiftRandomSource((long) seed.hashCode() ^ this.seed);
+ }
+
+ @Override
+ public @NonNull RandomSource fromSeed(final long seed) {
+ return new XorshiftRandomSource(seed);
+ }
+
+ @Override
+ @VisibleForTesting
+ public void parityConfigString(@NonNull StringBuilder info) {
+ info.append("XorshiftRandomSource$XorshiftRandomSourceFactory{").append(this.seed).append("}");
+ }
+ }
+
+}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,244 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 26 Oct 2024 13:42:26 +0900
Subject: [PATCH] Implement alternative noise chunk generator
Based on Steveplays28/noisium.
Copyright (C) 2024 Darion Spaargaren, Licensed under GPL v3.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
index e4ae25c83ab9dd1aaa530a5456275ef63cdb8511..03a5effa6f0ef4d5c46a03a39cf336493873cfea 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunkSection.java
@@ -19,9 +19,9 @@ public class LevelChunkSection implements ca.spottedleaf.moonrise.patches.block_
public static final int SECTION_HEIGHT = 16;
public static final int SECTION_SIZE = 4096;
public static final int BIOME_CONTAINER_BITS = 2;
- short nonEmptyBlockCount; // Paper - package private
- private short tickingBlockCount;
- private short tickingFluidCount;
+ public short nonEmptyBlockCount; // Paper - package private // Plazma -> public
+ public short tickingBlockCount; // Plazma - private -> public
+ public short tickingFluidCount; // Plazma - private -> public
public final PalettedContainer<BlockState> states;
private PalettedContainer<Holder<Biome>> biomes; // CraftBukkit - read/write
@@ -35,8 +35,8 @@ public class LevelChunkSection implements ca.spottedleaf.moonrise.patches.block_
private boolean isClient;
private static final short CLIENT_FORCED_SPECIAL_COLLIDING_BLOCKS = (short)9999;
- private short specialCollidingBlocks;
- private final ca.spottedleaf.moonrise.common.list.ShortList tickingBlocks = new ca.spottedleaf.moonrise.common.list.ShortList();
+ public short specialCollidingBlocks; // Plazma - private -> public
+ public final ca.spottedleaf.moonrise.common.list.ShortList tickingBlocks = new ca.spottedleaf.moonrise.common.list.ShortList(); // Plazma - private -> public
@Override
public final boolean moonrise$hasSpecialCollidingBlocks() {
@@ -309,18 +309,14 @@ public class LevelChunkSection implements ca.spottedleaf.moonrise.patches.block_
// CraftBukkit end
public void fillBiomesFromNoise(BiomeResolver biomeSupplier, Climate.Sampler sampler, int x, int y, int z) {
- PalettedContainer<Holder<Biome>> datapaletteblock = this.biomes.recreate();
- boolean flag = true;
+ // Plazma start - Optimize noise
+ PalettedContainer<Holder<Biome>> block = this.biomes.recreate();
- for (int l = 0; l < 4; ++l) {
- for (int i1 = 0; i1 < 4; ++i1) {
- for (int j1 = 0; j1 < 4; ++j1) {
- datapaletteblock.getAndSetUnchecked(l, i1, j1, biomeSupplier.getNoiseBiome(x + l, y + i1, z + j1, sampler));
- }
- }
- }
+ for (int dY = 0; dY < 4; ++dY) for (int dZ = 0; dZ < 4; ++dZ) for (int dX = 0; dX < 4; ++dX)
+ block.getAndSetUnchecked(dX, dY, dZ, biomeSupplier.getNoiseBiome(x + dX, y + dY, z + dZ, sampler));
- this.biomes = datapaletteblock;
+ this.biomes = block;
+ // Plazma end - Optimize noise
}
public LevelChunkSection copy() {
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
index 8b84bf2272556ac3321cbf16361d7f48a1cc6873..84047336fbd8833cc95bf5afa721f983aee97d4d 100644
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
+++ b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
@@ -30,7 +30,7 @@ public class PalettedContainer<T> implements PaletteResize<T>, PalettedContainer
public final IdMap<T> registry;
private final T @org.jetbrains.annotations.Nullable [] presetValues; // Paper - Anti-Xray - Add preset values
public volatile PalettedContainer.Data<T> data; // Paper - optimise collisions - public
- private final PalettedContainer.Strategy strategy;
+ public final PalettedContainer.Strategy strategy; // Plazma - private -> public
// private final ThreadingDetector threadingDetector = new ThreadingDetector("PalettedContainer"); // Paper - unused
public void acquire() {
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
index 0346fd4ab7095d66c0eef5a440afbc7a8ba52466..35b589fa6d53cce957365e1cfcb5cf1978390546 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -51,6 +51,7 @@ import org.apache.commons.lang3.mutable.MutableObject;
public final class NoiseBasedChunkGenerator extends ChunkGenerator {
+ public static boolean PLAZMA_USE_NOISIUM = false; // Plazma - Optimize noise chunk generation
public static final MapCodec<NoiseBasedChunkGenerator> CODEC = RecordCodecBuilder.mapCodec((instance) -> {
return instance.group(BiomeSource.CODEC.fieldOf("biome_source").forGetter((chunkgeneratorabstract) -> {
return chunkgeneratorabstract.biomeSource;
@@ -270,6 +271,24 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
int k = Mth.floorDiv(noisesettings.height(), noisesettings.getCellHeight());
return k <= 0 ? CompletableFuture.completedFuture(chunk) : CompletableFuture.supplyAsync(() -> {
+ // Plazma start - Optimize noise chunk generation
+ if (PLAZMA_USE_NOISIUM) {
+ int l = chunk.getSectionIndex(k * noisesettings.getCellHeight() - 1 + i);
+ int i1 = chunk.getSectionIndex(i);
+
+ var set = chunk.getSections();
+ for (int j1 = l; j1 >= i1; --j1) set[j1].acquire();
+
+ ChunkAccess ichunkaccess1;
+ try {
+ ichunkaccess1 = this.doFill(blender, structureAccessor, noiseConfig, chunk, j, k);
+ } finally {
+ for (int j1 = l; j1 >= i1; --j1) set[j1].release();
+ }
+
+ return ichunkaccess1;
+ }
+ // Plazma end - Optimize noise chunk generation
int l = chunk.getSectionIndex(k * noisesettings.getCellHeight() - 1 + i);
int i1 = chunk.getSectionIndex(i);
Set<LevelChunkSection> set = Sets.newHashSet();
@@ -377,6 +396,18 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
iblockdata = this.debugPreliminarySurfaceLevel(noisechunk, j4, j3, i5, iblockdata);
if (iblockdata != NoiseBasedChunkGenerator.AIR && !SharedConstants.debugVoidTerrain(chunk.getPos())) {
+ // Plazma start - Optimize noise
+ if (PLAZMA_USE_NOISIUM) {
+ var id = chunksection.states.data.palette().idFor(iblockdata);
+ chunksection.states.data.storage().getAndSet(chunksection.states.strategy.getIndex(k4, k3, j5), id);
+
+ ++chunksection.nonEmptyBlockCount;
+ if (iblockdata.isRandomlyTicking()) ++chunksection.tickingBlockCount;
+ if (iblockdata.getFluidState().isRandomlyTicking()) ++chunksection.tickingFluidCount;
+ if (ca.spottedleaf.moonrise.patches.collisions.CollisionUtil.isSpecialCollidingBlock(iblockdata)) ++chunksection.specialCollidingBlocks;
+ if (chunksection.isRandomlyTicking()) chunksection.tickingBlocks.add((short) (k4 | (k3 << 4) | (j5 << (4+4))));
+ } else
+ // Plazma end - Optimize noise
chunksection.setBlockState(k4, k3, j5, iblockdata, false);
heightmap.update(k4, j3, j5, iblockdata);
heightmap1.update(k4, j3, j5, iblockdata);
diff --git a/src/main/java/net/minecraft/world/level/levelgen/NoiseSettings.java b/src/main/java/net/minecraft/world/level/levelgen/NoiseSettings.java
index 932d1d9bd717b1176f8c82b0cf65d2eb6403ad40..a54a279cbaa30c58df572242ad5cf9786c715b66 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseSettings.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseSettings.java
@@ -8,7 +8,7 @@ import net.minecraft.core.QuartPos;
import net.minecraft.world.level.LevelHeightAccessor;
import net.minecraft.world.level.dimension.DimensionType;
-public record NoiseSettings(int minY, int height, int noiseSizeHorizontal, int noiseSizeVertical) {
+public record NoiseSettings(int minY, int height, int noiseSizeHorizontal, int noiseSizeVertical, int horizontalCellBlockCount, int verticalCellBlockCount) { // Plazma - Optimize noise
public static final Codec<NoiseSettings> CODEC = RecordCodecBuilder.<NoiseSettings>create(
instance -> instance.group(
Codec.intRange(DimensionType.MIN_Y, DimensionType.MAX_Y).fieldOf("min_y").forGetter(NoiseSettings::minY),
@@ -16,7 +16,7 @@ public record NoiseSettings(int minY, int height, int noiseSizeHorizontal, int n
Codec.intRange(1, 4).fieldOf("size_horizontal").forGetter(NoiseSettings::noiseSizeHorizontal),
Codec.intRange(1, 4).fieldOf("size_vertical").forGetter(NoiseSettings::noiseSizeVertical)
)
- .apply(instance, NoiseSettings::new)
+ .apply(instance, NoiseSettings::create) // Plazma - Optimize noise
)
.comapFlatMap(NoiseSettings::guardY, Function.identity());
protected static final NoiseSettings OVERWORLD_NOISE_SETTINGS = create(-64, 384, 1, 2);
@@ -36,7 +36,7 @@ public record NoiseSettings(int minY, int height, int noiseSizeHorizontal, int n
}
public static NoiseSettings create(int minimumY, int height, int horizontalSize, int verticalSize) {
- NoiseSettings noiseSettings = new NoiseSettings(minimumY, height, horizontalSize, verticalSize);
+ NoiseSettings noiseSettings = new NoiseSettings(minimumY, height, horizontalSize, verticalSize, QuartPos.toBlock(horizontalSize), QuartPos.toBlock(verticalSize)); // Plazma - Optimize noise
guardY(noiseSettings).error().ifPresent(error -> {
throw new IllegalStateException(error.message());
});
@@ -44,16 +44,16 @@ public record NoiseSettings(int minY, int height, int noiseSizeHorizontal, int n
}
public int getCellHeight() {
- return QuartPos.toBlock(this.noiseSizeVertical());
+ return this.horizontalCellBlockCount; // Plazma - Optimize noise
}
public int getCellWidth() {
- return QuartPos.toBlock(this.noiseSizeHorizontal());
+ return this.verticalCellBlockCount; // Plazma - Optimize noise
}
public NoiseSettings clampToHeightAccessor(LevelHeightAccessor world) {
int i = Math.max(this.minY, world.getMinY());
int j = Math.min(this.minY + this.height, world.getMaxY() + 1) - i;
- return new NoiseSettings(i, j, this.noiseSizeHorizontal, this.noiseSizeVertical);
+ return new NoiseSettings(i, j, this.noiseSizeHorizontal, this.noiseSizeVertical, QuartPos.toBlock(this.noiseSizeHorizontal), QuartPos.toBlock(this.noiseSizeVertical)); // Plazma - Optimize noise
}
}
diff --git a/src/main/java/net/minecraft/world/level/levelgen/material/MaterialRuleList.java b/src/main/java/net/minecraft/world/level/levelgen/material/MaterialRuleList.java
index 0e6dfe2635ea5f5e410049b05f94f5083b2f18a4..584311a00c5037a6d5bc05b1261969aad1c38a4c 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/material/MaterialRuleList.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/material/MaterialRuleList.java
@@ -9,12 +9,15 @@ public record MaterialRuleList(NoiseChunk.BlockStateFiller[] materialRuleList) i
@Nullable
@Override
public BlockState calculate(DensityFunction.FunctionContext pos) {
- for (NoiseChunk.BlockStateFiller blockStateFiller : this.materialRuleList) {
- BlockState blockState = blockStateFiller.calculate(pos);
- if (blockState != null) {
- return blockState;
- }
+ // Plazma start - Optimize noise
+ //noinspection ForLoopReplaceableByForEach
+ for (int i = 0; i < this.materialRuleList.length; i++) {
+ BlockState state = this.materialRuleList[i].calculate(pos);
+ if (state == null) continue;
+
+ return state;
}
+ // Plazma end - Optimize noise
return null;
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 92de32ee00bc9c4e8750773bca95a9cf5fbae067..fbcbbba15e8f7f8ea812a75d807908925305cb29 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -61,6 +61,8 @@ public class GlobalConfiguration extends ConfigurationPart {
public WorldGeneration worldgen;
public class WorldGeneration extends ConfigurationPart {
+ boolean useAlternativeNoiseGenerator = OPTIMIZE;
+
public LavaSea lavaSea;
public class LavaSea extends ConfigurationPart {
@@ -80,6 +82,11 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+ @PostProcess
+ void post() {
+ net.minecraft.world.level.levelgen.NoiseBasedChunkGenerator.PLAZMA_USE_NOISIUM = this.useAlternativeNoiseGenerator;
+ }
+
}
public Entity entity;

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,236 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Tue, 5 Nov 2024 18:31:09 +0900
Subject: [PATCH] Hashed rcon password
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 3dd5c7441bb300ca17d717af37edbefb89db4b2f..df367fbb8c582614aaf2087aa37d5e47247af810 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -73,7 +73,6 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
public final int queryPort;
public final boolean enableRcon;
public final int rconPort;
- public final String rconPassword;
public final boolean hardcore;
public final boolean allowNether;
public final boolean spawnMonsters;
@@ -113,6 +112,25 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
public final String rconIp; // Paper - Configurable rcon ip
+ // Plazma start - hashed rcon password
+ private final boolean rconHash;
+ private final int rconHashIterationCount;
+ private final byte[] rconSalt;
+ private final String rconPassword;
+
+ private static final @Nullable javax.crypto.SecretKeyFactory HASH_INSTANCE;
+ static {
+ @Nullable javax.crypto.SecretKeyFactory factory;
+ try {
+ factory = javax.crypto.SecretKeyFactory.getInstance("PBKDF2WithHmacSHA512/256");
+ } catch (Exception e) {
+ LOGGER.error("Failed to initialize rcon hash instance", e);
+ factory = null;
+ }
+ HASH_INSTANCE = factory;
+ }
+ // Plazma end - hashed rcon password
+
// CraftBukkit start
public DedicatedServerProperties(Properties properties, OptionSet optionset) {
super(properties, optionset);
@@ -126,7 +144,7 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
this.queryPort = this.get("query.port", 25565);
this.enableRcon = this.get("enable-rcon", false);
this.rconPort = this.get("rcon.port", 25575);
- this.rconPassword = this.get("rcon.password", "");
+ // this.rconPassword = this.get("rcon.password", ""); // Plazma - hashed rcon password
this.hardcore = this.get("hardcore", false);
this.allowNether = this.get("allow-nether", true);
this.spawnMonsters = this.get("spawn-monsters", true);
@@ -179,7 +197,82 @@ public class DedicatedServerProperties extends Settings<DedicatedServerPropertie
final String rconIp = this.getStringRaw("rcon.ip");
this.rconIp = rconIp == null ? this.serverIp : rconIp;
// Paper end - Configurable rcon ip
+
+ // Plazma start - hashed rcon password
+ this.rconHash = this.get("rcon.hash", false);
+ this.rconHashIterationCount = this.get("rcon.hash.iteration-count", Character.MAX_VALUE);
+ this.rconSalt = this.rconSalt();
+ this.rconPassword = this.rconPassword();
+ // Plazma end - hashed rcon password
+ }
+
+ // Plazma start - hashed rcon password
+ private byte[] rconSalt() {
+ if (!this.rconHash) return org.plazmamc.plazma.constants.Null.BYTE;
+
+ String salt = this.get("rcon.hash.salt", "");
+ if (!salt.isBlank()) {
+ try {
+ return java.util.HexFormat.of().parseHex(salt);
+ } catch (Exception e) {
+ LOGGER.error("Invalid RCON salt detected! RCON will be disabled");
+ return org.plazmamc.plazma.constants.Null.BYTE;
+ }
+ }
+
+ byte[] newSalt = new byte[16];
+ (new java.security.SecureRandom()).nextBytes(newSalt);
+ salt = java.util.HexFormat.of().formatHex(newSalt);
+ this.set("rcon.hash.salt", salt);
+ return newSalt;
+ }
+
+ private String rconPassword() {
+ String hashed = this.get("rcon.hash.password", "");
+ if (!hashed.isBlank()) {
+ try {
+ java.util.HexFormat.of().parseHex(hashed);
+ } catch (Exception e) {
+ LOGGER.error("Invalid hashed RCON password detected! RCON will be disabled");
+ return "";
+ }
+ return hashed;
+ }
+
+ String decoded = this.get("rcon.password", "");
+ if (decoded.isBlank() || HASH_INSTANCE == null || this.rconSalt.length == 0) return decoded;
+
+ try {
+ final java.security.spec.KeySpec spec = new javax.crypto.spec.PBEKeySpec(decoded.toCharArray(), this.rconSalt, this.rconHashIterationCount, 256);
+ byte[] hashedByte = HASH_INSTANCE.generateSecret(spec).getEncoded();
+ hashed = java.util.HexFormat.of().formatHex(hashedByte);
+ this.set("rcon.hash.password", hashed);
+ this.remove("rcon.password");
+ return hashed;
+ } catch (Exception e) {
+ LOGGER.error("Failed to encode rcon password", e);
+ return "";
+ }
+ }
+
+ public Boolean shouldStartRCON() {
+ return this.enableRcon && !this.rconPassword.isBlank();
+ }
+
+ public Boolean matchRconPassword(String value) {
+ if (this.rconSalt.length == 0 || HASH_INSTANCE == null) return this.rconPassword.equals(value);
+
+ try {
+ final java.security.spec.KeySpec spec = new javax.crypto.spec.PBEKeySpec(value.toCharArray(), this.rconSalt, this.rconHashIterationCount, 256);
+ byte[] hashedByte = HASH_INSTANCE.generateSecret(spec).getEncoded();
+ String hashed = java.util.HexFormat.of().formatHex(hashedByte);
+ return this.rconPassword.equals(hashed);
+ } catch (Exception e) {
+ LOGGER.error("Failed to validate rcon password", e);
+ return false;
+ }
}
+ // Plazma end - hashed rcon password
// CraftBukkit start
public static DedicatedServerProperties fromFile(Path path, OptionSet optionset) {
diff --git a/src/main/java/net/minecraft/server/dedicated/Settings.java b/src/main/java/net/minecraft/server/dedicated/Settings.java
index d7bd235ef2815890e038091dd625177049d253a5..afced52731868d5726b85a03011111adeffeb074 100644
--- a/src/main/java/net/minecraft/server/dedicated/Settings.java
+++ b/src/main/java/net/minecraft/server/dedicated/Settings.java
@@ -243,6 +243,11 @@ public abstract class Settings<T extends Settings<T>> {
return v1;
}
+ // Plazma start - Settings helper
+ protected <V> void set(String key, V value) { this.properties.put(key, value); }
+ protected void remove(String key) { this.properties.remove(key); }
+ // Plazma end - Settings helper
+
protected <V> Settings<T>.MutableValue<V> getMutable(String key, Function<String, V> parser, Function<V, String> stringifier, V fallback) {
String s1 = this.getStringRaw(key);
V v1 = MoreObjects.firstNonNull(s1 != null ? parser.apply(s1) : null, fallback);
diff --git a/src/main/java/net/minecraft/server/rcon/thread/RconClient.java b/src/main/java/net/minecraft/server/rcon/thread/RconClient.java
index 1c3775c6d29a85803c87948c64ec81cbeb87aef4..4f6f46398ac0814a95d8253cc5f575b8f09f7209 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/RconClient.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/RconClient.java
@@ -26,13 +26,12 @@ public class RconClient extends GenericThread {
private boolean authed;
private final Socket client;
private final byte[] buf = new byte[1460];
- private final String rconPassword;
// CraftBukkit start
private final DedicatedServer serverInterface;
private final RconConsoleSource rconConsoleSource;
// CraftBukkit end
- RconClient(ServerInterface server, String password, Socket socket) {
+ RconClient(ServerInterface server, Socket socket) {// Plazma - hashed rcon password
super("RCON Client " + String.valueOf(socket.getInetAddress()));
this.serverInterface = (DedicatedServer) server; // CraftBukkit
this.client = socket;
@@ -43,7 +42,6 @@ public class RconClient extends GenericThread {
this.running = false;
}
- this.rconPassword = password;
this.rconConsoleSource = new net.minecraft.server.rcon.RconConsoleSource(this.serverInterface, socket.getRemoteSocketAddress()); // CraftBukkit
}
@@ -93,7 +91,7 @@ public class RconClient extends GenericThread {
String s1 = PktUtils.stringFromByteArray(this.buf, j, i);
int j1 = j + s1.length();
- if (!s1.isEmpty() && s1.equals(this.rconPassword)) {
+ if (!s1.isEmpty() && serverInterface.getProperties().matchRconPassword(s1)) {
this.authed = true;
this.send(l, 2, "");
continue;
diff --git a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
index c12d7db2b048a327c0e8f398848cd3a9bce0ebce..150cecc44a7f49740fa400e02de09671ff8b392a 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/RconThread.java
@@ -16,15 +16,13 @@ import org.slf4j.Logger;
public class RconThread extends GenericThread {
private static final Logger LOGGER = LogUtils.getLogger();
private final ServerSocket socket;
- private final String rconPassword;
private final List<RconClient> clients = Lists.newArrayList();
private final ServerInterface serverInterface;
- private RconThread(ServerInterface server, ServerSocket listener, String password) {
+ private RconThread(ServerInterface server, ServerSocket listener) {// Plazma - hashed rcon password
super("RCON Listener");
this.serverInterface = server;
this.socket = listener;
- this.rconPassword = password;
}
private void clearClients() {
@@ -37,7 +35,7 @@ public class RconThread extends GenericThread {
while (this.running) {
try {
Socket socket = this.socket.accept();
- RconClient rconClient = new RconClient(this.serverInterface, this.rconPassword, socket);
+ RconClient rconClient = new RconClient(this.serverInterface, socket); // Plazma - hashed rcon password
rconClient.start();
this.clients.add(rconClient);
this.clearClients();
@@ -64,15 +62,14 @@ public class RconThread extends GenericThread {
int i = dedicatedServerProperties.rconPort;
if (0 < i && 65535 >= i) {
- String string2 = dedicatedServerProperties.rconPassword;
- if (string2.isEmpty()) {
+ if (!dedicatedServerProperties.shouldStartRCON()) { // Plazma - hashed rcon password
LOGGER.warn("No rcon password set in server.properties, rcon disabled!");
return null;
} else {
try {
ServerSocket serverSocket = new ServerSocket(i, 0, InetAddress.getByName(string));
serverSocket.setSoTimeout(500);
- RconThread rconThread = new RconThread(server, serverSocket, string2);
+ RconThread rconThread = new RconThread(server, serverSocket); // Plazma - hashed rcon password
if (!rconThread.start()) {
return null;
} else {

View File

@@ -0,0 +1,333 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 14 Dec 2024 00:39:05 +0900
Subject: [PATCH] Ticking Controller
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 8964ccc27ea7db306140fd6b04c9f5cb33158aa0..bd8048bfe2a93c3a4b4bb84e7d992a8bb0c65778 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1654,6 +1654,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
public void tickServer(BooleanSupplier shouldKeepTicking) {
+ org.plazmamc.plazma.util.TickingController.tick(); // Plazma - TickControl System
org.spigotmc.WatchdogThread.tick(); // Spigot
long i = Util.getNanos();
int j = this.pauseWhileEmptySeconds() * 20;
diff --git a/src/main/java/net/minecraft/server/dedicated/ServerWatchdog.java b/src/main/java/net/minecraft/server/dedicated/ServerWatchdog.java
index 660a142036c4e608d3d6fed6ec700a3488400bec..d092bef5e6626f000a44a0f424f247a1a69d34af 100644
--- a/src/main/java/net/minecraft/server/dedicated/ServerWatchdog.java
+++ b/src/main/java/net/minecraft/server/dedicated/ServerWatchdog.java
@@ -34,6 +34,7 @@ public class ServerWatchdog implements Runnable {
@Override
public void run() {
while (this.server.isRunning()) {
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().tickControl.enabled) return; // Plazma - TickControl System
long l = this.server.getNextTickTime();
long m = Util.getNanos();
long n = m - l;
diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
index a84faa2e82a8d33b7bfe71f174f2913b585d99e8..0d8800d05bd6a14b3d5702d6a51f8cb0c7ae2186 100644
--- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java
+++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java
@@ -630,7 +630,7 @@ public class ServerChunkCache extends ChunkSource implements ca.spottedleaf.moon
// this.lastSpawnState = spawnercreature_d; // Pufferfish - this is managed asynchronously
//profiler.popPush("spawnAndTick"); // Plazma - Completely remove Mojang profiler
boolean flag = this.level.getGameRules().getBoolean(GameRules.RULE_DOMOBSPAWNING) && !this.level.players().isEmpty(); // CraftBukkit
- int k = this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING);
+ int k = org.plazmamc.plazma.util.TickingController.calc(this.level.getGameRules().getInt(GameRules.RULE_RANDOMTICKING), it -> it.accelerate.randomTick, false); // Plazma - TickControl system
List list1;
if (flag && (this.spawnEnemies || this.spawnFriendlies)) {
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 9a54883281352cc4fa08143f5126d61dbd89761d..982b172b188fb890fa7719662e67a007ab172668 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -909,7 +909,12 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
this.setDayTime(this.preciseTime);
} else
// Purpur end - Configurable daylight cycle
- this.setDayTime(this.levelData.getDayTime() + 1L);
+ // Plazma start - TickControl System
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().tickControl.accelerate.dayTime)
+ this.setDayTime(this.levelData.getDayTime() + org.plazmamc.plazma.util.TickingController.missedTicks() + 1L);
+ else
+ this.setDayTime(this.levelData.getDayTime() + 1L);
+ // Plazma end - TickControl System
}
}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index d6d43ad1677d035c26619b73e5a2dd6e72ab278b..ee6ad451ba8755cf296e9c0a01404a5ed025e749 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -562,6 +562,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
this.tickEffects();
+ if (plazma.Config.get().tickControl.delay.potionEffect) for (int i = 0; i < org.plazmamc.plazma.util.TickingController.missedTicks(); i++) this.tickEffects(); // Plazma - TickControl System
this.animStepO = this.animStep;
this.yBodyRotO = this.yBodyRot;
this.yHeadRotO = this.yHeadRot;
diff --git a/src/main/java/net/minecraft/world/entity/PortalProcessor.java b/src/main/java/net/minecraft/world/entity/PortalProcessor.java
index b4a8249964786d484aa0767d0e73d71d2156f0e8..49505d04c737c41e4229d80a7b96d4ed0b68d083 100644
--- a/src/main/java/net/minecraft/world/entity/PortalProcessor.java
+++ b/src/main/java/net/minecraft/world/entity/PortalProcessor.java
@@ -24,7 +24,7 @@ public class PortalProcessor {
return false;
} else {
this.insidePortalThisTick = false;
- return canUsePortals && this.portalTime++ >= this.portal.getPortalTransitionTime(world, entity);
+ return canUsePortals && this.increaseTick() >= this.portal.getPortalTransitionTime(world, entity); // Plazma - TickControl System
}
}
@@ -33,6 +33,14 @@ public class PortalProcessor {
return this.portal.getPortalDestination(world, entity, this.entryPosition);
}
+ // Plazma start - TickControl System
+ private int increaseTick() {
+ if (!plazma.Config.get().tickControl.delay.portalUse)
+ this.portalTime += org.plazmamc.plazma.util.TickingController.missedTicks();
+ return this.portalTime++;
+ }
+ // Plazma end - TickControl System
+
public Portal.Transition getPortalLocalTransition() {
return this.portal.getLocalTransition();
}
diff --git a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
index 4aaaadce69e62fa371d5b441e5e69c1384e5d63e..97c63c335287e01b20687eeea4a5815520363e13 100644
--- a/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/ItemEntity.java
@@ -158,6 +158,7 @@ public class ItemEntity extends Entity implements TraceableEntity {
if (this.getItem().isEmpty()) {
this.discard(EntityRemoveEvent.Cause.DESPAWN); // CraftBukkit - add Bukkit remove cause
} else {
+ if (this.pickupDelay > 0 && plazma.Config.get().tickControl.delay.itemPickup) this.pickupDelay = Math.max(this.pickupDelay - org.plazmamc.plazma.util.TickingController.missedTicks(), 0); // Plazma - TickControl System
super.tick();
// Paper start - remove anti tick skipping measures / wall time - revert to vanilla
if (this.pickupDelay > 0 && this.pickupDelay != 32767) {
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 5a9e85c44fbb716dc1e8616645732cb8db947ee9..4ea1a327c80f915aa45ccf3a5955ed6ff42692c1 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -305,6 +305,11 @@ public abstract class Player extends LivingEntity {
if (this.sleepCounter > 100) {
this.sleepCounter = 100;
}
+ // Plazma start - TickControl System
+ else if (this.sleepCounter < 100 && plazma.Config.get().tickControl.delay.sleep && org.plazmamc.plazma.util.TickingController.missedTicks() > 0) {
+ this.sleepCounter += org.plazmamc.plazma.util.TickingController.missedTicks();
+ }
+ // Plazma end - TickControl System
if (/*!this.level().isClientSide &&*/ this.level().isDay()) { // Plazma - Remove persist 'isClientSide' flag
this.stopSleepInBed(false, true);
diff --git a/src/main/java/net/minecraft/world/item/Item.java b/src/main/java/net/minecraft/world/item/Item.java
index 29afbe0aa72f12d8fa6c03af55d17abef89c8dd4..78742ef91ed332d229d007af9224555a79cd6be9 100644
--- a/src/main/java/net/minecraft/world/item/Item.java
+++ b/src/main/java/net/minecraft/world/item/Item.java
@@ -260,7 +260,7 @@ public class Item implements FeatureElement, ItemLike {
public int getUseDuration(ItemStack stack, LivingEntity user) {
Consumable consumable = stack.get(DataComponents.CONSUMABLE);
- return consumable != null ? consumable.consumeTicks() : 0;
+ return consumable != null ? org.plazmamc.plazma.util.TickingController.calc(consumable.consumeTicks(), it -> it.delay.itemUse, true) : 0; // Plazma - TickControl System
}
public boolean releaseUsing(ItemStack stack, Level world, LivingEntity user, int remainingUseTicks) {
diff --git a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
index c8ae6e4cd74549f753ec04def5d882de1ab72308..b01b80ff0318f95a737ce3f93a5c69426019cc9c 100644
--- a/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
+++ b/src/main/java/net/minecraft/world/level/block/state/BlockBehaviour.java
@@ -336,13 +336,14 @@ public abstract class BlockBehaviour implements FeatureElement {
protected float getDestroyProgress(BlockState state, Player player, BlockGetter world, BlockPos pos) {
float f = state.getDestroySpeed(world, pos);
- if (f == -1.0F) {
- return 0.0F;
- } else {
- int i = player.hasCorrectToolForDrops(state) ? 30 : 100;
-
- return player.getDestroySpeed(state) / f / (float) i;
- }
+ // Plazma start - TickControl system
+ if (f == -1.0F) return 0.0F;
+ return org.plazmamc.plazma.util.TickingController.calc(
+ player.getDestroySpeed(state) / f / (player.hasCorrectToolForDrops(state) ? 30 : 100),
+ it -> it.delay.blockBreak,
+ false
+ );
+ // Plazma end - TickControl system
}
protected void spawnAfterBreak(BlockState state, ServerLevel world, BlockPos pos, ItemStack tool, boolean dropExperience) {}
diff --git a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
index a1756429e8fc09cfd78109c4d5113857304b317d..158da3ebd4b09d8c682960ff658a2e861cbee6dc 100644
--- a/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
+++ b/src/main/java/net/minecraft/world/level/chunk/LevelChunk.java
@@ -1081,8 +1081,18 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
this.chunkCoordinateKey = chunkCoordinateKey;
}
+ // Plazma start - TickControl System
+ private void tickTicker(BlockState state) {
+ this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), state, this.blockEntity);
+
+ if (!org.plazmamc.plazma.util.TickingController.shouldTickAgain(state.getBlock())) return;
+ for (int i = 0; i < org.plazmamc.plazma.util.TickingController.missedTicks(); i++)
+ this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), state, this.blockEntity);
+ }
+ // Plazma end - TickControl System
+
@Override
- public void tick() {
+ public final void tick() { // Plazma - TickControl System (make final)
if (this.blockEntity.isRemoved() || !this.blockEntity.hasLevel()) return;
BlockPos pos = this.blockEntity.getBlockPos();
@@ -1092,7 +1102,7 @@ public class LevelChunk extends ChunkAccess implements ca.spottedleaf.moonrise.p
BlockState state = LevelChunk.this.getBlockState(pos);
if (this.blockEntity.getType().isValid(state)) {
- this.ticker.tick(LevelChunk.this.level, this.blockEntity.getBlockPos(), state, this.blockEntity);
+ this.tickTicker(state); // Plazma - TickControl System
this.loggedInvalidBlockState = false;
// Paper start - Remove the Block Entity if it's invalid
} else {
diff --git a/src/main/java/net/minecraft/world/level/material/LavaFluid.java b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
index 6e643c1a7f7e71cfd20603facaf224985ee81716..cbbbcf8a915a4146eb63e29ba5dd91354ac7228b 100644
--- a/src/main/java/net/minecraft/world/level/material/LavaFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/LavaFluid.java
@@ -181,7 +181,7 @@ public abstract class LavaFluid extends FlowingFluid {
@Override
public int getTickDelay(LevelReader world) {
- return world.dimensionType().ultraWarm() ? world.getWorldBorder().world.purpurConfig.lavaSpeedNether : world.getWorldBorder().world.purpurConfig.lavaSpeedNotNether; // Purpur
+ return org.plazmamc.plazma.util.TickingController.calc(world.dimensionType().ultraWarm() ? world.getWorldBorder().world.purpurConfig.lavaSpeedNether : world.getWorldBorder().world.purpurConfig.lavaSpeedNotNether, it -> it.delay.lavaFluid, true); // Purpur // Plazma - TickControl system
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/material/WaterFluid.java b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
index 028aea6640356ba80f5d682e3cc03b7f82f5b9c7..d788849dc5a568d455cd83ca5b6e1b4ba1a9161f 100644
--- a/src/main/java/net/minecraft/world/level/material/WaterFluid.java
+++ b/src/main/java/net/minecraft/world/level/material/WaterFluid.java
@@ -123,7 +123,7 @@ public abstract class WaterFluid extends FlowingFluid {
@Override
public int getTickDelay(LevelReader world) {
- return world.getWorldBorder().world.plazmaConfig().block.waterFlowingTick; // Plazma - Configurable water flowing speed
+ return org.plazmamc.plazma.util.TickingController.calc(world.getWorldBorder().world.plazmaConfig().block.waterFlowingTick, it -> it.delay.waterFluid, true); // Plazma - Configurable water flowing speed // Plazma - TickControl System
}
@Override
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 768cb135081c233a820566015ed58351e417c45c..898f9e6ec6f306a15639ee0d03bcfe7bf55e2c6c 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -195,4 +195,39 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+ public TickControl tickControl;
+ public class TickControl extends ConfigurationPart {
+
+ public boolean enabled = false;
+
+ public Delay delay;
+ public class Delay extends ConfigurationPart {
+
+ public boolean sleep = true;
+ public boolean itemUse = true;
+ public boolean portalUse = true;
+ public boolean lavaFluid = true;
+ public boolean waterFluid = true;
+ public boolean blockBreak = true;
+ public boolean itemPickup = true;
+ public boolean potionEffect = true;
+
+ }
+
+ public Accelerate accelerate;
+ public class Accelerate extends ConfigurationPart {
+
+ public boolean dayTime = true;
+ public boolean randomTick = true;
+ public boolean blockEntity = true;
+
+ }
+
+ @PostProcess
+ void post() {
+ org.plazmamc.plazma.util.TickingController.post(this);
+ }
+
+ }
+
}
diff --git a/src/main/java/org/plazmamc/plazma/util/TickingController.java b/src/main/java/org/plazmamc/plazma/util/TickingController.java
new file mode 100644
index 0000000000000000000000000000000000000000..0e71a47a639a1a3dd0918c5a403ed827aca67966
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/util/TickingController.java
@@ -0,0 +1,56 @@
+package org.plazmamc.plazma.util;
+
+import net.minecraft.world.level.block.Block;
+import org.jspecify.annotations.NonNull;
+import org.jspecify.annotations.Nullable;
+import org.plazmamc.plazma.configurations.GlobalConfiguration;
+import java.util.function.Function;
+
+import static net.minecraft.server.MinecraftServer.getServer;
+
+public final class TickingController {
+
+ private static @Nullable TickingController INSTANCE;
+ private final GlobalConfiguration.TickControl configuration;
+ private int missedTicks = 0;
+
+ private TickingController(GlobalConfiguration.TickControl configuration) {
+ this.configuration = configuration;
+ }
+
+ public static void tick() {
+ if (INSTANCE == null) return;
+ INSTANCE.missedTicks -= INSTANCE.missedTicks;
+ INSTANCE.missedTicks += (int) (getServer().tickTimes5s.getAverage() / 50 - 1);
+ }
+
+ public static void post(GlobalConfiguration.TickControl configuration) {
+ if (!configuration.enabled) {
+ INSTANCE = null;
+ return;
+ }
+
+ INSTANCE = new TickingController(configuration);
+ }
+
+ public static float calc(float original, @NonNull Function<GlobalConfiguration.TickControl, Boolean> isAffected, boolean swap) {
+ if (INSTANCE == null || !isAffected.apply(INSTANCE.configuration) || original == 0) return original;
+ if (swap) return (float) Math.max(original * getServer().tps5s.getAverage() / 20, 1);
+ return (float) (original * 20 / getServer().tps5s.getAverage());
+ }
+
+ public static int calc(int original, @NonNull Function<GlobalConfiguration.TickControl, Boolean> isAccelerated, boolean swap) {
+ return (int) Math.ceil(calc((float) original, isAccelerated, swap));
+ }
+
+ public static int missedTicks() {
+ if (INSTANCE == null) return 0;
+ return INSTANCE.missedTicks;
+ }
+
+ public static boolean shouldTickAgain(Block block) {
+ // TODO: Configurable block masking
+ return INSTANCE != null && !INSTANCE.configuration.accelerate.blockEntity;
+ }
+
+}

View File

@@ -0,0 +1,225 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 22 Jan 2025 11:50:19 +0900
Subject: [PATCH] Bundle as quivers
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index ee6ad451ba8755cf296e9c0a01404a5ed025e749..53c62f51bcdaecba265eb2e0f5e69e890b1b0b03 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -4774,7 +4774,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
return !this.isSleeping() && super.isInWall();
}
- public ItemStack getProjectile(ItemStack stack) {
+ // Plazma start - Bundle as quivers!
+ public final ItemStack getProjectile(final ItemStack stack) {
+ return this.getProjectile(stack, false, false);
+ }
+
+ public ItemStack getProjectile(final ItemStack stack, final boolean bundle, final boolean shrink) {
+ // Plazma end - Bundle as quivers!
return ItemStack.EMPTY;
}
diff --git a/src/main/java/net/minecraft/world/entity/monster/Monster.java b/src/main/java/net/minecraft/world/entity/monster/Monster.java
index c2061f575c731ecc6071384b007517c08e0cf983..a9f7a1ef69fa6fb8ce45237dd812a4827eb5940d 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Monster.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Monster.java
@@ -143,7 +143,7 @@ public abstract class Monster extends PathfinderMob implements Enemy {
}
@Override
- public ItemStack getProjectile(ItemStack stack) {
+ public final ItemStack getProjectile(final ItemStack stack, final boolean bundle, final boolean shrink) { // Plazma - Bundle as quivers!
if (stack.getItem() instanceof ProjectileWeaponItem) {
Predicate<ItemStack> predicate = ((ProjectileWeaponItem)stack.getItem()).getSupportedHeldProjectiles();
ItemStack itemStack = ProjectileWeaponItem.getHeldProjectile(this, predicate);
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
index 4ea1a327c80f915aa45ccf3a5955ed6ff42692c1..121c2a78b0ae30785dcb3587cfd228d049e10993 100644
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
@@ -2321,30 +2321,49 @@ public abstract class Player extends LivingEntity {
// Paper end - PlayerReadyArrowEvent
@Override
- public ItemStack getProjectile(ItemStack stack) {
- if (!(stack.getItem() instanceof ProjectileWeaponItem)) {
- return ItemStack.EMPTY;
- } else {
- Predicate<ItemStack> predicate = ((ProjectileWeaponItem) stack.getItem()).getSupportedHeldProjectiles().and(item -> tryReadyArrow(stack, item)); // Paper - PlayerReadyArrowEvent
- ItemStack itemstack1 = ProjectileWeaponItem.getHeldProjectile(this, predicate);
+ // Plazma start - Bundle as quivers!
+ public final ItemStack getProjectile(final ItemStack stack, final boolean bundle, final boolean shrink) {
+ if (!(stack.getItem() instanceof ProjectileWeaponItem weapon)) return ItemStack.EMPTY;
- if (!itemstack1.isEmpty()) {
- return itemstack1;
- } else {
- predicate = ((ProjectileWeaponItem) stack.getItem()).getAllSupportedProjectiles().and(item -> tryReadyArrow(stack, item)); // Paper - PlayerReadyArrowEvent
+ Predicate<ItemStack> predicate = weapon.getSupportedHeldProjectiles().and(item -> tryReadyArrow(stack, item)); // Paper - PlayerReadyArrowEvent
+ final ItemStack held = ProjectileWeaponItem.getHeldProjectile(this, predicate);
+ if (!held.isEmpty()) return held;
+
+ predicate = weapon.getAllSupportedProjectiles().and(item -> tryReadyArrow(stack, item)); // Paper - PlayerReadyArrowEvent
+ for (int i = 0; i < this.inventory.getContainerSize(); ++i) {
+ ItemStack item = this.inventory.getItem(i);
- for (int i = 0; i < this.inventory.getContainerSize(); ++i) {
- ItemStack itemstack2 = this.inventory.getItem(i);
+ if (bundle && item.getItem() instanceof net.minecraft.world.item.BundleItem) {
+ final net.minecraft.world.item.component.BundleContents contents = item.get(net.minecraft.core.component.DataComponents.BUNDLE_CONTENTS);
+ if (contents == null || contents.isEmpty()) continue;
- if (predicate.test(itemstack2)) {
- return itemstack2;
- }
+ final Optional<ItemStack> optional = contents.itemCopyStream().filter(predicate).findFirst();
+ if (optional.isEmpty()) continue;
+
+ final ItemStack first = optional.get();
+ if (shrink) {
+ final net.minecraft.world.item.component.BundleContents.Mutable mutable = new net.minecraft.world.item.component.BundleContents.Mutable(contents);
+ final ItemStack next = mutable.removeOne(first.copyAndClear());
+ if (next == null) continue;
+
+ next.shrink(1);
+ if (next.getCount() != 0) mutable.tryInsert(next);
+
+ item.set(net.minecraft.core.component.DataComponents.BUNDLE_CONTENTS, mutable.toImmutable());
}
- return this.abilities.instabuild ? new ItemStack(Items.ARROW) : ItemStack.EMPTY;
+ first.setCount(1);
+ return first;
+ }
+
+ if (predicate.test(item)) {
+ return item;
}
}
+
+ return this.abilities.instabuild ? new ItemStack(Items.ARROW) : ItemStack.EMPTY;
}
+ // Plazma end - Bundle as quivers!
@Override
public Vec3 getRopeHoldPosition(float delta) {
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
index 58fa528e4b2589d362eb976afd6221cd94f2623c..6a2381e37709b05a9c5e49c34d549a6da1b8f388 100644
--- a/src/main/java/net/minecraft/world/item/BowItem.java
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
@@ -27,7 +27,7 @@ public class BowItem extends ProjectileWeaponItem {
if (!(user instanceof Player player)) {
return false;
} else {
- ItemStack itemStack = player.getProjectile(stack);
+ ItemStack itemStack = player.getProjectile(stack, world.plazmaConfig().item.bundleAsQuivers.enableForBow, net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, stack) == 0); // Plazma - Bundle as quivers!
// Purpur start
if (world.purpurConfig.infinityWorksWithoutArrows && itemStack.isEmpty() && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, stack) > 0) {
itemStack = new ItemStack(Items.ARROW);
@@ -93,7 +93,7 @@ public class BowItem extends ProjectileWeaponItem {
@Override
public InteractionResult use(Level world, Player user, InteractionHand hand) {
ItemStack itemStack = user.getItemInHand(hand);
- boolean bl = !user.getProjectile(itemStack).isEmpty();
+ boolean bl = !user.getProjectile(itemStack, world.plazmaConfig().item.bundleAsQuivers.enableForBow, false).isEmpty();
if (!user.hasInfiniteMaterials() && !bl && !(world.purpurConfig.infinityWorksWithoutArrows && net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, itemStack) > 0)) { // Purpur
return InteractionResult.FAIL;
} else {
diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
index f8946704838d96ad522182d2b9f41ac8bfe92ac4..c46b5e6fb007280b1ff264414c9acaf8a5f49101 100644
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
@@ -72,7 +72,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
if (chargedProjectiles != null && !chargedProjectiles.isEmpty()) {
this.performShooting(world, user, hand, itemStack, getShootingPower(chargedProjectiles), (float) world.purpurConfig.crossbowProjectileOffset, null); // Purpur
return InteractionResult.CONSUME;
- } else if (!user.getProjectile(itemStack).isEmpty()) {
+ } else if (!user.getProjectile(itemStack, world.plazmaConfig().item.bundleAsQuivers.enableForCrossbow, false).isEmpty() || net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, itemStack) > 0 && world.plazmaConfig().item.allowCrossbowInfinity) { // Plazma - Bundle as quivers!
this.startSoundPlayed = false;
this.midLoadSoundPlayed = false;
user.startUsingItem(hand);
@@ -124,7 +124,11 @@ public class CrossbowItem extends ProjectileWeaponItem {
return CrossbowItem.tryLoadProjectiles(shooter, crossbow, true);
}
private static boolean tryLoadProjectiles(LivingEntity shooter, ItemStack crossbow, boolean consume) {
- List<ItemStack> list = draw(crossbow, shooter.getProjectile(crossbow), shooter, consume);
+ // Plazma start - Bundle as quivers!
+ boolean infinity = net.minecraft.world.item.enchantment.EnchantmentHelper.getItemEnchantmentLevel(net.minecraft.world.item.enchantment.Enchantments.INFINITY, crossbow) > 0 && shooter.level().plazmaConfig().item.allowCrossbowInfinity;
+ List<ItemStack> list = draw(crossbow, shooter.getProjectile(crossbow, shooter.level().plazmaConfig().item.bundleAsQuivers.enableForBow, !infinity), shooter, consume);
+ if (list.isEmpty() && infinity) list = List.of(new ItemStack(Items.ARROW));
+ // Plazma end - Bundle as quivers!
// Paper end - Add EntityLoadCrossbowEvent
if (!list.isEmpty()) {
crossbow.set(DataComponents.CHARGED_PROJECTILES, ChargedProjectiles.of(list));
diff --git a/src/main/java/net/minecraft/world/item/component/BundleContents.java b/src/main/java/net/minecraft/world/item/component/BundleContents.java
index d4e7e92875162b67226a20c5add8973e09fd882c..6e57ed3b395b0155bdf13129c11ee8ddf4a68199 100644
--- a/src/main/java/net/minecraft/world/item/component/BundleContents.java
+++ b/src/main/java/net/minecraft/world/item/component/BundleContents.java
@@ -157,7 +157,13 @@ public final class BundleContents implements TooltipComponent {
}
private int findStackIndex(ItemStack stack) {
- if (!stack.isStackable()) {
+ // Plazma start - Bundle as quivers!
+ return this.findStackIndex(stack, false);
+ }
+
+ private int findStackIndex(final ItemStack stack, final boolean skipStackableCheck) {
+ if (!skipStackableCheck && !stack.isStackable()) {
+ // Plazma end - Bundle as quivers!
return -1;
} else {
for (int i = 0; i < this.items.size(); i++) {
@@ -211,11 +217,20 @@ public final class BundleContents implements TooltipComponent {
@Nullable
public ItemStack removeOne() {
+ // Plazma start - Bundle as quivers!
+ return this.removeOne(null);
+ }
+
+ @Nullable
+ public ItemStack removeOne(final @Nullable ItemStack stack) {
+ // Plazma end - Bundle as quivers!
if (this.items.isEmpty()) {
return null;
} else {
- int i = this.selectedItem != -1 && this.selectedItem < this.items.size() ? this.selectedItem : 0;
- ItemStack itemStack = this.items.remove(i).copy();
+ // Plazma start - Bundle as quivers!
+ int i = stack != null ? this.findStackIndex(stack, true) : this.selectedItem != -1 && this.selectedItem < this.items.size() ? this.selectedItem : 0;
+ ItemStack itemStack = this.items.remove(i != -1 ? i : 0).copy();
+ // Plazma end - Bundle as quivers!
this.weight = this.weight.subtract(BundleContents.getWeight(itemStack).multiplyBy(Fraction.getFraction(itemStack.getCount(), 1)));
this.toggleSelectedItem(-1);
return itemStack;
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index e88b18ff76bf21d9fa340a1d58abedefbf30ec91..8daf361f82af8d41661d8c5afe717c8a90803dfe 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -104,6 +104,7 @@ public class WorldConfigurations extends ConfigurationPart {
public class Item extends ConfigurationPart {
public boolean skipMapUpdateIfCraftRenderIsNull = true;
+ public boolean allowCrossbowInfinity = false;
public ShootableFireCharge shootableFireCharge;
public class ShootableFireCharge extends ConfigurationPart {
@@ -125,6 +126,14 @@ public class WorldConfigurations extends ConfigurationPart {
}
+ public BundleAsQuivers bundleAsQuivers;
+ public class BundleAsQuivers extends ConfigurationPart {
+
+ public boolean enableForBow = false;
+ public boolean enableForCrossbow = false;
+
+ }
+
}
}

View File

@@ -0,0 +1,227 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 14 Dec 2024 00:29:15 +0900
Subject: [PATCH] Implement CarpetFixes
diff --git a/src/main/java/net/minecraft/world/entity/animal/Sheep.java b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
index 0503f936d0d7194f110069adabff984f51af0a3a..0ca88636cca9b8f93cddf8bc58038e626e171df8 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Sheep.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Sheep.java
@@ -379,19 +379,22 @@ public class Sheep extends Animal implements Shearable {
}
private DyeColor getOffspringColor(ServerLevel world, Sheep firstParent, Sheep secondParent) {
- DyeColor enumcolor = firstParent.getColor();
- DyeColor enumcolor1 = secondParent.getColor();
- CraftingInput craftinginput = Sheep.makeCraftInput(enumcolor, enumcolor1);
- Optional<Item> optional = world.recipeAccess().getRecipeFor(RecipeType.CRAFTING, craftinginput, world).map((recipeholder) -> { // CraftBukkit - decompile error
- return ((CraftingRecipe) recipeholder.value()).assemble(craftinginput, world.registryAccess());
- }).map(ItemStack::getItem);
-
- Objects.requireNonNull(DyeItem.class);
- optional = optional.filter(DyeItem.class::isInstance);
- Objects.requireNonNull(DyeItem.class);
- return (DyeColor) optional.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> {
- return world.random.nextBoolean() ? enumcolor : enumcolor1;
- });
+ // Plazma start - Implement CarpetFixes
+ final DyeColor firstColor = firstParent.getColor();
+ final DyeColor secondColor = secondParent.getColor();
+// PLAZMA - REMOVE THIS
+ if (world.plazmaConfig().carpetFixes.preparedSheepChildColor) {
+ final DyeColor color = org.plazmamc.plazma.util.CarpetFixes.properDyeMixin(firstColor, secondColor);
+ if (color != null) return color;
+ return world.random.nextBoolean() ? firstColor : secondColor;
+ }
+// PLAZMA - REMOVE THIS
+ final CraftingInput input = Sheep.makeCraftInput(firstColor, secondColor);
+// PLAZMA - REMOVE THIS
+ Optional<Item> result = world.recipeAccess().getRecipeFor(RecipeType.CRAFTING, input, world).map((recipeholder) -> recipeholder.value().assemble(input, world.registryAccess())).map(ItemStack::getItem);
+ result = result.filter(DyeItem.class::isInstance);
+ return result.map(DyeItem.class::cast).map(DyeItem::getDyeColor).orElseGet(() -> world.random.nextBoolean() ? firstColor : secondColor);
+ // Plazma end - Implement CarpetFixes
}
private static CraftingInput makeCraftInput(DyeColor firstColor, DyeColor secondColor) {
diff --git a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
index 90f8360f547ce709fd13ee34f8e67d8bfa94b498..4e5fb377696c0a98a56f9ea11d0116b28399c8f6 100644
--- a/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
+++ b/src/main/java/net/minecraft/world/level/biome/BiomeManager.java
@@ -9,6 +9,8 @@ import net.minecraft.util.Mth;
public class BiomeManager {
public static final int CHUNK_CENTER_QUART = QuartPos.fromBlock(8);
+ public static boolean PLAZMA_CARPET_FIXES = false; // Plazma - Implement CarpetFixes
+ private static final double MAX_OFFSET = 0.450_000_000_1; // Plazma - Implement CarpetFixes
private static final int ZOOM_BITS = 2;
private static final int ZOOM = 4;
private static final int ZOOM_MASK = 3;
@@ -29,6 +31,79 @@ public class BiomeManager {
}
public Holder<Biome> getBiome(BlockPos pos) {
+ // Plazma start - Implement CarpetFixes
+ if (PLAZMA_CARPET_FIXES) {
+ final int x2 = pos.getX() - 2;
+ final int y2 = pos.getY() - 2;
+ final int z2 = pos.getZ() - 2;
+
+ final int x = x2 >> 2;
+ final int y = y2 >> 2;
+ final int z = z2 >> 2;
+
+ final double qX = (x2 & 3) / 4.0D;
+ final double qY = (y2 & 3) / 4.0D;
+ final double qZ = (z2 & 3) / 4.0D;
+
+ int minX = 0;
+ double minD = Double.POSITIVE_INFINITY;
+ for (int bX = 0; bX < 8; ++bX) {
+ final boolean x0 = (bX & 4) == 0;
+ final boolean y0 = (bX & 2) == 0;
+ final boolean z0 = (bX & 1) == 0;
+
+ final double x1 = x0 ? qX : qX - 1.0D;
+ final double y1 = y0 ? qY : qY - 1.0D;
+ final double z1 = z0 ? qZ : qZ - 1.0D;
+
+ double maxQY = 0.0D;
+ double maxQZ = 0.0D;
+ if (bX != 0) {
+ final double maxQX = Mth.square(Math.max(x1 + MAX_OFFSET, Math.abs(x1 - MAX_OFFSET)));
+ maxQY = Mth.square(Math.max(y1 + MAX_OFFSET, Math.abs(y1 - MAX_OFFSET)));
+ maxQZ = Mth.square(Math.max(z1 + MAX_OFFSET, Math.abs(z1 - MAX_OFFSET)));
+
+ if (minD < maxQY + maxQZ + maxQX) continue;
+ }
+
+ int pX = x0 ? x : x + 1;
+ int pY = y0 ? y : y + 1;
+ int pZ = z0 ? z : z + 1;
+
+ long seed = this.biomeZoomSeed;
+ seed = LinearCongruentialGenerator.next(seed, pX);
+ seed = LinearCongruentialGenerator.next(seed, pY);
+ seed = LinearCongruentialGenerator.next(seed, pZ);
+ seed = LinearCongruentialGenerator.next(seed, pX);
+ seed = LinearCongruentialGenerator.next(seed, pY);
+ seed = LinearCongruentialGenerator.next(seed, pZ);
+
+ double dX = getFiddle(seed);
+ double sX = Mth.square(x1 + dX);
+ if (bX != 0 && minD < sX + maxQY + maxQZ) continue;
+
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
+ double dY = getFiddle(seed);
+ double sY = Mth.square(y1 + dY);
+ if (bX != 0 && minD < sX + sY + maxQZ) continue;
+
+ seed = LinearCongruentialGenerator.next(seed, this.biomeZoomSeed);
+ double dZ = getFiddle(seed);
+ double bD = sX + sY + Mth.square(z1 + dZ);
+
+ if (minD <= bD) continue;
+ minX = bX;
+ minD = bD;
+ }
+
+ return this.noiseBiomeSource.getNoiseBiome(
+ (minX & 4) == 0 ? x : x + 1,
+ (minX & 2) == 0 ? y : y + 1,
+ (minX & 1) == 0 ? z : z + 1
+ );
+ }
+ // Plazma end - Implement CarpetFixes
+
int i = pos.getX() - 2;
int j = pos.getY() - 2;
int k = pos.getZ() - 2;
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 538c572661bd92666f84e6f9ef3e9760f69f50a9..db31d0c066e92fe308e7e64075e832bec66a5c02 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -188,4 +188,16 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+ public CarpetFixes carpetFixes;
+ public class CarpetFixes extends ConfigurationPart {
+
+ boolean optimizeBiomeAccess = OPTIMIZE;
+
+ @PostProcess
+ void post() {
+ net.minecraft.world.level.biome.BiomeManager.PLAZMA_CARPET_FIXES = this.optimizeBiomeAccess;
+ }
+
+ }
+
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 36345efa302413ad4e7d6e611d182572622f76ff..d314be46a02d73e669088d3a37937c8751f7735d 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -126,4 +126,11 @@ public class WorldConfigurations extends ConfigurationPart {
}
+ public CarpetFixes carpetFixes;
+ public class CarpetFixes extends ConfigurationPart {
+
+ public boolean preparedSheepChildColor = OPTIMIZE;
+
+ }
+
}
diff --git a/src/main/java/org/plazmamc/plazma/util/CarpetFixes.java b/src/main/java/org/plazmamc/plazma/util/CarpetFixes.java
new file mode 100644
index 0000000000000000000000000000000000000000..a5b0ce75a0ffa65e357cde2d55b7a0f116a2afad
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/util/CarpetFixes.java
@@ -0,0 +1,45 @@
+package org.plazmamc.plazma.util;
+
+import net.minecraft.world.item.DyeColor;
+
+public interface CarpetFixes {
+
+ static DyeColor properDyeMixin(DyeColor firstColor, DyeColor secondColor) {
+ if (firstColor.equals(secondColor)) return firstColor;
+
+ return switch (firstColor) {
+ case WHITE -> switch (secondColor) {
+ case BLUE -> DyeColor.LIGHT_BLUE;
+ case GRAY -> DyeColor.LIGHT_GRAY;
+ case BLACK -> DyeColor.GRAY;
+ case GREEN -> DyeColor.LIME;
+ case RED -> DyeColor.PINK;
+ default -> null;
+ };
+ case BLUE -> switch (secondColor) {
+ case WHITE -> DyeColor.LIGHT_BLUE;
+ case GREEN -> DyeColor.CYAN;
+ case RED -> DyeColor.PURPLE;
+ default -> null;
+ };
+ case RED -> switch (secondColor) {
+ case YELLOW -> DyeColor.ORANGE;
+ case WHITE -> DyeColor.PINK;
+ case BLUE -> DyeColor.PURPLE;
+ default -> null;
+ };
+ case GREEN -> switch (secondColor) {
+ case BLUE -> DyeColor.CYAN;
+ case WHITE -> DyeColor.LIME;
+ default -> null;
+ };
+ case YELLOW -> secondColor.equals(DyeColor.RED) ? DyeColor.ORANGE : null;
+ case PURPLE -> secondColor.equals(DyeColor.PINK) ? DyeColor.MAGENTA : null;
+ case PINK -> secondColor.equals(DyeColor.PURPLE) ? DyeColor.MAGENTA : null;
+ case GRAY -> secondColor.equals(DyeColor.WHITE) ? DyeColor.LIGHT_GRAY : null;
+ case BLACK -> secondColor.equals(DyeColor.WHITE) ? DyeColor.GRAY : null;
+ default -> null;
+ };
+ }
+
+}

View File

@@ -5,71 +5,108 @@ Subject: [PATCH] Save Json list asynchronously
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
index 935dac757280731bfeb0a8f033cbe315ecac46da..038f370ac2cb768e14fe7605b32b2ac811c33b8f 100644
index 22c4f8dea99f92a1eb3da2baf0a15bf9d2ca0462..20c531f11b310dab0a867e589c769393ed835df5 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedPlayerList.java
@@ -60,20 +60,20 @@ public class DedicatedPlayerList extends PlayerList {
@@ -58,21 +58,23 @@ public class DedicatedPlayerList extends PlayerList {
this.loadWhiteList();
}
+ // Plazma start - Save JSON list asynchronously
private void saveIpBanList() {
- try {
+ //try { // Plazma - Build fix
this.getIpBans().save();
- this.getIpBans().save();
- } catch (IOException var2) {
+ /*} catch (IOException var2) { // Plazma - Build fix
LOGGER.warn("Failed to save ip banlist: ", (Throwable)var2);
- LOGGER.warn("Failed to save ip banlist: ", (Throwable)var2);
- }
+ }*/ // Plazma - Build fix
+ this.getIpBans().save();
}
private void saveUserBanList() {
- try {
+ //try { // Plazma - Build fix
this.getBans().save();
- this.getBans().save();
- } catch (IOException var2) {
+ /*} catch (IOException var2) { // Plazma - Build fix
LOGGER.warn("Failed to save user banlist: ", (Throwable)var2);
- LOGGER.warn("Failed to save user banlist: ", (Throwable)var2);
- }
+ }*/ // Plazma - Build fix
+ this.getBans().save();
+ }
+
+ private void saveOps() {
+ this.getOps().save();
+ }
+
+ private void saveWhiteList() {
+ this.getWhiteList().save();
}
+ // Plazma end - Save JSON list asynchronously
private void loadIpBanList() {
try {
@@ -98,14 +100,6 @@ public class DedicatedPlayerList extends PlayerList {
}
}
- private void saveOps() {
- try {
- this.getOps().save();
- } catch (Exception var2) {
- LOGGER.warn("Failed to save operators list: ", (Throwable)var2);
- }
- }
-
private void loadWhiteList() {
try {
this.getWhiteList().load();
@@ -114,14 +108,6 @@ public class DedicatedPlayerList extends PlayerList {
}
}
- private void saveWhiteList() {
- try {
- this.getWhiteList().save();
- } catch (Exception var2) {
- LOGGER.warn("Failed to save white-list: ", (Throwable)var2);
- }
- }
-
@Override
public boolean isWhiteListed(GameProfile profile) {
return !this.isUsingWhitelist() || this.isOp(profile) || this.getWhiteList().isWhiteListed(profile);
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index 34b7c5421da93f14050425b0fc16bbc27e5f3eba..a35340b9231bc3009ca9449fa6ea8f8ae6929146 100644
index c038da20b76c0b7b1c18471b20be01e849d29f3a..0735a0bd182635e1969d19336b46bc72b14e555f 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -61,11 +61,11 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
@@ -42,13 +42,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void add(V entry) {
this.map.put(this.getKeyForUser(entry.getUser()), entry);
-
- try {
+ //try { // Plazma - Fix build
this.save();
- this.save();
- } catch (IOException ioexception) {
+ /*} catch (IOException ioexception) { // Plazma - Fix build
StoredUserList.LOGGER.warn("Could not save the list after adding a user.", ioexception);
- StoredUserList.LOGGER.warn("Could not save the list after adding a user.", ioexception);
- }
+ }*/ // Plazma - Fix build
-
+ this.save(); // Plazma - Save Json list asynchronously
}
@@ -83,11 +83,11 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
@Nullable
@@ -62,13 +56,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void remove(K key) {
this.map.remove(this.getKeyForUser(key));
-
- try {
+ //try { // Plazma - Fix build
this.save();
- this.save();
- } catch (IOException ioexception) {
+ /*} catch (IOException ioexception) { // Plazma - Fix build
StoredUserList.LOGGER.warn("Could not save the list after removing a user.", ioexception);
- StoredUserList.LOGGER.warn("Could not save the list after removing a user.", ioexception);
- }
+ }*/ // Plazma - Fix build
-
+ this.save(); // Plazma - Save Json list asynchronously
}
@@ -142,7 +142,10 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
public void remove(StoredUserEntry<K> entry) {
@@ -102,7 +90,9 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
return this.map.values();
}
@@ -77,11 +114,10 @@ index 34b7c5421da93f14050425b0fc16bbc27e5f3eba..a35340b9231bc3009ca9449fa6ea8f8a
+ // Plazma start - Save Json list asynchronously
+ public void save()/* throws IOException*/ {
+ io.papermc.paper.util.MCUtil.scheduleAsyncTask(() -> {
+
this.removeExpired(); // Paper - remove expired values before saving
JsonArray jsonarray = new JsonArray();
Stream<JsonObject> stream = this.map.values().stream().map((jsonlistentry) -> { // CraftBukkit - decompile error
@@ -154,27 +157,16 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
@@ -114,27 +104,16 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
Objects.requireNonNull(jsonarray);
stream.forEach(jsonarray::add);
@@ -89,7 +125,7 @@ index 34b7c5421da93f14050425b0fc16bbc27e5f3eba..a35340b9231bc3009ca9449fa6ea8f8a
- try {
+ try (BufferedWriter bufferedwriter = Files.newWriter(this.file, StandardCharsets.UTF_8)) {
StoredUserList.GSON.toJson(jsonarray, bufferedwriter);
StoredUserList.GSON.toJson(jsonarray, StoredUserList.GSON.newJsonWriter(bufferedwriter));
- } catch (Throwable throwable) {
- if (bufferedwriter != null) {
- try {
@@ -110,7 +146,7 @@ index 34b7c5421da93f14050425b0fc16bbc27e5f3eba..a35340b9231bc3009ca9449fa6ea8f8a
+ });
}
+ // Plazma end
+ // Plazma end - Save Json list asynchronously
public void load() throws IOException {
if (this.file.exists()) {

View File

@@ -0,0 +1,69 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 26 Oct 2024 18:09:08 +0900
Subject: [PATCH] Load player data asynchronously
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 16069b9cbf6c7679c28a2e9a54e77d23cd10e541..bb10892f33ba0d7fc3959debef1045073868f8b8 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -76,7 +76,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
// CraftBukkit end
private static final AtomicInteger UNIQUE_THREAD_ID = new AtomicInteger(0);
static final Logger LOGGER = LogUtils.getLogger();
- private static final java.util.concurrent.ExecutorService authenticatorPool = java.util.concurrent.Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("User Authenticator #%d").setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER)).build()); // Paper - Cache authenticator threads
+ public static final java.util.concurrent.ExecutorService authenticatorPool = java.util.concurrent.Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("User Authenticator #%d").setUncaughtExceptionHandler(new DefaultUncaughtExceptionHandler(LOGGER)).build()); // Paper - Cache authenticator threads // Plazma - private -> public
private static final int MAX_TICKS_BEFORE_LOGIN = 600;
private final byte[] challenge;
final MinecraftServer server;
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index aead28160c7a5067340ec80a833eafcab1817d67..c18868796957c0756aca3b5a15fd0d0c8a5221f4 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -183,6 +183,16 @@ public abstract class PlayerList {
abstract public void loadAndSaveFiles(); // Paper - fix converting txt to json file; moved from DedicatedPlayerList constructor
public void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData) {
+ // Plazma start - load player information asynchronously
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.loadAsynchronously)
+ this.placeNewPlayer(connection, player, clientData, this.load(player));
+ else java.util.concurrent.CompletableFuture
+ .supplyAsync(() -> this.load(player), net.minecraft.server.network.ServerLoginPacketListenerImpl.authenticatorPool)
+ .thenAcceptAsync(nbt -> this.placeNewPlayer(connection, player, clientData, nbt), this.server);
+ }
+
+ private void placeNewPlayer(Connection connection, ServerPlayer player, CommonListenerCookie clientData, Optional<CompoundTag> optional) {
+ // Plazma end - load player information asynchronously
player.isRealPlayer = true; // Paper
player.loginTime = System.currentTimeMillis(); // Paper - Replace OfflinePlayer#getLastPlayed
GameProfile gameprofile = player.getGameProfile();
@@ -191,14 +201,13 @@ public abstract class PlayerList {
String s;
if (usercache != null) {
- Optional<GameProfile> optional = usercache.get(gameprofile.getId()); // CraftBukkit - decompile error
- s = (String) optional.map(GameProfile::getName).orElse(gameprofile.getName());
+ s = usercache.get(gameprofile.getId()).map(GameProfile::getName).orElse(gameprofile.getName()); // CraftBukkit - decompile error // Plazma - varname conflict
usercache.add(gameprofile);
} else {
s = gameprofile.getName();
}
- Optional<CompoundTag> optional = this.load(player); // CraftBukkit - decompile error
+ // Optional<CompoundTag> optional = this.load(player); // CraftBukkit - decompile error // Plazma - extract
ResourceKey<Level> resourcekey = null; // Paper
// CraftBukkit start - Better rename detection
if (optional.isPresent()) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 14ba63f5ef6ad5d96972b18e1174a8a94491fa57..c2f3facf65aa2682306c64c3466357461a76f267 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -44,6 +44,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public class Player extends ConfigurationPart {
public boolean checkSpectatorMovedToQuickly = !OPTIMIZE;
+ public boolean loadAsynchronously = OPTIMIZE;
public FreedomChat freedomChat;
public class FreedomChat extends ConfigurationPart {

Some files were not shown because too many files have changed in this diff Show More