Compare commits

...

139 Commits

Author SHA1 Message Date
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
177 changed files with 43538 additions and 17889 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

@@ -23,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,141 +0,0 @@
name: Release Plazma (1.20.6)
on:
push:
branches: [ "ver/*", "dev/*", "feat/**/*" ]
paths:
- "**.patch"
workflow_dispatch:
env:
ORG_NAME: PlazmaMC
MC_VERSION: 1.20.6
jobs:
release:
name: Release Plazma
strategy:
matrix:
base_jdk: [21]
os: [ubuntu-22.04]
if: "!startsWith(github.event.commits[0].message, '[CI-Skip]')"
runs-on: ${{ matrix.os }}
steps:
- name: Setup Variables
id: setup
env:
BRANCH: ${{ github.ref_name }}
run: echo "branch=${BRANCH##*/}" >> $GITHUB_OUTPUT
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout javadocs
uses: actions/checkout@v4
continue-on-error: true
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
with:
repository: PlazmaMC/Javadocs
path: javadoc
ref: ${{ steps.setup.outputs.branch }}
token: ${{ secrets.GH_PAT }}
- name: Checkout javadocs
uses: actions/checkout@v4
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
with:
repository: PlazmaMC/Javadocs
path: jdmain
token: ${{ secrets.GH_PAT }}
- 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
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
continue-on-error: true
run: |
if [ ! -d "javadoc" ]; then
mkdir javadoc
cd javadoc
git init && git branch -m ${{ steps.setup.outputs.branch }}
git remote add origin https://github.com/PlazmaMC/Javadocs
fi
(cd Plazma-API/build/docs/javadoc && tar c .) | (cd javadoc && tar xf -)
cd javadoc
git add . && git commit -m "Update Javadocs"
git push -f
cd ../jdmain
git submodule update
git add . && git commit -m "Update Javadocs"
git push
- name: Publish Packages
if: startsWith(github.ref_name, 'ver/') || startsWith(github.ref_name, 'dev/')
run: |
export GITHUB_USERNAME=${{ env.ORG_NAME }}
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
./gradlew publish --stacktrace
- 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

4
.gitignore vendored
View File

@@ -18,6 +18,9 @@ out/
nbproject/
nbactions.xml
# vscode
.vscode/
# Gradle
!gradle-wrapper.jar
.gradle/
@@ -58,3 +61,4 @@ paper-api-generator
compare.txt
*.patch
!patches/**/*
upstream

View File

@@ -4,35 +4,21 @@
### 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.4&logo=GoogleAnalytics&style=for-the-badge&logoColor=ffffff)](https://github.com/PlazmaMC/Plazma/actions/workflows/build.yml?query=branch:ver/1.20.4)
[![MC Version](https://img.shields.io/badge/MC-1.20.4-6047ff?&logo=Webpack&style=for-the-badge&logoColor=ffffff)](https://github.com/PlazmaMC/Plazma/releases/build/1.20.4/latest)
[![Discord](https://api.plazmamc.org/internal/cdn/discord)](https://plazmamc.org/discord)
[![License](https://api.plazmamc.org/internal/cdn/license)](LICENSE.md)
[![Version](https://badge.plazmamc.org/1/MC/1.21.3/Webpack)](https://plazmamc.org/downloads)
[![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)
[![Downloads](https://api.plazmamc.org/internal/cdn/dlcountmini)](https://plazmamc.org/downloads)
[![Stargazers](https://api.plazmamc.org/internal/cdn/starsmini)](https://github.com/PlazmaMC/Plazma/stargazers)
[![Forks](https://api.plazmamc.org/internal/cdn/forks)](https://github.com/PlazmaMC/Plazma/forks)
[![Watchers](https://api.plazmamc.org/internal/cdn/watches)](https://github.com/PlazmaMC/Plazma/watchers)
### [⬇️ Downloads](https://plazmamc.org/downloads)
</div>
[main]: https://github.com/PlazmaMC/Plazma
[main]: https://github.com/PlazmaMC/PlazmaBukkit/blob/main/README.md
> [!IMPORTANT]
This is the branch for Plazma 1.20.4. If you want to know more about Plazma, please check the **[main branch][main]**.<br>
이곳은 플라즈마의 1.20.4용 분기입니다. 플라즈마에 대해 자세히 알고 싶다면 **[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.4/latest/plazma-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar
[paperMojmap]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.4/latest/plazma-paperclip-1.20.4-R0.1-SNAPSHOT-mojmap.jar
[bundlerReobf]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.4/latest/plazma-bundler-1.20.4-R0.1-SNAPSHOT-reobf.jar
[bundlerMojmap]: https://github.com/PlazmaMC/Plazma/releases/download/build/1.20.4/latest/plazma-bundler-1.20.4-R0.1-SNAPSHOT-mojmap.jar
| **Reobf Paperclip (Default)** | Mojmap Paperclip | Reobf Bundler | Mojmap Bundler |
|:-----------------------------:|:-----------------------:|:------------------------:|:-------------------------:|
| [Download][paperReobf] | [Download][paperMojmap] | [Download][bundlerReobf] | [Download][bundlerMojmap] |
This is the branch for Plazma 1.21.4. If you want to know more about Plazma, please check the **[main branch][main]**.<br>
해당 페이지는 Plazma의 1.21.4용 분기입니다. 플라즈마에 대해 자세히 알고 싶다면 **[main 분기][main]** 를 확인해주세요.

View File

@@ -12,3 +12,6 @@
# mc_data chat_type/chat.json
# mc_data dimension_type/overworld.json
#
minecraft net.minecraft.server.commands.PardonCommand
minecraft net.minecraft.server.commands.PardonIpCommand

View File

@@ -4,140 +4,51 @@ 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)
}
val jdkVersion = property("jdkVersion").toString().toInt()
kotlin.jvmToolchain {
languageVersion = JavaLanguageVersion.of(jdkVersion)
}
repositories {
mavenCentral()
maven("https://papermc.io/repo/repository/maven-public/") {
content {
onlyForConfigurations(configurations.paperclip.name)
}
maven("https://repo.papermc.io/repository/maven-public/") { name = "papermc"
content { onlyForConfigurations(configurations.paperclip.name) }
}
maven("https://repo.codemc.io/repository/maven-public/") { name = "codemc" }
maven("https://jitpack.io") { name = "jitpack" }
}
dependencies {
remapper(libs.remapper)
decompiler(libs.decompiler)
paperclip(libs.paperclip)
decompiler(libs.decompiler)
}
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(jdkVersion))
publishing {
repositories {
maven {
name = "githubPackage"
url = uri("https://maven.pkg.github.com/PlazmaMC/PlazmaBukkit")
credentials {
username = System.getenv("GITHUB_USERNAME")
password = System.getenv("GITHUB_TOKEN")
}
}
publications.register<MavenPublication>("gpr") {
from(components["java"])
}
}
}
}
subprojects {
tasks {
withType<JavaCompile>().configureEach {
options.compilerArgs.addAll(listOf("--add-modules=jdk.incubator.vector", "-Xmaxwarns", "1"))
options.encoding = Charsets.UTF_8.name()
options.release = jdkVersion
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
}
}
repositories {
mavenCentral()
maven("https://jitpack.io")
maven("https://papermc.io/repo/repository/maven-public/")
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
name = "sonatype-oss-snapshots"
}
}
}
val brandName: String by project
val providerRepo: String by project
paperweight {
serverProject = project(":plazma-server")
serverProject = project(":${brandName.lowercase()}-server")
remapRepo = "https://repo.papermc.io/repository/maven-public/"
decompileRepo = "https://repo.papermc.io/repository/maven-public/"
usePaperUpstream(providers.gradleProperty("paperCommit")) {
withPaperPatcher {
apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("Plazma-API"))
apiPatchDir.set(projectDir.resolve("patches/api"))
apiOutputDir.set(projectDir.resolve("$brandName-API"))
serverPatchDir.set(layout.projectDirectory.dir("patches/server"))
serverOutputDir.set(layout.projectDirectory.dir("Plazma-Server"))
serverPatchDir.set(projectDir.resolve("patches/server"))
serverOutputDir.set(projectDir.resolve("$brandName-Server"))
}
patchTasks.register("generatedApi") {
isBareDirectory = true
upstreamDirPath = "paper-api-generator/generated"
patchDir = layout.projectDirectory.dir("patches/generated-api")
outputDir = layout.projectDirectory.dir("paper-api-generator/generated")
}
patchTasks.register("mojangApi") {
isBareDirectory = true
upstreamDirPath = "Paper-MojangAPI"
patchDir = layout.projectDirectory.dir("patches/mojang-api")
outputDir = layout.projectDirectory.dir("Plazma-MojangAPI")
patchDir = projectDir.resolve("patches/generated-api")
outputDir = projectDir.resolve("paper-api-generator/generated")
}
}
}
alwaysUpToDate {
paperRepoName.set("org.plazmamc.alwaysuptodate.paper.repository")
paperBranchName.set("paperBranch")
paperCommitName.set("paperCommit")
purpurRepoName.set("org.plazmamc.alwaysuptodate.purpur.repository")
purpurBranchName.set("purpurBranch")
purpurCommitName.set("purpurCommit")
pufferfishRepoName.set("pufferfishRepo")
pufferfishBranchName.set("pufferfishBranch")
pufferfishToggleName.set("usePufferfish")
}
tasks {
applyPatches {
dependsOn("applyGeneratedApiPatches")
@@ -148,20 +59,75 @@ tasks {
}
generateDevelopmentBundle {
apiCoordinates.set("org.plazmamc.plazma:plazma-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
apiCoordinates.set("${project.group}:${brandName.lowercase()}-api")
libraryRepositories.addAll(
"https://repo.maven.apache.org/maven2/",
"https://maven.pkg.github.com/PlazmaMC/Plazma",
"https://papermc.io/repo/repository/maven-public/"
"https://repo1.maven.org/maven2/",
"https://repo.papermc.io/repository/maven-public/",
"https://repo.codemc.io/repository/maven-public/",
"https://jitpack.io",
)
}
}
publishing {
publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) {
artifactId = "dev-bundle"
publishing.publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) { artifactId = "dev-bundle" }
}
val mavenUsername: String? by project
val mavenPassword: String? by project
allprojects {
apply(plugin = "java")
apply(plugin = "maven-publish")
java.toolchain.languageVersion.set(JavaLanguageVersion.of(21))
publishing.repositories.maven("https://maven.pkg.github.com/$providerRepo") {
name = "github"
credentials {
username = mavenUsername ?: System.getenv("GRADLE_PROPERTY_MAVEN_USERNAME") ?: System.getenv("MAVEN_USERNAME")
password = mavenPassword ?: System.getenv("GRADLE_PROPERTY_MAVEN_PASSWORD") ?: System.getenv("MAVEN_PASSWORD")
}
}
publishing.repositories.maven("https://repo.codemc.io/repository/maven-snapshots/") {
name = "codemc"
credentials {
username = mavenUsername ?: System.getenv("GRADLE_PROPERTY_MAVEN_USERNAME") ?: System.getenv("MAVEN_USERNAME")
password = mavenPassword ?: System.getenv("GRADLE_PROPERTY_MAVEN_PASSWORD") ?: System.getenv("MAVEN_PASSWORD")
}
}
}
subprojects {
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/") { name = "papermc" }
maven("https://repo.codemc.io/repository/maven-public/") { name = "codeme" }
maven("https://jitpack.io") { name = "jitpack" }
}
tasks {
withType<JavaCompile>().configureEach {
options.encoding = Charsets.UTF_8.name()
options.release = 21
}
withType<Javadoc> {
options.encoding = Charsets.UTF_8.name()
}
withType<ProcessResources> {
filteringCharset = Charsets.UTF_8.name()
}
withType<Test> {
testLogging {
showStackTraces = true
exceptionFormat = TestExceptionFormat.FULL
events(TestLogEvent.STANDARD_OUT)
}
}
}
}

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.6.2-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,22 +0,0 @@
package org.plazmamc.alwaysuptodate
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.plazmamc.alwaysuptodate.tasks.CheckPaperCommitTask
import org.plazmamc.alwaysuptodate.tasks.CheckPurpurCommitTask
import org.plazmamc.alwaysuptodate.tasks.PaperUpdateTask
import org.plazmamc.alwaysuptodate.tasks.PurpurUpdateTask
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)
target.tasks.register("checkPaperCommit", CheckPaperCommitTask::class.java)
target.tasks.register("checkPurpurCommit", CheckPurpurCommitTask::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,19 +0,0 @@
package org.plazmamc.alwaysuptodate
import org.gradle.api.provider.Property
interface AlwaysUpToDateExtension {
val paperBranchName: Property<String>
val paperRepoName: Property<String>
val paperCommitName: Property<String>
val pufferfishToggleName: Property<String>
val pufferfishBranchName: Property<String>
val pufferfishRepoName: Property<String>
val purpurBranchName: Property<String>
val purpurRepoName: Property<String>
val purpurCommitName: Property<String>
}

View File

@@ -1,72 +0,0 @@
package org.plazmamc.alwaysuptodate.tasks
import io.papermc.paperweight.util.Git
import io.papermc.paperweight.util.fromJson
import io.papermc.paperweight.util.gson
import org.gradle.api.Project
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 paper.libs.com.google.gson.JsonObject
import java.net.URI
abstract class CheckPaperCommitTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
@TaskAction
fun check() {
println(project.checkCommit(
project.property(property.paperRepoName.get()).toString(),
project.property(property.paperBranchName.get()).toString(),
property.paperCommitName.get()
))
}
}
abstract class CheckPurpurCommitTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
@TaskAction
fun check() {
println(project.checkCommit(
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
property.purpurCommitName.get()
))
}
}
fun Project.getLatest(repository: String, branch: String) : String {
val regex = "[a-z0-9]{40}\trefs/heads/$branch".toRegex()
val temp = Git(project.pathIO)("ls-remote", repository).readText()
return temp?.lines()?.first { regex.matches(it) }?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest commit of $repository")
}
fun Project.checkCommit(repository: String, branch: String, propertyName: String) : Boolean {
val latestCommit = project.getLatest(repository, branch)
val currentCommit = project.properties[propertyName] as String
return currentCommit == latestCommit
}
fun Project.createCompareComment(repository: String, branch: String, before: String, clear: Boolean = false) {
val builder = StringBuilder()
val rawRepo = URI.create(repository).path.substring(1)
if (!clear) builder.append(project.file("compare.txt").readText())
builder.append("\n\n[${rawRepo.split("/").last()} Changes]\n")
gson.fromJson<JsonObject>(URI.create("https://api.github.com/repos/$rawRepo/compare/$before...$branch").toURL().readText())["commits"].asJsonArray.forEach {
val commit = it.asJsonObject
builder.append("$rawRepo@${commit["sha"].asString.subSequence(0, 7)}: ${commit["commit"].asJsonObject["message"].asString.split("\n")[0]}\n")
}
project.file("compare.txt").writeText(builder.toString())
}

View File

@@ -1,54 +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 java.io.File
abstract class PaperUpdateTask : Task() {
private val property = project.extensions["alwaysUpToDate"] as AlwaysUpToDateExtension
override fun init() {
outputs.upToDateWhen {
project.checkCommit(
project.property(property.paperRepoName.get()).toString(),
project.property(property.paperBranchName.get()).toString(),
property.paperCommitName.get()
)
}
}
@TaskAction
fun update() {
if (project.checkCommit(
project.property(property.paperRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
property.purpurCommitName.get()
)) return
project.createCompareComment(
project.property(property.paperRepoName.get()).toString(),
project.property(property.paperBranchName.get()).toString(),
project.property(property.paperCommitName.get()).toString(),
true
)
updatePaperCommit(
project.property(property.paperRepoName.get()).toString(),
project.property(property.paperBranchName.get()).toString(),
project.file("gradle.properties")
)
}
}
fun updatePaperCommit(repo: String, branch: String, properties: File, regexRule: String = "paperCommit = ") {
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("$regexRule.*".toRegex(), "$regexRule$latestCommit"))
}

View File

@@ -1,290 +0,0 @@
package org.plazmamc.alwaysuptodate.tasks
import io.papermc.paperweight.util.Git
import io.papermc.paperweight.util.cache
import io.papermc.paperweight.util.path
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 java.nio.file.Path
import java.util.Calendar
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) ${Calendar.getInstance().get(Calendar.YEAR)} 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) ${Calendar.getInstance().get(Calendar.YEAR)} 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 {
project.checkCommit(
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
property.purpurCommitName.get()
)
}
}
private fun withoutPufferfish(dir: Path) {
val git = Git(dir)
val purpur = git.clone(
"Purpur",
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
dir
)
val purpurPatches = purpur.resolve("patches")
project.properties.let {
it[property.paperRepoName.get()].toString() to it[property.paperBranchName.get()].toString()
}.also {
updatePaperCommit(it.first, it.second, purpur.resolve("gradle.properties").toFile())
if (project.checkCommit(
it.first,
it.second,
property.paperCommitName.get()
)) return@also
project.createCompareComment(
it.first,
it.second,
project.property(property.paperCommitName.get()).toString()
)
updatePaperCommit(
it.first,
it.second,
project.file("gradle.properties")
)
}
val latestCommit = git("ls-remote", project.property(property.purpurRepoName.get()).toString()).readText()?.lines()
?.filterNot { "[a-z0-9]{40}\trefs/heads/${project.property(property.purpurBranchName.get())}".toRegex().matches(it) }
?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
val purpurGradle = Gradle(purpur)
purpurGradle("applyPatches").executeOut()
purpur.resolve("Purpur-Server").also {
val dotGit = it.resolve(".git").toFile()
dotGit.deleteRecursively()
copySource(it)
val paper = purpur.resolve(".gradle/caches/paperweight/upstreams/paper/Paper-Server")
copySource(paper)
Git(paper).addCommit("Vanilla Sources", "--author=Vanilla <auto@mated.null>")
Thread.sleep(1_000)
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
Git(it).addCommit("Purpur Server Changes\n\n$purpurCommit", "--author=granny <contact@granny.dev>")
}
purpur.resolve("Purpur-API").also {
val dotGit = it.resolve(".git").toFile()
dotGit.deleteRecursively()
val paper = purpur.resolve(".gradle/caches/paperweight/upstreams/paper/Paper-API")
paper.resolve(".git").toFile().copyRecursively(dotGit, overwrite = true)
Git(it).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-Purpur-Server-Changes.patch")
}
with(purpurPatches.resolve("api")) {
val target = it.resolve("api")
copyPatch(this, target, "0001-Purpur-API-Changes.patch")
}
}
project.file("gradle.properties").writeText(
project.file("gradle.properties").readText()
.replace("purpurCommit = .*".toRegex(), "purpurCommit = $latestCommit")
)
}
private fun withPufferfish(dir: Path) {
val git = Git(dir)
val pufferfish = git.clone(
"Pufferfish",
project.property(property.pufferfishRepoName.get()).toString(),
project.property(property.pufferfishBranchName.get()).toString(),
dir
)
val purpur = git.clone(
"Purpur",
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
dir
)
project.properties.let {
it[property.paperRepoName.get()].toString() to it[property.paperBranchName.get()].toString()
}.also {
updatePaperCommit(it.first, it.second, pufferfish.resolve("gradle.properties").toFile(), "paperRef=")
updatePaperCommit(it.first, it.second, purpur.resolve("gradle.properties").toFile())
if (project.checkCommit(
it.first,
it.second,
property.paperCommitName.get()
)) return@also
project.createCompareComment(
it.first,
it.second,
project.property(property.paperCommitName.get()).toString()
)
updatePaperCommit(
it.first,
it.second,
project.file("gradle.properties")
)
}
val latestCommit = git("ls-remote", project.property(property.purpurRepoName.get()).toString()).readText()?.lines()
?.filterNot { "[a-z0-9]{40}\trefs/heads/${project.property(property.purpurBranchName.get())}".toRegex().matches(it) }
?.first()?.split("\t")?.first()
?: throw AlwaysUpToDateException("Failed to get latest Purpur commit")
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).addCommit("Vanilla Sources", "--author=Vanilla <auto@mated.null>")
Thread.sleep(1_000)
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")
}
}
project.file("gradle.properties").writeText(project.file("gradle.properties").readText().replace("purpurCommit = .*".toRegex(), "purpurCommit = $latestCommit"))
}
@TaskAction
fun update() {
if (project.checkCommit(
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
property.purpurCommitName.get()
)) return
Git.checkForGit()
project.createCompareComment(
project.property(property.purpurRepoName.get()).toString(),
project.property(property.purpurBranchName.get()).toString(),
project.property(property.purpurCommitName.get()).toString(),
true
)
val dir = project.layout.cache.resolve("AlwaysUpToDate/UpdatePurpur")
if (dir.exists()) dir.toFile().deleteRecursively()
dir.createDirectories()
if (project.property(property.pufferfishToggleName.get()).toString().toBoolean()) withPufferfish(dir)
else withoutPufferfish(dir)
}
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", ".").executeOut()
this("commit", "-m", *args).executeOut()
}

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

14
fxapi
View File

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

14
fxsrv
View File

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

View File

@@ -1,21 +1,20 @@
group = org.plazmamc.plazma
org.gradle.daemon = true
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.plazmamc.alwaysuptodate.paper.repository = https://github.com/PaperMC/Paper
org.plazmamc.alwaysuptodate.purpur.repository = https://github.com/PurpurMC/Purpur
paper.runMemoryGb = 8
paper.runDisableWatchdog = true
version = 1.20.6-R0.1-SNAPSHOT
mcVersion = 1.20.6
jdkVersion = 21
group = org.plazmamc.plazma
brandKey = plazmamc:plazma
brandName = Plazma
providerName = PlazmaMC
providerRepo = PlazmaMC/PlazmaBukkit
paperBranch = master
purpurBranch = ver/1.20.6
pufferfishBranch = ver/1.20
usePufferfish = false
version = 1.21.4-R0.1-SNAPSHOT
mcVersion = 1.21.4
paperCommit = 0db72ac19e735d398e85b2152d5a32317bb03dc8
purpurCommit = 1ddead8ef8f0d1e2fcfb32e30c8dbe18792a53d7
paperCommit = b746d9df0b6b7765478b2a72c2d963b6e668fa35
purpurCommit = f06fd5bb3880e660ecfb43beaadf8ddac175fa8f

View File

@@ -1,15 +1,15 @@
[versions]
shadow = "8.1.1"
paperweight = "1.6.2"
shadow = "8.3.5"
remapper = "0.10.3"
paperclip = "3.0.3"
paperweight = "1.7.7"
decompiler = "1.10.1"
remapper = "0.10.1"
[libraries]
paperclip = { group = "io.papermc", name = "paperclip", version.ref = "paperclip" }
remapper = { group = "net.fabricmc", name = "tiny-remapper", version.ref="remapper" }
decompiler = { group = "org.vineflower", name = "vineflower", version.ref = "decompiler" }
paperclip = { group = "io.papermc", name = "paperclip", version.ref = "paperclip" }
[plugins]
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
paperweight = { id = "io.papermc.paperweight.patcher", version.ref = "paperweight" }

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.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

2
gradlew vendored
View File

@@ -55,7 +55,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/.

184
gradlew.bat vendored
View File

@@ -1,92 +1,92 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
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.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
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.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
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
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
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
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

136
initDev Executable file
View File

@@ -0,0 +1,136 @@
#!/bin/bash
# To initialize your development environment,
# run below command in your terminal:
# source ./initDev
PROJECT_DIR=$(pwd)
alias cl="clear;"
alias src="cd $PROJECT_DIR;"
alias ca="cd $PROJECT_DIR/*-API || exit 1; vs;"
alias cg="cd $PROJECT_DIR/paper-api-generator/generated || exit 1; vs;"
alias cs="cd $PROJECT_DIR/*-Server || exit 1; vs;"
alias fa="ca __generate_fixup_patch"
alias fg="cg __generate_fixup_patch"
alias fs="cs __generate_fixup_patch"
alias gradle="./gradlew" # TODO: Paperweight will not work with Gradle 8.10.2
alias gr="cd $PROJECT_DIR; gradle"
alias grc="gr --no-rebuild"
alias ap="grc applyPatches"
alias aap="grc applyAPIPatches"
alias agp="grc applyGeneratedAPIPatches"
alias asp="grc applyServerPatches"
alias aap!="rm -rf $PROJECT_DIR/*-API; aap"
alias agp!="rm -rf $PROJECT_DIR/paper-api-generator/generated; agp"
alias asp!="rm -rf $PROJECT_DIR/*-Server; asp"
alias aapa="ca vpa"
alias aapc="ca vpc"
alias aapc="ca vps"
alias agpa="cg vpa"
alias agpc="cg vpc"
alias agpc="cg vps"
alias aspa="cs vpa"
alias aspc="cs vpc"
alias aspc="cs vps"
alias rp="grc rebuildPatches"
alias rap="grc rebuildAPIPatches"
alias rgp="grc rebuildGeneratedAPIPatches"
alias rsp="grc rebuildServerPatches"
alias mk="gr build"
alias mko="gr createReobfPaperclipJar"
alias mkm="gr createMojmapPaperclipJar"
alias va="git add"
alias va.="git add ."
alias vl="git log --oneline base..HEAD"
alias vr="git rebase --autosquash base"
alias vra="git rebase --abort"
alias vrc="va.; git rebase --continue"
alias vrs="git rebase --skip"
alias vp="git am --show-current-patch"
alias vpa="git am --abort"
alias vpc="git am --continue"
alias vps="git am --skip"
alias vm="git commit --fixup"
alias vs="git status"
alias vc="git commit --verbose --no-interactive"
alias vcn="vc --no-message"
alias vcm="vc --message"
alias vca="git commit --verbose --no-interactive --all"
alias vcan="git commit --verbose --no-interactive --all --no-message"
alias vcam="git commit --verbose --no-interactive --all --message"
alias ve="git commit --verbose --no-interactive --amend"
alias ven="ve --no-message"
alias vem="ve --message"
alias vea="git commit --verbose --no-interactive --all --amend"
alias vean="vea --no-message"
alias veam="vea --message"
alias as="ca src"
alias al="ca vl"
alias ac="ca va.; vcm"
alias am="ca vm"
alias ae="ca ve"
alias aea="ca vea"
alias aean="ca vean"
alias aeam="ca veam"
alias gs="cg src"
alias gl="cg vl"
alias gc="cg va.; vcm"
alias gm="cg vm"
alias ge="cg ve"
alias gea="cg vea"
alias gean="cg vean"
alias geam="cg veam"
alias ss="cs src"
alias sl="cs vl"
alias sc="cs va.; vcm"
alias sm="cs vm"
alias se="cs ve"
alias sea="cs vea"
alias sean="cs vean"
alias seam="cs veam"
function __generate_fixup_patch() {
garg="."
[[ "$1" == "-x" ]] && garg="--amend"
git add .
git commit "$garg" -m "fixup"
git format-patch -1
mv 0001-fixup.patch ../ -f
cd ../
}
# Commit Updated Upstream
function cuu() {
# shellcheck disable=SC2059
printf "Updated Upstream ($1)$(/bin/cat compare.txt)" | git commit -F -
}
git update-index --assume-unchanged ./build-data/dev-imports.txt
if [ ! -L "$PROJECT_DIR/upstream" ]; then
grc applyPatches
ln -dsf "$PROJECT_DIR/.gradle/caches/paperweight/upstreams/paper" "$PROJECT_DIR/upstream"
fi

View File

@@ -1,29 +1,47 @@
[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 = "2.0.9"
bungeechat = "1.20-R0.2"
brigadier = "1.2.9"
guava = "33.3.1-jre"
gson = "2.11.0"
bungeechat = "1.20-R0.2-deprecated+build.19"
# snakeyaml
joml = "1.10.8"
json-simple = "1.1.1"
annotations = "24.0.1"
fastutil = "8.5.15"
# adventure
# log4j
slf4j-api = "2.0.9"
sentry = "5.4.0"
# asm
# mvn
annotations = "24.1.0"
checkerqual = "3.21.0"
jspecify = "1.0.0"
[libraries]
joml = { group = "org.joml", name = "joml", version.ref = "joml" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
brigadier = { group = "com.mojang", name = "brigadier", version.ref = "brigadier" }
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" }
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
bungeechat = { group = "net.md-5", name = "bungeecord-chat", version.ref = "bungeechat" }
joml = { group = "org.joml", name = "joml", version.ref = "joml" }
jsonsimple = { group = "com.googlecode.json-simple", name = "json-simple", version.ref = "json-simple" }
fastutil = { group = "it.unimi.dsi", name = "fastutil", version.ref = "fastutil" }
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j-api" }
sentry = { group = "io.sentry", name = "sentry", version.ref = "sentry" }
annotations = { group = "org.jetbrains", name = "annotations", version.ref = "annotations" }
checkerqual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerqual" }
jspecify = { group = "org.jspecify", name = "jspecify", version.ref = "jspecify" }
[bundles]
api = [ "guava", "gson", "joml", "fastutil", "slf4j-api", "sentry" ]
api = [ "brigadier", "guava", "gson", "fastutil", "slf4j", "sentry", "jspecify" ]
annotations = [ "annotations", "checkerqual" ]

View File

@@ -1,45 +1,73 @@
[versions]
asm = "9.6"
log4j = "2.19.0"
mockito = "5.5.0"
jupiter = "5.10.0"
hamcrest = "2.2"
snakeyaml = "2.2"
adventure = "4.17.0-SNAPSHOT"
adventure = "4.17.0"
log4j = "2.24.1"
asm = "9.7.1"
mvn = "3.9.6"
mvn-resolver = "1.9.18"
commons-lang2 = "2.6"
commons-lang3 = "3.12.0"
maven-provider = "3.9.6"
maven-resolver = "1.9.18"
snakeyaml = "2.2"
junit = "1.10.0"
junit-jupiter = "5.10.0"
junit-pioneer = "2.2.0"
hamcrest = "2.2"
mockito = "5.14.1"
[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-logger-slf4j = { group = "net.kyori", name = "adventure-text-logger-slf4j", 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" }
log4j = { group = "org.apache.logging.log4j", name = "log4j-core", version.ref = "log4j" }
log4j-api = { group = "org.apache.logging.log4j", name = "log4j-api", version.ref = "log4j" }
log4j-stream = { group = "org.apache.logging.log4j", name = "log4j-iostreams", version.ref = "log4j" }
asm = { 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" }
mvn = { group = "org.apache.maven", name = "maven-resolver-provider", version.ref = "mvn" }
mvn-connector = { group = "org.apache.maven.resolver", name = "maven-resolver-connector-basic", version.ref = "mvn-resolver" }
mvn-transport = { group = "org.apache.maven.resolver", name = "maven-resolver-transport-http", version.ref = "mvn-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" }
snakeyaml = { group = "org.yaml", name = "snakeyaml", version.ref = "snakeyaml" }
junit = { group = "org.junit.platform", name = "junit-platform-suite-engine", version.ref = "junit" }
junit-jupiter = { group = "org.junit.jupiter", name = "junit-jupiter", version.ref = "junit-jupiter" }
junit-pioneer = { group = "org.junit-pioneer", name = "junit-pioneer", version.ref = "junit-pioneer" }
hamcrest = { group = "org.hamcrest", name = "hamcrest", version.ref = "hamcrest" }
mockito = { group = "org.mockito", name = "mockito-core", version.ref = "mockito" }
[bundles]
asm = [ "asm-head", "asm-commons" ]
test = [ "jupiter", "hamcrest", "mockito", "asm-tree" ]
maven = [ "maven-connector", "maven-transport" ]
adventure = [ "adventure-api", "adventure-slf4j", "adventure-minimessage", "adventure-serializer-gson", "adventure-serializer-plain", "adventure-serializer-legacy" ]
asm = [ "asm", "asm-commons" ]
mvn = [ "mvn-connector", "mvn-transport" ]
test = [
"junit-jupiter",
"hamcrest",
"mockito",
"asm-tree"
]
adventure = [
"adventure-api",
"adventure-minimessage",
"adventure-logger-slf4j",
"adventure-serializer-gson",
"adventure-serializer-plain",
"adventure-serializer-legacy"
]

View File

@@ -1,49 +1,94 @@
[versions]
art = "2.0.3"
concurrentutil = "0.0.2"
jline = "3.27.1"
tca = "1.3.0"
upnp = "1.0"
ansi = "1.0.3"
jansi = "3.21.0"
rhino = "1.7.14"
mysql = "8.2.0"
sqlite = "3.42.0.1"
pioneer = "2.2.0"
haproxy = "4.1.97.Final"
rewriter = "0.0.1"
srgutils = "1.0.9"
velocity = "3.1.2-SNAPSHOT"
disruptor = "3.4.4"
simpleyaml = "1.8.4"
classgraph = "4.8.47"
mapping-io = "0.5.0"
# adventure
# log4j
netty = "4.1.97.Final"
# asm
configurate = "4.2.0-SNAPSHOT"
# commons2
sqlite = "3.47.0.0"
mysql = "9.1.0"
disruptor = "3.4.4"
velocity = "3.3.0-SNAPSHOT"
# mvn
# snakeyaml
simpleyaml = "1.8.4"
rhino = "1.7.14"
upnp = "1.0"
classgraph = "4.8.47"
# test (junit, hamcrest, mockito, asm-tree)
srgutils = "1.0.9"
art = "2.0.3"
rewriter = "0.0.3"
spark-api = "0.1-20240720.200737-2"
spark = "1.10.119-SNAPSHOT"
[libraries]
art = { group = "net.neoforged", name = "AutoRenamingTool", version.ref = "art" }
tca = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="tca" }
ansi = { group = "net.kyori", name = "ansi", version.ref = "ansi" }
upnp = { group = "dev.omega24", name = "upnp4j", version.ref = "upnp" }
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" }
pioneer = { group = "org.junit-pioneer", name = "junit-pioneer", version.ref = "pioneer" }
haproxy = { group = "io.netty", name = "netty-codec-haproxy", version.ref = "haproxy" }
srgutils = { group = "net.neoforged", name = "srgutils", version.ref = "srgutils" }
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" }
concurrentutil = { group = "ca.spottedleaf", name = "concurrentutil", version.ref = "concurrentutil" }
jline-ffm = { group = "org.jline", name = "jline-terminal-ffm", version.ref = "jline" }
jline-jni = { group = "org.jline", name = "jline-terminal-jni", version.ref = "jline" }
tca = { group = "net.minecrell", name = "terminalconsoleappender", version.ref="tca" }
# adventure
# log4j
netty-haproxy = { group = "io.netty", name = "netty-codec-haproxy", version.ref = "netty" }
# asm
configurate-yaml = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
# commons2
sqlite = { group = "org.xerial", name = "sqlite-jdbc", version.ref = "sqlite" }
mysql = { group = "com.mysql", name = "mysql-connector-j", version.ref = "mysql" }
disruptor = { group = "com.lmax", name = "disruptor", version.ref = "disruptor" }
velocity-native = { group = "com.velocitypowered", name = "velocity-native", version.ref = "velocity" }
# snakeyaml
simpleyaml = { group = "com.github.carleslc.Simple-YAML", name = "Simple-Yaml", version.ref = "simpleyaml" }
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
rhino-runtime = { group = "org.mozilla", name = "rhino-runtime", version.ref = "rhino" }
rhino-engine = { group = "org.mozilla", name = "rhino-engine", version.ref = "rhino" }
upnp = { group = "dev.omega24", name = "upnp4j", version.ref = "upnp" }
classgraph = { group = "io.github.classgraph", name = "classgraph", version.ref = "classgraph" }
# test (junit, hamcrest, mockito, asm-tree)
srgutils = { group = "net.neoforged", name = "srgutils", version.ref = "srgutils" }
art = { group = "net.neoforged", name = "AutoRenamingTool", version.ref = "art" }
rewriter = { group = "io.papermc", name = "reflection-rewriter", version.ref = "rewriter" }
rewriter-runtime = { group = "io.papermc", name = "reflection-rewriter-runtime", version.ref = "rewriter" }
rewriter-generator = { group = "io.papermc", name = "reflection-rewriter-proxy-generator", version.ref = "rewriter" }
rewriter-proxy = { group = "io.papermc", name = "reflection-rewriter-proxy-generator", version.ref = "rewriter" }
spark-api = { group = "me.lucko", name = "spark-api", version.ref = "spark-api" }
spark = { group = "me.lucko", name = "spark-paper", version.ref = "spark" }
[bundles]
runtime = [ "sqlite", "mysql", "disruptor" ]
implementation = [ "jansi", "tca", "ansi", "upnp", "haproxy", "configurate", "mappingio", "rhino-engine", "rhino-runtime", "srgutils", "art", "rewriter", "rewriter-runtime", "rewriter-generator" ]
test = [ "classgraph", "pioneer" ]
test = [ "classgraph" ]
implementation = [
"concurrentutil",
"jline-ffm",
"jline-jni",
"tca",
"netty-haproxy",
"configurate-yaml",
"velocity-native",
"rhino-runtime",
"rhino-engine",
"upnp",
"srgutils",
"art",
"rewriter",
"rewriter-runtime",
"rewriter-proxy",
"spark-api",
"spark"
]

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,897 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 10 Jan 2024 12:43:26 +0900
Subject: [PATCH] Reduce allocations
diff --git a/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java b/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
index ad1eeebe6de219143492b94da309cb54ae9e0a5b..f83bdcf5d2d6f676b2dc83bc1fc0a7453fc2b36a 100644
--- a/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
+++ b/src/main/java/ca/spottedleaf/starlight/common/light/StarLightEngine.java
@@ -38,6 +38,7 @@ public abstract class StarLightEngine {
AxisDirection.POSITIVE_X, AxisDirection.NEGATIVE_X,
AxisDirection.POSITIVE_Z, AxisDirection.NEGATIVE_Z
};
+ private static final AxisDirection[] EMPTY_DIRECTIONS = new AxisDirection[0]; // Plazma - Reduce allocations
protected static enum AxisDirection {
@@ -1094,7 +1095,7 @@ public abstract class StarLightEngine {
for (int bitset = i, len = Integer.bitCount(i), index = 0; index < len; ++index, bitset ^= IntegerUtil.getTrailingBit(bitset)) {
directions.add(AXIS_DIRECTIONS[IntegerUtil.trailingZeros(bitset)]);
}
- OLD_CHECK_DIRECTIONS[i] = directions.toArray(new AxisDirection[0]);
+ OLD_CHECK_DIRECTIONS[i] = directions.toArray(EMPTY_DIRECTIONS); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
index e7fe98ea30ae6d0baea3ec1f9f98a89502a49a12..7663ccd247b9942ccfb7a320b047ee621fc1bebe 100644
--- a/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
+++ b/src/main/java/com/destroystokyo/paper/antixray/ChunkPacketBlockControllerAntiXray.java
@@ -97,8 +97,8 @@ public final class ChunkPacketBlockControllerAntiXray extends ChunkPacketBlockCo
Set<BlockState> presetBlockStateSet = new LinkedHashSet<>();
// Therefore addAll(Collection<? extends E>) is used, which guarantees this order in the doc
presetBlockStateSet.addAll(presetBlockStateList);
- presetBlockStates = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateSet.toArray(new BlockState[0]);
- presetBlockStatesFull = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateList.toArray(new BlockState[0]);
+ presetBlockStates = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateSet.toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
+ presetBlockStatesFull = presetBlockStateSet.isEmpty() ? new BlockState[]{Blocks.DIAMOND_ORE.defaultBlockState()} : presetBlockStateList.toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
presetBlockStatesStone = null;
presetBlockStatesDeepslate = null;
presetBlockStatesNetherrack = null;
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
index 0133ea6feb1ab88f021f66855669f58367e7420b..a04049bc7738225633ac0b01c470cfbfde86c032 100644
--- a/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/EntityList.java
@@ -17,9 +17,9 @@ public final class EntityList implements Iterable<Entity> {
this.entityToIndex.defaultReturnValue(Integer.MIN_VALUE);
}
- protected static final Entity[] EMPTY_LIST = new Entity[0];
+ //protected static final Entity[] EMPTY_LIST = new Entity[0]; // Plazma - Reduce allocations
- protected Entity[] entities = EMPTY_LIST;
+ protected Entity[] entities = org.plazmamc.plazma.constants.Empty.ENTITY; // Plazma - Reduce allocations
protected int count;
public int size() {
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
index 277cfd9d1e8fff5d9b5e534b75c3c5162d58b0b7..30d8d9c2dce5e4eb26cc52a03bc395c16c04c256 100644
--- a/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/IBlockDataList.java
@@ -20,9 +20,9 @@ public final class IBlockDataList {
this.map.defaultReturnValue(Long.MAX_VALUE);
}
- private static final long[] EMPTY_LIST = new long[0];
+ //private static final long[] EMPTY_LIST = new long[0]; // Plazma - Reduce allocations
- private long[] byIndex = EMPTY_LIST;
+ private long[] byIndex = org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
private int size;
public static int getLocationKey(final int x, final int y, final int z) {
diff --git a/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java b/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
index 190c5f0b02a3d99054704ae1afbffb3498ddffe1..042ea49ec61ee327c0f67ddcf080774042e44c02 100644
--- a/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
+++ b/src/main/java/com/destroystokyo/paper/util/maplist/ReferenceList.java
@@ -15,9 +15,9 @@ public final class ReferenceList<E> implements Iterable<E> {
this.referenceToIndex.defaultReturnValue(Integer.MIN_VALUE);
}
- protected static final Object[] EMPTY_LIST = new Object[0];
+ //protected static final Object[] EMPTY_LIST = new Object[0]; // Plazma - Reduce allocations
- protected Object[] references = EMPTY_LIST;
+ protected Object[] references = org.plazmamc.plazma.constants.Empty.OBJECT; // Plazma - Reduce allocations
protected int count;
public int size() {
diff --git a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
index 049e20407..bbd0b944c 100644
--- a/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
+++ b/src/main/java/io/papermc/paper/chunk/system/scheduling/ChunkTaskScheduler.java
@@ -42,6 +42,7 @@ import java.util.function.Consumer;
public final class ChunkTaskScheduler {
private static final Logger LOGGER = LogUtils.getClassLogger();
+ private static final ChunkInfo[] EMPTY_INFO = new ChunkInfo[0]; // Plazma - Reduce allocations
static int newChunkSystemIOThreads;
static int newChunkSystemWorkerThreads;
@@ -854,7 +855,7 @@ public final class ChunkTaskScheduler {
public static ChunkInfo[] getChunkInfos() {
synchronized (WAITING_CHUNKS) {
- return WAITING_CHUNKS.toArray(new ChunkInfo[0]);
+ return WAITING_CHUNKS.toArray(EMPTY_INFO); // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java b/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
index ae60bd96b5284d54676d8e7e4dd5d170b526ec1e..359c4b080bd47234e569dce7055da03ddb7b1e90 100644
--- a/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
+++ b/src/main/java/io/papermc/paper/command/subcommands/VersionCommand.java
@@ -14,7 +14,7 @@ public final class VersionCommand implements PaperSubcommand {
public boolean execute(final CommandSender sender, final String subCommand, final String[] args) {
final @Nullable Command ver = MinecraftServer.getServer().server.getCommandMap().getCommand("version");
if (ver != null) {
- ver.execute(sender, "paper", new String[0]);
+ ver.execute(sender, "paper", org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
}
return true;
}
diff --git a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
index 3e82ea07c..692bef556 100644
--- a/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
+++ b/src/main/java/io/papermc/paper/plugin/manager/PaperPluginInstanceManager.java
@@ -47,6 +47,8 @@ import java.util.logging.Level;
class PaperPluginInstanceManager {
private static final FileProviderSource FILE_PROVIDER_SOURCE = new FileProviderSource("File '%s'"::formatted);
+ private static final JavaPlugin[] EMPTY_JPLUGIN = new JavaPlugin[0]; // Plazma - Reduce allocations
+ private static final Plugin[] EMPTY_PLUGIN = new Plugin[0]; // Plazma - Reduce allocations
private final List<Plugin> plugins = new ArrayList<>();
private final Map<String, Plugin> lookupNames = new HashMap<>();
@@ -68,7 +70,7 @@ class PaperPluginInstanceManager {
}
public @NotNull Plugin[] getPlugins() {
- return this.plugins.toArray(new Plugin[0]);
+ return this.plugins.toArray(EMPTY_PLUGIN); // Plazma - Reduce allocations
}
public boolean isPluginEnabled(@NotNull String name) {
@@ -133,7 +135,7 @@ class PaperPluginInstanceManager {
this.server.getLogger().log(Level.SEVERE, "Unknown error occurred while loading plugins through PluginManager.", e);
}
- return runtimePluginEntrypointHandler.getPluginProviderStorage().getLoaded().toArray(new JavaPlugin[0]);
+ return runtimePluginEntrypointHandler.getPluginProviderStorage().getLoaded().toArray(EMPTY_JPLUGIN); // Plazma - Reduce allocations
}
// The behavior of this is that all errors are logged instead of being thrown
diff --git a/src/main/java/io/papermc/paper/util/CollisionUtil.java b/src/main/java/io/papermc/paper/util/CollisionUtil.java
index ee8e9c0e3..f2598e139 100644
--- a/src/main/java/io/papermc/paper/util/CollisionUtil.java
+++ b/src/main/java/io/papermc/paper/util/CollisionUtil.java
@@ -1149,7 +1149,7 @@ public final class CollisionUtil {
}
private static final MergedVoxelCoordinateList EMPTY = new MergedVoxelCoordinateList(
- new double[] { 0.0 }, 0.0, new int[0], new int[0], 0
+ new double[] { 0.0 }, 0.0, org.plazmamc.plazma.constants.Empty.INT, org.plazmamc.plazma.constants.Empty.INT, 0 // Plazma - Reduce allocations
);
private static int[] getIndices(final int length) {
diff --git a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
index c78cbec447032de9fe69748591bef6be300160ed..8ca248e844e73685a8d44a966144657315a799aa 100644
--- a/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
+++ b/src/main/java/io/papermc/paper/world/ChunkEntitySlices.java
@@ -304,7 +304,7 @@ public final class ChunkEntitySlices {
protected static final class BasicEntityList<E extends Entity> {
- protected static final Entity[] EMPTY = new Entity[0];
+ //protected static final Entity[] EMPTY = new Entity[0]; // Plazma - Reduce allocations
protected static final int DEFAULT_CAPACITY = 4;
protected E[] storage;
@@ -315,7 +315,7 @@ public final class ChunkEntitySlices {
}
public BasicEntityList(final int cap) {
- this.storage = (E[])(cap <= 0 ? EMPTY : new Entity[cap]);
+ this.storage = (E[])(cap <= 0 ? org.plazmamc.plazma.constants.Empty.ENTITY : new Entity[cap]);
}
public boolean isEmpty() {
@@ -327,7 +327,7 @@ public final class ChunkEntitySlices {
}
private void resize() {
- if (this.storage == EMPTY) {
+ if (this.storage == org.plazmamc.plazma.constants.Empty.ENTITY) {
this.storage = (E[])new Entity[DEFAULT_CAPACITY];
} else {
this.storage = Arrays.copyOf(this.storage, this.storage.length * 2);
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
index c5a3f9c2daf3da135cccecb757353534e1688821..e5585c6befeef62ecf130e8dabbe6b78f9e90a65 100644
--- a/src/main/java/net/minecraft/CrashReport.java
+++ b/src/main/java/net/minecraft/CrashReport.java
@@ -30,7 +30,7 @@ public class CrashReport {
@Nullable
private File saveFile;
private boolean trackingStackTrace = true;
- private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0];
+ private StackTraceElement[] uncategorizedStackTrace = org.plazmamc.plazma.constants.Empty.TRACE; // Plazma - Reduce allocations
private final SystemReport systemReport = new SystemReport();
public CrashReport(String message, Throwable cause) {
diff --git a/src/main/java/net/minecraft/CrashReportCategory.java b/src/main/java/net/minecraft/CrashReportCategory.java
index 2176171954609fd88f97f93408e14e018c1d6eaa..2a5576dc66a9b1f56e06ba47bef4fe882935c382 100644
--- a/src/main/java/net/minecraft/CrashReportCategory.java
+++ b/src/main/java/net/minecraft/CrashReportCategory.java
@@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState;
public class CrashReportCategory {
private final String title;
private final List<CrashReportCategory.Entry> entries = Lists.newArrayList();
- private StackTraceElement[] stackTrace = new StackTraceElement[0];
+ private StackTraceElement[] stackTrace = org.plazmamc.plazma.constants.Empty.TRACE; // Plazma - Reduce allocations
public CrashReportCategory(String title) {
this.title = title;
diff --git a/src/main/java/net/minecraft/Util.java b/src/main/java/net/minecraft/Util.java
index 01a12f4d6f3c2f09bffc78692443b9fd391db45a..9a6e4538dd09263544f39c93f5f1480dc589fb4d 100644
--- a/src/main/java/net/minecraft/Util.java
+++ b/src/main/java/net/minecraft/Util.java
@@ -409,7 +409,7 @@ public class Util {
} else if (futures.size() == 1) {
return futures.get(0).thenApply(List::of);
} else {
- CompletableFuture<Void> completableFuture = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
+ CompletableFuture<Void> completableFuture = CompletableFuture.allOf(futures.toArray(org.plazmamc.plazma.constants.Empty.FUTURE)); // Plazma - Reduce allocations
return completableFuture.thenApply(void_ -> futures.stream().map(CompletableFuture::join).toList());
}
}
diff --git a/src/main/java/net/minecraft/nbt/ByteArrayTag.java b/src/main/java/net/minecraft/nbt/ByteArrayTag.java
index 06648f9751fd8a322d0809ffebf6a544596ee1a4..b0ea87e2ed8f9bf04b33c2ff8a827d4f6f57a435 100644
--- a/src/main/java/net/minecraft/nbt/ByteArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/ByteArrayTag.java
@@ -175,7 +175,7 @@ public class ByteArrayTag extends CollectionTag<ByteTag> {
}
public void clear() {
- this.data = new byte[0];
+ this.data = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/nbt/CompoundTag.java b/src/main/java/net/minecraft/nbt/CompoundTag.java
index 4e005b7b0..059a1e49f 100644
--- a/src/main/java/net/minecraft/nbt/CompoundTag.java
+++ b/src/main/java/net/minecraft/nbt/CompoundTag.java
@@ -409,7 +409,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, ByteArrayTag.TYPE, var3));
}
- return new byte[0];
+ return org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
}
public int[] getIntArray(String key) {
@@ -421,7 +421,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, IntArrayTag.TYPE, var3));
}
- return new int[0];
+ return org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
public long[] getLongArray(String key) {
@@ -433,7 +433,7 @@ public class CompoundTag implements Tag {
throw new ReportedException(this.createReport(key, LongArrayTag.TYPE, var3));
}
- return new long[0];
+ return org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
}
public CompoundTag getCompound(String key) {
diff --git a/src/main/java/net/minecraft/nbt/IntArrayTag.java b/src/main/java/net/minecraft/nbt/IntArrayTag.java
index ff13d67151c50ea11a45117e524c7524e2b1a202..5048ec707c147b9a5b2dd8736d518d938ba95df0 100644
--- a/src/main/java/net/minecraft/nbt/IntArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/IntArrayTag.java
@@ -186,7 +186,7 @@ public class IntArrayTag extends CollectionTag<IntTag> {
}
public void clear() {
- this.data = new int[0];
+ this.data = org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/nbt/ListTag.java b/src/main/java/net/minecraft/nbt/ListTag.java
index 154bffd34..83c36d452 100644
--- a/src/main/java/net/minecraft/nbt/ListTag.java
+++ b/src/main/java/net/minecraft/nbt/ListTag.java
@@ -258,7 +258,7 @@ public class ListTag extends CollectionTag<Tag> {
}
}
- return new int[0];
+ return org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
public long[] getLongArray(int index) {
@@ -269,7 +269,7 @@ public class ListTag extends CollectionTag<Tag> {
}
}
- return new long[0];
+ return org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
}
public double getDouble(int index) {
diff --git a/src/main/java/net/minecraft/nbt/LongArrayTag.java b/src/main/java/net/minecraft/nbt/LongArrayTag.java
index 2e5c34ebb94a1536cf09d71bdf052a49ecb9159d..144d3bbe80fc0f459a06017a19929e3e849aabd0 100644
--- a/src/main/java/net/minecraft/nbt/LongArrayTag.java
+++ b/src/main/java/net/minecraft/nbt/LongArrayTag.java
@@ -185,7 +185,7 @@ public class LongArrayTag extends CollectionTag<LongTag> {
@Override
public void clear() {
- this.data = new long[0];
+ this.data = org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/nbt/NbtIo.java b/src/main/java/net/minecraft/nbt/NbtIo.java
index 9f659af04..d2969c1ce 100644
--- a/src/main/java/net/minecraft/nbt/NbtIo.java
+++ b/src/main/java/net/minecraft/nbt/NbtIo.java
@@ -277,7 +277,7 @@ public class NbtIo {
@Nullable
public static CompoundTag read(Path path) throws IOException {
- if (!Files.exists(path, new LinkOption[0])) {
+ if (!Files.exists(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
return null;
} else {
InputStream inputstream = Files.newInputStream(path);
diff --git a/src/main/java/net/minecraft/network/CipherBase.java b/src/main/java/net/minecraft/network/CipherBase.java
index a2920b8a9eff77d9c5d1d7f70ad3abdacba8f0fa..70d776d5cfdb0612f65d92333d6f872afedc2207 100644
--- a/src/main/java/net/minecraft/network/CipherBase.java
+++ b/src/main/java/net/minecraft/network/CipherBase.java
@@ -7,8 +7,8 @@ import javax.crypto.ShortBufferException;
public class CipherBase {
private final Cipher cipher;
- private byte[] heapIn = new byte[0];
- private byte[] heapOut = new byte[0];
+ private byte[] heapIn = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
+ private byte[] heapOut = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
protected CipherBase(Cipher cipher) {
this.cipher = cipher;
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
index 9f274048b..ba54c16f1 100644
--- a/src/main/java/net/minecraft/network/Connection.java
+++ b/src/main/java/net/minecraft/network/Connection.java
@@ -316,7 +316,7 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
}
private void validateListener(ProtocolInfo<?> state, PacketListener listener) {
- Validate.notNull(listener, "packetListener", new Object[0]);
+ Validate.notNull(listener, "packetListener"/*, new Object[0]*/); // Plazma - Reduce allocations
PacketFlow enumprotocoldirection = listener.flow();
String s;
diff --git a/src/main/java/net/minecraft/network/chat/Component.java b/src/main/java/net/minecraft/network/chat/Component.java
index 6dcade427..4a0b4b0fa 100644
--- a/src/main/java/net/minecraft/network/chat/Component.java
+++ b/src/main/java/net/minecraft/network/chat/Component.java
@@ -189,7 +189,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
}
static MutableComponent translatable(String key) {
- return MutableComponent.create(new TranslatableContents(key, (String) null, TranslatableContents.NO_ARGS));
+ return MutableComponent.create(new TranslatableContents(key, (String) null, org.plazmamc.plazma.constants.Empty.OBJECT)); // Plazma - Reduce allocations
}
static MutableComponent translatable(String key, Object... args) {
@@ -209,7 +209,7 @@ public interface Component extends Message, FormattedText, Iterable<Component> {
}
static MutableComponent translatableWithFallback(String key, @Nullable String fallback) {
- return MutableComponent.create(new TranslatableContents(key, fallback, TranslatableContents.NO_ARGS));
+ return MutableComponent.create(new TranslatableContents(key, fallback, org.plazmamc.plazma.constants.Empty.OBJECT)); // Plazma - Reduce allocations
}
static MutableComponent translatableWithFallback(String key, @Nullable String fallback, Object... args) {
diff --git a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
index 4aa6232bf..84e8a29f0 100644
--- a/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
+++ b/src/main/java/net/minecraft/network/chat/contents/TranslatableContents.java
@@ -29,7 +29,7 @@ import net.minecraft.util.ExtraCodecs;
import net.minecraft.world.entity.Entity;
public class TranslatableContents implements ComponentContents {
- public static final Object[] NO_ARGS = new Object[0];
+ // public static final Object[] NO_ARGS = new Object[0]; // Plazma - Reduce allocations
private static final Codec<Object> PRIMITIVE_ARG_CODEC = ExtraCodecs.JAVA.validate(TranslatableContents::filterAllowedArguments);
private static final Codec<Object> ARG_CODEC = Codec.either(PRIMITIVE_ARG_CODEC, ComponentSerialization.CODEC)
.xmap(
@@ -69,7 +69,7 @@ public class TranslatableContents implements ComponentContents {
}
private static Object[] adjustArgs(Optional<List<Object>> args) {
- return args.<Object[]>map(list -> list.isEmpty() ? NO_ARGS : list.toArray()).orElse(NO_ARGS);
+ return args.<Object[]>map(list -> list.isEmpty() ? org.plazmamc.plazma.constants.Empty.OBJECT : list.toArray()).orElse(org.plazmamc.plazma.constants.Empty.OBJECT); // Plazma - Reduce allocations
}
private static TranslatableContents create(String key, Optional<String> fallback, Optional<List<Object>> args) {
diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
index 1a37654af..0e61f8cb3 100644
--- a/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundSectionBlocksUpdatePacket.java
@@ -66,7 +66,7 @@ public class ClientboundSectionBlocksUpdatePacket implements Packet<ClientGamePa
public ClientboundSectionBlocksUpdatePacket(SectionPos sectionPos, it.unimi.dsi.fastutil.shorts.Short2ObjectMap<BlockState> blockChanges) {
this.sectionPos = sectionPos;
this.positions = blockChanges.keySet().toShortArray();
- this.states = blockChanges.values().toArray(new BlockState[0]);
+ this.states = blockChanges.values().toArray(org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
}
// Paper end - Multi Block Change API
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e121cc57e..7b27af22a 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1541,13 +1541,10 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private Optional<ServerStatus.Favicon> loadStatusIcon() {
- Optional<Path> optional = Optional.of(this.getFile("server-icon.png").toPath()).filter((path) -> {
- return Files.isRegularFile(path, new LinkOption[0]);
- }).or(() -> {
- return this.storageSource.getIconFile().filter((path) -> {
- return Files.isRegularFile(path, new LinkOption[0]);
- });
- });
+ // Plazma start - Reduce allocations
+ Optional<Path> optional = Optional.of(this.getFile("server-icon.png").toPath()).filter(Files::isRegularFile)
+ .or(() -> this.storageSource.getIconFile().filter(Files::isRegularFile));
+ // Plazma end
return optional.flatMap((path) -> {
try {
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index ef520d1dd..b3b0c18b4 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -130,7 +130,7 @@ public class PlayerAdvancements {
}
private void load(ServerAdvancementManager advancementLoader) {
- if (Files.isRegularFile(this.playerSavePath, new LinkOption[0])) {
+ if (Files.isRegularFile(this.playerSavePath/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
try {
JsonReader jsonreader = new JsonReader(Files.newBufferedReader(this.playerSavePath, StandardCharsets.UTF_8));
diff --git a/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java b/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
index 0f52e8a61ca7e57e9f52473dceb9cc3464c0c86d..f54bde32760541a653460682e5a3ddd0b2ceec51 100644
--- a/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
+++ b/src/main/java/net/minecraft/server/RunningOnDifferentThreadException.java
@@ -4,12 +4,12 @@ public final class RunningOnDifferentThreadException extends RuntimeException {
public static final RunningOnDifferentThreadException RUNNING_ON_DIFFERENT_THREAD = new RunningOnDifferentThreadException();
private RunningOnDifferentThreadException() {
- this.setStackTrace(new StackTraceElement[0]);
+ this.setStackTrace(org.plazmamc.plazma.constants.Empty.TRACE); // Plazma - Reduce allocations
}
@Override
public synchronized Throwable fillInStackTrace() {
- this.setStackTrace(new StackTraceElement[0]);
+ this.setStackTrace(org.plazmamc.plazma.constants.Empty.TRACE); // Plazma - Reduce allocations
return this;
}
}
diff --git a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
index bae0d208b31aa0a6977c30f2f8484ab3c316bc71..981c3023044f3cc6dc22ada20cd4bedcf7a28db3 100644
--- a/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
+++ b/src/main/java/net/minecraft/server/ServerFunctionLibrary.java
@@ -92,7 +92,7 @@ public class ServerFunctionLibrary implements PreparableReloadListener {
}, prepareExecutor));
}
- CompletableFuture<?>[] completableFutures = map.values().toArray(new CompletableFuture[0]);
+ CompletableFuture<?>[] completableFutures = map.values().toArray(org.plazmamc.plazma.constants.Empty.FUTURE); // Plazma - Reduce allocations
return CompletableFuture.allOf(completableFutures).handle((unused, ex) -> map);
}
);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 4e6fccec4..618dc900d 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -112,6 +112,7 @@ import org.bukkit.craftbukkit.generator.CustomChunkGenerator;
public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider {
+ private static final ServerPlayerConnection[] EMPTY_CONNECTION = new ServerPlayerConnection[0]; // Plazma - Reduce allocations
private static final byte CHUNK_TYPE_REPLACEABLE = -1;
private static final byte CHUNK_TYPE_UNKNOWN = 0;
private static final byte CHUNK_TYPE_FULL = 1;
@@ -1361,7 +1362,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// stuff could have been removed, so we need to check the trackedPlayers set
// for players that were removed
- for (ServerPlayerConnection conn : this.seenBy.toArray(new ServerPlayerConnection[0])) { // avoid CME
+ for (ServerPlayerConnection conn : this.seenBy.toArray(EMPTY_CONNECTION)) { // avoid CME // Plazma - Reduce allocations
if (newTrackerCandidates == null || !newTrackerCandidates.contains(conn.getPlayer())) {
this.updatePlayer(conn.getPlayer());
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f72af2feb..0aaa0e63f 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -1439,7 +1439,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
public static List<Entity> getCurrentlyTickingEntities() {
Entity ticking = currentlyTickingEntity.get();
- List<Entity> ret = java.util.Arrays.asList(ticking == null ? new Entity[0] : new Entity[] { ticking });
+ List<Entity> ret = java.util.Arrays.asList(ticking == null ? org.plazmamc.plazma.constants.Empty.ENTITY : new Entity[] { ticking }); // Plazma - Reduce allocations
return ret;
}
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
index 3b4fadb37..f276fe09f 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -165,12 +165,12 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleHello(ServerboundHelloPacket packet) {
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet", new Object[0]);
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.HELLO, "Unexpected hello packet"/*, new Object[0]*/); // Plazma - Reduce allocations
// Paper start - Validate usernames
if (io.papermc.paper.configuration.GlobalConfiguration.get().proxies.isProxyOnlineMode()
&& io.papermc.paper.configuration.GlobalConfiguration.get().unsupportedSettings.performUsernameValidation
&& !this.iKnowThisMayNotBeTheBestIdeaButPleaseDisableUsernameValidation) {
- Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username", new Object[0]);
+ Validate.validState(StringUtil.isReasonablePlayerName(packet.name()), "Invalid characters in username"/*, new Object[0]*/); // Plazma - Reduce allocations
}
// Paper end - Validate usernames
this.requestedUsername = packet.name();
@@ -268,7 +268,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleKey(ServerboundKeyPacket packet) {
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.KEY, "Unexpected key packet", new Object[0]);
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.KEY, "Unexpected key packet"/*, new Object[0]*/); // Plazma - Reduce allocations
final String s;
@@ -448,7 +448,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
@Override
public void handleLoginAcknowledgement(ServerboundLoginAcknowledgedPacket packet) {
- Validate.validState(this.state == ServerLoginPacketListenerImpl.State.PROTOCOL_SWITCHING, "Unexpected login acknowledgement packet", new Object[0]);
+ Validate.validState(this.state == ServerLoginPacketListenerImpl.State.PROTOCOL_SWITCHING, "Unexpected login acknowledgement packet"/*, new Object[0]*/); // Plazma - Reduce allocations
this.connection.setupOutboundProtocol(ConfigurationProtocols.CLIENTBOUND);
CommonListenerCookie commonlistenercookie = CommonListenerCookie.createInitial((GameProfile) Objects.requireNonNull(this.authenticatedProfile), this.transferred);
ServerConfigurationPacketListenerImpl serverconfigurationpacketlistenerimpl = new ServerConfigurationPacketListenerImpl(this.server, this.connection, commonlistenercookie, this.player); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b863f6fe6..068c7619b 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 org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[] EMPTY_FLAG = new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]; // Plazma - Reduce allocations
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();
@@ -815,7 +816,7 @@ public abstract class PlayerList {
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason) {
// Paper start - Expand PlayerRespawnEvent
- return respawn(entityplayer, worldserver, flag, location, avoidSuffocation, reason, new org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag[0]);
+ return respawn(entityplayer, worldserver, flag, location, avoidSuffocation, reason, EMPTY_FLAG); // Plazma - Reduce allocations
}
public ServerPlayer respawn(ServerPlayer entityplayer, ServerLevel worldserver, boolean flag, Location location, boolean avoidSuffocation, RespawnReason reason, org.bukkit.event.player.PlayerRespawnEvent.RespawnFlag...respawnFlags) {
diff --git a/src/main/java/net/minecraft/server/players/StoredUserList.java b/src/main/java/net/minecraft/server/players/StoredUserList.java
index c038da20b..b6cab933d 100644
--- a/src/main/java/net/minecraft/server/players/StoredUserList.java
+++ b/src/main/java/net/minecraft/server/players/StoredUserList.java
@@ -76,7 +76,7 @@ public abstract class StoredUserList<K, V extends StoredUserEntry<K>> {
}
public String[] getUserList() {
- return (String[]) this.map.keySet().toArray(new String[0]);
+ return this.map.keySet().toArray(org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
}
public boolean isEmpty() {
diff --git a/src/main/java/net/minecraft/util/MemoryReserve.java b/src/main/java/net/minecraft/util/MemoryReserve.java
index 0ee04fe6ff6a4d09754f326526ae04fe7226bab2..5663ce568a1daa638b7387bee8b9917ce1f64d14 100644
--- a/src/main/java/net/minecraft/util/MemoryReserve.java
+++ b/src/main/java/net/minecraft/util/MemoryReserve.java
@@ -11,6 +11,6 @@ public class MemoryReserve {
}
public static void release() {
- reserve = new byte[0];
+ reserve = org.plazmamc.plazma.constants.Empty.BYTE; // Plazma - Reduce allocations
}
}
diff --git a/src/main/java/net/minecraft/util/ZeroBitStorage.java b/src/main/java/net/minecraft/util/ZeroBitStorage.java
index 01f5b946fabbe34f31110e75973dab9f39897346..2564c21900df7ca3c58872741ec8f68bce80a903 100644
--- a/src/main/java/net/minecraft/util/ZeroBitStorage.java
+++ b/src/main/java/net/minecraft/util/ZeroBitStorage.java
@@ -5,7 +5,7 @@ import java.util.function.IntConsumer;
import org.apache.commons.lang3.Validate;
public class ZeroBitStorage implements BitStorage {
- public static final long[] RAW = new long[0];
+ // public static final long[] RAW = new long[0]; // Plazma - Reduce allocations
private final int size;
public ZeroBitStorage(int size) {
@@ -33,7 +33,7 @@ public class ZeroBitStorage implements BitStorage {
@Override
public long[] getRaw() {
- return RAW;
+ return org.plazmamc.plazma.constants.Empty.LONG; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
index f34159f8d..4088ec804 100644
--- a/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/ComposterBlock.java
@@ -57,6 +57,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
public static final Object2FloatMap<ItemLike> COMPOSTABLES = new Object2FloatOpenHashMap();
private static final int AABB_SIDE_THICKNESS = 2;
private static final VoxelShape OUTER_SHAPE = Shapes.block();
+ private static final int[] ZERO_INT = new int[]{0}; // Plazma - Reduce allocations // Plazma - Reduce allocations
private static final VoxelShape[] SHAPES = (VoxelShape[]) Util.make(new VoxelShape[9], (avoxelshape) -> {
for (int i = 0; i < 8; ++i) {
avoxelshape[i] = Shapes.join(ComposterBlock.OUTER_SHAPE, Block.box(2.0D, (double) Math.max(2, 1 + i * 2), 2.0D, 14.0D, 16.0D, 14.0D), BooleanOp.ONLY_FIRST);
@@ -458,7 +459,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return side == Direction.DOWN ? new int[]{0} : new int[0];
+ return side == Direction.DOWN ? ZERO_INT : org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
@Override
@@ -507,7 +508,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return side == Direction.UP ? new int[]{0} : new int[0];
+ return side == Direction.UP ? ZERO_INT : org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
@Override
@@ -549,7 +550,7 @@ public class ComposterBlock extends Block implements WorldlyContainerHolder {
@Override
public int[] getSlotsForFace(Direction side) {
- return new int[0];
+ return org.plazmamc.plazma.constants.Empty.INT; // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
index 1362a4794..2490b63cb 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFile.java
@@ -445,7 +445,7 @@ public class RegionFile implements AutoCloseable {
this.path = path;
initOversizedState(); // Paper
this.version = compressionFormat;
- if (!Files.isDirectory(directory, new LinkOption[0])) {
+ if (!Files.isDirectory(directory/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
throw new IllegalArgumentException("Expected directory, got " + String.valueOf(directory.toAbsolutePath()));
} else {
this.externalFileDir = directory;
@@ -717,7 +717,7 @@ public class RegionFile implements AutoCloseable {
private DataInputStream createExternalChunkInputStream(ChunkPos pos, byte flags) throws IOException {
Path path = this.getExternalChunkPath(pos);
- if (!Files.isRegularFile(path, new LinkOption[0])) {
+ if (!Files.isRegularFile(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
RegionFile.LOGGER.error("External chunk path {} is not file", path);
return null;
} else {
@@ -769,7 +769,7 @@ public class RegionFile implements AutoCloseable {
return false;
}
- if (!Files.isRegularFile(this.getExternalChunkPath(pos), new LinkOption[0])) {
+ if (!Files.isRegularFile(this.getExternalChunkPath(pos)/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
return false;
}
} else {
diff --git a/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java b/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
index b8e333e79..b6012d360 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/DebugLevelSource.java
@@ -89,7 +89,7 @@ public class DebugLevelSource extends ChunkGenerator {
@Override
public NoiseColumn getBaseColumn(int x, int z, LevelHeightAccessor world, RandomState noiseConfig) {
- return new NoiseColumn(0, new BlockState[0]);
+ return new NoiseColumn(0, org.plazmamc.plazma.constants.Empty.BLOCK_STATE); // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
index 399da9d43aefbb95897df4697860d5bce5317152..df7816c1c5f069d89a22dbd876a2d663ba68949f 100644
--- a/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
+++ b/src/main/java/net/minecraft/world/level/storage/LevelStorageSource.java
@@ -110,7 +110,7 @@ public class LevelStorageSource {
}
public static DirectoryValidator parseValidator(Path allowedSymlinksFile) {
- if (Files.exists(allowedSymlinksFile, new LinkOption[0])) {
+ if (Files.exists(allowedSymlinksFile/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
try {
BufferedReader bufferedreader = Files.newBufferedReader(allowedSymlinksFile);
@@ -189,7 +189,7 @@ public class LevelStorageSource {
}
public LevelStorageSource.LevelCandidates findLevelCandidates() throws LevelStorageException {
- if (!Files.isDirectory(this.baseDir, new LinkOption[0])) {
+ if (!Files.isDirectory(this.baseDir/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
throw new LevelStorageException(Component.translatable("selectWorld.load_folder_access"));
} else {
try {
@@ -198,11 +198,12 @@ public class LevelStorageSource {
LevelStorageSource.LevelCandidates convertable_a;
try {
- List<LevelStorageSource.LevelDirectory> list = stream.filter((path) -> {
- return Files.isDirectory(path, new LinkOption[0]);
- }).map(LevelStorageSource.LevelDirectory::new).filter((convertable_b) -> {
- return Files.isRegularFile(convertable_b.dataFile(), new LinkOption[0]) || Files.isRegularFile(convertable_b.oldDataFile(), new LinkOption[0]);
- }).toList();
+ // Plazma start - Reduce allocations
+ List<LevelStorageSource.LevelDirectory> list = stream.filter(Files::isDirectory)
+ .map(LevelStorageSource.LevelDirectory::new)
+ .filter(convertable_b -> Files.isRegularFile(convertable_b.dataFile()) || Files.isRegularFile(convertable_b.oldDataFile()))
+ .toList();
+ // Plazma end
convertable_a = new LevelStorageSource.LevelCandidates(list);
} catch (Throwable throwable) {
@@ -312,7 +313,7 @@ public class LevelStorageSource {
private LevelSummary readLevelSummary(LevelStorageSource.LevelDirectory save, boolean locked) {
Path path = save.dataFile();
- if (Files.exists(path, new LinkOption[0])) {
+ if (Files.exists(path/*, new LinkOption[0]*/)) { // Plazma - Reduce allocations
try {
if (Files.isSymbolicLink(path)) {
List<ForbiddenSymlinkInfo> list = this.worldDirValidator.validateSymlink(path);
@@ -411,7 +412,7 @@ public class LevelStorageSource {
public boolean levelExists(String name) {
try {
- return Files.isDirectory(this.getLevelPath(name), new LinkOption[0]);
+ return Files.isDirectory(this.getLevelPath(name)/*, new LinkOption[0]*/); // Plazma - Reduce allocations
} catch (InvalidPathException invalidpathexception) {
return false;
}
@@ -752,7 +753,7 @@ public class LevelStorageSource {
}
public boolean hasWorldData() {
- return Files.exists(this.levelDirectory.dataFile(), new LinkOption[0]) || Files.exists(this.levelDirectory.oldDataFile(), new LinkOption[0]);
+ return Files.exists(this.levelDirectory.dataFile()/*, new LinkOption[0]*/) || Files.exists(this.levelDirectory.oldDataFile()/*, new LinkOption[0]*/); // Plazma - Reduce allocations
}
public void close() throws IOException {
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 63e187c65cb855031f286aad0d25ac4694f7a331..e0f085169fafa5e574caf368efa343514540b348 100644
--- a/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
+++ b/src/main/java/net/minecraft/world/level/storage/PlayerDataStorage.java
@@ -124,7 +124,7 @@ public class PlayerDataStorage {
String[] astring = this.playerDir.list();
if (astring == null) {
- astring = new String[0];
+ astring = org.plazmamc.plazma.constants.Empty.STRING; // Plazma - Reduce allocations
}
for (int i = 0; i < astring.length; ++i) {
diff --git a/src/main/java/net/minecraft/world/scores/Team.java b/src/main/java/net/minecraft/world/scores/Team.java
index f00791b89fdb1bb0fb358eff2af2e687bda15e85..aa16c93a4333b603729e2704b92f6d38aec0fd7b 100644
--- a/src/main/java/net/minecraft/world/scores/Team.java
+++ b/src/main/java/net/minecraft/world/scores/Team.java
@@ -70,7 +70,7 @@ public abstract class Team {
public final int id;
public static String[] getAllNames() {
- return BY_NAME.keySet().toArray(new String[0]);
+ return BY_NAME.keySet().toArray(org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
}
@Nullable
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
index fb2d05e43df3bfb72b1f6e325736dd3cbc6c3096..de4e1d713e5ec182ea8d4832b8359556095ac214 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
@@ -426,7 +426,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
public void sendTitle(Title title) {
Preconditions.checkNotNull(title, "Title is null");
setTitleTimes(title.getFadeIn(), title.getStay(), title.getFadeOut());
- setSubtitle(title.getSubtitle() == null ? new BaseComponent[0] : title.getSubtitle());
+ setSubtitle(title.getSubtitle() == null ? org.plazmamc.plazma.constants.Empty.BASE_COMPONENT : title.getSubtitle()); // Plazma - Reduce allocations
showTitle(title.getTitle());
}
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
index c5d1ba7a1be3f102edcdfdc05fc50b30ef1f775b..66006d9ff581ac96f13389261de0cd647279b98a 100644
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaBook.java
@@ -610,7 +610,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
throw new IllegalArgumentException("Invalid page number " + page + "/" + CraftMetaBook.this.getPageCount());
}
- BaseComponent[] newText = text == null ? new BaseComponent[0] : text;
+ BaseComponent[] newText = text == null ? org.plazmamc.plazma.constants.Empty.BASE_COMPONENT : text; // Plazma - Reduce allocations
CraftMetaBook.this.pages.set(page - 1, this.componentsToPage(newText));
}
@@ -623,7 +623,7 @@ public class CraftMetaBook extends CraftMetaItem implements BookMeta {
public void addPage(final BaseComponent[]... pages) {
for (BaseComponent[] page : pages) {
if (page == null) {
- page = new BaseComponent[0];
+ page = org.plazmamc.plazma.constants.Empty.BASE_COMPONENT; // Plazma - Reduce allocations
}
CraftMetaBook.this.internalAddPage(this.componentsToPage(page));
diff --git a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
index b25dc23b81687dd4d4e70b3615ffb91f8c03c68b..acb98770b9d01e930642a5794f9179660b411c02 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/WeakCollection.java
@@ -164,7 +164,7 @@ public final class WeakCollection<T> implements Collection<T> {
@Override
public Object[] toArray() {
- return this.toArray(new Object[0]);
+ return this.toArray(org.plazmamc.plazma.constants.Empty.OBJECT); // Plazma - Reduce allocations
}
@Override
diff --git a/src/main/java/org/plazmamc/plazma/constants/Empty.java b/src/main/java/org/plazmamc/plazma/constants/Empty.java
new file mode 100644
index 0000000000000000000000000000000000000000..2b6eb7997986ab73ccb3b1baca945a3234ae916e
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/constants/Empty.java
@@ -0,0 +1,20 @@
+package org.plazmamc.plazma.constants;
+
+public interface Empty {
+
+ int[] INT = new int[0];
+ long[] LONG = new long[0];
+ byte[] BYTE = new byte[0];
+
+ Object[] OBJECT = new Object[0];
+ String[] STRING = new String[0];
+ StackTraceElement[] TRACE = new StackTraceElement[0];
+ java.util.concurrent.CompletableFuture<?>[] FUTURE = new java.util.concurrent.CompletableFuture[0];
+
+ net.minecraft.world.level.block.state.BlockState[] BLOCK_STATE = new net.minecraft.world.level.block.state.BlockState[0];
+ net.minecraft.world.entity.Entity[] ENTITY = new net.minecraft.world.entity.Entity[0];
+
+ @SuppressWarnings("deprecation")
+ net.md_5.bungee.api.chat.BaseComponent[] BASE_COMPONENT = new net.md_5.bungee.api.chat.BaseComponent[0];
+
+}
diff --git a/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java b/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
index 2621e54879e9ab0029a875f1d09eee67878b90d5..e7e959368c01de69261618d1eb749bebba3527af 100644
--- a/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
+++ b/src/main/java/org/purpurmc/purpur/command/PurpurCommand.java
@@ -57,7 +57,7 @@ public class PurpurCommand extends Command {
} else if (args[0].equalsIgnoreCase("version")) {
Command verCmd = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
if (verCmd != null) {
- return verCmd.execute(sender, commandLabel, new String[0]);
+ return verCmd.execute(sender, commandLabel, org.plazmamc.plazma.constants.Empty.STRING); // Plazma - Reduce allocations
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -5,42 +5,45 @@ Subject: [PATCH] Use Gradle Version Catalogs
diff --git a/build.gradle.kts b/build.gradle.kts
index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633b696e3ab 100644
index 49546dfbb4dd006b5a2419908890ba4c2a0e207a..d3c92a382acbf414bf7e704870d252cc88c5d9db 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,11 +9,13 @@ java {
withJavadocJar()
}
+/*
+/* // Plazma - Use Gradle Version Catalogs
val annotationsVersion = "24.1.0"
val bungeeCordChatVersion = "1.20-R0.2"
val adventureVersion = "4.17.0-SNAPSHOT"
val adventureVersion = "4.17.0"
val slf4jVersion = "2.0.9"
val log4jVersion = "2.17.1"
+ */
+ */ // Plazma - Use Gradle Version Catalogs
val apiAndDocs: Configuration by configurations.creating {
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
@@ -27,54 +29,31 @@ configurations.api {
}
@@ -39,60 +41,31 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
// Paper end - configure mockito agent that is needed in newer java versions
dependencies {
- api("com.mojang:brigadier:1.2.9") // Paper - Brigadier command api
- // api dependencies are listed transitively to API consumers
- api("com.google.guava:guava:32.1.2-jre")
- api("com.google.code.gson:gson:2.10.1")
- api("com.google.guava:guava:33.3.1-jre")
- api("com.google.code.gson:gson:2.11.0")
- // Paper start - adventure
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.18") {
- api("net.md-5:bungeecord-chat:$bungeeCordChatVersion-deprecated+build.19") {
- exclude("com.google.guava", "guava")
- }
- // Paper - adventure
- api("org.yaml:snakeyaml:2.2")
- api("org.joml:joml:1.10.5")
- api("org.joml:joml:1.10.8") {
- isTransitive = false // https://github.com/JOML-CI/JOML/issues/352
- }
- // Paper start
- api("com.googlecode.json-simple:json-simple:1.1.1") {
- isTransitive = false // includes junit
- }
- api("it.unimi.dsi:fastutil:8.5.6")
- api("it.unimi.dsi:fastutil:8.5.15")
- apiAndDocs(platform("net.kyori:adventure-bom:$adventureVersion"))
- apiAndDocs("net.kyori:adventure-api")
- apiAndDocs("net.kyori:adventure-text-minimessage")
@@ -50,9 +53,10 @@ index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633
- 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.7")
- implementation("org.ow2.asm:asm-commons:9.7")
- implementation("org.ow2.asm:asm:9.7.1")
- implementation("org.ow2.asm:asm-commons:9.7.1")
- // Paper end
-
- api("org.apache.maven:maven-resolver-provider:3.9.6") // Paper - make API dependency for Paper Plugins
@@ -68,59 +72,63 @@ index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633
- compileOnlyApi(checkerQual)
- testCompileOnly(checkerQual)
- // Paper end
- api("org.jspecify:jspecify:1.0.0") // Paper - add jspecify
-
- testImplementation("org.apache.commons:commons-lang3:3.12.0")
- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
- testImplementation("org.hamcrest:hamcrest:2.2")
- testImplementation("org.mockito:mockito-core:5.11.0")
- testImplementation("org.ow2.asm:asm-tree:9.7")
+
- testImplementation("org.mockito:mockito-core:5.14.1")
- testImplementation("org.ow2.asm:asm-tree:9.7.1")
- mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions
+ // Plazma start - Use Gradle Version Catalogs
+ implementation(common.bundles.asm)
+
+ api(api.bundles.api)
+ api(common.snakeyaml)
+ api(common.log4j.api)
+ api(common.maven.provider)
+ api(api.bungeechat) { exclude("com.google.guava", "guava") }
+ api(common.snakeyaml)
+ api(api.joml) { isTransitive = false }
+ api(api.jsonsimple) { isTransitive = false }
+ apiAndDocs(platform(common.adventure.bom))
+ apiAndDocs(common.bundles.adventure)
+
+ compileOnly(common.bundles.maven)
+ api(common.log4j.api)
+
+ implementation(common.bundles.asm)
+
+ api(common.mvn)
+ compileOnly(common.bundles.mvn)
+
+ compileOnly(api.annotations)
+ testCompileOnly(api.annotations)
+
+ compileOnlyApi(api.checkerqual)
+
+ testImplementation(common.asm.tree)
+ testCompileOnly(api.checkerqual)
+
+ testImplementation(common.commons.lang3)
+ testImplementation(common.bundles.test)
+
+ testCompileOnly(api.annotations)
+ testCompileOnly(api.checkerqual)
+ mockitoAgent(common.mockito) { isTransitive = false }
+ // Plazma end
+
}
// Paper start
@@ -128,25 +107,16 @@ tasks.withType<Javadoc> {
@@ -177,27 +150,25 @@ tasks.withType<Javadoc> {
options.use()
options.isDocFilesSubDirs = true
options.links(
- "https://guava.dev/releases/32.1.2-jre/api/docs/",
- "https://guava.dev/releases/33.3.1-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
- // "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/1.10.8/index.html",
- "https://www.javadoc.io/doc/com.google.code.gson/gson/2.11.0",
- "https://jspecify.dev/docs/api/",
- // 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://jd.advntr.dev/api/$adventureVersion/",
- "https://jd.advntr.dev/key/$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/",
- // Paper end
@@ -131,9 +139,18 @@ index 892e78b1d2d29dc54def03fcb6d85a93ad56d84c..cd64328dd664821a23ba2765e82dd633
+ "https://javadoc.io/doc/org.jetbrains/annotations/${api.annotations.orNull?.version}/",
+ "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}",
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.api.orNull?.version}/",
+ "https://jspecify.dev/docs/api/", //diff on change
+ "https://jd.advntr.dev/api/${common.adventure.api.orNull?.version}/",
+ "https://jd.advntr.dev/key/${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.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
+ "https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.orNull?.version}/",
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/${common.log4j.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.maven.connector.orNull?.version}",
+ "https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.mvn.connector.orNull?.version}",
+ // Plazma end
)
options.tags("apiNote:a:API Note:")

View File

@@ -0,0 +1,93 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Tue, 14 May 2024 18:36:30 +0900
Subject: [PATCH] Fork-friendly Rebranding
diff --git a/src/main/java/co/aikar/timings/TimingHandler.java b/src/main/java/co/aikar/timings/TimingHandler.java
index 199789d56d22fcb1b77ebd56805cc28aa5a5ab0a..41d10421e1e79711e2e90ff2dc225bfd9cac9284 100644
--- a/src/main/java/co/aikar/timings/TimingHandler.java
+++ b/src/main/java/co/aikar/timings/TimingHandler.java
@@ -127,7 +127,7 @@ class TimingHandler implements Timing {
while ((last = TIMING_STACK.removeLast()) != this) {
last.timingDepth = 0;
if ("Minecraft".equalsIgnoreCase(last.identifier.group)) {
- Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Look above this for any errors and report this to Paper unless it has a plugin in the stack trace (" + last.identifier + " did not stopTiming)");
+ Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Look above this for any errors and report this to " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " unless it has a plugin in the stack trace (" + last.identifier + " did not stopTiming)"); // Plazma - Fork-friendly Rebranding
} else {
Logger.getGlobal().log(Level.SEVERE, "TIMING_STACK_CORRUPTION - Report this to the plugin " + last.identifier.group + " (Look for errors above this in the logs) (" + last.identifier + " did not stopTiming)", new Throwable());
}
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfo.java b/src/main/java/io/papermc/paper/ServerBuildInfo.java
index 7196594e07af19a14c320d77df893978525fe386..6ac3376f12df2ee3e0519ab8b5a0c8211350e550 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfo.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfo.java
@@ -33,6 +33,29 @@ public interface ServerBuildInfo {
Key BRAND_PURPUR_ID = Key.key("purpurmc", "purpur");
// Purpur end
+ // Plazma start - Fork-friendly Rebranding
+ /**
+ * The brand id for Plazma.
+ */
+ Key BRAND_PLAZMA_ID = Key.key("plazmamc", "plazma");
+
+ // For those who fork Plazma - please add the new branding key here
+
+ /**
+ * The brand id of the server.
+ */
+ Key BRAND_ID = BRAND_PLAZMA_ID;
+
+ /**
+ * Supported brands of the server.
+ */
+ java.util.List<Key> SUPPORTED_BRANDS = java.util.Arrays.asList(
+ BRAND_PAPER_ID,
+ BRAND_PURPUR_ID,
+ BRAND_PLAZMA_ID
+ );
+ // Plazma end - Fork-friendly Rebranding
+
/**
* Gets the {@code ServerBuildInfo}.
*
diff --git a/src/main/java/org/bukkit/command/defaults/VersionCommand.java b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
index c880d0010849ab733ad13bbd18fab3c864d0cf61..316317222a137c2781b9b0c38948912e9dd08c76 100644
--- a/src/main/java/org/bukkit/command/defaults/VersionCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/VersionCommand.java
@@ -259,7 +259,7 @@ public class VersionCommand extends BukkitCommand {
// Purpur start
int distance = getVersionFetcher().distance();
final Component message = Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()),
- ChatColor.parseMM("<grey>Current Purpur Version: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()),
+ ChatColor.parseMM("<grey>Current " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + " Version: %s%s*", distance == 0 ? "<green>" : distance > 0 ? "<yellow>" : "<red>", Bukkit.getVersion()), // Plazma - Fork-friendly Rebranding
// Purpur end
msg
);
@@ -282,6 +282,7 @@ public class VersionCommand extends BukkitCommand {
}
}
+ /* // Plazma - Fork-friendly Rebranding
private static int getDistance(@NotNull String repo, @NotNull String hash) {
try {
BufferedReader reader = Resources.asCharSource(
@@ -302,4 +303,5 @@ public class VersionCommand extends BukkitCommand {
return -1;
}
}
+ */ // Plazma - Fork-friendly Rebranding
}
diff --git a/src/main/java/org/bukkit/plugin/EventExecutor.java b/src/main/java/org/bukkit/plugin/EventExecutor.java
index 60e086be70529e0804280b24a2a3e7ae72d8d363..dcf1d53af919e94a6947bc3f81121bd4fad1a163 100644
--- a/src/main/java/org/bukkit/plugin/EventExecutor.java
+++ b/src/main/java/org/bukkit/plugin/EventExecutor.java
@@ -54,7 +54,7 @@ public interface EventExecutor {
if (m.getReturnType() != Void.TYPE) {
final org.bukkit.plugin.java.JavaPlugin plugin = org.bukkit.plugin.java.JavaPlugin.getProvidingPlugin(m.getDeclaringClass());
org.bukkit.Bukkit.getLogger().warning("@EventHandler method " + m.getDeclaringClass().getName() + (Modifier.isStatic(m.getModifiers()) ? '.' : '#') + m.getName()
- + " returns non-void type " + m.getReturnType().getName() + ". This is unsupported behavior and will no longer work in a future version of Paper."
+ + " returns non-void type " + m.getReturnType().getName() + ". This is unsupported behavior and will no longer work in a future version of " + io.papermc.paper.ServerBuildInfo.buildInfo().brandName() + "." // Plazma - Fork-friendly Rebranding
+ " This should be reported to the developers of " + plugin.getPluginMeta().getDisplayName() + " (" + String.join(",", plugin.getPluginMeta().getAuthors()) + ')');
}
if (Modifier.isStatic(m.getModifiers())) {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Plazma Configurations
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index a15d0ed710ff261f203d7e355e7d532f2e68abc9..a1d870c6523b0b382d01ca27501a4c091eb795af 100644
index ddb1ff894910761a78b91a343f32e129f03a03c4..bebe4116e50f0b0f64f6bdbd3f05f0b998225435 100644
--- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java
@@ -2266,6 +2266,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
@@ -2295,6 +2295,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
}
// Purpur end

View File

@@ -0,0 +1,26 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 6 May 2024 20:43:37 +0900
Subject: [PATCH] Various API Tweaks
diff --git a/src/main/java/com/destroystokyo/paper/MaterialTags.java b/src/main/java/com/destroystokyo/paper/MaterialTags.java
index 679f78e07a3a2de745fa237165d0a8db5e086f29..ac24a288fda957546e2832f375bd1c958db8852b 100644
--- a/src/main/java/com/destroystokyo/paper/MaterialTags.java
+++ b/src/main/java/com/destroystokyo/paper/MaterialTags.java
@@ -591,6 +591,15 @@ public class MaterialTags {
.add(material -> material.name().startsWith("DEEPSLATE_") && material.name().endsWith("_ORE"))
.ensureSize("DEEPSLATE_ORES", 8).lock();
+ // Plazma start - Various API Tweaks
+ /**
+ * Covers the variants of stone ores.
+ */
+ public static final MaterialSetTag STONE_ORES = new MaterialSetTag(keyFor("stone_ores"))
+ .add(material -> !material.name().startsWith("DEEPSLATE_") && !material.name().startsWith("NETHER_") && material.name().endsWith("_ORE"))
+ .ensureSize("STONE_ORES", 8).lock();
+ // Plazma end - Various API Tweaks
+
/**
* Covers the variants of raw ore blocks.
*/

File diff suppressed because it is too large Load Diff

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,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,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 15 Dec 2024 13:34:45 +0900
Subject: [PATCH] Temporary javadoc build fix
diff --git a/build.gradle.kts b/build.gradle.kts
index d3c92a382acbf414bf7e704870d252cc88c5d9db..64639737e96f0a0b41899fef09677a89d319c2eb 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -166,7 +166,7 @@ tasks.withType<Javadoc> {
"https://jd.advntr.dev/text-logger-slf4j/${common.adventure.api.orNull?.version}/",
"https://javadoc.io/doc/org.yaml/snakeyaml/${common.snakeyaml.orNull?.version}/",
"https://javadoc.io/doc/org.slf4j/slf4j-api/${api.slf4j.orNull?.version}/",
- "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/${common.log4j.api.orNull?.version}/",
+ "https://javadoc.io/doc/org.apache.logging.log4j/log4j-api/2.20.0/", // Plazma - TODO: log4j 2.24.2 javadocs not found
"https://javadoc.io/doc/org.apache.maven.resolver/maven-resolver-api/${common.mvn.connector.orNull?.version}",
// Plazma end
)

View File

@@ -25,10 +25,10 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
diff --git a/com/destroystokyo/paper/entity/ai/VanillaGoal.java b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
index 069f2668f5229b0368b796e65eef1648fba0a097..9b991201a2f6cc9feccccf7f4e7bcded64117764 100644
index 35dfd25f21ca67b7f4d69326500980f4a021ef49..a9816fbfa466b3fe3f82c19aeeeb564c660e4b6a 100644
--- a/com/destroystokyo/paper/entity/ai/VanillaGoal.java
+++ b/com/destroystokyo/paper/entity/ai/VanillaGoal.java
@@ -442,6 +442,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
@@ -441,6 +441,18 @@ public interface VanillaGoal<T extends Mob> extends Goal<T> {
GoalKey<Zombie> ZOMBIE_ATTACK_TURTLE_EGG = create("zombie_attack_turtle_egg", Zombie.class);
@@ -44,6 +44,6 @@ index 069f2668f5229b0368b796e65eef1648fba0a097..9b991201a2f6cc9feccccf7f4e7bcded
+ GoalKey<IronGolem> RECEIVE_FLOWER = GoalKey.of(IronGolem.class, NamespacedKey.minecraft("receive_flower"));
+ // Purpur end
+
/**
* Removed in 1.20.2
*/
private static <T extends Mob> GoalKey<T> create(final String key, final Class<T> type) {
return GoalKey.of(type, NamespacedKey.minecraft(key));
}

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Alpha <dev@alpha93.kr>
Date: Tue, 27 Feb 2024 18:36:43 +0900
Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts
index a278ee93d7001e8dc7fd2f5409c2f528c637cb2f..a00cf1659f1fd9dff3ff34561d78732645b51dfb 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,7 +9,7 @@ java {
}
dependencies {
- implementation(project(":paper-api"))
+ implementation(project(":plazma-api")) // Plazma - Rebrand
api("com.mojang:brigadier:1.0.18")
compileOnly("it.unimi.dsi:fastutil:8.5.6")

File diff suppressed because it is too large Load Diff

View File

@@ -1,87 +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] Use Gradle Version Catalogs
diff --git a/build.gradle.kts b/build.gradle.kts
index 81996f00384674b29368e8bea944bdd14d631da3..feaff0406fa47ffb265ce316b057fb52aa367870 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -18,57 +18,27 @@ dependencies {
exclude("io.papermc.paper", "paper-api")
}
// Purpur end
- // Paper start
- implementation("org.jline:jline-terminal-jansi:3.21.0")
- implementation("net.minecrell:terminalconsoleappender:1.3.0")
- implementation("net.kyori:adventure-text-serializer-ansi:4.16.0") // Keep in sync with adventureVersion from Paper-API build file
- /*
- Required to add the missing Log4j2Plugins.dat file from log4j-core
- which has been removed by Mojang. Without it, log4j has to classload
- all its classes to check if they are plugins.
- Scanning takes about 1-2 seconds so adding this speeds up the server start.
- */
- implementation("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - implementation
- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins
+
+ // Plazma start - Use Gradle Version Catalogs
+ implementation(server.bundles.implementation)
+ implementation(common.asm.commons)
+ implementation(common.log4j.iostreams)
+ implementation(common.commons.lang2)
+ implementation(server.velocity) { isTransitive = false }
+
+ runtimeOnly(common.maven.provider)
+ runtimeOnly(common.bundles.maven)
+ runtimeOnly(server.bundles.runtime)
+
+ implementation(common.log4j.core) // Paper - implementation
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j.core) // Paper - Needed to generate meta for our Log4j plugins
runtimeOnly(log4jPlugins.output)
alsoShade(log4jPlugins.output)
- implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
- // Paper end
- implementation("org.apache.logging.log4j:log4j-iostreams:2.22.1") // Paper - remove exclusion
- implementation("org.ow2.asm:asm-commons:9.7")
- implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
- implementation("commons-lang:commons-lang:2.6")
- runtimeOnly("org.xerial:sqlite-jdbc:3.45.3.0")
- runtimeOnly("com.mysql:mysql-connector-j:8.3.0")
- runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
- // Paper start - Use Velocity cipher
- implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
- isTransitive = false
- }
- // Paper end - Use Velocity cipher
-
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
-
- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur
- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur
- implementation("dev.omega24:upnp4j:1.0") // Purpur
-
- testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
- testImplementation("org.hamcrest:hamcrest:2.2")
- testImplementation("org.mockito:mockito-core:5.11.0")
- testImplementation("org.ow2.asm:asm-tree:9.7")
- testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
- implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
- implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins
- // Paper start - Remap reflection
- val reflectionRewriterVersion = "0.0.1"
- implementation("io.papermc:reflection-rewriter:$reflectionRewriterVersion")
- implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
- implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
- // Paper end - Remap reflection
+
+ testImplementation(server.bundles.test)
+ testImplementation(common.bundles.test)
+ // Plazma end - Use Gradle Version Catalogs
+
}
paperweight {

View File

@@ -0,0 +1,71 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sat, 2 Nov 2024 15:26:27 +0900
Subject: [PATCH] mc dev fixes
diff --git a/src/main/java/net/minecraft/server/commands/DebugCommand.java b/src/main/java/net/minecraft/server/commands/DebugCommand.java
index 06568cc308e06b16f43ec7facd5e2c4e36f3fee9..c3374d11753d8cd152784727bf7ed08d18931136 100644
--- a/src/main/java/net/minecraft/server/commands/DebugCommand.java
+++ b/src/main/java/net/minecraft/server/commands/DebugCommand.java
@@ -271,5 +271,12 @@ public class DebugCommand {
public void close() {
IOUtils.closeQuietly((Writer)this.output);
}
+
+ // Plazma start - Decompile fixes
+ @Override
+ public org.bukkit.command.CommandSender getBukkitSender(final CommandSourceStack wrapper) {
+ return wrapper.getBukkitSender();
+ }
+ // Plazma end - Decompile fixes
}
}
diff --git a/src/main/java/net/minecraft/server/commands/ReturnCommand.java b/src/main/java/net/minecraft/server/commands/ReturnCommand.java
index 9f82ca1fee2a319d52a4106c3581f5e9a9554a9e..f5c7748117342dedd9d600881143c206e429fe5b 100644
--- a/src/main/java/net/minecraft/server/commands/ReturnCommand.java
+++ b/src/main/java/net/minecraft/server/commands/ReturnCommand.java
@@ -16,18 +16,18 @@ import net.minecraft.commands.execution.tasks.BuildContexts;
import net.minecraft.commands.execution.tasks.FallthroughTask;
public class ReturnCommand {
- public static <T extends ExecutionCommandSource<T>> void register(CommandDispatcher<T> dispatcher) {
- dispatcher.register(
- (LiteralArgumentBuilder<T>)LiteralArgumentBuilder.<ExecutionCommandSource>literal("return")
- .requires(source -> source.hasPermission(2))
- .then(
- RequiredArgumentBuilder.<T, Integer>argument("value", IntegerArgumentType.integer())
- .executes(new ReturnCommand.ReturnValueCustomExecutor<>())
- )
- .then(LiteralArgumentBuilder.<T>literal("fail").executes(new ReturnCommand.ReturnFailCustomExecutor<>()))
- .then(LiteralArgumentBuilder.<T>literal("run").forward(dispatcher.getRoot(), new ReturnCommand.ReturnFromCommandCustomModifier<>(), false))
+
+ // Plazma start - Decompile fixes
+ public static void register(CommandDispatcher<net.minecraft.commands.CommandSourceStack> dispatcher) {
+ dispatcher.register(net.minecraft.commands.Commands.literal("return")
+ .requires(source -> source.hasPermission(2))
+ .then(net.minecraft.commands.Commands.argument("value", IntegerArgumentType.integer())
+ .executes(new ReturnCommand.ReturnValueCustomExecutor<>()))
+ .then(net.minecraft.commands.Commands.literal("fail").executes(new ReturnCommand.ReturnFailCustomExecutor<>()))
+ .then(net.minecraft.commands.Commands.literal("run").forward(dispatcher.getRoot(), new ReturnCommand.ReturnFromCommandCustomModifier<>(), false))
);
}
+ // Plazma end - Decompile fixes
static class ReturnFailCustomExecutor<T extends ExecutionCommandSource<T>> implements CustomCommandExecutor.CommandAdapter<T> {
@Override
diff --git a/src/main/java/net/minecraft/world/entity/animal/allay/AllayAi.java b/src/main/java/net/minecraft/world/entity/animal/allay/AllayAi.java
index 3fc1ec01e1a77a169ec762a23f15b97f040ce5f8..b5464708c1fa949e7df8aed71126ccad72d66ee3 100644
--- a/src/main/java/net/minecraft/world/entity/animal/allay/AllayAi.java
+++ b/src/main/java/net/minecraft/world/entity/animal/allay/AllayAi.java
@@ -62,8 +62,8 @@ public class AllayAi {
Activity.CORE,
0,
ImmutableList.of(
- new Swim<>(0.8F),
- new AnimalPanic(2.5F),
+ new Swim<Allay>(0.8F), // Plazma - mc dev fixes
+ new AnimalPanic<Allay>(2.5F), // Plazma - mc dev fixes
new LookAtTargetSink(45, 90),
new MoveToTargetSink(),
new CountDownCooldownTicks(MemoryModuleType.LIKED_NOTEBLOCK_COOLDOWN_TICKS),

View File

@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 13 Dec 2024 13:54:22 +0900
Subject: [PATCH] Minor code optimizations
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index 1a808fc381c0c3ea1fc49bbffebddf2c550e817a..55f15f26b56b97a561054b0660ba4965bb008b36 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -1698,7 +1698,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
@Override
public List<Entity> getEntities(@Nullable Entity except, AABB box, Predicate<? super Entity> predicate) {
Profiler.get().incrementCounter("getEntities");
- List<Entity> list = Lists.newArrayList();
+ //List<Entity> list = Lists.newArrayList(); // Plazma - minor optimizations
// Paper start - rewrite chunk system
final List<Entity> ret = new java.util.ArrayList<>();

View File

@@ -1,411 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 21 Dec 2022 19:31:24 +0900
Subject: [PATCH] Rebrand
diff --git a/build.gradle.kts b/build.gradle.kts
index feaff0406fa47ffb265ce316b057fb52aa367870..902c2eeedeeced8135ec97f64f08420c0996731b 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -12,12 +12,10 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
val alsoShade: Configuration by configurations.creating
dependencies {
- // Purpur start
- implementation(project(":purpur-api"))
- implementation("io.papermc.paper:paper-mojangapi:${project.version}") {
- exclude("io.papermc.paper", "paper-api")
- }
- // Purpur end
+ // Plazma start - Rebrand
+ implementation(project(":plazma-api"))
+ implementation(project(":plazma-mojangapi"))
+ // Plazma end
// Plazma start - Use Gradle Version Catalogs
implementation(server.bundles.implementation)
@@ -57,7 +55,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 // Plazma - Setup Gradle Project
"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..1de03b16c513d83550077bab46b52ae6e40eb98e 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 - Rebrand
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 // Plazma - Rebrand
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..80159d9c8432f21aa774d3ade9e2ae84b2d5261c 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -20,10 +20,11 @@ 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 // Plazma - Rebrand
private static int distance = -2; public int distance() { return distance; }
// Purpur end
private static @Nullable String mcVer;
+ public static final boolean DEVELOPMENT = false; // Plazma
@Override
public long getCacheTime() {
@@ -33,8 +34,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 // Plazma - Rebrand
+ final Component updateMessage = getUpdateStatusMessage("PlazmaMC/PlazmaBukkit", (DEVELOPMENT ? "dev/" : "ver/") + getMinecraftVersion(), parts[0]); // Purpur // Plazma // Plazma - Rebrand
final Component history = getHistory();
return history != null ? Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()), history, updateMessage) : updateMessage; // Purpur
@@ -47,7 +48,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 // Plazma - Rebrand
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
}
@@ -57,6 +58,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 +67,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 - Disable CI Checking
switch (distance) {
case -1:
@@ -83,6 +90,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 +110,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..aa5f7dbaa62d83168055f2d389ba1ed512d1741b 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 - Rebrand
.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 c366d84518979e842a6f10f969a5951539ecac93..570b379596cc3088745d3f42b3d917f94c2d9c29 100644
--- a/src/main/java/net/minecraft/CrashReport.java
+++ b/src/main/java/net/minecraft/CrashReport.java
@@ -37,7 +37,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 - Rebrand
}
public String getTitle() {
@@ -127,7 +127,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 - Rebrand
// 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 411f1f8c6be072cfc5ba88cbec38dbc4300a41d1..2579b32009a5f5e288edf56ee8f1246cd70343fc 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -107,6 +107,26 @@ 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┛\033[0m
+ // """);
+ System.out.println("""
+
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╗\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m╗\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m \033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m╗\033[38;2;142;54;148m \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m╗\033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m╗ \033[38;2;78;81;161m \033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m╗\033[38;2;56;91;166m\s
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m█\033[38;2;196;31;137m█\033[38;2;193;33;138m╗ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m╗ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m╔\033[38;2;116;65;153m╝ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m█\033[38;2;101;72;157m╗\033[38;2;97;73;157m \033[38;2;94;75;158m█\033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m╗
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╔\033[38;2;193;33;138m╝ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m \033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m╔\033[38;2;120;64;153m╝\033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m╔\033[38;2;104;71;156m█\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m█\033[38;2;91;76;159m╔\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m═\033[38;2;196;31;137m╝\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m╔\033[38;2;123;62;152m╝\033[38;2;120;64;153m \033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m╚\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m╔\033[38;2;91;76;159m╝\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m║\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m█\033[38;2;180;38;140m█\033[38;2;177;39;141m█\033[38;2;174;41;142m█\033[38;2;170;42;142m█\033[38;2;167;43;143m╗ \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m║\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m \033[38;2;101;72;157m╚\033[38;2;97;73;157m═\033[38;2;94;75;158m╝\033[38;2;91;76;159m \033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m║\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m╚\033[38;2;212;24;134m═\033[38;2;209;26;134m╝\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m╚\033[38;2;186;35;139m═\033[38;2;183;37;140m═\033[38;2;180;38;140m═\033[38;2;177;39;141m═\033[38;2;174;41;142m═\033[38;2;170;42;142m═\033[38;2;167;43;143m╝ \033[38;2;164;45;144m╚\033[38;2;161;46;144m═\033[38;2;158;47;145m╝\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m╚\033[38;2;145;53;148m═\033[38;2;142;54;148m╝ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m═\033[38;2;126;61;151m═\033[38;2;123;62;152m═\033[38;2;120;64;153m═\033[38;2;116;65;153m╝ \033[38;2;113;67;154m╚\033[38;2;110;68;155m═\033[38;2;107;69;155m╝\033[38;2;104;71;156m \033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m \033[38;2;88;77;159m╚\033[38;2;85;79;160m═\033[38;2;81;80;161m╝ \033[38;2;78;81;161m╚\033[38;2;75;83;162m═\033[38;2;72;84;163m╝\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m╚\033[38;2;59;90;165m═\033[38;2;56;91;166m╝\033[0m
+ """);
+ // Plazma end
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index dfeae138e830e95ab823b6349a91160b02622208..e121cc57ec5bf6f5b1d81e2fd4f551063ac60d64 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -963,7 +963,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 - Rebrand
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 842f382de43df5d5c321422372ec30ccdd7859d7..5b7ed096999dbb7e95fb7d615e737f19604f58ff 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -56,7 +56,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", "A Plazma Server"); // Purpur // Plazma - Rebrand
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 8f74c2ec5252b6265549589310d742337c91cb2c..e34c3d00887240cc0f78f6b95da4116a22438626 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 - Rebrand
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 - Improve ServerGUI // Purpur
+ jframe.setName("Plazma Minecraft server"); // Paper - Improve ServerGUI // Purpur // Plazma - Rebrand
// Paper start - Improve ServerGUI
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 - Rebrand
server.halt(true);
servergui.runFinalizers();
}
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 f6e3b745fc417354380d4a969f83aee430bad785..ce0686759f0c32e9ffcb26f99503215a49873b91 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
@@ -155,7 +155,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 - Rebrand
}
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 8d754bf77cb88d8ddf964f3221183e4097f06d13..dca6cce8768c8c08e4abba249c30731dbdec7763 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -268,7 +268,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 - Rebrand
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 222865a3cee62f244a566092a7d814efe478ee01..333c8a313208652700c21fc2ac629296b5b02078 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -142,7 +142,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 - Rebrand
this.acceptsAll(Main.asList("demo"), "Demo mode");
@@ -187,7 +187,7 @@ public class Main {
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
.ofType(String.class)
- .defaultsTo("Unknown Server")
+ .defaultsTo("A Plazma Server") // Plazma - Rebrand
.describedAs("Name");
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index ca8ae8e1c51b937dac916e0b0dc94b5e2e61efeb..2058af0975e510b3f86d7dbb1811062b9b0dc342 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -503,7 +503,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 - Rebrand
// 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..0aa8dfa94368fb119644760e3686a7c01f510456 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 - Rebrand & Improve Versioning
+ 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 - Rebrand & Improve Versioning
}
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 046304d9149472eaffb3ff5f4fa22a230969de86..79456fab220fc797f0f28fc9657f3a406d751900 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 - Rebrand
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 a353eb9f45af7b7f9bfd92a4a89403335b841840..29a4709c1085d133bd7753ac9744f6c9701ac345 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 - Rebrand
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/PlazmaBukkit/issues" ); // Purpur // Plazma - Rebrand
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 - Rebrand
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
@@ -184,12 +184,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 - Rebrand
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 - Rebrand
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper - rewrite chunk system
this.dumpTickingInfo(); // Paper - log detailed tick information
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
@@ -205,7 +205,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 - Rebrand
}
log.log( Level.SEVERE, "------------------------------" );

View File

@@ -0,0 +1,129 @@
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 624588207afdc52adae14e5de3d18fe1c330d832..a40dc8b2560b8cd124d961f3dfd5865efd2a3b9e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -25,73 +25,35 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
// Paper end - configure mockito agent that is needed in newer java versions
dependencies {
- implementation(project(":purpur-api")) // Pufferfish // Paper // Purpur - Rebrand
- implementation("ca.spottedleaf:concurrentutil:0.0.2") // Paper - Add ConcurrentUtil dependency
- // Paper start
- implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
- implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
- implementation("net.minecrell:terminalconsoleappender:1.3.0")
- implementation("net.kyori:adventure-text-serializer-ansi:4.17.0") // Keep in sync with adventureVersion from Paper-API build file
- /*
- Required to add the missing Log4j2Plugins.dat file from log4j-core
- which has been removed by Mojang. Without it, log4j has to classload
- all its classes to check if they are plugins.
- Scanning takes about 1-2 seconds so adding this speeds up the server start.
- */
- implementation("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - implementation
- log4jPlugins.annotationProcessorConfigurationName("org.apache.logging.log4j:log4j-core:2.19.0") // Paper - Needed to generate meta for our Log4j plugins
- runtimeOnly(log4jPlugins.output)
- alsoShade(log4jPlugins.output)
- implementation("io.netty:netty-codec-haproxy:4.1.97.Final") // Paper - Add support for proxy protocol
- // Paper end
- implementation("org.apache.logging.log4j:log4j-iostreams:2.24.1") // Paper - remove exclusion
- implementation("org.ow2.asm:asm-commons:9.7.1")
- implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
- implementation("commons-lang:commons-lang:2.6")
- runtimeOnly("org.xerial:sqlite-jdbc:3.47.0.0")
- runtimeOnly("com.mysql:mysql-connector-j:9.1.0")
- runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
- // Paper start - Use Velocity cipher
- implementation("com.velocitypowered:velocity-native:3.3.0-SNAPSHOT") {
- isTransitive = false
- }
- // Paper end - Use Velocity cipher
+ implementation(project(":${rootProject.providers.gradleProperty("brandName").get().lowercase()}-api")) // Pufferfish // Paper // Purpur // Plazma - Fork-friendly Rebranding
+ // Plazma start - Use Gradle Version Catalogs
+ implementation(server.bundles.implementation)
+ implementation(common.adventure.serializer.ansi)
+ implementation(common.log4j.stream)
- runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
- runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
+ implementation(common.log4j)
+ log4jPlugins.annotationProcessorConfigurationName(common.log4j)
+ runtimeOnly(log4jPlugins.output) // diff on change
+ alsoShade(log4jPlugins.output) // diff on change
- // Pufferfish start
- implementation("org.yaml:snakeyaml:1.32")
- implementation ("com.github.carleslc.Simple-YAML:Simple-Yaml:1.8.4") { // Purpur - Fix pufferfish issues
- exclude(group="org.yaml", module="snakeyaml")
- }
- // Pufferfish end
+ runtimeOnly(server.bundles.runtime)
+
+ implementation(common.bundles.asm)
+ implementation(common.commons.lang2)
+ implementation(server.velocity.native) { isTransitive = false }
+
+ runtimeOnly(common.mvn)
+ runtimeOnly(common.bundles.mvn)
- implementation("org.mozilla:rhino-runtime:1.7.14") // Purpur - Rebrand
- implementation("org.mozilla:rhino-engine:1.7.14") // Purpur - Rebrand
- implementation("dev.omega24:upnp4j:1.0") // Purpur - Rebrand
+ implementation(common.snakeyaml)
+ implementation(server.simpleyaml) { exclude(group="org.yaml", module="snakeyaml") }
- testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
- testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
- testImplementation("org.junit.platform:junit-platform-suite-engine:1.10.0")
- testImplementation("org.hamcrest:hamcrest:2.2")
- testImplementation("org.mockito:mockito-core:5.14.1")
- mockitoAgent("org.mockito:mockito-core:5.14.1") { isTransitive = false } // Paper - configure mockito agent that is needed in newer java versions
- testImplementation("org.ow2.asm:asm-tree:9.7.1")
- testImplementation("org.junit-pioneer:junit-pioneer:2.2.0") // Paper - CartesianTest
- implementation("net.neoforged:srgutils:1.0.9") // Paper - mappings handling
- implementation("net.neoforged:AutoRenamingTool:2.0.3") // Paper - remap plugins
- // Paper start - Remap reflection
- val reflectionRewriterVersion = "0.0.3"
- implementation("io.papermc:reflection-rewriter:$reflectionRewriterVersion")
- implementation("io.papermc:reflection-rewriter-runtime:$reflectionRewriterVersion")
- implementation("io.papermc:reflection-rewriter-proxy-generator:$reflectionRewriterVersion")
- // Paper end - Remap reflection
- // Paper start - spark
- implementation("me.lucko:spark-api:0.1-20240720.200737-2")
- implementation("me.lucko:spark-paper:1.10.119-SNAPSHOT")
- // Paper end - spark
+ testImplementation(server.classgraph)
+ testImplementation(common.bundles.test)
+ testImplementation(common.junit)
+ mockitoAgent(common.mockito) { isTransitive = false }
+ testImplementation(common.junit.pioneer)
+ // Plazma end - Use Gradle Version Catalogs
}
paperweight {
@@ -119,14 +81,14 @@ tasks.jar {
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
- "Implementation-Title" to "Purpur", // Pufferfish // Purpur - Rebrand
+ "Implementation-Title" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
"Implementation-Version" to implementationVersion,
"Implementation-Vendor" to date, // Paper
- "Specification-Title" to "Purpur", // Pufferfish // Purpur - Rebrand
+ "Specification-Title" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
"Specification-Version" to project.version,
- "Specification-Vendor" to "Purpur Team", // Pufferfish // Purpur - Rebrand
- "Brand-Id" to "purpurmc:purpur", // Pufferfish // Purpur - Rebrand
- "Brand-Name" to "Purpur", // Pufferfish // Purpur - Rebrand
+ "Specification-Vendor" to rootProject.providers.gradleProperty("providerName").get(), // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
+ "Brand-Id" to rootProject.providers.gradleProperty("brandKey").get(), // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
+ "Brand-Name" to rootProject.providers.gradleProperty("brandName").get(), // Pufferfish // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
"Build-Number" to (build ?: ""),
"Build-Time" to Instant.now().toString(),
"Git-Branch" to gitBranch, // Paper

View File

@@ -1,319 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
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..efa53bcb692650396b2e71b62243a15dd95aa096 100644
GIT binary patch
literal 7439
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
literal 9260
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
HqBZh=dic2S

View File

@@ -0,0 +1,425 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 21 Dec 2022 19:31:24 +0900
Subject: [PATCH] Fork-friendly Rebranding
diff --git a/src/main/java/com/destroystokyo/paper/Metrics.java b/src/main/java/com/destroystokyo/paper/Metrics.java
index be1bb14dca9367b9685841985b6198376986c496..b58f4eb26ce6bd6696b3289b5f199ab8f0ff28b6 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -592,7 +592,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 - Purpur config files
+ Metrics metrics = new Metrics(io.papermc.paper.ServerBrandConstants.BRAND_NAME, serverUUID, logFailedRequests, Bukkit.getLogger()); // Pufferfish // Purpur - Purpur config files // Plazma - Fork-friendly Rebranding
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index fe66e43c27e0798770e102d1385bacbaa90bda07..1ad562a95809cf7d503f5446f8645ba8c2680914 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -36,7 +36,7 @@ public class PaperVersionFetcher implements VersionFetcher {
private static final int DISTANCE_ERROR = -1;
private static final int DISTANCE_UNKNOWN = -2;
// Purpur start - Rebrand
- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
+ // private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads"; // Plazma - Fork-friendly Rebranding
private static int distance = DISTANCE_UNKNOWN; public int distance() { return distance; }
// Purpur end - Rebrand
@@ -52,7 +52,7 @@ public class PaperVersionFetcher implements VersionFetcher {
if (build.buildNumber().isEmpty() && build.gitCommit().isEmpty()) {
updateMessage = text("You are running a development version without access to version information", color(0xFF5300));
} else {
- updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", build); // Purpur - Rebrand
+ updateMessage = getUpdateStatusMessage("PlazmaMC/Plazma", build); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
}
final @Nullable Component history = this.getHistory();
@@ -63,8 +63,12 @@ public class PaperVersionFetcher implements VersionFetcher {
//int distance = DISTANCE_ERROR; // Purpur - use field - Rebrand
final OptionalInt buildNumber = build.buildNumber();
- if (buildNumber.isPresent()) {
- distance = fetchDistanceFromSiteApi(build, buildNumber.getAsInt());
+ // Plazma start - TODO: CI Checking
+ //noinspection PointlessBooleanExpression
+ if (false && buildNumber.isPresent()) {
+ throw new UnsupportedOperationException("Version fetching from CI is not supported yet");
+ // distance = fetchDistanceFromSiteApi(build, buildNumber.getAsInt());
+ // Plazma end - TODO: CI Checking
} else {
final Optional<String> gitBranch = build.gitBranch();
final Optional<String> gitCommit = build.gitCommit();
@@ -80,12 +84,13 @@ public class PaperVersionFetcher implements VersionFetcher {
default -> text("* You are " + distance + " version(s) behind", NamedTextColor.YELLOW) // Purpur - Rebrand
.append(Component.newline())
.append(text("Download the new version at: ")
- .append(text(DOWNLOAD_PAGE, NamedTextColor.GOLD)
+ .append(text(io.papermc.paper.ServerBrandConstants.DOWNLOAD_PAGE, NamedTextColor.GOLD) // Plazma - Fork-friendly Rebranding
.hoverEvent(text("Click to open", NamedTextColor.WHITE))
- .clickEvent(ClickEvent.openUrl(DOWNLOAD_PAGE))));
+ .clickEvent(ClickEvent.openUrl(io.papermc.paper.ServerBrandConstants.DOWNLOAD_PAGE)))); // Plazma - Fork-friendly Rebranding
};
}
+ /* // Plazma - TODO: CI Checking
private static int fetchDistanceFromSiteApi(final ServerBuildInfo build, final int jenkinsBuild) {
try {
try (final BufferedReader reader = Resources.asCharSource(
@@ -105,6 +110,7 @@ public class PaperVersionFetcher implements VersionFetcher {
return DISTANCE_ERROR;
}
}
+ */ // Plazma - TODO: CI Checking
// Contributed by Techcable <Techcable@outlook.com> in GH-65
private static int fetchDistanceFromGitHub(final String repo, final String branch, final 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 bc7e4e5560708fea89c584b1d8b471f4966f311a..986be14b664e55111a590f5c1fded5a799578da0 100644
--- a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
+++ b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
@@ -20,7 +20,7 @@ public final class PaperConsole extends SimpleTerminalConsole {
@Override
protected LineReader buildReader(LineReaderBuilder builder) {
builder
- .appName("Purpur") // Purpur - Rebrand
+ .appName(io.papermc.paper.ServerBrandConstants.BRAND_NAME) // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
.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/io/papermc/paper/ServerBrandConstants.java b/src/main/java/io/papermc/paper/ServerBrandConstants.java
new file mode 100644
index 0000000000000000000000000000000000000000..3af005ce2bbd30601917987d8c831db23c733ab8
--- /dev/null
+++ b/src/main/java/io/papermc/paper/ServerBrandConstants.java
@@ -0,0 +1,29 @@
+package io.papermc.paper;
+
+import org.jetbrains.annotations.Nullable;
+
+public interface ServerBrandConstants {
+
+ // Basic brand informations
+ String BRAND_NAME = "Plazma";
+ String RESOURCE_PATH = "META-INF/maven/org.plazmamc.plazma/plazma-api/pom.properties";
+
+ @Nullable
+ String ASCII_LOGO = """
+
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╗\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m╗\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m \033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m╗\033[38;2;142;54;148m \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m╗\033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m╗ \033[38;2;78;81;161m \033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m╗\033[38;2;56;91;166m\s
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m█\033[38;2;196;31;137m█\033[38;2;193;33;138m╗ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m╗ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m╔\033[38;2;116;65;153m╝ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m█\033[38;2;104;71;156m█\033[38;2;101;72;157m╗\033[38;2;97;73;157m \033[38;2;94;75;158m█\033[38;2;91;76;159m█\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m╗
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m█\033[38;2;205;27;135m█\033[38;2;202;28;136m█\033[38;2;199;30;136m█\033[38;2;196;31;137m╔\033[38;2;193;33;138m╝ \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m█\033[38;2;155;49;146m█\033[38;2;151;50;146m█\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m \033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m╔\033[38;2;120;64;153m╝\033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m╔\033[38;2;104;71;156m█\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m█\033[38;2;91;76;159m╔\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m█\033[38;2;69;86;163m█\033[38;2;66;87;164m█\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m╔\033[38;2;205;27;135m═\033[38;2;202;28;136m═\033[38;2;199;30;136m═\033[38;2;196;31;137m╝\033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m║\033[38;2;180;38;140m \033[38;2;177;39;141m \033[38;2;174;41;142m \033[38;2;170;42;142m \033[38;2;167;43;143m \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m╔\033[38;2;155;49;146m═\033[38;2;151;50;146m═\033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m \033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m╔\033[38;2;123;62;152m╝\033[38;2;120;64;153m \033[38;2;116;65;153m \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m╚\033[38;2;101;72;157m█\033[38;2;97;73;157m█\033[38;2;94;75;158m╔\033[38;2;91;76;159m╝\033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m╔\033[38;2;69;86;163m═\033[38;2;66;87;164m═\033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m█\033[38;2;212;24;134m█\033[38;2;209;26;134m║\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m█\033[38;2;186;35;139m█\033[38;2;183;37;140m█\033[38;2;180;38;140m█\033[38;2;177;39;141m█\033[38;2;174;41;142m█\033[38;2;170;42;142m█\033[38;2;167;43;143m╗ \033[38;2;164;45;144m█\033[38;2;161;46;144m█\033[38;2;158;47;145m║\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m█\033[38;2;145;53;148m█\033[38;2;142;54;148m║ \033[38;2;139;56;149m█\033[38;2;135;57;149m█\033[38;2;132;58;150m█\033[38;2;129;60;151m█\033[38;2;126;61;151m█\033[38;2;123;62;152m█\033[38;2;120;64;153m█\033[38;2;116;65;153m╗ \033[38;2;113;67;154m█\033[38;2;110;68;155m█\033[38;2;107;69;155m║\033[38;2;104;71;156m \033[38;2;101;72;157m╚\033[38;2;97;73;157m═\033[38;2;94;75;158m╝\033[38;2;91;76;159m \033[38;2;88;77;159m█\033[38;2;85;79;160m█\033[38;2;81;80;161m║ \033[38;2;78;81;161m█\033[38;2;75;83;162m█\033[38;2;72;84;163m║\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m█\033[38;2;59;90;165m█\033[38;2;56;91;166m║
+ \033[38;2;215;23;133m╚\033[38;2;212;24;134m═\033[38;2;209;26;134m╝\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m╚\033[38;2;186;35;139m═\033[38;2;183;37;140m═\033[38;2;180;38;140m═\033[38;2;177;39;141m═\033[38;2;174;41;142m═\033[38;2;170;42;142m═\033[38;2;167;43;143m╝ \033[38;2;164;45;144m╚\033[38;2;161;46;144m═\033[38;2;158;47;145m╝\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m╚\033[38;2;145;53;148m═\033[38;2;142;54;148m╝ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m═\033[38;2;126;61;151m═\033[38;2;123;62;152m═\033[38;2;120;64;153m═\033[38;2;116;65;153m╝ \033[38;2;113;67;154m╚\033[38;2;110;68;155m═\033[38;2;107;69;155m╝\033[38;2;104;71;156m \033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m \033[38;2;88;77;159m╚\033[38;2;85;79;160m═\033[38;2;81;80;161m╝ \033[38;2;78;81;161m╚\033[38;2;75;83;162m═\033[38;2;72;84;163m╝\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m╚\033[38;2;59;90;165m═\033[38;2;56;91;166m╝\033[0m
+ """;
+
+ // Support URLs
+ String DOWNLOAD_PAGE = "https://plazmamc.org/downloads";
+ String CONFIG_REFERENCE = "https://docs.plazmamc.org/plazma/administration/reference/configurations";
+ String START_GUIDE = "https://docs.plazmamc.org/plazma/administration/getting-started";
+ String USAGE_GUIDE = "https://docs.plazmamc.org/plazma/administration/getting-started/next-step";
+ String SUPPORT_PAGE = "https://github.com/PlazmaMC/Plazma/issues";
+
+}
diff --git a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
index 0843e7c5c335a58d955a0841f2e02a9e4ac824d9..f7c15d0a63f948c4f52f6e6bbcbc4dc096b3281f 100644
--- a/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
+++ b/src/main/java/io/papermc/paper/ServerBuildInfoImpl.java
@@ -30,10 +30,6 @@ public record ServerBuildInfoImpl(
private static final String ATTRIBUTE_GIT_BRANCH = "Git-Branch";
private static final String ATTRIBUTE_GIT_COMMIT = "Git-Commit";
- private static final String BRAND_PAPER_NAME = "Paper";
- private static final String BRAND_PUFFERFISH_NAME = "Pufferfish"; // Purpur - Fix pufferfish issues
- private static final String BRAND_PURPUR_NAME = "Purpur"; // Purpur - Rebrand
-
private static final String BUILD_DEV = "DEV";
public ServerBuildInfoImpl() {
@@ -44,9 +40,9 @@ public record ServerBuildInfoImpl(
this(
getManifestAttribute(manifest, ATTRIBUTE_BRAND_ID)
.map(Key::key)
- .orElse(BRAND_PURPUR_ID), // Purpur - Fix pufferfish issues // Purpur - Rebrand
+ .orElse(BRAND_ID), // Purpur - Fix pufferfish issues // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
getManifestAttribute(manifest, ATTRIBUTE_BRAND_NAME)
- .orElse(BRAND_PURPUR_NAME), // Purpur - Fix pufferfish issues // Purpur - Rebrand
+ .orElse(ServerBrandConstants.BRAND_NAME), // Purpur - Fix pufferfish issues // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
SharedConstants.getCurrentVersion().getId(),
SharedConstants.getCurrentVersion().getName(),
getManifestAttribute(manifest, ATTRIBUTE_BUILD_NUMBER)
@@ -63,7 +59,7 @@ public record ServerBuildInfoImpl(
@Override
public boolean isBrandCompatible(final @NotNull Key brandId) {
- return brandId.equals(this.brandId) || brandId.equals(BRAND_PAPER_ID) || brandId.equals(BRAND_PUFFERFISH_ID); // Purpur - Fix pufferfish issues // Purpur - Rebrand
+ return brandId.equals(this.brandId) || SUPPORTED_BRANDS.contains(brandId); // Purpur - Fix pufferfish issues // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
}
@Override
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
index 8cf720f08514e8e4f62f4ad196f1277bd761c6b2..cda2ca940e30506807a5d12b84dbf69529051e26 100644
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
@@ -112,7 +112,7 @@ public abstract class Configurations<G, W> {
loader.save(node);
} catch (ConfigurateException ex) {
if (ex.getCause() instanceof AccessDeniedException) {
- LOGGER.warn("Could not save {}: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details.", filename, ex);
+ LOGGER.warn("Could not save {}: {} could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at {} for more details.", filename, io.papermc.paper.ServerBrandConstants.BRAND_NAME, io.papermc.paper.ServerBrandConstants.CONFIG_REFERENCE, ex); // Plazma - Fork-friendly Rebranding
} else throw ex;
}
}
diff --git a/src/main/java/net/minecraft/CrashReport.java b/src/main/java/net/minecraft/CrashReport.java
index 710477ae27ebc5afdf0012ef0867d05efd293c24..3a5e7546c5cc1fcec880cece3f0d0b04ec23cc18 100644
--- a/src/main/java/net/minecraft/CrashReport.java
+++ b/src/main/java/net/minecraft/CrashReport.java
@@ -32,13 +32,13 @@ public class CrashReport {
private boolean trackingStackTrace = true;
private StackTraceElement[] uncategorizedStackTrace = new StackTraceElement[0];
private final SystemReport systemReport = new SystemReport();
- private List<String> extraInfo = List.of("", "DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!", ""); // Purpur - Rebrand
+ private List<String> extraInfo = List.of("", "DO NOT REPORT THIS TO PAPER OR PURPUR! REPORT TO " + io.papermc.paper.ServerBrandConstants.BRAND_NAME.toUpperCase() + " INSTEAD!", ""); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
public CrashReport(String message, Throwable cause) {
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(io.papermc.paper.ServerBrandConstants.BRAND_NAME + " CraftBukkit Information", new org.bukkit.craftbukkit.CraftCrashReport()); // CraftBukkit // Plazma - Fork-friendly Rebranding
}
public String getTitle() {
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index a880f4e5cf712654649ad043e58e073e9a87c0fe..c3bce9206aee05b18ddd8b2788f892a972146737 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -110,6 +110,11 @@ public class Main {
*/ // CraftBukkit end
try {
+ // Plazma start - Fork-friendly Rebranding
+ //noinspection ConstantValue
+ if (io.papermc.paper.ServerBrandConstants.ASCII_LOGO != null)
+ System.out.println(io.papermc.paper.ServerBrandConstants.ASCII_LOGO);
+ // Plazma end - Fork-friendly Rebranding
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index fa5f7bc53f3dfa5581f7c747c732ebc7737a7820..17afd1c5b9984b19b4d31711bfd7f8cc120d89fd 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1281,7 +1281,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
LOGGER.info("*************************************************************************************");
LOGGER.info("This is the first time you're starting this server.");
LOGGER.info("It's recommended you read our 'Getting Started' documentation for guidance.");
- LOGGER.info("View this and more helpful information here: https://docs.papermc.io/paper/next-steps");
+ LOGGER.info("View this and more helpful information here: {}", io.papermc.paper.ServerBrandConstants.START_GUIDE); // Plazma - Fork-friendly Rebranding
LOGGER.info("*************************************************************************************");
}
// Paper end - Add onboarding message for initial server start
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 0a579af1f1ecd6e73a8440e6821c41338dd28829..b0b79b9d743cca3e6b1a33c592d66d3cdad3d819 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -788,7 +788,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.bukkit.plugin.Plugin[] plugins = this.server.getPluginManager().getPlugins();
result.append(this.server.getName());
- result.append(" on Bukkit ");
+ result.append(" on ").append(io.papermc.paper.ServerBrandConstants.BRAND_NAME).append(" "); // Plazma - Fork-friendly Rebranding
result.append(this.server.getBukkitVersion());
if (plugins.length > 0 && this.server.getQueryPlugins()) {
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
index 05e16103af3fd276f0196ddf1a2e5b729b025c34..8f7e922ceca286b1a590181c301fbe9bff55c024 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServerProperties.java
@@ -56,10 +56,10 @@ 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", "A " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Server"); // Purpur // Plazma - Fork-friendly Rebranding
public final boolean pvp = this.get("pvp", true);
public final boolean allowFlight = this.get("allow-flight", false);
- public final String motd = this.get("motd", "A Minecraft Server");
+ public final String motd = this.get("motd", "A " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Server"); // Plazma - Fork-friendly Rebranding
public final String bugReportLink = this.get("bug-report-link", "");
public final boolean forceGameMode = this.get("force-gamemode", false);
public final boolean enforceWhitelist = this.get("enforce-whitelist", false);
diff --git a/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java b/src/main/java/net/minecraft/server/gui/MinecraftServerGui.java
index 8f74c2ec5252b6265549589310d742337c91cb2c..ecb5a046514e3cd448cbf633c728831b1eb5d30b 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(io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Minecraft server"); // Purpur // Plazma - Fork-friendly Rebranding
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 - Improve ServerGUI // Purpur
+ jframe.setName(io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Minecraft server"); // Paper - Improve ServerGUI // Purpur // Plazma - Fork-friendly Rebranding
// Paper start - Improve ServerGUI
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(io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Minecraft server - shutting down!"); // Purpur // Plazma - Fork-friendly Rebranding
server.halt(true);
servergui.runFinalizers();
}
@@ -123,7 +123,7 @@ public class MinecraftServerGui extends JComponent {
// Paper start - Add onboarding message for initial server start
private JComponent buildOnboardingPanel() {
- String onboardingLink = "https://docs.papermc.io/paper/next-steps";
+ String onboardingLink = io.papermc.paper.ServerBrandConstants.USAGE_GUIDE; // Plazma - Fork-friendly Rebranding
JPanel jPanel = new JPanel();
javax.swing.JLabel jLabel = new javax.swing.JLabel("If you need help setting up your server you can visit:");
diff --git a/src/main/java/net/minecraft/world/damagesource/DamageSource.java b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
index 3781bca61379516d537650c79c614933454fdcd8..b669721a900c4644a5bc125a83c000af21f43692 100644
--- a/src/main/java/net/minecraft/world/damagesource/DamageSource.java
+++ b/src/main/java/net/minecraft/world/damagesource/DamageSource.java
@@ -90,7 +90,7 @@ public class DamageSource {
public DamageSource customEventDamager(Entity entity) {
if (this.directEntity != null) {
- throw new IllegalStateException("Cannot set custom event damager when direct entity is already set (report a bug to Paper)");
+ throw new IllegalStateException("Cannot set custom event damager when direct entity is already set (report a bug to " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + ")"); // Plazma - Fork-friendly Rebranding
}
DamageSource damageSource = this.cloneInstance();
damageSource.customEventDamager = entity;
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 a68f27288604b6f6755efe3c8ea612e295cb1656..47d19180ba80615e596e2322db24571868042a93 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
@@ -289,7 +289,7 @@ public class RegionFileStorage implements AutoCloseable, ca.spottedleaf.moonrise
// 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 PURPUR - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur - Rebrand
+ 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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " - You may ask for help on Discord, but do not file an issue. These error messages can not be removed."); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
}
private static CompoundTag readOversizedChunk(RegionFile regionfile, ChunkPos chunkCoordinate) throws IOException {
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 10aa600fab7146b330d46b5fd2fe596da222a70a..9c275f6f2c78c5d78736dc6921eadda2c12a5a10 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -143,7 +143,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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Version"); // Plazma - Fork-friendly Rebranding
this.acceptsAll(Main.asList("demo"), "Demo mode");
@@ -194,7 +194,7 @@ public class Main {
acceptsAll(asList("server-name"), "Name of the server")
.withRequiredArg()
.ofType(String.class)
- .defaultsTo("Unknown Server")
+ .defaultsTo("A " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Server") // Plazma - Fork-friendly Rebranding
.describedAs("Name");
// Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 2e7c3d4befeb6256ce81ecaa9ed4e8fbcb21651e..b28b2076972612d3d0b5890cf5938db53b1ceb2f 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -491,7 +491,7 @@ public class CraftScheduler implements BukkitScheduler {
this.parsePending();
} else {
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(this.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 - Rebrand
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to " + io.papermc.paper.ServerBrandConstants.BRAND_NAME); // Paper // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
// 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 99eb04643fce44c37fd96c99756837ccafe7b559..0627428492e082da5dfbd93906d87bb10e8c1a6b 100644
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
+++ b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
@@ -11,7 +11,7 @@ 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 - Rebrand
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream(io.papermc.paper.ServerBrandConstants.RESOURCE_PATH); // Pufferfish // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
Properties properties = new Properties();
if (stream != null) {
@@ -20,7 +20,7 @@ public final class Versioning {
result = 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 " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " version!", ex); // Plazma - Fork-friendly Rebranding
}
}
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 47f168b2d62c9a0eebdd8ab678afd857e7622571..40342e412f3fa0ea76e8f41f5eb9995eff83daa6 100644
--- a/src/main/java/org/spigotmc/WatchdogThread.java
+++ b/src/main/java/org/spigotmc/WatchdogThread.java
@@ -155,14 +155,14 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
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 - Rebrand
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " bug." ); // Paper // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
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 - Rebrand
+ log.log( Level.SEVERE, "If you are unsure or still think this is a " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " bug, please report this to " + io.papermc.paper.ServerBrandConstants.SUPPORT_PAGE ); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
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 - Rebrand
+ log.log( Level.SEVERE, io.papermc.paper.ServerBrandConstants.BRAND_NAME + " version: " + Bukkit.getServer().getVersion() ); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
@@ -184,12 +184,12 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
// 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 - Rebrand
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO " + io.papermc.paper.ServerBrandConstants.BRAND_NAME.toUpperCase() + " - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
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 - Rebrand
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + "!):" ); // Paper // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
ca.spottedleaf.moonrise.patches.chunk_system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(MinecraftServer.getServer(), isLongTimeout); // Paper - rewrite chunk system
this.dumpTickingInfo(); // Paper - log detailed tick information
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
@@ -205,7 +205,7 @@ public class WatchdogThread extends ca.spottedleaf.moonrise.common.util.TickThre
WatchdogThread.dumpThread( thread, log );
}
} else {
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur - Rebrand
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " - THIS IS NOT A BUG OR A CRASH ---"); // Purpur - Rebrand // Plazma - Fork-friendly Rebranding
}
log.log( Level.SEVERE, "------------------------------" );

View File

@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Wed, 25 Dec 2024 18:16:50 +0900
Subject: [PATCH] Enable CI version tracking
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index 1ad562a95809cf7d503f5446f8645ba8c2680914..21a3761f075ace896c981936b2810fccb0b5d610 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -90,19 +90,18 @@ public class PaperVersionFetcher implements VersionFetcher {
};
}
- /* // Plazma - TODO: CI Checking
private static int fetchDistanceFromSiteApi(final ServerBuildInfo build, final int jenkinsBuild) {
try {
try (final BufferedReader reader = Resources.asCharSource(
- URI.create("https://api.purpurmc.org/v2/purpur/" + build.minecraftVersionId()).toURL(), // Purpur - Rebrand
+ URI.create("https://ci.codemc.io/job/PlazmaMC/job/Plazma/job/" + build.gitBranch().orElseThrow().replace("/", "%2F") + "/api/json").toURL(), // Purpur - Rebrand // Plazma - Rebrand
Charsets.UTF_8
).openBufferedStream()) {
final JsonObject json = new Gson().fromJson(reader, JsonObject.class);
//final JsonArray builds = json.getAsJsonArray("builds"); // Purpur - Rebrand
- final int latest = json.getAsJsonObject("builds").getAsJsonPrimitive("latest").getAsInt(); // Purpur - Rebrand
+ final int latest = json.getAsJsonObject("lastSuccessfulBuild").getAsJsonPrimitive("number").getAsInt(); // Purpur - Rebrand // Plazma - Rebrand
return latest - jenkinsBuild;
} catch (final JsonSyntaxException ex) {
- LOGGER.error("Error parsing json from Purpur's downloads API", ex); // Purpur - Rebrand
+ LOGGER.error("Error parsing json from CI", ex); // Purpur - Rebrand // Plazma - Rebrand
return DISTANCE_ERROR;
}
} catch (final IOException e) {
@@ -110,7 +109,6 @@ public class PaperVersionFetcher implements VersionFetcher {
return DISTANCE_ERROR;
}
}
- */ // Plazma - TODO: CI Checking
// Contributed by Techcable <Techcable@outlook.com> in GH-65
private static int fetchDistanceFromGitHub(final String repo, final String branch, final String hash) {

File diff suppressed because it is too large Load Diff

View File

@@ -1,40 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 3 May 2024 19:50:32 +0900
Subject: [PATCH] Warn on startup
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index 2579b32009a5f5e288edf56ee8f1246cd70343fc..c59a1b6a365bf80ac913c1a9c939ad2cc5f3b963 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -127,6 +127,18 @@ public class Main {
\033[38;2;215;23;133m╚\033[38;2;212;24;134m═\033[38;2;209;26;134m╝\033[38;2;205;27;135m \033[38;2;202;28;136m \033[38;2;199;30;136m \033[38;2;196;31;137m \033[38;2;193;33;138m \033[38;2;190;34;138m╚\033[38;2;186;35;139m═\033[38;2;183;37;140m═\033[38;2;180;38;140m═\033[38;2;177;39;141m═\033[38;2;174;41;142m═\033[38;2;170;42;142m═\033[38;2;167;43;143m╝ \033[38;2;164;45;144m╚\033[38;2;161;46;144m═\033[38;2;158;47;145m╝\033[38;2;155;49;146m \033[38;2;151;50;146m \033[38;2;148;52;147m╚\033[38;2;145;53;148m═\033[38;2;142;54;148m╝ \033[38;2;139;56;149m╚\033[38;2;135;57;149m═\033[38;2;132;58;150m═\033[38;2;129;60;151m═\033[38;2;126;61;151m═\033[38;2;123;62;152m═\033[38;2;120;64;153m═\033[38;2;116;65;153m╝ \033[38;2;113;67;154m╚\033[38;2;110;68;155m═\033[38;2;107;69;155m╝\033[38;2;104;71;156m \033[38;2;101;72;157m \033[38;2;97;73;157m \033[38;2;94;75;158m \033[38;2;91;76;159m \033[38;2;88;77;159m╚\033[38;2;85;79;160m═\033[38;2;81;80;161m╝ \033[38;2;78;81;161m╚\033[38;2;75;83;162m═\033[38;2;72;84;163m╝\033[38;2;69;86;163m \033[38;2;66;87;164m \033[38;2;62;88;165m╚\033[38;2;59;90;165m═\033[38;2;56;91;166m╝\033[0m
""");
// Plazma end
+ // Plazma start - Warn on startup
+ if (!org.plazmamc.plazma.Options.NO_WARN) {
+ LOGGER.warn("Warning! Plazma may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
+ if (com.destroystokyo.paper.PaperVersionFetcher.DEVELOPMENT) {
+ LOGGER.error("*********************** CAUTION ***********************");
+ LOGGER.error("This version is a developed version of Plazma.");
+ LOGGER.error("Nobody knows what kind of problem you're going to have, and there's always the possibility of unexpected problems.");
+ LOGGER.error("Never use this version on a public server, and after you've tested it enough before using it!");
+ LOGGER.error("*******************************************************");
+ }
+ }
+ // Plazma end
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index 5942d0997f07bd51d934dac32cd349792a10643e..b02a0dddd99df1691c125660828a61cc4a5a4d02 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -5,5 +5,6 @@ import static java.lang.Boolean.getBoolean;
public interface Options {
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
+ boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
}

View File

@@ -1,19 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 26 Jan 2024 15:34:53 +0900
Subject: [PATCH] Development Build
diff --git a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
index 80159d9c8432f21aa774d3ade9e2ae84b2d5261c..f2a034a5062b58f3d6bde25150e13fe1cff3af0e 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -24,7 +24,7 @@ public class PaperVersionFetcher implements VersionFetcher {
private static int distance = -2; public int distance() { return distance; }
// Purpur end
private static @Nullable String mcVer;
- public static final boolean DEVELOPMENT = false; // Plazma
+ public static final boolean DEVELOPMENT = true; // Plazma
@Override
public long getCacheTime() {

View File

@@ -4,25 +4,13 @@ Date: Fri, 3 Nov 2023 00:11:50 +0900
Subject: [PATCH] Plazma Configurations
diff --git a/build.gradle.kts b/build.gradle.kts
index 902c2eeedeeced8135ec97f64f08420c0996731b..41c335bc9d80abb40e58dfbc4842b66db23e0cba 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -22,6 +22,7 @@ dependencies {
implementation(common.asm.commons)
implementation(common.log4j.iostreams)
implementation(common.commons.lang2)
+ implementation(common.adventure.serializer.ansi)
implementation(server.velocity) { isTransitive = false }
runtimeOnly(common.maven.provider)
diff --git a/src/main/java/io/papermc/paper/configuration/Configurations.java b/src/main/java/io/papermc/paper/configuration/Configurations.java
index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772c9dfecac 100644
index cda2ca940e30506807a5d12b84dbf69529051e26..150556ba594eae2214e4d1f0243ee97a7beb1e99 100644
--- a/src/main/java/io/papermc/paper/configuration/Configurations.java
+++ b/src/main/java/io/papermc/paper/configuration/Configurations.java
@@ -39,28 +39,95 @@ public abstract class Configurations<G, W> {
@@ -37,27 +37,94 @@ public abstract class Configurations<G, W> {
public static final String WORLD_DEFAULTS = "__world_defaults__";
public static final ResourceLocation WORLD_DEFAULTS_KEY = new ResourceLocation("configurations", WORLD_DEFAULTS);
public static final ResourceLocation WORLD_DEFAULTS_KEY = ResourceLocation.fromNamespaceAndPath("configurations", WORLD_DEFAULTS);
protected final Path globalFolder;
- protected final Class<G> globalConfigClass;
- protected final Class<W> worldConfigClass;
@@ -38,7 +26,13 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
- final String defaultWorldConfigFileName,
- final String worldConfigFileName
- ) {
+
- this.globalFolder = globalFolder;
- this.globalConfigClass = globalConfigType;
- this.worldConfigClass = worldConfigClass;
- this.globalConfigFileName = globalConfigFileName;
- this.defaultWorldConfigFileName = defaultWorldConfigFileName;
- this.worldConfigFileName = worldConfigFileName;
+
+ // Plazma start - Configurable Plazma
+ @org.jetbrains.annotations.VisibleForTesting
+ public static final java.util.function.Supplier<org.spigotmc.SpigotWorldConfig> SPIGOT_WORLD_DEFAULTS = com.google.common.base.Suppliers.memoize(() -> new org.spigotmc.SpigotWorldConfig(org.apache.commons.lang.RandomStringUtils.randomAlphabetic(255)) {
@@ -55,14 +49,9 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
+ } catch (IOException e) {
+ throw new RuntimeException("Could not setup configurations", e);
+ }
this.globalFolder = globalFolder;
- this.globalConfigClass = globalConfigType;
- this.worldConfigClass = worldConfigClass;
- this.globalConfigFileName = globalConfigFileName;
- this.defaultWorldConfigFileName = defaultWorldConfigFileName;
- this.worldConfigFileName = worldConfigFileName;
}
+ this.globalFolder = globalFolder; // Plazma - diff on changes
+ } // Plazma - diff on changes
+
+ protected abstract Class<G> globalConfigClass();
+ protected abstract String globalConfigFileName();
+ protected abstract org.spongepowered.configurate.NodePath[] removedGlobalPaths();
@@ -129,13 +118,12 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
+ } catch (Exception e) {
+ throw new RuntimeException("Could not reload configuration files", e);
+ }
+ }
}
+ // Plazma end - Configurable Plazma
+
protected ObjectMapper.Factory.Builder createObjectMapper() {
return ObjectMapper.factoryBuilder()
.addConstraint(Constraint.class, new Constraint.Factory())
@@ -68,17 +135,21 @@ public abstract class Configurations<G, W> {
@@ -66,17 +133,21 @@ public abstract class Configurations<G, W> {
}
protected YamlConfigurationLoader.Builder createLoaderBuilder() {
@@ -160,16 +148,16 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
}
@MustBeInvokedByOverriders
@@ -96,7 +167,7 @@ public abstract class Configurations<G, W> {
@@ -94,7 +165,7 @@ public abstract class Configurations<G, W> {
};
}
- static <T> CheckedFunction<ConfigurationNode, T, SerializationException> reloader(Class<T> type, T instance) {
+ protected static <T> CheckedFunction<ConfigurationNode, T, SerializationException> reloader(Class<T> type, T instance) { // Plazma - AT (package -> public)
+ protected static <T> CheckedFunction<ConfigurationNode, T, SerializationException> reloader(Class<T> type, T instance) { // Plazma - package -> protected
return node -> {
ObjectMapper.Factory factory = (ObjectMapper.Factory) Objects.requireNonNull(node.options().serializers().get(type));
ObjectMapper.Mutable<T> mutable = (ObjectMapper.Mutable<T>) factory.get(type);
@@ -106,7 +177,7 @@ public abstract class Configurations<G, W> {
@@ -104,7 +175,7 @@ public abstract class Configurations<G, W> {
}
public G initializeGlobalConfiguration(final RegistryAccess registryAccess) throws ConfigurateException {
@@ -178,7 +166,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
}
private void trySaveFileNode(YamlConfigurationLoader loader, ConfigurationNode node, String filename) throws ConfigurateException {
@@ -120,7 +191,7 @@ public abstract class Configurations<G, W> {
@@ -118,7 +189,7 @@ public abstract class Configurations<G, W> {
}
protected G initializeGlobalConfiguration(final CheckedFunction<ConfigurationNode, G, SerializationException> creator) throws ConfigurateException {
@@ -187,7 +175,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
final YamlConfigurationLoader loader = this.createGlobalLoaderBuilder()
.defaultOptions(this.applyObjectMapperFactory(this.createGlobalObjectMapperFactoryBuilder().build()))
.path(configFile)
@@ -151,6 +222,13 @@ public abstract class Configurations<G, W> {
@@ -149,6 +220,13 @@ public abstract class Configurations<G, W> {
}
protected void applyGlobalConfigTransformations(final ConfigurationNode node) throws ConfigurateException {
@@ -201,7 +189,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
}
@MustBeInvokedByOverriders
@@ -158,6 +236,7 @@ public abstract class Configurations<G, W> {
@@ -156,6 +234,7 @@ public abstract class Configurations<G, W> {
return ContextMap.builder()
.put(WORLD_NAME, WORLD_DEFAULTS)
.put(WORLD_KEY, WORLD_DEFAULTS_KEY)
@@ -209,7 +197,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
.put(REGISTRY_ACCESS, registryAccess);
}
@@ -165,7 +244,7 @@ public abstract class Configurations<G, W> {
@@ -163,7 +242,7 @@ public abstract class Configurations<G, W> {
final ContextMap contextMap = this.createDefaultContextMap(registryAccess)
.put(FIRST_DEFAULT)
.build();
@@ -218,7 +206,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
final DefaultWorldLoader result = this.createDefaultWorldLoader(false, contextMap, configFile);
final YamlConfigurationLoader loader = result.loader();
final ConfigurationNode node = loader.load();
@@ -175,8 +254,8 @@ public abstract class Configurations<G, W> {
@@ -173,8 +252,8 @@ public abstract class Configurations<G, W> {
this.verifyWorldConfigVersion(contextMap, node);
}
this.applyWorldConfigTransformations(contextMap, node, null);
@@ -229,29 +217,33 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
this.trySaveFileNode(loader, node, configFile.toString());
}
@@ -197,31 +276,42 @@ public abstract class Configurations<G, W> {
private record DefaultWorldLoader(YamlConfigurationLoader loader, boolean isNewFile) {
@@ -196,30 +275,45 @@ public abstract class Configurations<G, W> {
}
+ // Plazma start - Configurable Plazma
protected ObjectMapper.Factory.Builder createWorldObjectMapperFactoryBuilder(final ContextMap contextMap) {
- return this.createObjectMapper();
+ // Plazma start - Configurable Plazma
+ return this.createObjectMapper()
+ .addNodeResolver(new io.papermc.paper.configuration.legacy.RequiresSpigotInitialization.Factory(contextMap.require(SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get()))
+ .addNodeResolver(new NestedSetting.Factory())
+ .addDiscoverer(new io.papermc.paper.configuration.mapping.InnerClassFieldDiscoverer(Map.of(this.worldConfigClass(), createWorldConfigInstance(contextMap))));
+ // Plazma end - Configurable Plazma
}
@MustBeInvokedByOverriders
protected YamlConfigurationLoader.Builder createWorldConfigLoaderBuilder(final ContextMap contextMap) {
- return this.createLoaderBuilder();
+ // Plazma start - Configurable Plazma
+ return this.createLoaderBuilder().defaultOptions(options -> options
+ .header(contextMap.require(WORLD_NAME).equals(WORLD_DEFAULTS) ? this.worldDefaultHeader() : this.buildWorldHeader(contextMap)));
+ // Plazma end - Configurable Plazma
}
+ // Plazma start - Configurable Plazma
// Make sure to run version transforms on the default world config first via #setupWorldDefaultsConfig
- public W createWorldConfig(final ContextMap contextMap) throws IOException {
- return this.createWorldConfig(contextMap, creator(this.worldConfigClass, false));
- }
+ public W createWorldConfig(final ContextMap contextMap) {
+ final String levelName = contextMap.require(WORLD_NAME);
+ try {
@@ -259,7 +251,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
+ } catch (IOException exception) {
+ throw new RuntimeException("Could not create world config for " + levelName, exception);
+ }
}
+ } // diff on change
+ // Plazma end - Configurable Plazma
protected W createWorldConfig(final ContextMap contextMap, final CheckedFunction<ConfigurationNode, W, SerializationException> creator) throws IOException {
@@ -279,7 +271,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
Files.createFile(worldConfigFile); // create empty file as template
newFile = true;
}
@@ -265,6 +355,13 @@ public abstract class Configurations<G, W> {
@@ -263,6 +357,13 @@ public abstract class Configurations<G, W> {
}
protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node, final @Nullable ConfigurationNode defaultsNode) throws ConfigurateException {
@@ -293,7 +285,7 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
}
protected void applyDefaultsAwareWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode worldNode, final ConfigurationNode defaultsNode) throws ConfigurateException {
@@ -277,7 +374,7 @@ public abstract class Configurations<G, W> {
@@ -275,7 +376,7 @@ public abstract class Configurations<G, W> {
}
public Path getWorldConfigFile(ServerLevel level) {
@@ -303,10 +295,10 @@ index 96142deb42700f888ea08689ab62c27ef2b881fd..e9b9a889d3bb7b2909fc46dc00013772
public static class ContextMap {
diff --git a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15ea16ea262 100644
index 47a2cba0db36b11548d06ec21f7c7d7c9a962d6e..3f99ca451099d2c7baf12b7b603d8b30f520734c 100644
--- a/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
+++ b/src/main/java/io/papermc/paper/configuration/PaperConfigurations.java
@@ -134,6 +134,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -137,6 +137,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
See https://docs.papermc.io/paper/configuration for more information.
""";
@@ -314,16 +306,14 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
@VisibleForTesting
public static final Supplier<SpigotWorldConfig> SPIGOT_WORLD_DEFAULTS = Suppliers.memoize(() -> new SpigotWorldConfig(RandomStringUtils.randomAlphabetic(255)) {
@Override // override to ensure "verbose" is false
@@ -142,12 +143,69 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -145,11 +146,68 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
}
});
public static final ContextKey<Supplier<SpigotWorldConfig>> SPIGOT_WORLD_CONFIG_CONTEXT_KEY = new ContextKey<>(new TypeToken<Supplier<SpigotWorldConfig>>() {}, "spigot world config");
-
+ // Plazma start - Configurable Plazma
+ */
+ */ // Plazma - Configurable Plazma
public PaperConfigurations(final Path globalFolder) {
- super(globalFolder, GlobalConfiguration.class, WorldConfiguration.class, GLOBAL_CONFIG_FILE_NAME, WORLD_DEFAULTS_CONFIG_FILE_NAME, WORLD_CONFIG_FILE_NAME);
+ // Plazma start - Configurable Plazma
+ public PaperConfigurations(final Path globalFolder) { // diff on change
+ super(globalFolder);
+ }
+
@@ -371,30 +361,48 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
+ protected String worldDefaultHeader() {
+ return WORLD_DEFAULTS_HEADER;
+ }
+
- public PaperConfigurations(final Path globalFolder) {
- super(globalFolder, GlobalConfiguration.class, WorldConfiguration.class, GLOBAL_CONFIG_FILE_NAME, WORLD_DEFAULTS_CONFIG_FILE_NAME, WORLD_CONFIG_FILE_NAME);
+ @Override
+ protected String buildWorldHeader(final ContextMap contextMap) {
+ return WORLD_HEADER.apply(contextMap);
}
+ }
+
+ @Override
+ protected WorldConfiguration getWorldConfiguration(final ServerLevel level) {
+ return level.paperConfig();
+ }
}
+ // Plazma end - Configurable Plazma
+
@Override
protected int globalConfigVersion() {
return GlobalConfiguration.CURRENT_VERSION;
@@ -158,6 +216,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return WorldConfiguration.CURRENT_VERSION;
@@ -164,14 +222,11 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@Override
protected YamlConfigurationLoader.Builder createLoaderBuilder() {
return super.createLoaderBuilder()
- .defaultOptions(PaperConfigurations::defaultOptions);
+ .defaultOptions(PaperConfigurations::defaultOptions0); // Plazma - Configurable Plazma
}
- private static ConfigurationOptions defaultOptions(ConfigurationOptions options) {
+ private static ConfigurationOptions defaultOptions0(ConfigurationOptions options) { // Plazma - Configurable Plazma
return options.serializers(builder -> builder
- .register(MapSerializer.TYPE, new MapSerializer(false))
- .register(new EnumValueSerializer())
- .register(new ComponentSerializer())
.register(IntOr.Default.SERIALIZER)
.register(IntOr.Disabled.SERIALIZER)
.register(DoubleOr.Default.SERIALIZER)
@@ -183,6 +238,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
);
}
+ /* // Plazma - Configurable Plazma
@Override
protected YamlConfigurationLoader.Builder createLoaderBuilder() {
return super.createLoaderBuilder()
@@ -180,6 +239,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
protected ObjectMapper.Factory.Builder createGlobalObjectMapperFactoryBuilder() {
return defaultGlobalFactoryBuilder(super.createGlobalObjectMapperFactoryBuilder());
@@ -191,6 +247,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
private static ObjectMapper.Factory.Builder defaultGlobalFactoryBuilder(ObjectMapper.Factory.Builder builder) {
return builder.addDiscoverer(InnerClassFieldDiscoverer.globalConfig());
}
@@ -402,7 +410,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
@Override
protected YamlConfigurationLoader.Builder createGlobalLoaderBuilder() {
@@ -203,6 +263,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -213,6 +270,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return configuration;
}
@@ -410,7 +418,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
@Override
protected ContextMap.Builder createDefaultContextMap(final RegistryAccess registryAccess) {
return super.createDefaultContextMap(registryAccess)
@@ -216,8 +277,9 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -226,8 +284,9 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
.addNodeResolver(new NestedSetting.Factory())
.addDiscoverer(InnerClassFieldDiscoverer.worldConfig(createWorldConfigInstance(contextMap)));
}
@@ -421,7 +429,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
return new WorldConfiguration(
contextMap.require(PaperConfigurations.SPIGOT_WORLD_CONFIG_CONTEXT_KEY).get(),
contextMap.require(Configurations.WORLD_KEY)
@@ -229,7 +291,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -239,7 +298,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
final RegistryAccess access = contextMap.require(REGISTRY_ACCESS);
return super.createWorldConfigLoaderBuilder(contextMap)
.defaultOptions(options -> options
@@ -430,7 +438,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
.serializers(serializers -> serializers
.register(new TypeToken<Reference2IntMap<?>>() {}, new FastutilMapSerializer.SomethingToPrimitive<Reference2IntMap<?>>(Reference2IntOpenHashMap::new, Integer.TYPE))
.register(new TypeToken<Reference2LongMap<?>>() {}, new FastutilMapSerializer.SomethingToPrimitive<Reference2LongMap<?>>(Reference2LongOpenHashMap::new, Long.TYPE))
@@ -254,11 +316,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -259,12 +318,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@Override
protected void applyWorldConfigTransformations(final ContextMap contextMap, final ConfigurationNode node, final @Nullable ConfigurationNode defaultsNode) throws ConfigurateException {
@@ -438,12 +446,13 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
- for (final NodePath path : RemovedConfigurations.REMOVED_WORLD_PATHS) {
- builder.addAction(path, TransformAction.remove());
- }
- org.purpurmc.purpur.configuration.transformation.VoidDamageHeightMigration.apply(builder, contextMap); // Purpur
- builder.build().apply(node);
+ super.applyWorldConfigTransformations(contextMap, node, defaultsNode); // Plazma - Configurable Plazma // Plazma - Configurable Plazma
+ super.applyWorldConfigTransformations(contextMap, node, defaultsNode); // Plazma - Configurable Plazma
final ConfigurationTransformation.VersionedBuilder versionedBuilder = Transformations.versionedBuilder();
V29_ZeroWorldHeight.apply(versionedBuilder);
@@ -270,11 +328,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -276,11 +330,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@Override
protected void applyGlobalConfigTransformations(ConfigurationNode node) throws ConfigurateException {
@@ -456,7 +465,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
final ConfigurationTransformation.VersionedBuilder versionedBuilder = Transformations.versionedBuilder();
V29_LogIPs.apply(versionedBuilder);
@@ -294,6 +348,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -300,6 +350,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
builder.build().apply(worldNode);
}
@@ -464,7 +473,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
@Override
public WorldConfiguration createWorldConfig(final ContextMap contextMap) {
final String levelName = contextMap.require(WORLD_NAME);
@@ -335,6 +390,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -341,6 +392,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
.put(GAME_RULES, gameRules)
.build();
}
@@ -472,7 +481,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
public static PaperConfigurations setup(final Path legacyConfig, final Path configDir, final Path worldFolder, final File spigotConfig) throws Exception {
final Path legacy = Files.isSymbolicLink(legacyConfig) ? Files.readSymbolicLink(legacyConfig) : legacyConfig;
@@ -368,12 +424,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -374,12 +426,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
throw new RuntimeException("Could not convert '" + legacyFileName + "' to the new configuration format", ex);
}
}
@@ -486,7 +495,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
}
private static void convert(final Path legacyConfig, final Path configDir, final Path worldFolder, final File spigotConfig) throws Exception {
@@ -424,6 +475,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -430,6 +477,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return Files.exists(legacyConfig) && Files.isRegularFile(legacyConfig);
}
@@ -494,7 +503,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
@Deprecated
public YamlConfiguration createLegacyObject(final MinecraftServer server) {
YamlConfiguration global = YamlConfiguration.loadConfiguration(this.globalFolder.resolve(this.globalConfigFileName).toFile());
@@ -434,6 +486,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -440,6 +488,7 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
}
return global;
}
@@ -502,7 +511,7 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
@Deprecated
public static YamlConfiguration loadLegacyConfigFile(File configFile) throws Exception {
@@ -456,10 +509,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
@@ -462,10 +511,13 @@ public class PaperConfigurations extends Configurations<GlobalConfiguration, Wor
return BasicConfigurationNode.root(options);
}
@@ -517,18 +526,18 @@ index 83a726bcf8b7dce73a361b0d79dbd63a0afc7a12..3c893e5da90f7fcf519f190e34e2b15e
+
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index e121cc57ec5bf6f5b1d81e2fd4f551063ac60d64..2903c9a2480ac505f0931d29ac3c5013037e65f1 100644
index 17afd1c5b9984b19b4d31711bfd7f8cc120d89fd..82bded015da16ed2feae1161a31f916804c6fbbb 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -314,6 +314,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 4 ]; // Purpur
@@ -328,6 +328,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
public final double[] recentTps = new double[ 4 ]; // Purpur - Add 5 second tps average in /tps
// Spigot end
public final io.papermc.paper.configuration.PaperConfigurations paperConfigurations; // Paper - add paper configuration files
+ public final org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations; // Plazma - Configurable Plazma
public static long currentTickLong = 0L; // Paper - track current tick as a long
public boolean isIteratingOverLevels = false; // Paper - Throw exception on world create while being ticked
public boolean lagging = false; // Purpur
@@ -425,6 +426,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
private final Set<String> pluginsBlockingSleep = new java.util.HashSet<>(); // Paper - API to allow/disallow tick sleeping
public boolean lagging = false; // Purpur - Lagging threshold
@@ -516,6 +517,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
Runtime.getRuntime().addShutdownHook(new org.bukkit.craftbukkit.util.ServerShutdownThread(this));
// CraftBukkit end
this.paperConfigurations = services.paperConfigurations(); // Paper - add paper configuration files
@@ -537,21 +546,35 @@ index e121cc57ec5bf6f5b1d81e2fd4f551063ac60d64..2903c9a2480ac505f0931d29ac3c5013
private void readScoreboard(DimensionDataStorage persistentStateManager) {
diff --git a/src/main/java/net/minecraft/server/Services.java b/src/main/java/net/minecraft/server/Services.java
index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..5b3d59cc5e4efd54bea967d2e37dc9339aff1737 100644
index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..4f1071c48fec78036d6759cdff179df3182f28f5 100644
--- a/src/main/java/net/minecraft/server/Services.java
+++ b/src/main/java/net/minecraft/server/Services.java
@@ -12,13 +12,20 @@ import net.minecraft.util.SignatureValidator;
@@ -12,13 +12,34 @@ import net.minecraft.util.SignatureValidator;
public record Services(
- MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @javax.annotation.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations // Paper - add paper configuration files
+ MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache, @org.jetbrains.annotations.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations, @org.jetbrains.annotations.Nullable org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations // Paper - add paper configuration files // Plazma - Configurable Plazma
+ // Plazma start - Configurable Plazma
+ MinecraftSessionService sessionService,
+ ServicesKeySet servicesKeySet,
+ GameProfileRepository profileRepository,
+ GameProfileCache profileCache,
+ @org.jetbrains.annotations.Nullable io.papermc.paper.configuration.PaperConfigurations paperConfigurations,
+ @org.jetbrains.annotations.Nullable org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations
+ // Plazma end - Configurable Plazma
) {
// Paper start - add paper configuration files
+ // Plazma start - Configurable Plazma
public Services(MinecraftSessionService sessionService, ServicesKeySet servicesKeySet, GameProfileRepository profileRepository, GameProfileCache profileCache) {
- this(sessionService, servicesKeySet, profileRepository, profileCache, null);
+ this(sessionService, servicesKeySet, profileRepository, profileCache, null, null);
+ this(
+ sessionService,
+ servicesKeySet,
+ profileRepository,
+ profileCache,
+ null,
+ null
+ );
}
+ @Override
@@ -563,97 +586,142 @@ index 33e3815a0c979609d4c7ab83ad91e87ac07a556d..5b3d59cc5e4efd54bea967d2e37dc933
@Override
public io.papermc.paper.configuration.PaperConfigurations paperConfigurations() {
return java.util.Objects.requireNonNull(this.paperConfigurations);
@@ -34,7 +41,11 @@ public record Services(
@@ -34,7 +55,16 @@ public record Services(
final java.nio.file.Path legacyConfigPath = ((File) optionSet.valueOf("paper-settings")).toPath();
final java.nio.file.Path configDirPath = ((File) optionSet.valueOf("paper-settings-directory")).toPath();
io.papermc.paper.configuration.PaperConfigurations paperConfigurations = io.papermc.paper.configuration.PaperConfigurations.setup(legacyConfigPath, configDirPath, rootDirectory.toPath(), (File) optionSet.valueOf("spigot-settings"));
- return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations);
+ // Plazma start - Configurable Plazma
+ final java.nio.file.Path plazmaConfigDirPath = ((File) optionSet.valueOf("plazma-settings-directory")).toPath();
+ org.plazmamc.plazma.configurations.PlazmaConfigurations plazmaConfigurations = new org.plazmamc.plazma.configurations.PlazmaConfigurations(plazmaConfigDirPath);
+ return new Services(minecraftSessionService, authenticationService.getServicesKeySet(), gameProfileRepository, gameProfileCache, paperConfigurations, plazmaConfigurations);
+ return new Services(
+ minecraftSessionService,
+ authenticationService.getServicesKeySet(),
+ gameProfileRepository,
+ gameProfileCache,
+ paperConfigurations,
+ new org.plazmamc.plazma.configurations.PlazmaConfigurations(optionSet)
+ );
+ // Plazma end
// Paper end - load paper config files from cli options
}
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 775c5de4f5094260096cef6723dd50dfe2cb0c81..8289334e77999f72214c330a3306cbfeb17afbf1 100644
index b0b79b9d743cca3e6b1a33c592d66d3cdad3d819..14fd0ff2b4dc226f2890e538587226cdb60d37c2 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -222,6 +222,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -232,6 +232,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
// Paper start - initialize global and world-defaults configuration
this.paperConfigurations.initializeGlobalConfiguration(this.registryAccess());
this.paperConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess());
+ this.plazmaConfigurations.initializeGlobalConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
+ this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
// Paper end - initialize global and world-defaults configuration
this.server.spark.enableEarlyIfRequested(); // Paper - spark
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
@@ -232,6 +234,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -243,6 +245,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
org.spigotmc.WatchdogThread.doStart(org.spigotmc.SpigotConfig.timeoutTime, org.spigotmc.SpigotConfig.restartOnCrash); // Paper - start watchdog thread
thread.start(); // Paper - Enhance console tab completions for brigadier commands; start console thread after MinecraftServer.console & PaperConfig are initialized
io.papermc.paper.command.PaperCommands.registerCommands(this); // Paper - setup /paper command
+ org.plazmamc.plazma.commands.Commands.register(this); // Plazma - Configurable Plazma
this.server.spark.registerCommandBeforePlugins(this.server); // Paper - spark
com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics(); // Paper - start metrics
// Purpur start
try {
// Purpur start - Purpur config files
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index f72af2feb74626abbdfbfd090c15357457810240..f03b59754f5900fa47985b4118cacccadf04920f 100644
index fe8a1a073920b7cbbe3791ac1fcac3fccec6b9f7..fd175eb4e58479e588c8e2b436dab15c7647b870 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -700,7 +700,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Holder holder = worlddimension.type(); // CraftBukkit - decompile error
@@ -601,7 +601,24 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
// 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(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
+ 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(), iworlddataserver.getGameRules())), spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(org.plazmamc.plazma.configurations.PlazmaConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor // Plazma - Configurable Plazma
// Add env and gen to constructor, IWorldDataServer -> WorldDataServer
public ServerLevel(MinecraftServer minecraftserver, Executor executor, LevelStorageSource.LevelStorageAccess convertable_conversionsession, PrimaryLevelData iworlddataserver, ResourceKey<Level> resourcekey, LevelStem worlddimension, ChunkProgressListener worldloadlistener, boolean flag, long i, List<CustomSpawner> list, boolean flag1, @Nullable RandomSequences randomsequences, org.bukkit.World.Environment env, org.bukkit.generator.ChunkGenerator gen, org.bukkit.generator.BiomeProvider biomeProvider) {
- super(iworlddataserver, resourcekey, minecraftserver.registryAccess(), worlddimension.type(), 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(), iworlddataserver.getGameRules())), executor); // Paper - create paper world configs; Async-Anti-Xray: Pass executor
+ // Plazma start - Configurable Plazma
+ super(
+ iworlddataserver,
+ resourcekey,
+ minecraftserver.registryAccess(),
+ worlddimension.type(),
+ 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(), iworlddataserver.getGameRules())),
+ spigotConfig -> minecraftserver.plazmaConfigurations.createWorldConfig(org.plazmamc.plazma.configurations.PlazmaConfigurations.createWorldContextMap(convertable_conversionsession.levelDirectory.path(), iworlddataserver.getLevelName(), resourcekey.location(), spigotConfig, minecraftserver.registryAccess(), iworlddataserver.getGameRules())),
+ executor
+ );
+ // Plazma end - Configurable Plazma
this.pvpMode = minecraftserver.isPvpAllowed();
this.convertable = convertable_conversionsession;
this.uuid = WorldUUID.getUUID(convertable_conversionsession.levelDirectory.path().toFile());
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index eda2f8cc034cf46293be1be117a60cf8b663c303..79ebec0543f730af403240e9c1c011777464a698 100644
index e12d3ec3c957e182a57142352b1224a18d256f37..90df89b67c34540901190cac6063bc5721d95ae0 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -168,6 +168,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
@@ -173,7 +173,12 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
return this.paperConfig;
}
// Paper end - add paper world config
-
+ // Plazma start - Configurable Plazma
+ private final org.plazmamc.plazma.configurations.WorldConfigurations plazmaConfig;
+ public org.plazmamc.plazma.configurations.WorldConfigurations plazmaConfig() {
+ return this.plazmaConfig;
+ }
+ // Plazma end - Configurable Plazma
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
@@ -257,9 +263,10 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur - Purpur config files
public static BlockPos lastPhysicsProblem; // Spigot
@@ -875,7 +880,24 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
}
// Paper end - optimise random ticking
public abstract ResourceKey<LevelStem> getTypeKey();
- 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.concurrent.Executor executor) { // Paper - create paper world config; Async-Anti-Xray: Pass executor
+ 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 - create paper world config; Async-Anti-Xray: Pass executor // Plazma - Configurable Plazma
- protected Level(WritableLevelData worlddatamutable, ResourceKey<Level> resourcekey, RegistryAccess iregistrycustom, Holder<DimensionType> holder, 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.concurrent.Executor executor) { // Paper - create paper world config & Anti-Xray
+ // Plazma start - Configurable Plazma
+ protected Level(
+ WritableLevelData worlddatamutable,
+ ResourceKey<Level> resourcekey,
+ RegistryAccess iregistrycustom,
+ Holder<DimensionType> holder,
+ 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
+ ) {
+ // Plazma end - Configurable Plazma
// Paper start - getblock optimisations - cache world height/sections
final DimensionType dimType = holder.value();
this.minY = dimType.minY();
@@ -887,6 +909,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable, ca.spottedl
// Paper end - getblock optimisations - cache world height/sections
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper - create paper world config
+ this.plazmaConfig = plazmaWorldConfigurationCreator.apply(this.spigotConfig); // Plazma - Configurable Plazma
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur - Purpur config files
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
this.generator = gen;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index dca6cce8768c8c08e4abba249c30731dbdec7763..d06473349dff50a33b7843ae6dcde28f50fcd708 100644
index badf280a6b01b06e8148c552330872d64e6256b7..090cb821a43ccfea21a990580e47b592df9d030f 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -1068,6 +1068,7 @@ public final class CraftServer implements Server {
@@ -1100,6 +1100,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) this.console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console);
+ this.console.plazmaConfigurations.reloadConfigs(this.console); // Plazma - Configurable Plazma
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur - Purpur config files
for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
@@ -3126,6 +3127,13 @@ public final class CraftServer implements Server {
@@ -3113,6 +3114,13 @@ public final class CraftServer implements Server {
}
// Purpur end
// Purpur end - Purpur config files
+ // Plazma start - Configurable Plazma
+ @Override
@@ -666,11 +734,11 @@ index dca6cce8768c8c08e4abba249c30731dbdec7763..d06473349dff50a33b7843ae6dcde28f
public void restart() {
org.spigotmc.RestartCommand.restart();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 333c8a313208652700c21fc2ac629296b5b02078..9b3371fee86b5e41d5564424c0b3a3805b2059f9 100644
index 9c275f6f2c78c5d78736dc6921eadda2c12a5a10..a75f3328ba32466b6ceeddb0069c856524f19c0a 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -190,6 +190,14 @@ public class Main {
.defaultsTo("A Plazma Server") // Plazma - Rebrand
@@ -197,6 +197,14 @@ public class Main {
.defaultsTo("A " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " Server") // Plazma - Fork-friendly Rebranding
.describedAs("Name");
// Paper end
+
@@ -686,13 +754,14 @@ index 333c8a313208652700c21fc2ac629296b5b02078..9b3371fee86b5e41d5564424c0b3a380
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..5942d0997f07bd51d934dac32cd349792a10643e
index 0000000000000000000000000000000000000000..ca11bd22a65c8b9f4fffb1832ada8c519ab75b98
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -0,0 +1,9 @@
@@ -0,0 +1,10 @@
+package org.plazmamc.plazma;
+
+import static java.lang.Boolean.getBoolean;
+import static java.lang.System.getProperty;
+
+public interface Options {
+
@@ -948,16 +1017,20 @@ index 0000000000000000000000000000000000000000..b6664ba0fce55f5cfa0c8d3051dc8c2b
+}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
new file mode 100644
index 0000000000000000000000000000000000000000..d8006ae086c18a4ef43906d516eba0d5fd397f5f
index 0000000000000000000000000000000000000000..b638690d5cd2360444e6c525f97f634d8e1dc60e
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -0,0 +1,26 @@
@@ -0,0 +1,30 @@
+package org.plazmamc.plazma.configurations;
+
+import io.papermc.paper.configuration.Configuration;
+import io.papermc.paper.configuration.ConfigurationPart;
+import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
+import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
+import net.minecraft.Util;
+import org.jetbrains.annotations.NotNull;
+import org.spongepowered.configurate.objectmapping.meta.Setting;
+import java.util.List;
+
+@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "InnerClassMayBeStatic"})
+public class GlobalConfiguration extends ConfigurationPart {
@@ -980,15 +1053,16 @@ index 0000000000000000000000000000000000000000..d8006ae086c18a4ef43906d516eba0d5
+}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
new file mode 100644
index 0000000000000000000000000000000000000000..af27a8199c46c2995424a60893439c0dbc162791
index 0000000000000000000000000000000000000000..09053b4ccf268fd204c81dbb8d4f10fa9edcad5f
--- /dev/null
+++ b/src/main/java/org/plazmamc/plazma/configurations/PlazmaConfigurations.java
@@ -0,0 +1,217 @@
@@ -0,0 +1,219 @@
+package org.plazmamc.plazma.configurations;
+
+import com.mojang.logging.LogUtils;
+import io.papermc.paper.configuration.ConfigurationPart;
+import io.papermc.paper.configuration.Configurations;
+import joptsimple.OptionSet;
+import net.minecraft.core.RegistryAccess;
+import net.minecraft.server.level.ServerLevel;
+import org.checkerframework.checker.nullness.qual.NonNull;
@@ -1004,6 +1078,7 @@ index 0000000000000000000000000000000000000000..af27a8199c46c2995424a60893439c0d
+import org.spongepowered.configurate.objectmapping.ObjectMapper;
+import org.spongepowered.configurate.yaml.YamlConfigurationLoader;
+
+import java.io.File;
+import java.nio.file.Path;
+import java.util.function.Function;
+
@@ -1012,7 +1087,7 @@ index 0000000000000000000000000000000000000000..af27a8199c46c2995424a60893439c0d
+@DefaultQualifier(NonNull.class)
+public class PlazmaConfigurations extends Configurations<GlobalConfiguration, WorldConfigurations> {
+
+ public static final Logger LOGGER = LogUtils.getLogger();
+ public static final Logger LOGGER = LogUtils.getClassLogger();
+ public static final String CONFIG_DIR = "config";
+ static final String GLOBAL_CONFIG_FILE_NAME = "plazma-global.yml";
+ static final String WORLD_DEFAULTS_CONFIG_FILE_NAME = "plazma-world-defaults.yml";
@@ -1097,8 +1172,8 @@ index 0000000000000000000000000000000000000000..af27a8199c46c2995424a60893439c0d
+ CONFIG_DIR, WORLD_DEFAULTS_CONFIG_FILE_NAME
+ );
+
+ public PlazmaConfigurations(final Path globalFolder) {
+ super(globalFolder);
+ public PlazmaConfigurations(final OptionSet optionSet) {
+ super(((File) optionSet.valueOf("plazma-settings-directory")).toPath());
+ }
+
+ @Override
@@ -1248,18 +1323,45 @@ index 0000000000000000000000000000000000000000..f2d3d51cb4b8fc7a5fd6db1a63289fff
+ int version = VERSION;
+
+}
diff --git a/src/test/java/org/bukkit/support/AbstractTestingBase.java b/src/test/java/org/bukkit/support/AbstractTestingBase.java
index 1b1d51a68c0abe7d8f0aa1172064192c71ae645e..74af3501397bfd89d637ad5ce72bb8f2c2bbdc8a 100644
--- a/src/test/java/org/bukkit/support/AbstractTestingBase.java
+++ b/src/test/java/org/bukkit/support/AbstractTestingBase.java
@@ -64,6 +64,7 @@ public abstract class AbstractTestingBase {
diff --git a/src/main/java/plazma/Config.java b/src/main/java/plazma/Config.java
new file mode 100644
index 0000000000000000000000000000000000000000..dbba467f668600ef3dcc653d9bfe1f712c69e245
--- /dev/null
+++ b/src/main/java/plazma/Config.java
@@ -0,0 +1,21 @@
+package plazma;
+
+import org.jetbrains.annotations.Contract;
+import org.jspecify.annotations.NonNull;
+import org.plazmamc.plazma.configurations.GlobalConfiguration;
+import org.plazmamc.plazma.configurations.PlazmaConfigurations;
+import java.util.List;
+
+public interface Config {
+
+ @Contract(pure = true)
+ static boolean optimize() {
+ return PlazmaConfigurations.optimize();
+ }
+
+ @Contract(pure = true)
+ static @NonNull GlobalConfiguration get() {
+ return GlobalConfiguration.get();
+ }
+
+}
diff --git a/src/test/java/org/bukkit/support/DummyServerHelper.java b/src/test/java/org/bukkit/support/DummyServerHelper.java
index 309d371247adcddf0a1b370cc5faff3e6e01cb0f..285a90ff5cdc8cb28fafd4ea3dae306ae5b899c9 100644
--- a/src/test/java/org/bukkit/support/DummyServerHelper.java
+++ b/src/test/java/org/bukkit/support/DummyServerHelper.java
@@ -92,6 +92,7 @@ public final class DummyServerHelper {
// Paper end - testing additions
DummyServer.setup();
io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper
io.papermc.paper.configuration.GlobalConfigTestingBase.setupGlobalConfigForTest(); // Paper - configuration files - setup global configuration test base
+ org.plazmamc.plazma.configurations.GlobalConfigurationTestingBase.setupGlobalConfigForTest(); // Plazma - Configurable Plazma
CraftRegistry.setMinecraftRegistry(REGISTRY_CUSTOM);
// Paper start - add test for recipe conversion
when(instance.recipeIterator()).thenAnswer(ignored ->
diff --git a/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java b/src/test/java/org/plazmamc/plazma/configurations/GlobalConfigurationTestingBase.java
new file mode 100644
index 0000000000000000000000000000000000000000..c63942e2dc00ed6d6b4119f418bdaa5a64b4c0fe

View File

@@ -1,123 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Thu, 25 Jan 2024 17:13:09 +0900
Subject: [PATCH] Port SparklyPaper patches
SparklyPower
Copyright (C) 2024 SparklyPower
Based on commit: 29212936a832106c4d68e2a2017acbea2fdd3cc4
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 39e7dcf3c92c9203c190782be401c00c010b8aeb..b86ae3929ec5d3c4eb69d92774dc445aa5b3093e 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -78,6 +78,7 @@ public class ServerEntity {
private List<SynchedEntityData.DataValue<?>> trackedDataValues;
// CraftBukkit start
public final Set<ServerPlayerConnection> trackedPlayers; // Purpur - private -> public
+ public static boolean skipSqrWhenNoDeltaChanges = false; // Plazma - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
public ServerEntity(ServerLevel worldserver, Entity entity, int i, boolean flag, Consumer<Packet<?>> consumer, Set<ServerPlayerConnection> trackedPlayers) {
this.trackedPlayers = trackedPlayers;
@@ -208,12 +209,16 @@ public class ServerEntity {
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
Vec3 vec3d1 = this.entity.getDeltaMovement();
- double d0 = vec3d1.distanceToSqr(this.ap);
+ // Plazma start - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
+ if (!skipSqrWhenNoDeltaChanges && vec3d1 != this.ap) {
+ double d0 = vec3d1.distanceToSqr(this.ap);
- if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
- this.ap = vec3d1;
- this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
+ if (d0 > 1.0E-7D || d0 > 0.0D && vec3d1.lengthSqr() == 0.0D) {
+ this.ap = vec3d1;
+ this.broadcast.accept(new ClientboundSetEntityMotionPacket(this.entity.getId(), this.ap));
+ }
}
+ // Plazma end - SparklyPaper port; Skip distanceToSqr if the delta movement hasn't changed
}
if (packet1 != null) {
diff --git a/src/main/java/net/minecraft/stats/ServerStatsCounter.java b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
index f890738d3bb9fb5e70a9d323c6cec97f9948f9cf..52e72277c661b67a54bc5ce584efb04134599dd3 100644
--- a/src/main/java/net/minecraft/stats/ServerStatsCounter.java
+++ b/src/main/java/net/minecraft/stats/ServerStatsCounter.java
@@ -243,7 +243,7 @@ public class ServerStatsCounter extends StatsCounter {
public void sendStats(ServerPlayer player) {
Object2IntMap<Stat<?>> object2intmap = new Object2IntOpenHashMap();
- Iterator iterator = this.getDirty().iterator();
+ Iterator<Stat<?>> iterator = this.dirty.iterator(); // Plazma - SparklyPaper port; Skip dirty stats copy when requesting player stats
while (iterator.hasNext()) {
Stat<?> statistic = (Stat) iterator.next();
@@ -251,6 +251,7 @@ public class ServerStatsCounter extends StatsCounter {
object2intmap.put(statistic, this.getValue(statistic));
}
+ this.dirty.clear(); // Plazma - SparklyPaper port; Skip dirty stats copy when requesting player stats
player.connection.send(new ClientboundAwardStatsPacket(object2intmap));
}
}
diff --git a/src/main/java/net/minecraft/world/item/MapItem.java b/src/main/java/net/minecraft/world/item/MapItem.java
index 608390ed36710a419de1542b80340dd3fcc7299c..043f068345ca3c50209c1c3cc1feb6277a3da61a 100644
--- a/src/main/java/net/minecraft/world/item/MapItem.java
+++ b/src/main/java/net/minecraft/world/item/MapItem.java
@@ -268,11 +268,13 @@ public class MapItem extends ComplexItem {
}
}
+ public static boolean skipTickWhenCraftNotPresent = false; // Plazma - SparklyPaper port; Skip map item ticking if the craft map renderer is not present
@Override
public void inventoryTick(ItemStack stack, Level world, Entity entity, int slot, boolean selected) {
if (!world.isClientSide) {
MapItemSavedData mapItemSavedData = getSavedData(stack, world);
if (mapItemSavedData != null) {
+ if (skipTickWhenCraftNotPresent && mapItemSavedData.mapView.getRenderers().stream().noneMatch(mapRenderer -> mapRenderer.getClass() == org.bukkit.craftbukkit.map.CraftMapRenderer.class)) return; // Plazma - SparklyPaper port; Skip map item ticking if the craft map renderer is not present
if (entity instanceof Player player) {
mapItemSavedData.tickCarriedBy(player, stack);
}
diff --git a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
index 8149b9c51b78eb5c689b7218a2ca3aab60e73bcf..b9a303f6280a2f6ad3616da152922a4f4a504281 100644
--- a/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
+++ b/src/main/java/org/bukkit/craftbukkit/map/CraftMapColorCache.java
@@ -145,7 +145,7 @@ public class CraftMapColorCache implements MapPalette.MapColorCache {
}
@Override
- public boolean isCached() {
+ public synchronized boolean isCached() { // Plazma - Fix concurrency issues when using "imageToBytes" in multiple threads
return this.cached || (!this.running.get() && this.initCache().isDone());
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 57d29f8f3bc89529db9ee8f6dc3fffdbd4a03ceb..9c830ec9129ac94aa08e914a82792210c13fc1a3 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -40,9 +40,11 @@ public class GlobalConfiguration extends ConfigurationPart {
public Entity entity;
public class Entity extends ConfigurationPart {
+ boolean skipSqrWhenNoDeltaChanges = OPTIMIZE;
@PostProcess
public void post() {
+ net.minecraft.server.level.ServerEntity.skipSqrWhenNoDeltaChanges = this.skipSqrWhenNoDeltaChanges;
}
}
@@ -50,9 +52,11 @@ public class GlobalConfiguration extends ConfigurationPart {
public World world;
public class World extends ConfigurationPart {
+ boolean skipTickWhenCraftNotPresent = OPTIMIZE;
@PostProcess
public void post() {
+ net.minecraft.world.item.MapItem.skipTickWhenCraftNotPresent = this.skipTickWhenCraftNotPresent;
}
}

View File

@@ -5,21 +5,33 @@ 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 d8006ae086c18a4ef43906d516eba0d5fd397f5f..57d29f8f3bc89529db9ee8f6dc3fffdbd4a03ceb 100644
index b638690d5cd2360444e6c525f97f634d8e1dc60e..e89534b6e2b91483d7eddfcb3441e9addf9bccc7 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -3,6 +3,7 @@ package org.plazmamc.plazma.configurations;
import io.papermc.paper.configuration.Configuration;
import io.papermc.paper.configuration.ConfigurationPart;
@@ -6,6 +6,7 @@ import it.unimi.dsi.fastutil.objects.Reference2ObjectMap;
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap;
import net.minecraft.Util;
import org.jetbrains.annotations.NotNull;
+import org.spongepowered.configurate.objectmapping.meta.PostProcess;
import org.spongepowered.configurate.objectmapping.meta.Setting;
import java.util.List;
@SuppressWarnings({"CanBeFinal", "FieldCanBeLocal", "FieldMayBeFinal", "InnerClassMayBeStatic"})
@@ -23,4 +24,43 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -27,4 +28,61 @@ public class GlobalConfiguration extends ConfigurationPart {
@Setting(Configuration.VERSION_FIELD)
int version = VERSION;
+ public Messages messages;
+ public class Messages extends ConfigurationPart {
+
+
+ }
+
+ public Command command;
+ public class Command extends ConfigurationPart {
+
+
+ }
+
+ public Player player;
+ public class Player extends ConfigurationPart {
+
@@ -53,6 +65,12 @@ index d8006ae086c18a4ef43906d516eba0d5fd397f5f..57d29f8f3bc89529db9ee8f6dc3fffdb
+
+ }
+
+ public Structure structure;
+ public class Structure extends ConfigurationPart {
+
+
+ }
+
+ public Miscellaneous misc;
+ public class Miscellaneous extends ConfigurationPart {
+
@@ -60,11 +78,28 @@ index d8006ae086c18a4ef43906d516eba0d5fd397f5f..57d29f8f3bc89529db9ee8f6dc3fffdb
+ }
+
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java
index 25c0f5d28107b45677aa7b19bc0d5238512d9826..ac0f038de0ce5cf6df0b730af69d3229c3119eff 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/RemovedConfigurations.java
@@ -2,9 +2,12 @@ package org.plazmamc.plazma.configurations;
import org.spongepowered.configurate.NodePath;
+import static org.spongepowered.configurate.NodePath.path;
+
interface RemovedConfigurations {
NodePath[] WORLD_PATHS = {
+ path("structure", "nether-portal")
};
NodePath[] GLOBAL_PATHS = {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index f2d3d51cb4b8fc7a5fd6db1a63289fff6d32a1ea..42d639688b6f0b9ff53debf49a920f5c8e232a19 100644
index f2d3d51cb4b8fc7a5fd6db1a63289fff6d32a1ea..c222d58520b655b54b8975ec226a4ba948691cd4 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 {
@@ -19,4 +19,44 @@ public class WorldConfigurations extends ConfigurationPart {
@Setting(Configuration.VERSION_FIELD)
int version = VERSION;
@@ -95,5 +130,17 @@ index f2d3d51cb4b8fc7a5fd6db1a63289fff6d32a1ea..42d639688b6f0b9ff53debf49a920f5c
+ }
+
+ }
+
+ public Block block;
+ public class Block extends ConfigurationPart {
+
+
+ }
+
+ public Item item;
+ public class Item 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 c59a1b6a365bf80ac913c1a9c939ad2cc5f3b963..20d215e53b4a02d7f52197decf05fd1e6ee44669 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -193,6 +193,7 @@ public class Main {
// Spigot Start
boolean eulaAgreed = Boolean.getBoolean( "com.mojang.eula.agree" );
+ eulaAgreed = eulaAgreed || Boolean.getBoolean("Paper.pushPaperAssetsRoot"); // Plazma - Always agree EULA on development mode
if ( eulaAgreed )
{
System.err.println( "You have used the Spigot command line EULA agreement flag." );

View File

@@ -0,0 +1,40 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 3 May 2024 19:50:32 +0900
Subject: [PATCH] Warn on startup
diff --git a/src/main/java/net/minecraft/server/Main.java b/src/main/java/net/minecraft/server/Main.java
index c3bce9206aee05b18ddd8b2788f892a972146737..fc378b08c10c7f670be93d52937c7642b986ed0d 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -115,6 +115,18 @@ public class Main {
if (io.papermc.paper.ServerBrandConstants.ASCII_LOGO != null)
System.out.println(io.papermc.paper.ServerBrandConstants.ASCII_LOGO);
// Plazma end - Fork-friendly Rebranding
+ // Plazma start - Warn on startup
+ if (!org.plazmamc.plazma.Options.NO_WARN) {
+ LOGGER.warn("Warning! " + io.papermc.paper.ServerBrandConstants.BRAND_NAME + " may cause unexpected problems, so be sure to test it thoroughly before using it on a public server.");
+ if (io.papermc.paper.ServerBuildInfo.buildInfo().asString(io.papermc.paper.ServerBuildInfo.StringRepresentation.VERSION_FULL).contains("DEV")) {
+ LOGGER.error("*********************** CAUTION ***********************");
+ LOGGER.error("This version is a development version of {}.", io.papermc.paper.ServerBrandConstants.BRAND_NAME);
+ LOGGER.error("Nobody knows what kind of problem you're going to have, and there's always the possibility of unexpected problems.");
+ LOGGER.error("Never use this version on a public server, and after you've tested it enough before using it!");
+ LOGGER.error("*******************************************************");
+ }
+ }
+ // Plazma end
Path path = (Path) optionset.valueOf("pidFile"); // CraftBukkit
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index ca11bd22a65c8b9f4fffb1832ada8c519ab75b98..5d41bd4d4b86ca0c7c03d3ac6e75b3f1f1abe73b 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -6,5 +6,6 @@ import static java.lang.System.getProperty;
public interface Options {
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
+ boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
}

View File

@@ -5,10 +5,10 @@ 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 1de03b16c513d83550077bab46b52ae6e40eb98e..0935884fa747407d262178c25388073957d4547e 100644
index b58f4eb26ce6bd6696b3289b5f199ab8f0ff28b6..6ab720b65dec49092addbaf967c77682bd304096 100644
--- a/src/main/java/com/destroystokyo/paper/Metrics.java
+++ b/src/main/java/com/destroystokyo/paper/Metrics.java
@@ -636,38 +636,59 @@ public class Metrics {
@@ -635,38 +635,59 @@ public class Metrics {
return map;
}));

View File

@@ -8,11 +8,48 @@ Subject: [PATCH] Optimize default configurations
- AkiraDevelopment/SimplyMC
- YouHaveTrouble/minecraft-exploits-and-how-to-fix-them
diff --git a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
index 3ff4f092a59242a8cb930c084915a774db881652..66f797f5205b9b259cc6f6cfd710293fc73cdf59 100644
--- a/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
+++ b/src/main/java/gg/pufferfish/pufferfish/PufferfishConfig.java
@@ -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 - Sponsorblock
"Join our Discord for support: https://discord.gg/reZw4vQV9H",
"Download new builds at https://ci.pufferfish.host/job/Pufferfish");
@@ -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", 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");
@@ -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 - 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.");
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,
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 2874bc3001c4e7d9191e47ba512c5a68369c21f1..750dd556123f3f912f8463ca3018256aaca5a2cb 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
@@ -156,7 +156,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -148,7 +148,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public class Watchdog extends ConfigurationPart {
public int earlyWarningEvery = 5000;
@@ -21,7 +58,7 @@ index 2874bc3001c4e7d9191e47ba512c5a68369c21f1..750dd556123f3f912f8463ca3018256a
}
public SpamLimiter spamLimiter;
@@ -196,7 +196,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -188,7 +188,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Commands commands;
public class Commands extends ConfigurationPart {
@@ -30,16 +67,16 @@ index 2874bc3001c4e7d9191e47ba512c5a68369c21f1..750dd556123f3f912f8463ca3018256a
public boolean fixTargetSelectorTagCompletion = true;
public boolean timeCommandAffectsAllWorlds = false;
}
@@ -245,7 +245,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;
@@ -256,7 +256,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);
@@ -56,7 +93,7 @@ index 2874bc3001c4e7d9191e47ba512c5a68369c21f1..750dd556123f3f912f8463ca3018256a
@ConfigSerializable
public record PacketLimit(@Required double interval, @Required double maxPacketRate, ViolateAction action) {
@@ -324,7 +332,7 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -332,7 +340,7 @@ public class GlobalConfiguration extends ConfigurationPart {
executor.setMaximumPoolSize(_chatExecutorMaxSize);
}
}
@@ -66,10 +103,10 @@ index 2874bc3001c4e7d9191e47ba512c5a68369c21f1..750dd556123f3f912f8463ca3018256a
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 efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3e27d5ab5 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;
@@ -105,7 +142,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
//<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>
);
@@ -135,7 +172,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
}
}
@@ -151,14 +192,14 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -157,14 +198,14 @@ public class WorldConfiguration extends ConfigurationPart {
public ArmorStands armorStands;
public class ArmorStands extends ConfigurationPart {
@@ -153,16 +190,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
}
public Sniffer sniffer;
@@ -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)));
@@ -382,7 +423,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;
@@ -171,16 +199,16 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
public boolean disableExplosionKnockback = false;
public boolean generateFlatBedrock = false;
public FrostedIce frostedIce;
@@ -434,7 +475,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;
@@ -462,9 +503,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;
@@ -192,7 +220,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
public boolean allowPlayerCrammingDamage = false;
}
@@ -472,18 +513,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();
@@ -242,7 +270,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
});
public boolean flushRegionsOnSave = false;
}
@@ -498,9 +562,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -535,9 +599,9 @@ public class WorldConfiguration extends ConfigurationPart {
public TickRates tickRates;
public class TickRates extends ConfigurationPart {
@@ -254,7 +282,7 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
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));
@@ -534,9 +598,9 @@ public class WorldConfiguration extends ConfigurationPart {
@@ -571,9 +635,9 @@ public class WorldConfiguration extends ConfigurationPart {
public class Misc extends ConfigurationPart {
public int lightQueueSize = 20;
@@ -263,9 +291,9 @@ index efc91ff91827872c62b8bd060282549ccdcf67dd..1d926378887b9e42f1827e958f506be3
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
@@ -279,10 +307,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 20d215e53b4a02d7f52197decf05fd1e6ee44669..f832834e02594eb35e08108054f395be3b2bed51 100644
index fc378b08c10c7f670be93d52937c7642b986ed0d..9a436132faa04efbf25d8be9d5488e13f2111dac 100644
--- a/src/main/java/net/minecraft/server/Main.java
+++ b/src/main/java/net/minecraft/server/Main.java
@@ -178,7 +178,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);
@@ -292,10 +320,10 @@ index 20d215e53b4a02d7f52197decf05fd1e6ee44669..f832834e02594eb35e08108054f395be
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 5b7ed096999dbb7e95fb7d615e737f19604f58ff..9684e7079c9586e764931e5b6c40961ac9eda853 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);
@@ -314,7 +342,7 @@ index 5b7ed096999dbb7e95fb7d615e737f19604f58ff..9684e7079c9586e764931e5b6c40961a
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);
@@ -324,10 +352,10 @@ index 5b7ed096999dbb7e95fb7d615e737f19604f58ff..9684e7079c9586e764931e5b6c40961a
this.enableJmxMonitoring = this.get("enable-jmx-monitoring", false);
this.enableStatus = this.get("enable-status", true);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index d06473349dff50a33b7843ae6dcde28f50fcd708..c1e5bc9cab10c51712dad1da8ad50e5d821b85b0 100644
index 090cb821a43ccfea21a990580e47b592df9d030f..4177a12d333925dd7f3422861847119f344a441b 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -426,7 +426,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);
@@ -337,29 +365,41 @@ index d06473349dff50a33b7843ae6dcde28f50fcd708..c1e5bc9cab10c51712dad1da8ad50e5d
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 b02a0dddd99df1691c125660828a61cc4a5a4d02..739bcbb7388b948982202b35a708753103fa38e8 100644
index 5d41bd4d4b86ca0c7c03d3ac6e75b3f1f1abe73b..c608770ea0df26859a09b794e93292f4aa6881b4 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -6,5 +6,6 @@ public interface Options {
@@ -7,5 +7,6 @@ public interface Options {
boolean NO_OPTIMIZE = getBoolean("Plazma.disableConfigOptimization");
boolean NO_WARN = getBoolean("Plazma.iKnowWhatIAmDoing");
+ boolean AGGRESSIVE = Boolean.getBoolean("Plazma.aggressiveOptimize");
+ 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 9311fcb675d20ee77d225e3cffe1d6ce56601963..f9779f8cf0399e434ebe9e49e7bae5386ce01410 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);
}
@@ -368,7 +408,7 @@ index 9311fcb675d20ee77d225e3cffe1d6ce56601963..f9779f8cf0399e434ebe9e49e7bae538
private static void useAlternateKeepAlive() {
useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive);
}
@@ -486,7 +487,7 @@ public class PurpurConfig {
@@ -491,7 +491,7 @@ public class PurpurConfig {
}
public static boolean useUPnP = false;
@@ -378,10 +418,10 @@ index 9311fcb675d20ee77d225e3cffe1d6ce56601963..f9779f8cf0399e434ebe9e49e7bae538
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 7a9a5985b1429c25467db732678d0658aafcfafa..25c9a5b9b22a8680be8140f8c2dfd255dbab1bf7 100644
index 0d5a0e14cbaacc63eeced78a6c28cc64ad918522..43ad38dadfe14b3dd0565c536b276eb3f9dbd813 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -433,7 +433,7 @@ public class PurpurWorldConfig {
@@ -426,7 +426,7 @@ public class PurpurWorldConfig {
public boolean idleTimeoutTargetPlayer = true;
public String playerDeathExpDropEquation = "expLevel * 7";
public int playerDeathExpDropMax = 100;
@@ -390,7 +430,7 @@ index 7a9a5985b1429c25467db732678d0658aafcfafa..25c9a5b9b22a8680be8140f8c2dfd255
public boolean teleportOnNetherCeilingDamage = false;
public boolean totemOfUndyingWorksInInventory = false;
public boolean playerFixStuckPortal = false;
@@ -3128,7 +3128,7 @@ public class PurpurWorldConfig {
@@ -3271,7 +3271,7 @@ public class PurpurWorldConfig {
public boolean zombieJockeyOnlyBaby = true;
public double zombieJockeyChance = 0.05D;
public boolean zombieJockeyTryExistingChickens = true;
@@ -400,23 +440,23 @@ index 7a9a5985b1429c25467db732678d0658aafcfafa..25c9a5b9b22a8680be8140f8c2dfd255
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 1cf6d4f854d89c515e48e1fb365eb95ff9340765..7d1ae99e83dc6511838092c3ab6e0fd5f39faabc 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 );
}
@@ -429,47 +469,58 @@ index 1cf6d4f854d89c515e48e1fb365eb95ff9340765..7d1ae99e83dc6511838092c3ab6e0fd5
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 );
}
@@ -478,7 +529,7 @@ index 1cf6d4f854d89c515e48e1fb365eb95ff9340765..7d1ae99e83dc6511838092c3ab6e0fd5
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

@@ -5,10 +5,10 @@ Subject: [PATCH] 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 8289334e77999f72214c330a3306cbfeb17afbf1..361dc9c3434d9b4ac4b9966fa09b17f6820b0f22 100644
index 14fd0ff2b4dc226f2890e538587226cdb60d37c2..32ebee3620b5ec1ff57b92a581fb2d7f5dfe17cf 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -193,16 +193,6 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -194,16 +194,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\"");
}
@@ -25,13 +25,12 @@ index 8289334e77999f72214c330a3306cbfeb17afbf1..361dc9c3434d9b4ac4b9966fa09b17f6
DedicatedServer.LOGGER.info("Loading properties");
DedicatedServerProperties dedicatedserverproperties = this.settings.getProperties();
@@ -225,6 +215,17 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -235,6 +225,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
this.plazmaConfigurations.initializeGlobalConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
this.plazmaConfigurations.initializeWorldDefaultsConfiguration(this.registryAccess()); // Plazma - Configurable Plazma
// Paper end - initialize global and world-defaults configuration
+ // Plazma - Tweak console logging; Moved down
+ // Paper start - detect running as root
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.rootUserWarnings && io.papermc.paper.util.ServerEnvironment.userIsRootOrAdmin()) {
+ // Paper start - detect running as root // Plazma - Tweak console logging (moved down)
+ 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.");
@@ -39,11 +38,10 @@ index 8289334e77999f72214c330a3306cbfeb17afbf1..361dc9c3434d9b4ac4b9966fa09b17f6
+ DedicatedServer.LOGGER.warn("****************************");
+ }
+ // Paper end - detect running as root
+ // Plazma end - Tweak console logging
this.server.spark.enableEarlyIfRequested(); // Paper - spark
// Paper start - fix converting txt to json file; convert old users earlier after PlayerList creation but before file load/save
if (this.convertOldUsers()) {
this.getProfileCache().save(false); // Paper
@@ -330,6 +331,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -344,6 +343,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 - Add Velocity IP Forwarding Support
@@ -51,7 +49,7 @@ index 8289334e77999f72214c330a3306cbfeb17afbf1..361dc9c3434d9b4ac4b9966fa09b17f6
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.");
@@ -343,7 +345,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
@@ -357,7 +357,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.warn("While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.");
}
// Spigot end
@@ -61,25 +59,26 @@ index 8289334e77999f72214c330a3306cbfeb17afbf1..361dc9c3434d9b4ac4b9966fa09b17f6
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
index b863f6fe65c796a1d3102cc3eddb5d6c5becd3ac..2707a96f9e22469d008ec7d2fa8a8c497efaf8cf 100644
index 5b1705794a8c3914cb11fdd35f75c8e0c128ecd0..459eea7dae68afdf7e1443f29f6f8d0c68668b74 100644
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
@@ -1467,6 +1467,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
@@ -1426,6 +1426,7 @@ public abstract class PlayerList {
}
public boolean verifyChatTrusted(PlayerChatMessage message) { // Paper - private -> public
+ if (!org.plazmamc.plazma.configurations.GlobalConfiguration.get().consoleLogs.notSecurePrefix) return true; // Plazma - Tweak console logging
return message.hasSignature() && !message.hasExpiredServer(Instant.now());
}
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 9c830ec9129ac94aa08e914a82792210c13fc1a3..f7457660566d64a8149db414e005f0b8ed2202b5 100644
index e89534b6e2b91483d7eddfcb3441e9addf9bccc7..3a9fa2ac6dc5eaa153deb06a005be51c59786bbe 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -67,4 +67,13 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -85,4 +85,14 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+
+ public ConsoleLogs consoleLogs;
+ public class ConsoleLogs extends ConfigurationPart {
+

View File

@@ -0,0 +1,62 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 13 Dec 2024 13:08:37 +0900
Subject: [PATCH] Add missing Pufferfish configurations
diff --git a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
index 30779f8a00d438972ad59372ce92e23193f99820..a1612c503c12b9a4d03c1a62320801f41c0ffa2e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
+++ b/src/main/java/net/minecraft/world/entity/animal/armadillo/Armadillo.java
@@ -163,11 +163,13 @@ public class Armadillo extends Animal {
return ArmadilloAi.makeBrain(this.brainProvider().makeBrain(dynamic));
}
+ private int behaviorTick; // Plazma - Add missing pufferfish configurations
@Override
protected void customServerAiStep(ServerLevel world) {
ProfilerFiller gameprofilerfiller = Profiler.get();
gameprofilerfiller.push("armadilloBrain");
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
((Brain<Armadillo>) this.brain).tick(world, this); // CraftBukkit - decompile error
gameprofilerfiller.pop();
gameprofilerfiller.push("armadilloActivityUpdate");
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 d0023e3734bb3c625fa53077f47039dcb82d9606..36f8bb5cf25566784e11988c91e1c7409f1ac5c8 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
@@ -154,6 +154,7 @@ public class Camel extends AbstractHorse {
return pose == Pose.SITTING ? Camel.SITTING_DIMENSIONS.scale(this.getAgeScale()) : super.getDefaultDimensions(pose);
}
+ private int behaviorTick = 0; // Plazma - Add missing pufferfish configurations
@Override
protected void customServerAiStep(ServerLevel world) {
ProfilerFiller gameprofilerfiller = Profiler.get();
@@ -161,6 +162,7 @@ public class Camel extends AbstractHorse {
gameprofilerfiller.push("camelBrain");
Brain<Camel> behaviorcontroller = (Brain<Camel>) this.getBrain(); // CraftBukkit - decompile error
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
behaviorcontroller.tick(world, this);
gameprofilerfiller.pop();
gameprofilerfiller.push("camelActivityUpdate");
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 489854333e71ad4e7635870eedbdd07a84297a13..3fa391b638062196675d102b8731a96a51df8e15 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
@@ -495,11 +495,13 @@ 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(ServerLevel world) {
ProfilerFiller gameprofilerfiller = Profiler.get();
gameprofilerfiller.push("snifferBrain");
+ if ((getRider() == null || !this.isControllable()) && this.behaviorTick++ % this.activatedPriority == 0) // Plazma - Add missing pufferfish configurations
this.getBrain().tick(world, this);
gameprofilerfiller.popPush("snifferActivityUpdate");
SnifferAi.updateActivity(this);

File diff suppressed because it is too large Load Diff

View File

@@ -1,16 +1,16 @@
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 bca7b7192debb3a34a08047010a2438e7b7e2a78..b77aa7518b6ca6c6a387fc0f7270d7ff2dca4ac9 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 - Add missing purpur configuration options
@@ -23,24 +23,19 @@ index bca7b7192debb3a34a08047010a2438e7b7e2a78..b77aa7518b6ca6c6a387fc0f7270d7ff
+ public boolean isAlwaysExperienceDropper() {
+ return level().purpurConfig.allayAlwaysDropExp;
+ }
+
+ @Override
+ public void initAttributes() {
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.allayMaxHealth);
+ }
+ // Plazma end - Add missing purpur configuration options
// Purpur end
// 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 24a1663cf1cd3f888981a13907811b55bdbf6133..fdc3aa9672077787e841d240fe1e690dcd9ca321 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
@@ -93,6 +93,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 - Add missing purpur configuration options
+ @Override
+ public boolean isSensitiveToWater() {
@@ -51,15 +46,15 @@ index 24a1663cf1cd3f888981a13907811b55bdbf6133..fdc3aa9672077787e841d240fe1e690d
+ public boolean isAlwaysExperienceDropper() {
+ return level().purpurConfig.camelAlwaysDropExp;
+ }
+ // Plazma end - Add missing purpur configuration optionsurpur 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 ee8c232ddaa518377bdfa54e83ffc04f7a2f2c9a..2c45f4d321629979926bb9e677ba4bc8b44eec8d 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
@@ -160,6 +160,23 @@ public class Frog extends Animal implements VariantHolder<Holder<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();
}
@@ -80,16 +75,16 @@ index ee8c232ddaa518377bdfa54e83ffc04f7a2f2c9a..2c45f4d321629979926bb9e677ba4bc8
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.frogMaxHealth);
+ }
+ // Plazma end - Add missing purpur configuration options
// Purpur end
// 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 09c4cf772df4644413e40055fedcdf42ee8064fd..73b2e74199d54d87aa6d2b7132f10f29eefa11db 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
@@ -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 - Add missing purpur configuration options
@@ -108,11 +103,11 @@ index 09c4cf772df4644413e40055fedcdf42ee8064fd..73b2e74199d54d87aa6d2b7132f10f29
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.tadpoleMaxHealth);
+ }
+ // Plazma end - Add missing purpur configuration options
// Purpur end
// 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 21bdcbd51d9f440e0734750b40cefa4c08cdaf5f..a2cc1efaa621861828b007759536ac49d7e3646e 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
@@ -119,6 +119,18 @@ public class Sniffer extends Animal {
@@ -131,16 +126,16 @@ index 21bdcbd51d9f440e0734750b40cefa4c08cdaf5f..a2cc1efaa621861828b007759536ac49
+ return level().purpurConfig.snifferAlwaysDropExp;
+ }
+ // Plazma end - Add missing purpur configuration options
// Purpur end
// 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 0bb577ec9ba0d23a741ccf067ac35f6be68312ca..358811e71b8b8a8a09fb6c56ed51bcc11b052add 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
@@ -147,6 +147,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 - Add missing purpur configuration options
@@ -159,29 +154,32 @@ index 0bb577ec9ba0d23a741ccf067ac35f6be68312ca..358811e71b8b8a8a09fb6c56ed51bcc1
+ this.getAttribute(Attributes.MAX_HEALTH).setBaseValue(level().purpurConfig.wardenMaxHealth);
+ }
+ // Plazma end - Add missing purpur configuration options
// Purpur end
// 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 b04f7ce0805453f6c737fa9dc11c4129ca64e934..9840678549e25c6da00aea222a585e7f01ec1e0e 100644
--- a/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
+++ b/src/main/java/net/minecraft/world/entity/vehicle/ChestBoat.java
@@ -45,12 +45,12 @@ 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 - Add missing purpur configuration options
}
public ChestBoat(Level world, double d0, double d1, double d2) {
super(EntityType.CHEST_BOAT, world);
- this.itemStacks = NonNullList.withSize(27, ItemStack.EMPTY);
+ this.itemStacks = NonNullList.withSize(org.purpurmc.purpur.PurpurConfig.chestBoatRows * 9, ItemStack.EMPTY); // Plazma - Add missing purpur configuration options
this.setPos(d0, d1, d2);
this.xo = d0;
this.yo = d1;
@@ -172,7 +172,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() {
@@ -191,10 +189,10 @@ index b04f7ce0805453f6c737fa9dc11c4129ca64e934..9840678549e25c6da00aea222a585e7f
@Override
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index f9779f8cf0399e434ebe9e49e7bae5386ce01410..c5cfda1a1f0bd434efcf32e253c87738eee92def 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;
@@ -202,7 +200,7 @@ index f9779f8cf0399e434ebe9e49e7bae5386ce01410..c5cfda1a1f0bd434efcf32e253c87738
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;
});
@@ -211,26 +209,24 @@ index f9779f8cf0399e434ebe9e49e7bae5386ce01410..c5cfda1a1f0bd434efcf32e253c87738
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 25c9a5b9b22a8680be8140f8c2dfd255dbab1bf7..08815190bbeb52cb7a006727aab76f59678dba81 100644
index 43ad38dadfe14b3dd0565c536b276eb3f9dbd813..474bab426175d8dece524faeffd8977a6e1bb074 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurWorldConfig.java
@@ -1173,7 +1173,15 @@ public class PurpurWorldConfig {
public boolean allayRidable = false;
public boolean allayRidableInWater = true;
@@ -1144,7 +1144,13 @@ public class PurpurWorldConfig {
public boolean allayControllable = true;
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 - 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);
@@ -1290,7 +1298,13 @@ public class PurpurWorldConfig {
@@ -1299,7 +1305,13 @@ public class PurpurWorldConfig {
public double camelMovementSpeedMin = 0.09D;
public double camelMovementSpeedMax = 0.09D;
public int camelBreedingTicks = 6000;
@@ -244,7 +240,7 @@ index 25c9a5b9b22a8680be8140f8c2dfd255dbab1bf7..08815190bbeb52cb7a006727aab76f59
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);
@@ -1718,7 +1732,15 @@ public class PurpurWorldConfig {
@@ -1764,7 +1776,15 @@ public class PurpurWorldConfig {
public boolean frogControllable = true;
public float frogRidableJumpHeight = 0.65F;
public int frogBreedingTicks = 6000;
@@ -260,9 +256,9 @@ index 25c9a5b9b22a8680be8140f8c2dfd255dbab1bf7..08815190bbeb52cb7a006727aab76f59
frogRidable = getBoolean("mobs.frog.ridable", frogRidable);
frogRidableInWater = getBoolean("mobs.frog.ridable-in-water", frogRidableInWater);
frogControllable = getBoolean("mobs.frog.controllable", frogControllable);
@@ -2669,7 +2691,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;
@@ -274,7 +270,7 @@ index 25c9a5b9b22a8680be8140f8c2dfd255dbab1bf7..08815190bbeb52cb7a006727aab76f59
snifferRidable = getBoolean("mobs.sniffer.ridable", snifferRidable);
snifferRidableInWater = getBoolean("mobs.sniffer.ridable-in-water", snifferRidableInWater);
snifferControllable = getBoolean("mobs.sniffer.controllable", snifferControllable);
@@ -2768,7 +2796,15 @@ public class PurpurWorldConfig {
@@ -2884,7 +2910,15 @@ public class PurpurWorldConfig {
public boolean tadpoleRidable = false;
public boolean tadpoleRidableInWater = true;
public boolean tadpoleControllable = true;
@@ -290,7 +286,7 @@ index 25c9a5b9b22a8680be8140f8c2dfd255dbab1bf7..08815190bbeb52cb7a006727aab76f59
tadpoleRidable = getBoolean("mobs.tadpole.ridable", tadpoleRidable);
tadpoleRidableInWater = getBoolean("mobs.tadpole.ridable-in-water", tadpoleRidableInWater);
tadpoleControllable = getBoolean("mobs.tadpole.controllable", tadpoleControllable);
@@ -2984,7 +3020,15 @@ public class PurpurWorldConfig {
@@ -3116,7 +3150,15 @@ public class PurpurWorldConfig {
public boolean wardenRidable = false;
public boolean wardenRidableInWater = true;
public boolean wardenControllable = true;

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 afe6b2170846273b41b694aa53dca4c31bf78b3f..52043e451ca0641c93205aac62aba5427625b81f 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
@@ -99,7 +99,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) {
@@ -132,7 +132,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) {
@@ -186,7 +186,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 42d639688b6f0b9ff53debf49a920f5c8e232a19..36728e206de513e071f387d36a608e70a5984a58 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

@@ -0,0 +1,90 @@
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 acdff7b4a00d563739fd301c3633a266875296fa..1266aaf4bfcf53aa16d7b9bd697a0c483d3218a9 100644
--- a/src/main/java/net/minecraft/world/level/portal/PortalShape.java
+++ b/src/main/java/net/minecraft/world/level/portal/PortalShape.java
@@ -113,7 +113,7 @@ public class PortalShape {
private static int calculateWidth(BlockGetter iblockaccess, BlockPos blockposition, Direction enumdirection, BlockStateListPopulator blocks) { // CraftBukkit
int i = PortalShape.getDistanceUntilEdgeAboveFrame(iblockaccess, blockposition, enumdirection, blocks); // CraftBukkit
- return i >= 2 && i <= 21 ? i : 0;
+ return i >= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.width.min() && i <= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.width.max() ? i : 0; // Plazma - Configurable nether portal size
}
private static int getDistanceUntilEdgeAboveFrame(BlockGetter iblockaccess, BlockPos blockposition, Direction enumdirection, BlockStateListPopulator blocks) { // CraftBukkit
@@ -146,7 +146,7 @@ public class PortalShape {
BlockPos.MutableBlockPos blockposition_mutableblockposition = new BlockPos.MutableBlockPos();
int j = PortalShape.getDistanceUntilTop(iblockaccess, blockposition, enumdirection, blockposition_mutableblockposition, i, mutableint, blocks); // CraftBukkit
- return j >= 3 && j <= 21 && PortalShape.hasTopFrame(iblockaccess, blockposition, enumdirection, blockposition_mutableblockposition, i, j, blocks) ? j : 0; // CraftBukkit
+ return j >= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.height.min() && j <= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.height.max() && PortalShape.hasTopFrame(iblockaccess, blockposition, enumdirection, blockposition_mutableblockposition, i, j, blocks) ? j : 0; // Craftbukkit // Plazma - Configurable nether portal size
}
private static boolean hasTopFrame(BlockGetter iblockaccess, BlockPos blockposition, Direction enumdirection, BlockPos.MutableBlockPos blockposition_mutableblockposition, int i, int j, BlockStateListPopulator blocks) { // CraftBukkit
@@ -200,7 +200,7 @@ public class PortalShape {
}
public boolean isValid() {
- return this.width >= 2 && this.width <= 21 && this.height >= 3 && this.height <= 21;
+ return this.width >= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.width.min() && this.width <= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.width.max() && this.height >= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.height.min() && this.height <= org.plazmamc.plazma.configurations.GlobalConfiguration.get().structure.netherPortal.height.max(); // Plazma - Configurable nether portal size
}
// CraftBukkit start - return boolean, add entity
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 3a9fa2ac6dc5eaa153deb06a005be51c59786bbe..f99a281244f7b736bd979cfc0bcd0787d9da9a42 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -76,6 +76,26 @@ public class GlobalConfiguration extends ConfigurationPart {
public Structure structure;
public class Structure 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); }
+
+ }
+
+ }
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index c222d58520b655b54b8975ec226a4ba948691cd4..c703237d46b114227cf0d5cdff2e033839bc5f57 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -36,17 +36,6 @@ public class WorldConfigurations extends ConfigurationPart {
}
- public Structure structure;
- public class Structure extends ConfigurationPart {
-
- public NetherPortal netherPortal;
- public class NetherPortal extends ConfigurationPart {
-
-
- }
-
- }
-
public Block block;
public class Block extends ConfigurationPart {

View File

@@ -1,319 +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 4a265c97ea872b178286394e2b8d2382166e4cf0..f0f33f5aea9a9d7b4c9b761458d425f83e83f227 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -235,6 +235,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@Nullable
private ServerStatus.Favicon statusIcon;
private final RandomSource random;
+ public static RandomSource random() { return getServer().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 b47a8a082170bcb630c4354be7c77a4cac71d105..7fe6b99e146e7374cd29534f1e89046edd340a82 100644
--- a/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
+++ b/src/main/java/net/minecraft/server/commands/SpreadPlayersCommand.java
@@ -66,7 +66,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 42a623254bd2886d09eb0cfeb01dd12d0dda19cf..feed838fe1ff9db60f1971cbafc25baf9af69fac 100644
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
@@ -482,7 +482,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;
@@ -519,7 +519,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 3b4fadb37eafb2f7b0ce4d6b276d2fdaa8287521..ba041288f9619870ab08c2956262d35eed85b44b 100644
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
@@ -91,7 +91,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 ? MinecraftServer.random() : RandomSource.create()).nextInt()); // Plazma - Reduce create random instance
this.transferred = transferred;
}
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 0e0867d7add9a024bbe9471f8ff92bbb25996a3d..c0fad810538ede0f248898db2e68625b96e56c16 100644
--- a/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
+++ b/src/main/java/net/minecraft/server/rcon/thread/QueryThreadGs4.java
@@ -341,7 +341,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.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 3fac11bf02652b5f51f30f99bdf516504467d0d2..9d939624756e8a7a07a787f9807f095c5033b234 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> {
protected final List<ShufflingList.WeightedEntry<U>> entries;
- private final RandomSource random = RandomSource.create();
+ private final RandomSource random = org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.reduceRandom ? net.minecraft.server.MinecraftServer.random() : RandomSource.create(); // Plazma - Reduce create random instance
private final boolean isUnsafe; // Paper - Fix Concurrency issue in ShufflingList during worldgen
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 09a7b418ddf564c0be13297f7c216db2e7ae1578..703006eb5df8099c4f51cdb4e41f95cacfbe43a6 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.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.0);
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 3d792957f27fd4bdfad8d76262a8e2a2012bf35f..71539b5910692489cad6f78ac90f3aabc4e58236 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
@@ -33,7 +33,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.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 -> instance.group(
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 96e9fce5f9084737d2fcf4deb83305733b480179..43da8ea227b2b01d6975a3f4f209099d350386f6 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.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 35299affb699d745804a3b60cb78b9323f3e068e..75890635b357bc54a03ed00bcfb3e287f1eb2cff 100644
--- a/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
+++ b/src/main/java/net/minecraft/world/entity/projectile/FishingHook.java
@@ -87,7 +87,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 fdff9788eaf663be79214b2ca491f0f0444f6136..de50b06f13df481fa59e1abe16d5181b8124b427 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -118,7 +118,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;
@@ -132,7 +132,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 c3a644b0f8c7c5622acc9e1a496f95d432718806..ce8fb88b31af1d27a7118735154673a9f05499ec 100644
--- a/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
+++ b/src/main/java/net/minecraft/world/inventory/EnchantmentMenu.java
@@ -95,7 +95,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 f5e84bf8817e2d53557e0909d8c9e0e0e8206a16..1792f18397d733d87ef067a7daaf076be4163c63 100644
--- a/src/main/java/net/minecraft/world/level/Explosion.java
+++ b/src/main/java/net/minecraft/world/level/Explosion.java
@@ -93,7 +93,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, ParticleOptions particle, ParticleOptions emitterParticle, Holder<SoundEvent> soundEvent) {
- 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 648b21e3a83e0c35be739bd4ebfa930b84b1e4dd..9e8faa787fe3f924da898244a00eb3da3354d68b 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -121,16 +121,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 Holder<DimensionType> dimensionTypeRegistration;
public final WritableLevelData levelData;
// private final Supplier<ProfilerFiller> profiler; // Plazma - Completely remove Mojang's Profiler
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 fb9611866671880fc7a1a969da928b8f2ad15269..44962ecedf724e941e59913188afe4cfad252fc8 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
@@ -357,7 +357,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 a6b6e5ea191c0e2cd7a2e4f01b89d8af40a83c1b..19769ac9fa688969fd2db7c9a5e92eaadac124c4 100644
--- a/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
+++ b/src/main/java/net/minecraft/world/level/chunk/ChunkGeneratorStructureState.java
@@ -224,7 +224,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.random() : RandomSource.create(); // Plazma - Reduce create random instace
// Paper start - Add missing structure set seed configs
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 7bbe93966fa00b7001da53bf2f22f4d942b7cc22..6c5eececc83571b0f60e7f672ed185e1d262e99c 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
@@ -81,7 +81,7 @@ public enum DragonRespawnAnimation {
world.explode((Entity) null, (double) ((float) worldgenender_spike.getCenterX() + 0.5F), (double) worldgenender_spike.getHeight(), (double) ((float) worldgenender_spike.getCenterZ() + 0.5F), 5.0F, Level.ExplosionInteraction.BLOCK);
SpikeConfiguration worldgenfeatureendspikeconfiguration = new SpikeConfiguration(true, ImmutableList.of(worldgenender_spike), new BlockPos(0, 128, 0));
- Feature.END_SPIKE.place(worldgenfeatureendspikeconfiguration, world, world.getChunkSource().getGenerator(), RandomSource.create(), new BlockPos(worldgenender_spike.getCenterX(), 45, worldgenender_spike.getCenterZ()));
+ Feature.END_SPIKE.place(worldgenfeatureendspikeconfiguration, world, world.getChunkSource().getGenerator(), (world.plazmaConfig().misc.reduceRandom ? world.getRandom() : RandomSource.create()), new BlockPos(worldgenender_spike.getCenterX(), 45, worldgenender_spike.getCenterZ())); // Plazma - Reduce create random instance
}
} else if (flag1) {
fight.setRespawnStage(SUMMONING_DRAGON); // CraftBukkit - decompile error
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 18a1b4325cac81b040596071dab99ef9bf6f3142..ab492b184a4ecdefc423823fc72abd800b71f016 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);
+ 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 - Prevent "softlocked" exit portal generation
- 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 1309fabd357eb9b8f90f882ec7ff3de9e60f187d..d300668899c3382a42e6a25dd084fb814b56f6bc 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 f7457660566d64a8149db414e005f0b8ed2202b5..d922c572e2410fa1f719fe2371f65cd1542ca8b4 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -64,6 +64,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 36728e206de513e071f387d36a608e70a5984a58..c8b10b3499fbdf41f0b268d8a9da729e3432bb66 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

@@ -7,10 +7,10 @@ Subject: [PATCH] Apply various optimizations
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 3aae4fa4176c0bf170f4532ae187e3122c142a6a..215368ec72d4763479c2cdc668c3e2389ceb4f7a 100644
index 305a569f8cd83f3c67a4d4377f2881d36961dacd..8001ae563ac06d8ba9fd1de0b4111a3c8241de8c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2201,8 +2201,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -2332,8 +2332,9 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
public void playerTouch(Player player) {}
public void push(Entity entity) {
@@ -21,7 +21,7 @@ index 3aae4fa4176c0bf170f4532ae187e3122c142a6a..215368ec72d4763479c2cdc668c3e238
if (this.level.paperConfig().collisions.onlyPlayersCollide && !(entity instanceof ServerPlayer || this instanceof ServerPlayer)) return; // Paper - Collision option for requiring a player participant
double d0 = entity.getX() - this.getX();
double d1 = entity.getZ() - this.getZ();
@@ -2230,8 +2231,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
@@ -2361,8 +2362,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
entity.push(d0, 0.0D, d1);
}
}

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Do not 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 04f67f7b43d2f461c776c76614dc3e5f060aea63..b3fe0dd152b3e2e1b83b4ec2270d387e6117ec1c 100644
index 27eb9a365006884c85603dc6d9dd8eee009c98b3..958a48d05aba8e500c7b19a466dcca6fea8a8bcc 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/PhantomSpawner.java
@@ -70,6 +70,7 @@ public class PhantomSpawner implements CustomSpawner {
@@ -17,10 +17,10 @@ index 04f67f7b43d2f461c776c76614dc3e5f060aea63..b3fe0dd152b3e2e1b83b4ec2270d387e
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 c8b10b3499fbdf41f0b268d8a9da729e3432bb66..922d1d250f2e2e5a4177bcf5fe7487ff2b43413b 100644
index c703237d46b114227cf0d5cdff2e033839bc5f57..a976e2b960a5f3b7ecf6e42afcb1dd3bd140b8bd 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 {
@@ -31,6 +31,7 @@ public class WorldConfigurations extends ConfigurationPart {
public Phantom phantom;
public class Phantom extends ConfigurationPart {

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] Do not 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 17da915ffa638500a83b67db0940a7b9a9b333a1..27a112818c000f4e649f044b7960ca988976876b 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
@@ -74,6 +74,7 @@ public abstract class RandomizableContainerBlockEntity extends BaseContainerBloc
@Override
public void unpackLootTable(@org.jetbrains.annotations.Nullable final Player player) {
+ if (player == null && org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.refreshLootTableForNonPlayerInteraction) return; // Plazma - Do not refresh LootTable for non player interaction
// Copied from super with changes, always check the original method
net.minecraft.world.level.Level level = this.getLevel();
BlockPos blockPos = this.getBlockPos();
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index d922c572e2410fa1f719fe2371f65cd1542ca8b4..a060257a62da7ed02b342b426e18e5f02ecdbdc9 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -66,6 +66,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean reduceRandom = OPTIMIZE;
public boolean ignoreThreadSafeRandom = false;
+ public boolean refreshLootTableForNonPlayerInteraction = !OPTIMIZE;
}

View File

@@ -6,22 +6,28 @@ Subject: [PATCH] Add option to disable moved to quickly check for specific
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 6d9242bc79526ebe4fdfe1f5d0ded429da2a9f95..4578339fc2ae7bff119a10744e2c2b3d4ac6cfd4 100644
index c783c17d45beda8297171d0834350197808a7335..611de28d27d75b73e33a552c8a23d6c0f53582da 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1444,6 +1444,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
// Paper end - Prevent moving into unloaded chunks
+ if (!this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.checkSpectatorMovedToQuickly && this.player.isSpectator())) // Plazma - Options to bypass moved to quickly check
if (!this.player.isChangingDimension() && (!this.player.level().getGameRules().getBoolean(GameRules.RULE_DISABLE_ELYTRA_MOVEMENT_CHECK) || !flag)) {
float f2 = flag ? 300.0F : 100.0F;
@@ -1749,7 +1749,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
}
}
+ // Plazma start - Add option to bypass moved to quickly check
private boolean shouldCheckPlayerMovement(boolean elytra) {
+ return (!this.player.getBukkitEntity().hasPermission("plazma.bypass-moved-to-quickly-check") || !(org.plazmamc.plazma.configurations.GlobalConfiguration.get().player.checkSpectatorMovedToQuickly && this.player.isSpectator())) && shouldCheckPlayerMovement0(elytra);
+ }
+
+ private boolean shouldCheckPlayerMovement0(boolean elytra) {
+ // Plazma end - Add option to bypass moved to quickly check
if (this.isSingleplayerOwner()) {
return false;
} else if (this.player.isChangingDimension()) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index a060257a62da7ed02b342b426e18e5f02ecdbdc9..f7e4d14a7eaa3e35c9b03f3c6a01ae8712ded569 100644
index f99a281244f7b736bd979cfc0bcd0787d9da9a42..6d313edc60082a5f2d30ef8ad9fbd57772f361fe 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 {
@@ -43,6 +43,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Player player;
public class Player extends ConfigurationPart {

View File

@@ -0,0 +1,63 @@
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 3f39d6c786d9dfdd9ad591e08ff05fcbb41a1df6..0346fd4ab7095d66c0eef5a440afbc7a8ba52466 100644
--- a/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
+++ b/src/main/java/net/minecraft/world/level/levelgen/NoiseBasedChunkGenerator.java
@@ -71,14 +71,14 @@ public final class NoiseBasedChunkGenerator extends ChunkGenerator {
}
private static Aquifer.FluidPicker createFluidPicker(NoiseGeneratorSettings settings) {
- 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());
- Aquifer.FluidStatus aquifer_b2 = new Aquifer.FluidStatus(DimensionType.MIN_Y * 2, Blocks.AIR.defaultBlockState());
-
- return (j, k, l) -> {
- return k < Math.min(-54, i) ? aquifer_b : aquifer_b1;
- };
+ // Plazma start - Configurable default lava sea level
+ int i = org.plazmamc.plazma.configurations.GlobalConfiguration.get().worldgen.lavaSea.startLevel;
+ int j = settings.seaLevel();
+ Aquifer.FluidStatus aquifer1 = new Aquifer.FluidStatus(i, org.plazmamc.plazma.configurations.GlobalConfiguration.get().worldgen.lavaSea.seaBlock());
+ Aquifer.FluidStatus aquifer2 = new Aquifer.FluidStatus(j, settings.defaultFluid());
+
+ return (x, y, z) -> y < Math.min(i, j) ? aquifer1 : aquifer2;
+ // Plazma end - Configurable default lava sea level
}
@Override
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index 6d313edc60082a5f2d30ef8ad9fbd57772f361fe..5450d2a784511122a8236d30485f6b1f798822f3 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -51,6 +51,24 @@ public class GlobalConfiguration extends ConfigurationPart {
public WorldGeneration worldgen;
public class WorldGeneration extends ConfigurationPart {
+ public LavaSea lavaSea;
+ public class LavaSea extends ConfigurationPart {
+
+ public int startLevel = -54;
+ String seaBlock = "default";
+
+ public net.minecraft.world.level.block.state.BlockState seaBlock() {
+ if (this.seaBlock.equalsIgnoreCase("default")) return net.minecraft.world.level.block.Blocks.LAVA.defaultBlockState();
+ return net.minecraft.core.registries.BuiltInRegistries.BLOCK
+ .getOptional(net.minecraft.resources.ResourceLocation.tryParse(this.seaBlock))
+ .orElseGet(() -> {
+ PlazmaConfigurations.LOGGER.warn("Invalid custom sea level block: {}, defaulting to lava", this.seaBlock);
+ return net.minecraft.world.level.block.Blocks.LAVA;
+ })
+ .defaultBlockState();
+ }
+
+ }
}

View File

@@ -5,31 +5,32 @@ 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 274ca06fbda0f54805fc82614d43b6e1a4a5d4a8..688f3c01cb939a6c959efbb3b59ac8ee60db3633 100644
index 0be6582e50ccc94036bb6782a5f811c0f9c42f01..98b08a2e83cf1c4e1e45a42ddcad2198f42a05e2 100644
--- a/src/main/java/net/minecraft/world/entity/Mob.java
+++ b/src/main/java/net/minecraft/world/entity/Mob.java
@@ -995,10 +995,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Targeti
//ProfilerFiller gameprofilerfiller = this.level().getProfiler(); // Purpur
@@ -951,10 +951,11 @@ public abstract class Mob extends LivingEntity implements EquipmentUser, Leashab
ProfilerFiller gameprofilerfiller = Profiler.get();
//gameprofilerfiller.push("sensing"); // Purpur
gameprofilerfiller.push("sensing");
- this.sensing.tick();
+ //this.sensing.tick(); // Plazma - Moved down
//gameprofilerfiller.pop(); // Purpur
+ //this.sensing.tick(); // Plazma - moved down
gameprofilerfiller.pop();
int i = this.tickCount + 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) {
//gameprofilerfiller.push("targetSelector"); // Purpur
this.targetSelector.tickRunningGoals(false);
gameprofilerfiller.push("targetSelector");
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 c8a3e91d0d6510b519e927027f5a534cddf7d0a3..bc283729cab4df2c596febf1df54241571227564 100644
index a976e2b960a5f3b7ecf6e42afcb1dd3bd140b8bd..9e408d6c1826d36a935b3e382e8eb0283f3d1580 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 {
@@ -28,6 +28,8 @@ public class WorldConfigurations extends ConfigurationPart {
public Entity entity;
public class Entity extends ConfigurationPart {
public boolean ignoreUselessPackets = OPTIMIZE;
+ public int sensorTick = 1;
+
public Phantom phantom;
public class Phantom extends ConfigurationPart {

View File

@@ -5,10 +5,10 @@ Subject: [PATCH] Variable entity wakeup duration
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index bc283729cab4df2c596febf1df54241571227564..1e7c23c8851ba1d0f37d2b17fd334220e060888e 100644
index 9e408d6c1826d36a935b3e382e8eb0283f3d1580..a371893777a2c2d1de22e7d52f2fd3f55b82d74d 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -39,6 +39,20 @@ public class WorldConfigurations extends ConfigurationPart {
@@ -37,6 +37,20 @@ public class WorldConfigurations extends ConfigurationPart {
}
@@ -28,21 +28,22 @@ index bc283729cab4df2c596febf1df54241571227564..1e7c23c8851ba1d0f37d2b17fd334220
+
}
public Structure structure;
public Block block;
diff --git a/src/main/java/org/spigotmc/ActivationRange.java b/src/main/java/org/spigotmc/ActivationRange.java
index de2b469f06f6679aed1d20156052bfbef5e7c30b..ebd0764dde2e1d79fb41b5d881990ee07a0590b1 100644
index 9b1a16747aa23b18e4cff986efaac6ce64b6ddb9..6a45bafaa1d7ddc0f80c0945e15c3d6c67f9f2b3 100644
--- a/src/main/java/org/spigotmc/ActivationRange.java
+++ b/src/main/java/org/spigotmc/ActivationRange.java
@@ -64,29 +64,36 @@ public class ActivationRange
Activity.PANIC
@@ -66,29 +66,37 @@ public class ActivationRange
net.minecraft.world.entity.schedule.Activity.PANIC
};
+ // Plazma start - Variable entity wakeup duration
+ private static int getWakeupDuration(net.minecraft.util.RandomSource random, int duration, double deviation) {
+ private static int getWakeUpDuration(net.minecraft.util.RandomSource random, int duration, double deviation) {
+ if (deviation == 0) return duration;
+ return (int) Math.min(Integer.MAX_VALUE, Math.max(1, Math.round(duration * (1 + deviation * random.nextGaussian()))));
+ }
+ // Plazma end - Variable entity wakeup duration
+
private static int checkInactiveWakeup(Entity entity) {
Level world = entity.level();
SpigotWorldConfig config = world.spigotConfig;
@@ -52,25 +53,25 @@ index de2b469f06f6679aed1d20156052bfbef5e7c30b..ebd0764dde2e1d79fb41b5d881990ee0
if (inactiveFor > config.wakeUpInactiveVillagersEvery && world.wakeupInactiveRemainingVillagers > 0) {
world.wakeupInactiveRemainingVillagers--;
- return config.wakeUpInactiveVillagersFor;
+ return getWakeupDuration(world.getRandom(), config.wakeUpInactiveVillagersFor, plazmaConfig.entity.wakeUpDurationVariance.villager()); // Plazma - Variable entity wakeup duration
+ return getWakeUpDuration(world.getRandom(), config.wakeUpInactiveVillagersFor, plazmaConfig.entity.wakeUpDurationVariance.villager()); // Plazma - Variable entity wakeup duration
}
} else if (entity.activationType == ActivationType.ANIMAL) {
if (inactiveFor > config.wakeUpInactiveAnimalsEvery && world.wakeupInactiveRemainingAnimals > 0) {
world.wakeupInactiveRemainingAnimals--;
- return config.wakeUpInactiveAnimalsFor;
+ return getWakeupDuration(world.getRandom(), config.wakeUpInactiveAnimalsFor, plazmaConfig.entity.wakeUpDurationVariance.animal()); // Plazma - Variable entity wakeup duration
+ return getWakeUpDuration(world.getRandom(), config.wakeUpInactiveAnimalsFor, plazmaConfig.entity.wakeUpDurationVariance.animal()); // Plazma - Variable entity wakeup duration
}
} else if (entity.activationType == ActivationType.FLYING_MONSTER) {
if (inactiveFor > config.wakeUpInactiveFlyingEvery && world.wakeupInactiveRemainingFlying > 0) {
world.wakeupInactiveRemainingFlying--;
- return config.wakeUpInactiveFlyingFor;
+ return getWakeupDuration(world.getRandom(), config.wakeUpInactiveFlyingFor, plazmaConfig.entity.wakeUpDurationVariance.flying()); // Plazma - Variable entity wakeup duration
+ return getWakeUpDuration(world.getRandom(), config.wakeUpInactiveFlyingFor, plazmaConfig.entity.wakeUpDurationVariance.flying()); // Plazma - Variable entity wakeup duration
}
} else if (entity.activationType == ActivationType.MONSTER || entity.activationType == ActivationType.RAIDER) {
if (inactiveFor > config.wakeUpInactiveMonstersEvery && world.wakeupInactiveRemainingMonsters > 0) {
world.wakeupInactiveRemainingMonsters--;
- return config.wakeUpInactiveMonstersFor;
+ return getWakeupDuration(world.getRandom(), config.wakeUpInactiveMonstersFor, plazmaConfig.entity.wakeUpDurationVariance.monster()); // Plazma - Variable entity wakeup duration
+ return getWakeUpDuration(world.getRandom(), config.wakeUpInactiveMonstersFor, plazmaConfig.entity.wakeUpDurationVariance.monster()); // Plazma - Variable entity wakeup duration
}
}
return -1;

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 8ce870a5341a61fbbaf42021ef7f7f615a6a3e09..e3990d5f5a49aca501289e92f7462a5f2709db9b 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 - Configurable cave lava sea level
+ 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 - Configurable cave lava sea level
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 f7e4d14a7eaa3e35c9b03f3c6a01ae8712ded569..4f3ed01e12ccb8a6f1a5c4f605451bb36370a236 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: {}, defaulting to lava", this.customSeaBlock);
+ return net.minecraft.world.level.block.Blocks.LAVA;
+ })
+ .defaultBlockState();
+ }
+
+ }
}

View File

@@ -7,7 +7,7 @@ Subject: [PATCH] Add entity spawn deadlock timer
- 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 967af8771ff8564c715d89f4b4b69b16c25add59..2ac5fb585636523787e05edaa58a4fa34a39ef28 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
@@ -50,6 +50,8 @@ public abstract class BaseSpawner {
@@ -61,10 +61,10 @@ index 967af8771ff8564c715d89f4b4b69b16c25add59..2ac5fb585636523787e05edaa58a4fa3
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 29514dd01d46ba9f6b123bf3af56981541f670db..6a0cfec24618227d9a5ddc6c71e37d1986147799 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 29514dd01d46ba9f6b123bf3af56981541f670db..6a0cfec24618227d9a5ddc6c71e37d19
+
}
public Structure structure;
public Block block;

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 45744d86e9582a93a0cec26009deea091080fbbe..5dd9473c55a08a775aa406901a0e54ef6f63837a 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 - Optimise state lookup more
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

@@ -5,10 +5,10 @@ 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 fa698cfefccdddf5e5e9938a2959004c70f743a7..b24754e36e210a635524be099cffe4553220a6a9 100644
index e64ff857bf95436033baf38db1e6895f75856f9c..f029cdfe3d1e1b13a0cc3bf04e7285907c02a9a8 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -2654,6 +2654,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
@@ -2832,6 +2832,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
protected void updateSwingTime() {

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 44e4a768a0ccde83cae5547c7ba07744cec4c693..7954be9d04d88444601144bab560701c04274aa7 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -406,7 +406,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
@@ -417,7 +418,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 1e7c23c8851ba1d0f37d2b17fd334220e060888e..29514dd01d46ba9f6b123bf3af56981541f670db 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 {

View File

@@ -0,0 +1,19 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 6 May 2024 12:25:59 +0900
Subject: [PATCH] Use Akair's flag when running the test server with gradle
diff --git a/build.gradle.kts b/build.gradle.kts
index a40dc8b2560b8cd124d961f3dfd5865efd2a3b9e..e4dfd79840913e776a84bacda776329cb32e2be9 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -164,7 +164,7 @@ fun TaskContainer.registerRunTask(
languageVersion.set(JavaLanguageVersion.of(21))
vendor.set(JvmVendorSpec.JETBRAINS)
})
- jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods")
+ jvmArgs("-XX:+AllowEnhancedClassRedefinition", "-XX:+AllowRedefinitionToAddDeleteMethods", "--add-modules=jdk.incubator.vector", "-XX:+UseG1GC", "-XX:+ParallelRefProcEnabled", "-XX:MaxGCPauseMillis=200", "-XX:+UnlockExperimentalVMOptions", "-XX:+DisableExplicitGC", "-XX:+AlwaysPreTouch", "-XX:G1HeapWastePercent=5", "-XX:G1MixedGCCountTarget=4", "-XX:InitiatingHeapOccupancyPercent=15", "-XX:G1MixedGCLiveThresholdPercent=90", "-XX:G1RSetUpdatingPauseTimePercent=5", "-XX:SurvivorRatio=32", "-XX:+PerfDisableSharedMem", "-XX:MaxTenuringThreshold=1", "-Dusing.aikars.flags=https://mcflags.emc.gs", "-Daikars.new.flags=true", "-XX:G1NewSizePercent=40", "-XX:G1MaxNewSizePercent=50", "-XX:G1HeapRegionSize=16M", "-XX:G1ReservePercent=15") // Plazma - Always agree EULA on development mode; Use Akair's flag when running the test server with gradle
if (rootProject.childProjects["test-plugin"] != null) {
val testPluginJar = rootProject.project(":test-plugin").tasks.jar.flatMap { it.archiveFile }

View File

@@ -0,0 +1,77 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Mon, 6 May 2024 13:40:48 +0900
Subject: [PATCH] Use Plazma logo instead if server favicon doesn't exist
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 82bded015da16ed2feae1161a31f916804c6fbbb..657f118713b2188cb2e7fe5ec3be455189b50623 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1628,29 +1628,32 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
}
private Optional<ServerStatus.Favicon> loadStatusIcon() {
- Optional<Path> optional = Optional.of(this.getFile("server-icon.png")).filter((path) -> {
- return Files.isRegularFile(path, new LinkOption[0]);
- }).or(() -> {
- return this.storageSource.getIconFile().filter((path) -> {
- return Files.isRegularFile(path, new LinkOption[0]);
- });
- });
-
- return optional.flatMap((path) -> {
- try {
- BufferedImage bufferedimage = ImageIO.read(path.toFile());
-
- Preconditions.checkState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide");
- Preconditions.checkState(bufferedimage.getHeight() == 64, "Must be 64 pixels high");
- ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
-
- ImageIO.write(bufferedimage, "PNG", bytearrayoutputstream);
- return Optional.of(new ServerStatus.Favicon(bytearrayoutputstream.toByteArray()));
- } catch (Exception exception) {
- MinecraftServer.LOGGER.error("Couldn't load server icon", exception);
- return Optional.empty();
- }
- });
+ // Plazma start - Use Plazma logo instead if server favicon doesn't exist
+ @Nullable File file = Optional.of(this.getFile("server-icon.png").toAbsolutePath()).filter(Files::isRegularFile)
+ .or(() -> this.storageSource.getIconFile().filter(Files::isRegularFile)).map(Path::toFile).orElse(null);
+ try (
+ java.io.InputStream stream = (file != null)
+ ? new java.io.FileInputStream(file)
+ : (
+ org.plazmamc.plazma.Options.VANILLA_ICO
+ ? null
+ : MinecraftServer.class.getResourceAsStream("logo.png")
+ )
+ ) {
+ if (stream == null) return Optional.empty();
+ if (file == null && !org.plazmamc.plazma.Options.VANILLA_ICO)
+ LOGGER.info("No server icon found, using the logo instead.");
+ BufferedImage bufferedimage = ImageIO.read(stream);
+ Preconditions.checkState(bufferedimage.getWidth() == 64, "Must be 64 pixels wide");
+ Preconditions.checkState(bufferedimage.getHeight() == 64, "Must be 64 pixels high");
+ ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();
+ ImageIO.write(bufferedimage, "PNG", bytearrayoutputstream);
+ return Optional.of(new ServerStatus.Favicon(bytearrayoutputstream.toByteArray()));
+ } catch (Exception exception) {
+ MinecraftServer.LOGGER.error("Couldn't load server icon", exception);
+ return Optional.empty();
+ }
+ // Plazma end - Use Plazma logo instead if server favicon doesn't exist
}
public Optional<Path> getWorldScreenshotFile() {
diff --git a/src/main/java/org/plazmamc/plazma/Options.java b/src/main/java/org/plazmamc/plazma/Options.java
index 063b71b3043a69a90130a81686b6a5f1e5f22fd1..e7092aeb5abce5aa5f9bd434adc6acd4e43dec13 100644
--- a/src/main/java/org/plazmamc/plazma/Options.java
+++ b/src/main/java/org/plazmamc/plazma/Options.java
@@ -10,5 +10,6 @@ public interface Options {
boolean AGGRESSIVE = getBoolean("Plazma.aggressiveOptimize") && !NO_OPTIMIZE;
boolean VANILLAIZE = getBoolean("Plazma.vanillaize") && !AGGRESSIVE;
boolean USE_VANILLA = getBoolean("Plazma.useVanillaConfiguration") && !AGGRESSIVE && NO_OPTIMIZE;
+ boolean VANILLA_ICO = getBoolean("Plazma.useVanillaFavicon");
}

View File

@@ -19,8 +19,20 @@ 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 2707a96f9e22469d008ec7d2fa8a8c497efaf8cf..9eedd395b3eac5e2511c8267781938a3fd994d90 100644
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 {
@@ -40,10 +52,10 @@ index 2707a96f9e22469d008ec7d2fa8a8c497efaf8cf..9eedd395b3eac5e2511c8267781938a3
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 4f3ed01e12ccb8a6f1a5c4f605451bb36370a236..98f26e3de66a881163e84295e9156c7f362bf7cb 100644
index 5450d2a784511122a8236d30485f6b1f798822f3..a0b1239e302f0366743949a895a0539348817077 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -29,6 +29,16 @@ public class GlobalConfiguration extends ConfigurationPart {
@@ -45,6 +45,15 @@ public class GlobalConfiguration extends ConfigurationPart {
public boolean checkSpectatorMovedToQuickly = !OPTIMIZE;
@@ -52,7 +64,6 @@ index 4f3ed01e12ccb8a6f1a5c4f605451bb36370a236..98f26e3de66a881163e84295e9156c7f
+
+ public boolean enabled = false;
+ public boolean rewriteChat = true;
+ public boolean claimSecureChatEnforced = true;
+ public boolean noChatReports = true;
+
+ }
@@ -62,103 +73,110 @@ index 4f3ed01e12ccb8a6f1a5c4f605451bb36370a236..98f26e3de66a881163e84295e9156c7f
@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..67f21c23e80881f52e7b92f22c6cbbe3a0bd55b5
index 0000000000000000000000000000000000000000..49290983ef6b63bbacdef30f774ce683228e5755
--- /dev/null
+++ b/src/main/java/ru/bk/oharass/freedomchat/FreedomChat.java
@@ -0,0 +1,96 @@
@@ -0,0 +1,103 @@
+package ru.bk.oharass.freedomchat;
+
+import com.google.gson.JsonObject;
+import com.mojang.logging.LogUtils;
+import com.mojang.serialization.JsonOps;
+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.EncoderException;
+import io.netty.handler.codec.MessageToByteEncoder;
+import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
+import net.minecraft.network.Connection;
+import net.minecraft.network.FriendlyByteBuf;
+import net.minecraft.network.chat.ChatType;
+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.ClientboundServerDataPacket;
+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 org.slf4j.Logger;
+import net.minecraft.server.MinecraftServer;
+
+import java.util.Objects;
+import java.util.Optional;
+
+import static org.plazmamc.plazma.configurations.GlobalConfiguration.get;
+import static net.minecraft.server.MinecraftServer.getServer;
+
+@ChannelHandler.Sharable
+public class FreedomChat extends MessageToByteEncoder<Packet<?>> {
+
+ private static final Logger LOGGER = LogUtils.getLogger();
+ 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.claimSecureChatEnforced && msg instanceof ClientboundServerDataPacket
+ || get().player.freedomChat.noChatReports && msg instanceof ClientboundStatusResponsePacket;
+ }
+
+ @Override
+ protected void encode(final ChannelHandlerContext context, final Packet<?> packet, final ByteBuf byteBuf) throws Exception {
+ protected void encode(
+ final ChannelHandlerContext context, final Packet<?> packet, final ByteBuf byteBuf
+ ) throws Exception {
+ final FriendlyByteBuf buf = new FriendlyByteBuf(byteBuf);
+
+ // TODO: JDK 21 - Change to pattern matching
+ if (packet instanceof ClientboundPlayerChatPacket chat)
+ encodeChat(context, chat, buf);
+ else if (packet instanceof ClientboundServerDataPacket data)
+ encodeData(context, data, buf);
+ else if (packet instanceof ClientboundStatusResponsePacket query)
+ encodeQuery(context, query, buf);
+ switch (packet) {
+ case ClientboundPlayerChatPacket chat -> encodeChat(context, chat, buf);
+ case ClientboundStatusResponsePacket data -> encodeQuery(context, data, buf);
+ default -> {}
+ }
+ }
+
+ private static void encodeChat(
+ final ChannelHandlerContext context, final ClientboundPlayerChatPacket packet, final FriendlyByteBuf byteBuf
+ final ChannelHandlerContext ignored, final ClientboundPlayerChatPacket packet, final FriendlyByteBuf byteBuf
+ ) {
+ final Optional<ChatType.Bound> bound = packet.chatType().resolve(getServer().registryAccess());
+ if (bound.isEmpty()) {
+ LOGGER.warn("Failed to resolve chat type: {}", packet.chatType().chatType(), new Throwable());
+ return;
+ }
+ final Component content = Objects.requireNonNullElseGet(
+ packet.unsignedContent(),
+ () -> Component.literal(packet.body().content())
+ );
+
+ final ClientboundSystemChatPacket after = new ClientboundSystemChatPacket( bound.orElseThrow().decorate(
+ Optional.ofNullable( packet.unsignedContent() ).orElse( Component.literal(packet.body().content()) )
+ ), false );
+ write(context, after, byteBuf);
+ after.write(byteBuf);
+ }
+
+ private static void encodeData(
+ final ChannelHandlerContext context, final ClientboundServerDataPacket packet, final FriendlyByteBuf byteBuf
+ ) {
+ write(context, packet, byteBuf);
+ byteBuf.writeComponent(packet.getMotd());
+ byteBuf.writeOptional(packet.getIconBytes(), FriendlyByteBuf::writeByteArray);
+ byteBuf.writeBoolean(true);
+ CODEC.encode(byteBuf, new ClientboundSystemChatPacket(packet.chatType().decorate(content), false));
+ }
+
+ private static void encodeQuery(
+ final ChannelHandlerContext context, final ClientboundStatusResponsePacket packet, final FriendlyByteBuf byteBuf
+ final ChannelHandlerContext ignored, final ClientboundStatusResponsePacket packet, final FriendlyByteBuf byteBuf
+ ) {
+ final JsonObject status = ServerStatus.CODEC.encodeStart(JsonOps.INSTANCE, packet.status()).get().left()
+ .orElseThrow(() -> new EncoderException("Failed to encode server status query response")).getAsJsonObject();
+
+ status.addProperty("preventsChatReports", true);
+ write(context, packet, byteBuf);
+ byteBuf.writeUtf(GsonComponentSerializer.gson().serializer().toJson(status));
+ byteBuf.writeVarInt(0x00);
+ byteBuf.writeJsonWithCodec(NCRMetadata.CODEC, NCRMetadata.from(packet.status()));
+ }
+
+ private static void write(
+ final ChannelHandlerContext context, final Packet<?> packet, final FriendlyByteBuf byteBuf
+ private record NCRMetadata(
+ Component description,
+ Optional<ServerStatus.Players> players,
+ Optional<ServerStatus.Version> version,
+ Optional<ServerStatus.Favicon> favicon,
+ boolean enforcesSecureChat,
+ boolean preventsChatReports
+ ) {
+ byteBuf.writeVarInt(context.channel().attr(Connection.ATTRIBUTE_CLIENTBOUND_PROTOCOL).get().packetId(packet));
+
+ 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,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 25 Oct 2024 19:11:40 +0900
Subject: [PATCH] Reset dirty flag when loading maps from the disk
Based on SparklyPaper, Copyright (C) 2024 SparklyPower
commit: c023b928439b9c71277f27cc9b5bd36ca32624ea
diff --git a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
index 26da9e7c25ef6a89482838010d8ed6bcf8c87511..71aa3b9c5604f832e764e0d7a93da467ffe7dee1 100644
--- a/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
+++ b/src/main/java/net/minecraft/world/level/saveddata/maps/MapItemSavedData.java
@@ -209,6 +209,7 @@ public class MapItemSavedData extends SavedData {
}
}
+ if (org.plazmamc.plazma.configurations.GlobalConfiguration.get().misc.resetDirtyWhenLoadingMapsFromDisk) worldmap.setDirty(false); // Plazma - Reset dirty flag when loading maps from the disk
return worldmap;
}
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index a0b1239e302f0366743949a895a0539348817077..14ba63f5ef6ad5d96972b18e1174a8a94491fa57 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -130,6 +130,7 @@ public class GlobalConfiguration extends ConfigurationPart {
public Miscellaneous misc;
public class Miscellaneous extends ConfigurationPart {
+ public boolean resetDirtyWhenLoadingMapsFromDisk = false;
}

View File

@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 25 Oct 2024 19:13:21 +0900
Subject: [PATCH] Allow throttling hopper checks if the target container is
full
Based on SparklyPaper, Copyright (C) 2024 SparklyPower.
commit: c023b928439b9c71277f27cc9b5bd36ca32624ea
diff --git a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
index 5ebbdb94d9b91c442ff60eb6872f740ebd790fa0..aeeb8af68ea43ae6c93952610918d77b1593ed54 100644
--- a/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
+++ b/src/main/java/net/minecraft/world/level/block/entity/HopperBlockEntity.java
@@ -441,6 +441,7 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
Direction enumdirection = blockEntity.facing.getOpposite();
if (HopperBlockEntity.isFullContainer(iinventory, enumdirection)) {
+ if (world.plazmaConfig().block.hopper.fullCooldown != 0) blockEntity.setCooldown(world.plazmaConfig().block.hopper.fullCooldown); // Plazma - Allow throttling hopper checks if the target container is full
return false;
} else {
// Paper start - Perf: Optimize Hoppers
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index d366e8755ba91c329164c16659f6b07245577fba..f21ed3431fd8472c78c15578bbd12214c499ceea 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -64,6 +64,12 @@ public class WorldConfigurations extends ConfigurationPart {
public Block block;
public class Block extends ConfigurationPart {
+ public Hopper hopper;
+ public class Hopper extends ConfigurationPart {
+
+ public int fullCooldown = 0;
+
+ }
}

View File

@@ -0,0 +1,41 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Fri, 25 Oct 2024 19:26:15 +0900
Subject: [PATCH] Suppress errors from dirty attributes
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index f029cdfe3d1e1b13a0cc3bf04e7285907c02a9a8..684e747255472b85a573e004f85e0319e2145d8e 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -1390,7 +1390,8 @@ public abstract class LivingEntity extends Entity implements Attackable {
}
private void refreshDirtyAttributes() {
- Set<AttributeInstance> set = this.getAttributes().getAttributesToUpdate();
+ Set<AttributeInstance> attr = this.getAttributes().getAttributesToUpdate(); // Plazma - Suppress errors from dirty attributes
+ final Set<AttributeInstance> set = level().plazmaConfig().entity.suppressErrorsFromDirtyAttributes ? java.util.Collections.synchronizedSet(attr) : attr; // Plazma - Suppress errors from dirty attributes
Iterator iterator = set.iterator();
while (iterator.hasNext()) {
@@ -1399,7 +1400,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
this.onAttributeUpdated(attributemodifiable.getAttribute());
}
- set.clear();
+ attr.clear(); // Plazma - Suppress errors from dirty attributes
}
protected void onAttributeUpdated(Holder<Attribute> attribute) {
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index f21ed3431fd8472c78c15578bbd12214c499ceea..9cfab16b9cdf40ccb709c0af66c406954560c0ef 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -29,6 +29,7 @@ public class WorldConfigurations extends ConfigurationPart {
public class Entity extends ConfigurationPart {
public int sensorTick = 1;
+ public boolean suppressErrorsFromDirtyAttributes = OPTIMIZE;
public Phantom phantom;
public class Phantom extends ConfigurationPart {

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,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 {

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("}");
+ }
+ }
+
+}

View File

@@ -0,0 +1,73 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 27 Oct 2024 00:16:25 +0900
Subject: [PATCH] Optimize advancement criteria triggering
Based on bigenergy/achievements-optimizer
Copyright (C) 2024 bigenergy, Licensed under MIT License
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.
diff --git a/src/main/java/net/minecraft/advancements/critereon/InventoryChangeTrigger.java b/src/main/java/net/minecraft/advancements/critereon/InventoryChangeTrigger.java
index ebbad97920df3d1645637e646a98e16cb04d361e..a149c949a042e1d1e504d9f5ce0bfa6df92db2fc 100644
--- a/src/main/java/net/minecraft/advancements/critereon/InventoryChangeTrigger.java
+++ b/src/main/java/net/minecraft/advancements/critereon/InventoryChangeTrigger.java
@@ -22,7 +22,21 @@ public class InventoryChangeTrigger extends SimpleCriterionTrigger<InventoryChan
return InventoryChangeTrigger.TriggerInstance.CODEC;
}
+ // Plazma start - Optimize advancement criteria triggering
+ public static int idleTick;
+ private int ticksSkipped;
+
+ private boolean shouldTick() {
+ if (++this.ticksSkipped <= idleTick) return false;
+
+ this.ticksSkipped = 0;
+ return true;
+ }
+ // Plazma end - Optimize advancement criteria triggering
+
public void trigger(ServerPlayer player, Inventory inventory, ItemStack stack) {
+ if (idleTick > 0 && !this.shouldTick()) return; // Plazma - Optimize advancement criteria triggering
+
int i = 0;
int j = 0;
int k = 0;
diff --git a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
index c2f3facf65aa2682306c64c3466357461a76f267..8914159c17b3c8b0114e88c5317df5f17b05e5d6 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/GlobalConfiguration.java
@@ -145,4 +145,16 @@ public class GlobalConfiguration extends ConfigurationPart {
}
+ public Advancements advancements;
+ public class Advancements extends ConfigurationPart {
+
+ int criteriaTriggerIdleTick = OPTIMIZE ? 5 : 0;
+
+ @PostProcess
+ void post() {
+ net.minecraft.advancements.critereon.InventoryChangeTrigger.idleTick = this.criteriaTriggerIdleTick;
+ }
+
+ }
+
}

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: AlphaKR93 <dev@alpha93.kr>
Date: Sun, 27 Oct 2024 13:48:01 +0900
Subject: [PATCH] Configurable water flowing speed
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 1e741f36b79585f33abe413beafe00cf5205d54f..028aea6640356ba80f5d682e3cc03b7f82f5b9c7 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 5;
+ return world.getWorldBorder().world.plazmaConfig().block.waterFlowingTick; // Plazma - Configurable water flowing speed
}
@Override
diff --git a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
index 0e27e4a1f767842d1dcd2ed235a6a45f120bf32e..c1d4a96cf5be77f4460c54ed19622f527d42ca06 100644
--- a/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
+++ b/src/main/java/org/plazmamc/plazma/configurations/WorldConfigurations.java
@@ -64,7 +64,9 @@ public class WorldConfigurations extends ConfigurationPart {
public Block block;
public class Block extends ConfigurationPart {
-
+
+ public int waterFlowingTick = 5;
+
public Hopper hopper;
public class Hopper extends ConfigurationPart {

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