Compare commits

...

150 Commits

Author SHA1 Message Date
kugge
47979cce0c Update config & feat 2023-06-21 18:08:42 +02:00
kugge
5ee903fe44 Split gameplay into gameplay+optimization 2023-06-21 17:49:21 +02:00
Sofiane H. Djerbi
66ca590e7d Fix visual respawn issue 2023-06-21 04:26:57 +03:00
Sofiane H. Djerbi
7303dafc78 Recipe spam fix 2023-06-19 21:30:48 +03:00
Sofiane H. Djerbi
7bbd7429a5 Chunk loading tweaks 2023-06-19 01:49:32 +03:00
Sofiane H. Djerbi
319347ed32 Patches 2023-06-17 21:19:11 +03:00
Sofiane H. Djerbi
61f2cb81f4 Update build.yml 2023-06-17 20:48:30 +03:00
Sofiane H. Djerbi
9cd3a602bc Swap distanceToSqr and EntitySelector 2023-06-17 19:54:23 +03:00
Sofiane H. Djerbi
7c29fb1beb Update ver 2023-06-17 19:49:28 +03:00
Sofiane H. Djerbi
f91b81c3a6 Update workflows 2023-06-17 02:31:28 +03:00
Sofiane H. Djerbi
e6ad43eea4 Update upstream 2023-06-17 02:12:56 +03:00
Sofiane H. Djerbi
fda258d608 1.20.1 2023-06-14 01:36:07 +03:00
Sofiane H. Djerbi
3c6f042353 Update upstream 2023-06-12 23:57:28 +03:00
Sofiane H. Djerbi
21321abd32 Bump version 2023-06-12 00:52:31 +03:00
Sofiane H. Djerbi
48ac9b311a Update patches for compilation 2023-06-12 00:50:48 +03:00
Sofiane H. Djerbi
dd425fd8f0 Update patches 2023-06-11 22:25:25 +03:00
Sofiane H. Djerbi
af7f63bf75 Update upstream (Folia 1.20) 2023-06-11 20:39:32 +03:00
Sofiane H. Djerbi
93f3978b49 Update README.md 2023-06-05 03:54:05 +03:00
Sofiane H. Djerbi
8056d0c632 Delete that ugly prefix 2023-06-05 03:49:19 +03:00
Sofiane H. Djerbi
344af397be Turn unaltered data into final 2023-06-05 03:41:14 +03:00
Sofiane H. Djerbi
2ac3df7e8b Use enums instead of strings, ready for benchmarks 2023-06-05 03:09:10 +03:00
xymb-endcrystalme
d12a002f3c Entity throttling & removal to prevent lag. (#59) 2023-06-04 21:14:51 +03:00
Sofiane H. Djerbi
d9ad7304e6 Cleanup / Hotfix 2023-05-28 03:44:41 +03:00
Sofiane H. Djerbi
087825eb26 Latest fixes 2023-05-28 02:08:58 +02:00
Sofiane H. Djerbi
efa1abc1d7 Finish vanilla 2023-05-28 02:08:58 +02:00
Sofiane H. Djerbi
ccebb2b390 Add velocity back 2023-05-28 02:08:58 +02:00
Sofiane H. Djerbi
2ed10d07b0 End portal tweaks 2023-05-28 02:08:58 +02:00
kugge
160f0452d0 Update Upstream (Folia) 2023-05-27 21:48:34 +02:00
Sofiane H. Djerbi
57d89067d7 Vanilla parity config option 2023-05-18 16:06:03 +03:00
Sofiane H. Djerbi
1139843c98 Update upstream 2023-05-17 02:48:22 +03:00
Sofiane H. Djerbi
fe414e027b Cleaning 2023-05-17 02:48:11 +03:00
Sofiane H. Djerbi
ab7a79c7b7 Still apply effect with entityscheduler 2023-05-17 02:45:18 +03:00
Sofiane H. Djerbi
3044e2a70d Remove "Fix off thread raid winners": upstream fix 2023-05-17 02:09:20 +03:00
kugge
ee365adb62 Update Upstream (Folia) 2023-05-16 16:37:51 +02:00
Sofiane H. Djerbi
d78112453c Update upstream (Folia) 2023-05-15 23:05:22 +02:00
Sofiane H. Djerbi
42d7d8a151 Delete "Fix villagers forgetting their jobsites" 2023-05-15 23:05:22 +02:00
Sofiane H. Djerbi
f936afbdfd Update upstream 2023-05-15 23:05:22 +02:00
Sofiane H. Djerbi
e611832cb7 Kick player instead of crashing whole server 2023-05-15 23:05:22 +02:00
Sofiane H. Djerbi
62951f0d92 Fix villagers forgetting jobsites 2023-05-15 23:05:22 +02:00
Sofiane H. Djerbi
73ab029e4c Update README.md 2023-05-12 02:33:50 +03:00
Sofiane H. Djerbi
47b4ce394c Adding SIMD back after tests 2023-05-12 02:32:22 +03:00
Sofiane H. Djerbi
6275320901 Change the toggle from world to global config 2023-05-11 22:42:18 +03:00
Sofiane H. Djerbi
a113654b36 Move simd to todo 2023-05-11 22:15:40 +03:00
Sofiane H. Djerbi
671522acdc Moving simd utils 2023-05-11 17:32:57 +03:00
Sofiane H. Djerbi
2779390c6b Allow RNG manipulation for players 2023-05-11 17:12:52 +03:00
Sofiane H. Djerbi
4fc704f16a SIMD utilities 2023-05-11 05:20:56 +03:00
Sofiane H. Djerbi
423f48684a Fix #54 (Spider version) 2023-05-10 17:59:29 +03:00
Sofiane H. Djerbi
c027a2e37f Benchmarked optimization 2023-05-10 16:50:38 +03:00
Sofiane H. Djerbi
3ec9267550 Fix #54 2023-05-09 17:38:42 +03:00
Sofiane H. Djerbi
57bd665a5e Another change for vanilla parity 2023-05-07 20:09:26 +03:00
Sofiane H. Djerbi
5faba7039e Update README.md 2023-05-07 14:35:06 +03:00
Sofiane H. Djerbi
3d7011f7d7 Added timestamps to linear 2023-05-06 02:46:36 +03:00
Sofiane H. Djerbi
74d3638155 Should we tick level when empty 2023-05-05 02:13:57 +03:00
Sofiane H. Djerbi
2da29dfbc5 Merge branch 'ver/1.19.4' of github.com:KaiijuMC/Kaiiju into ver/1.19.4 2023-05-04 17:37:58 +03:00
Sofiane H. Djerbi
d422fc645c Drop that stuping patch name convention 2023-05-04 17:37:35 +03:00
kugge
53851e72d4 Update Upstream (Folia) 2023-05-02 18:40:07 +02:00
Sofiane H. Djerbi
7c618748c6 Update README.md 2023-05-01 15:39:46 +02:00
Sofiane H. Djerbi
f63cf7c1fa [ci skip] Update README.md 2023-04-28 03:26:18 +03:00
Sofiane H. Djerbi
ea9ab3f27c Add an option to trigger hopper optimization
This patch break random redstone farm
We want kaiiju to be as vanilla as possible
And to respect every end user
So here is a toggle.
2023-04-27 04:21:20 +03:00
Sofiane H. Djerbi
ae5526ff76 Add comment 2023-04-25 02:51:02 +03:00
Sofiane H. Djerbi
f6f2314be6 Add todo dir 2023-04-23 23:50:53 +03:00
kugge
4e5feda68f Update Upstream (Folia) 2023-04-23 23:11:01 +03:00
Sofiane H. Djerbi
b6729158b0 Add void trading fix 2023-04-23 15:53:27 +03:00
kugge
d4cd2cf5b3 Update Upstream (Folia) 2023-04-19 16:36:35 +03:00
kugge
c4741b284e Update Upstream (Folia) 2023-04-18 02:25:58 +03:00
github-actions[bot]
65ee54da34 Update Upstream (Folia) (#46) 2023-04-16 18:22:36 +03:00
Sofiane H. Djerbi
7ebfac20b8 [ci skip] Update README.md 2023-04-16 18:09:24 +03:00
Sofiane H. Djerbi
fa210d634d Update README.md 2023-04-16 16:35:30 +03:00
Sofiane H. Djerbi
91eaf9966d Cleaning up skipping code 2023-04-16 05:14:15 +03:00
Sofiane H. Djerbi
3bc1986806 Add back symlink verification on existingOnly 2023-04-16 04:41:22 +03:00
Sofiane H. Djerbi
3f3c9292bf Update gradle & dependencies 2023-04-16 03:46:55 +03:00
xymb-endcrystalme
6a994e5d50 Add an option to crash on broken Linear symlink (#45)
* Add an option to crash on broken Linear symlink

* Refactoring Crash on broken symlink

---------

Co-authored-by: Sofiane H. Djerbi <46628754+kugge@users.noreply.github.com>
2023-04-16 03:24:48 +03:00
Sofiane H. Djerbi
034cf1e6d6 Merge pull request #43 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-11 04:19:40 +03:00
kugge
118cabf45c Update Upstream (Folia) 2023-04-11 01:08:48 +00:00
Sofiane H. Djerbi
5562bd750f Merge pull request #42 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-11 02:17:39 +03:00
kugge
cedc442598 Update Upstream (Folia) 2023-04-10 23:07:20 +00:00
Sofiane H. Djerbi
35983edbd3 [skip ci] Quickfix uncommented line 2023-04-09 18:03:48 +03:00
Sofiane H. Djerbi
8664b137ca Merge pull request #40 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-09 17:38:44 +03:00
kugge
94d5a28cc4 Update Upstream (Folia) 2023-04-09 14:32:34 +00:00
Sofiane H. Djerbi
76890444db Adding Purpur custom server mod name 2023-04-09 17:17:26 +03:00
Sofiane H. Djerbi
08dd766899 Consistency fixes 2023-04-09 17:17:16 +03:00
Sofiane H. Djerbi
7fb8ff8fd0 Merge pull request #39 from xymb-endcrystalme/ver/1.19.4
Add option to drop contents of shulker items when destroyed.
2023-04-09 00:10:38 +03:00
Sofiane H. Djerbi
32e02629a9 Quickfix patching conventions
UPSTREAM-CATEGORY-OPTION (for future automation purposes)
Split configuration commits (tracking adding config options)
Use per world config if possible
2023-04-09 00:09:39 +03:00
Xymb
ef8af2f22a Add option to drop contents of shulker items when destroyed. 2023-04-08 18:48:31 +02:00
Xymb
23b264963e Ensure atomicity on Btrfs 2023-04-08 18:38:25 +02:00
Sofiane H. Djerbi
95e8ffed83 Merge pull request #36 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-04 09:52:38 +02:00
kugge
e2b32c0b66 Update Upstream (Folia) 2023-04-04 07:52:26 +00:00
Sofiane H. Djerbi
12d82f3aa5 Merge pull request #35 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-01 17:32:23 +02:00
kugge
e7b45be456 Update Upstream (Folia) 2023-04-01 15:10:51 +00:00
Sofiane H. Djerbi
48a3fc55b7 Merge pull request #34 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-01 15:53:23 +02:00
kugge
29b6a8d59d Update Upstream (Folia) 2023-04-01 13:14:40 +00:00
Sofiane H. Djerbi
f7a4bb691b Merge pull request #33 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-01 06:01:18 +02:00
kugge
34724b4471 Update Upstream (Folia) 2023-04-01 04:00:40 +00:00
Sofiane H. Djerbi
660e911bbb Merge pull request #32 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-01 05:38:52 +02:00
kugge
092e4ddbd8 Update Upstream (Folia) 2023-04-01 03:38:16 +00:00
Sofiane H. Djerbi
7fd3f17095 Update README.md 2023-04-01 03:32:09 +02:00
Sofiane H. Djerbi
53fdedd162 Merge pull request #31 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-04-01 03:29:09 +02:00
kugge
e0f78402c8 Update Upstream (Folia) 2023-04-01 01:28:30 +00:00
Sofiane H. Djerbi
d36d0dc5fc Sand duping need plugin 2023-04-01 04:22:05 +03:00
Sofiane H. Djerbi
f6246f3349 Dropped lithium support 2023-03-31 19:36:28 +03:00
Sofiane H. Djerbi
b35f17f3e6 Merge branch 'ver/1.19.4' of github.com:KaiijuMC/Kaiiju into ver/1.19.4 2023-03-31 07:49:48 +03:00
Sofiane H. Djerbi
bc3c1437a0 Custom multithreading config (Paper won't like that) 2023-03-31 07:30:09 +03:00
Sofiane H. Djerbi
1f2930b604 Merge pull request #30 from KaiijuMC/update-upstream
Update Upstream (Folia)
2023-03-31 00:54:13 +02:00
Sofiane H. Djerbi
602212daff Added alternate keepalive 2023-03-31 01:53:50 +03:00
kugge
152dbba7b0 Update Upstream (Folia) 2023-03-30 22:47:24 +00:00
Sofiane H. Djerbi
757de4f65f Update README.md 2023-03-31 00:39:04 +02:00
Sofiane H. Djerbi
af98564be2 Update README.md 2023-03-31 00:38:47 +02:00
Sofiane H. Djerbi
4d29274175 Merge branch 'ver/1.19.4' of github.com:KaiijuMC/Kaiiju into ver/1.19.4 2023-03-31 01:35:29 +03:00
Sofiane H. Djerbi
1c59e62414 Folia upstream github action 2023-03-31 01:33:47 +03:00
Sofiane H. Djerbi
d0103df33b Merge pull request #29 from KaiijuMC/dev/folia-1.19.4
Added purpur toggleable sand duping patch
2023-03-31 00:29:18 +02:00
Sofiane H. Djerbi
34977e4e8a Added purpur toggleable sand duping patch 2023-03-31 01:24:22 +03:00
Sofiane H. Djerbi
d2d7c120e5 Update upstream 2023-03-30 18:02:15 +03:00
Kugge
7239362b4d First working build 2023-03-30 03:53:14 +03:00
Kugge
83dc76521c Convert patches for folia 2023-03-30 02:52:27 +03:00
Sofiane H. Djerbi
51e1e75382 Folia test 2023-03-30 02:25:41 +03:00
Sofiane H. Djerbi
86c3a4e8de Merge branch 'ver/1.19.4' of github.com:KaiijuMC/Kaiiju into ver/1.19.4 2023-03-29 23:49:31 +03:00
Sofiane H. Djerbi
c40c8785cd Merge branch 'ver/1.19.4' of github.com:KaiijuMC/Kaiiju into ver/1.19.4 2023-03-29 23:49:18 +03:00
Sofiane H. Djerbi
e3a38f51cf Merge branch 'ver/1.19.4' of github.com:KaiijuMC/Kaiiju into ver/1.19.4 2023-03-29 05:11:20 +03:00
Sofiane H. Djerbi
a3812b6cef Permissive lobotomization 2023-03-29 05:05:44 +03:00
Sofiane H. Djerbi
b8868beac9 Merge pull request #26 from KaiijuMC/update-upstream
Update Upstream (Purpur)
2023-03-28 18:26:37 +02:00
kugge
835c7b10d8 Update Upstream (Purpur) 2023-03-28 15:18:51 +00:00
Sofiane H. Djerbi
e7823d7a0a Added FastRetrieval (Lithium) 2023-03-26 18:07:05 +03:00
Sofiane H. Djerbi
e44b800bbe Merge branch 'ver/1.19.4' of github.com:KaiijuMC/Kaiiju into ver/1.19.4 2023-03-26 17:44:56 +03:00
Sofiane H. Djerbi
5705d55587 Update upstream (Manuam update) 2023-03-26 17:44:09 +03:00
Sofiane H. Djerbi
3c013f180c Update build.yml 2023-03-22 04:32:45 +01:00
Sofiane H. Djerbi
b5121bd590 Update release.yml 2023-03-22 04:32:32 +01:00
Sofiane H. Djerbi
2ac15d9c21 Merge pull request #25 from KaiijuMC/update-upstream
Update Upstream (Purpur)
2023-03-22 03:58:08 +01:00
kugge
eafa041f07 Update Upstream (Purpur) 2023-03-22 02:57:45 +00:00
Sofiane H. Djerbi
89828085c6 Merge pull request #24 from KaiijuMC/update-upstream
Update Upstream (Purpur)
2023-03-21 12:20:40 +01:00
kugge
9c397142c6 Update Upstream (Purpur) 2023-03-21 11:20:15 +00:00
Sofiane H. Djerbi
7e1ad9e37a Update BlockPos statements 2023-03-20 13:17:55 +02:00
Sofiane H. Djerbi
d844c7c954 Update patches to 1.19.4 2023-03-20 12:47:48 +02:00
Sofiane H. Djerbi
292f587834 Typo fix 2023-03-20 12:21:21 +02:00
kugge
cd442cc16b 1.19.4 ! 2023-03-19 21:48:43 +01:00
Sofiane H. Djerbi
e6207392bf Merge pull request #23 from KaiijuMC/update-upstream
Update Upstream (Purpur)
2023-03-19 19:10:33 +01:00
kugge
e817028ac1 Update Upstream (Purpur) 2023-03-15 15:20:16 +00:00
Sofiane H. Djerbi
ae74a9bb2c Update README.md 2023-03-13 07:32:31 +01:00
Sofiane H. Djerbi
fc5216a070 Merge pull request #22 from KaiijuMC/update-upstream
Update Upstream (Purpur)
2023-03-13 02:12:57 +01:00
kugge
2deb7e54f0 Update Upstream (Purpur) 2023-03-13 01:12:37 +00:00
Sofiane H. Djerbi
61e11ce710 Release with GraalVM 2023-03-09 19:42:08 +01:00
Sofiane H. Djerbi
f935b6ffd5 GraalVM optimisation flags 2023-03-09 19:40:42 +01:00
Sofiane H. Djerbi
d09ea5c71c Use GraalVM to build jar 2023-03-09 19:21:22 +01:00
Sofiane H. Djerbi
063da21ea3 Use GraalVM to build jar 2023-03-09 19:19:22 +01:00
Sofiane H. Djerbi
0ec98213bf Merge pull request #21 from KaiijuMC/update-upstream
Update Upstream (Purpur)
2023-03-08 16:34:59 +01:00
kugge
1a2f815bcf Update Upstream (Purpur) 2023-03-08 15:14:25 +00:00
Sofiane H. Djerbi
e58f00dded Add debug option 2023-03-08 01:03:46 +02:00
Sofiane H. Djerbi
7d9b65d3d4 Merge branch 'ver/1.19.3' of github.com:KaiijuMC/Kaiiju into ver/1.19.3 2023-03-07 05:38:58 +02:00
Sofiane H. Djerbi
3afafc910b Quick refactoring 2023-03-07 05:38:39 +02:00
Sofiane H. Djerbi
a4fdc32a0b Merge pull request #19 from KaiijuMC/update-upstream
Update Upstream (Purpur)
2023-03-07 04:11:21 +01:00
kugge
6150eef35c Update Upstream (Purpur) 2023-03-06 15:13:57 +00:00
51 changed files with 2736 additions and 2040 deletions

View File

@@ -1,20 +1,22 @@
name: Generate Jars name: Generate Jars
on: [ push, pull_request ] on: [ push, pull_request ]
env: env:
version: '1.19.3' version: '1.20.1'
branch: ver/1.19.3 branch: ver/1.20.1
jobs: jobs:
paperclip: paperclip:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Git Repository - name: Checkout Git Repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v2.5.0 uses: graalvm/setup-graalvm@v1
with: with:
java-version: '17' java-version: '17'
cache: 'gradle' cache: 'gradle'
distribution: 'temurin' distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: 'latest'
- name: Configure Git User Details - name: Configure Git User Details
run: | run: |
git config --global user.email "actions@github.com" && git config --global user.name "Github Actions" git config --global user.email "actions@github.com" && git config --global user.name "Github Actions"

View File

@@ -1,20 +1,22 @@
name: Release Jars name: Release Jars
on: [push, workflow_dispatch] on: [push, workflow_dispatch]
env: env:
version: '1.19.3' version: '1.20.1'
branch: ver/1.19.3 branch: ver/1.20.1
jobs: jobs:
paperclip: paperclip:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Git Repository - name: Checkout Git Repository
uses: actions/checkout@v2 uses: actions/checkout@v3
- name: Set up JDK - name: Set up JDK
uses: actions/setup-java@v2.5.0 uses: graalvm/setup-graalvm@v1
with: with:
java-version: '17' java-version: '17'
cache: 'gradle' cache: 'gradle'
distribution: 'temurin' distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
version: 'latest'
- name: Configure Git User Details - name: Configure Git User Details
run: | run: |
git config --global user.email "actions@github.com" && git config --global user.name "Github Actions" git config --global user.email "actions@github.com" && git config --global user.name "Github Actions"

View File

@@ -1,4 +1,4 @@
name: Update Upstream (Purpur) name: Update Upstream (Folia)
on: on:
schedule: schedule:
@@ -7,9 +7,7 @@ on:
jobs: jobs:
upstream: upstream:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Git Repository - name: Checkout Git Repository
uses: actions/checkout@v2 uses: actions/checkout@v2
@@ -22,7 +20,7 @@ jobs:
- name: Configure Git User Details - name: Configure Git User Details
run: git config --global user.email "actions@github.com" && git config --global user.name "Github Actions" run: git config --global user.email "actions@github.com" && git config --global user.name "Github Actions"
- name: Update Upstream Commit Hash - name: Update Upstream Commit Hash
run: ./gradlew purpurRefLatest --stacktrace run: ./gradlew foliaRefLatest --stacktrace
- name: Apply Patches - name: Apply Patches
run: ./gradlew applyPatches --stacktrace run: ./gradlew applyPatches --stacktrace
- name: Build Paperclip jar - name: Build Paperclip jar
@@ -37,8 +35,8 @@ jobs:
- name: Create Pull Request - name: Create Pull Request
uses: peter-evans/create-pull-request@v3 uses: peter-evans/create-pull-request@v3
with: with:
commit-message: Update Upstream (Purpur) commit-message: Update Upstream (Folia)
branch: update-upstream branch: update-upstream
delete-branch: true delete-branch: true
title: 'Update Upstream (Purpur)' title: 'Update Upstream (Folia)'
body: '' body: ''

View File

@@ -1,9 +1,7 @@
<div align="center"> <div align="center">
<img src="https://github.com/kugge/Kaiiju/blob/ver/1.19.3/logo.png?" width="32%" height="32%"/> <img src="https://github.com/kugge/Kaiiju/blob/ver/1.19.3/logo.png?" width="32%" height="32%"/>
<h1>Kaiiju</h1> <h1>Kaiiju</h1>
<h3>A Server Software Designed For Anarchy</h3> <h3>Folia fork, designed for vanilla/anarchy servers</h3>
<h4>❗ [ Warning ] Work in progress, contributions are welcome ❗</h4>
[![License](https://img.shields.io/github/license/kugge/Kaiiju?style=for-the-badge&logo=github)](LICENSE) [![License](https://img.shields.io/github/license/kugge/Kaiiju?style=for-the-badge&logo=github)](LICENSE)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/kugge/Kaiiju/build.yml?style=for-the-badge)](https://github.com/kugge/Kaiiju/actions) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/kugge/Kaiiju/build.yml?style=for-the-badge)](https://github.com/kugge/Kaiiju/actions)
@@ -13,17 +11,50 @@
## Features ## Features
### Additions ### Primary
- **Xymb Linear Format**: Saves about 50% of disk space in OW and Nether and 95% in The End. - **Xymb Linear Format**: Saves about 50% of disk space in OW/Nether and 95% in The End.
- **Lobotomize**: Lobotomize mobs and villagers without breaking vanilla mechanics. - **Auto update**: Automatic upstream updates.
### Notable
- **Entity throttling & removal**: Tweak entity tick frequency & max entity per region.
- **Technical Minecraft**: Enable Vanilla exploits such as sand duping, RNG manipulation...
### Configuration
```yaml
network:
send-null-entity-packets: true
alternate-keepalive: false
gameplay:
server-mod-name: Kaiiju
shared-random-for-players: true
world-settings:
default:
region-format:
format: ANVIL
linear:
compression-level: 1
crash-on-broken-symlink: true
gameplay:
fix-void-trading: true
optimize-hoppers: true
tick-when-empty: true
break-redstone-on-top-of-trap-doors-early: true
fix-tripwire-state-inconsistency: true
safe-teleportation: true
sand-duplication: false
optimization:
shulker-box-drop-contents-when-destroyed: true
enable-entity-throttling: false
```
Documentation: [Kaiiju Wiki](https://github.com/KaiijuMC/Kaiiju/wiki/Configuration)
### Roadmap ### Roadmap
- **Lithium**: Full implementation of Lithium. - **Static view distance**: Reduce RAM usage / Region size with a "static" view distance.
- **C2ME**: Full implementation of C2ME. - **Native world conversion**: Convert region file format at startup.
- **VMP**: Full implementation of VMP. - **Stash deduplication**: Make giant dupe stashes possible and lagless.
## Building ## Building
In order to distribute and use this server software, you need a paperclip file:
```bash ```bash
./gradlew applyPatches # Apply Kaiiju patches ./gradlew applyPatches # Apply Kaiiju patches
@@ -31,7 +62,4 @@ In order to distribute and use this server software, you need a paperclip file:
``` ```
## License ## License
Patches are licensed under GPL-3.0. Original patches are licensed under GPL-3.0.
All other files are licensed under MIT.
Made with <span style="color: #e25555;">&#9829;</span> on Earth.

View File

@@ -3,8 +3,8 @@ import io.papermc.paperweight.util.constants.*
plugins { plugins {
java java
id("com.github.johnrengelman.shadow") version "7.1.2" id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.papermc.paperweight.patcher") version "1.5.1" id("io.papermc.paperweight.patcher") version "1.5.4"
} }
allprojects { allprojects {
@@ -30,8 +30,8 @@ repositories {
dependencies { dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.6:fat") remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2") decompiler("net.minecraftforge:forgeflower:2.0.629.0")
paperclip("io.papermc:paperclip:3.0.2") paperclip("io.papermc:paperclip:3.0.3")
} }
subprojects { subprojects {
@@ -58,12 +58,12 @@ paperweight {
remapRepo.set(paperMavenPublicUrl) remapRepo.set(paperMavenPublicUrl)
decompileRepo.set(paperMavenPublicUrl) decompileRepo.set(paperMavenPublicUrl)
useStandardUpstream("Purpur") { useStandardUpstream("Folia") {
url.set(github("PurpurMC", "Purpur")) url.set(github("PaperMC", "Folia"))
ref.set(providers.gradleProperty("purpurRef")) ref.set(providers.gradleProperty("foliaRef"))
withStandardPatcher { withStandardPatcher {
baseName("Purpur") baseName("Folia")
apiPatchDir.set(layout.projectDirectory.dir("patches/api")) apiPatchDir.set(layout.projectDirectory.dir("patches/api"))
apiOutputDir.set(layout.projectDirectory.dir("kaiiju-api")) apiOutputDir.set(layout.projectDirectory.dir("kaiiju-api"))
@@ -72,36 +72,35 @@ paperweight {
serverOutputDir.set(layout.projectDirectory.dir("kaiiju-server")) serverOutputDir.set(layout.projectDirectory.dir("kaiiju-server"))
} }
} }
}
tasks.register("purpurRefLatest") { tasks.register("foliaRefLatest") {
// Update the purpurRef in gradle.properties to be the latest commit. // Update the foliaRef in gradle.properties to be the latest commit.
val tempDir = layout.cacheDir("purpurRefLatest"); val tempDir = layout.cacheDir("foliaRefLatest");
val file = "gradle.properties"; val file = "gradle.properties";
doFirst { doFirst {
data class GithubCommit( data class GithubCommit(
val sha: String val sha: String
) )
val purpurLatestCommitJson = layout.cache.resolve("purpurLatestCommit.json"); val foliaLatestCommitJson = layout.cache.resolve("foliaLatestCommit.json");
download.get().download("https://api.github.com/repos/PurpurMC/Purpur/commits/ver/1.19.3", purpurLatestCommitJson); download.get().download("https://api.github.com/repos/PaperMC/Folia/commits/master", foliaLatestCommitJson);
val purpurLatestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(purpurLatestCommitJson)["sha"].asString; val foliaLatestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(foliaLatestCommitJson)["sha"].asString;
copy { copy {
from(file) from(file)
into(tempDir) into(tempDir)
filter { line: String -> filter { line: String ->
line.replace("purpurRef = .*".toRegex(), "purpurRef = $purpurLatestCommit") line.replace("foliaRef = .*".toRegex(), "foliaRef = $foliaLatestCommit")
}
}
}
doLast {
copy {
from(tempDir.file("gradle.properties"))
into(project.file(file).parent)
} }
} }
} }
}
doLast {
copy {
from(tempDir.file("gradle.properties"))
into(project.file(file).parent)
}
}
}

View File

@@ -1,9 +1,10 @@
group = dev.kaiijumc.kaiiju group = dev.kaiijumc.kaiiju
version = 1.19.3-R0.1-SNAPSHOT version = 1.20.1-R0.1-SNAPSHOT
mcVersion = 1.19.3 mcVersion = 1.20.1
purpurRef = ade1ed1d98e936bfce92cc50ba0444d05310add4 foliaRef = 7c6e2514d2ecd9f5f7db911aab29bfe7f373eb9e
org.gradle.caching=true org.gradle.caching=true
org.gradle.parallel=true org.gradle.parallel=true
org.gradle.vfs.watch=false org.gradle.vfs.watch=false
org.gradle.jvmargs=-Xmx4G -Dfile.encoding=UTF-8 -Dgraal.UsePriorityInlining=true -Dgraal.Vectorization=true -Dgraal.OptDuplication=true -Dgraal.SpeculativeGuardMovement=true -Dgraal.WriteableCodeCache=true

Binary file not shown.

View File

@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

288
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/usr/bin/env sh #!/bin/sh
# #
# Copyright 2015 the original author or authors. # Copyright © 2015-2021 the original authors.
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
@@ -17,67 +17,98 @@
# #
############################################################################## ##############################################################################
## #
## Gradle start up script for UN*X # Gradle start up script for POSIX generated by Gradle.
## #
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# 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
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
############################################################################## ##############################################################################
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" app_path=$0
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do # Need this for daisy-chained symlinks.
ls=`ls -ld "$PRG"` while
link=`expr "$ls" : '.*-> \(.*\)$'` APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
if expr "$link" : '/.*' > /dev/null; then [ -h "$app_path" ]
PRG="$link" do
else ls=$( ls -ld "$app_path" )
PRG=`dirname "$PRG"`"/$link" link=${ls#*' -> '}
fi case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle" # This is normally unused
APP_BASE_NAME=`basename "$0"` # shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value. # Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum" MAX_FD=maximum
warn () { warn () {
echo "$*" echo "$*"
} } >&2
die () { die () {
echo echo
echo "$*" echo "$*"
echo echo
exit 1 exit 1
} } >&2
# OS specific support (must be 'true' or 'false'). # OS specific support (must be 'true' or 'false').
cygwin=false cygwin=false
msys=false msys=false
darwin=false darwin=false
nonstop=false nonstop=false
case "`uname`" in case "$( uname )" in #(
CYGWIN* ) CYGWIN* ) cygwin=true ;; #(
cygwin=true Darwin* ) darwin=true ;; #(
;; MSYS* | MINGW* ) msys=true ;; #(
Darwin* ) NONSTOP* ) nonstop=true ;;
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +118,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables # IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java" JAVACMD=$JAVA_HOME/jre/sh/java
else else
JAVACMD="$JAVA_HOME/bin/java" JAVACMD=$JAVA_HOME/bin/java
fi fi
if [ ! -x "$JAVACMD" ] ; then if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,7 +129,7 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation." location of your Java installation."
fi fi
else else
JAVACMD="java" JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the Please set the JAVA_HOME variable in your environment to match the
@@ -106,80 +137,109 @@ location of your Java installation."
fi fi
# Increase the maximum file descriptors if we can. # Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
MAX_FD_LIMIT=`ulimit -H -n` case $MAX_FD in #(
if [ $? -eq 0 ] ; then max*)
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
MAX_FD="$MAX_FD_LIMIT" # shellcheck disable=SC3045
fi MAX_FD=$( ulimit -H -n ) ||
ulimit -n $MAX_FD warn "Could not query maximum file descriptor limit"
if [ $? -ne 0 ] ; then esac
warn "Could not set maximum file descriptor limit: $MAX_FD" case $MAX_FD in #(
fi '' | soft) :;; #(
else *)
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
fi # shellcheck disable=SC3045
fi ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac esac
fi fi
# Escape application args # Collect all arguments for the java command, stacking in reverse order:
save () { # * args from the command line
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done # * the main class name
echo " " # * -classpath
} # * -D...appname settings
APP_ARGS=`save "$@"` # * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules # For Cygwin or MSYS, switch paths to Windows format before running java
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@" exec "$JAVACMD" "$@"

15
gradlew.bat vendored
View File

@@ -14,7 +14,7 @@
@rem limitations under the License. @rem limitations under the License.
@rem @rem
@if "%DEBUG%" == "" @echo off @if "%DEBUG%"=="" @echo off
@rem ########################################################################## @rem ##########################################################################
@rem @rem
@rem Gradle startup script for Windows @rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0 set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=. if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0 set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME% set APP_HOME=%DIRNAME%
@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end :end
@rem End local scope for the variables with windows NT shell @rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd if %ERRORLEVEL% equ 0 goto mainEnd
:fail :fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code! rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 set EXIT_CODE=%ERRORLEVEL%
exit /b 1 if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd :mainEnd
if "%OS%"=="Windows_NT" endlocal if "%OS%"=="Windows_NT" endlocal

View File

@@ -5,12 +5,12 @@ Subject: [PATCH] Kaiiju Configuration
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
index e0f69edf603c2ec99bc92b16b18912272cc41bd9..b2c8c18437537eb2ea91bdeb9f715e01a182fbcb 100644 index 1ef4cf3b19d58565e052829358eb5902f070ae02..490a70920dca1cfde4796cc2fb69fdb98942bbdc 100644
--- a/src/main/java/org/bukkit/Server.java --- a/src/main/java/org/bukkit/Server.java
+++ b/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java
@@ -1983,6 +1983,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi @@ -2007,6 +2007,13 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
} }
// Purpur end // Paper end
+ // Kaiiju start + // Kaiiju start
+ @NotNull + @NotNull

View File

@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Tue, 9 May 2023 15:11:56 +0300
Subject: [PATCH] Fix off thread raid winners
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 359f1690497eac00899eb26c17308e0a6fe943ad..3cc320e854cbb9e70b6c63f1f950091c5195edae 100644
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
@@ -404,6 +404,7 @@ public class Raid {
UUID uuid = (UUID) iterator.next();
Entity entity = this.level.getEntity(uuid);
+ if (!io.papermc.paper.util.TickThread.isTickThreadFor(entity)) continue; // Kaiiju - Prevent give effect to player off thread
if (entity instanceof LivingEntity && !entity.isSpectator()) {
LivingEntity entityliving = (LivingEntity) entity;

View File

@@ -1,775 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Fri, 10 Feb 2023 02:58:46 +0200
Subject: [PATCH] Kaiiju Rebranding
diff --git a/build.gradle.kts b/build.gradle.kts
index f25c0557cf984b97e0ab361f579eccbf46f82170..7f1f4988a25a5ebac36c25c045c51eefecab6862 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -7,7 +7,7 @@ plugins {
}
dependencies {
- implementation(project(":purpur-api")) // Purpur
+ implementation(project(":kaiiju-api")) // Purpur // Kaiiju
// Pufferfish start
implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") {
exclude("io.papermc.paper", "paper-api")
@@ -84,7 +84,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
- "Implementation-Version" to "git-Purpur-$implementationVersion", // Purpur
+ "Implementation-Version" to "git-Kaiiju-$implementationVersion", // Purpur // Kaiiju
"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 9713263c3bd34ab8a3bfc0a8797ba0b1b88ed733..0b95cd5305e4559d6dca59011869e5b203d51576 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()); // Purpur
+ Metrics metrics = new Metrics("Kaiiju", serverUUID, logFailedRequests, Bukkit.getLogger()); // Purpur // Kaiiju
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("kaiiju_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Purpur // Kaiiju
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 fba5dbdb7bcbb55400ef18342c9b54612972a718..8aaa2942d35d6447655f8355106841a30429b653 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -20,7 +20,7 @@ import java.util.stream.StreamSupport;
public class PaperVersionFetcher implements VersionFetcher {
private static final java.util.regex.Pattern VER_PATTERN = java.util.regex.Pattern.compile("^([0-9\\.]*)\\-.*R"); // R is an anchor, will always give '-R' at end
// Purpur start
- private static final String DOWNLOAD_PAGE = "https://purpurmc.org/downloads";
+ private static final String DOWNLOAD_PAGE = "https://github.com/KaiijuMC/Kaiiju/releases"; // Kaiiju
private static int distance = -2; public int distance() { return distance; }
// Purpur end
private static @Nullable String mcVer;
@@ -33,8 +33,8 @@ public class PaperVersionFetcher implements VersionFetcher {
@Nonnull
@Override
public Component getVersionMessage(@Nonnull String serverVersion) {
- String[] parts = serverVersion.substring("git-Purpur-".length()).split("[-\\s]"); // Purpur
- final Component updateMessage = getUpdateStatusMessage("PurpurMC/Purpur", "ver/" + getMinecraftVersion(), parts[0]); // Purpur
+ String[] parts = serverVersion.substring("git-Kaiiju-".length()).split("[-\\s]"); // Purpur // Kaiiju
+ final Component updateMessage = getUpdateStatusMessage("KaiijuMC/Kaiiju", "ver/" + getMinecraftVersion(), parts[0]); // Purpur // Kaiiju
final Component history = getHistory();
return history != null ? Component.join(net.kyori.adventure.text.JoinConfiguration.separator(Component.newline()), history, updateMessage) : updateMessage; // Purpur
@@ -47,7 +47,7 @@ public class PaperVersionFetcher implements VersionFetcher {
String result = matcher.group();
mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-'
} else {
- org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Purpur!"); // Purpur
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to Kaiiju!"); // Purpur // Kaiiju
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
}
@@ -58,6 +58,8 @@ public class PaperVersionFetcher implements VersionFetcher {
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
//int distance; // Purpur - use field
+ // Kaiiju start - disable jenkins/api checking
+ /*
try {
int jenkinsBuild = Integer.parseInt(versionInfo);
distance = fetchDistanceFromSiteApi(jenkinsBuild, getMinecraftVersion());
@@ -65,6 +67,10 @@ public class PaperVersionFetcher implements VersionFetcher {
versionInfo = versionInfo.replace("\"", "");
distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
}
+ */
+ versionInfo = versionInfo.replace("\"", "");
+ distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
+ // Kaiiju end
switch (distance) {
case -1:
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
index 3cb56595822799926a8141e60a42f5d1edfc6de5..7ae1c10ebfb8b61e7d0fa63c96ff2dee98294f4d 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("Kaiiju") // Purpur // Kaiiju
.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 b5b6657e52e4f7a630229bd3ba433438af293e22..afda0d4198398de29a62159fae701b222969e9fa 100644
--- a/src/main/java/net/minecraft/CrashReport.java
+++ b/src/main/java/net/minecraft/CrashReport.java
@@ -125,7 +125,7 @@ public class CrashReport {
stringbuilder.append("---- Minecraft Crash Report ----\n");
// Purpur start
stringbuilder.append("// ");
- stringbuilder.append("// DO NOT REPORT THIS TO PAPER! REPORT TO PURPUR INSTEAD!");
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER/PURPUR! REPORT TO KAIIJU INSTEAD!"); // Kaiiju
// Purpur end
stringbuilder.append("// ");
stringbuilder.append(CrashReport.getErrorComment());
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index cea4447aad2d64db56a76e4ba180dc7326d2e13b..40b4bd2f1a61c2d9a59c9c09b72713401969460b 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -927,7 +927,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 KAIIJU)"); // Purpur // Kaiiju
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
try {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index c32e32005968b46d1f7d5162ab15c61e36f398f5..23f4edebbfa045716f956128703b58baced58f49 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -261,7 +261,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
- private final String serverName = "Purpur"; // Paper // Purpur
+ private final String serverName = "Kaiiju"; // Paper // Purpur // Kaiiju
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/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 78ac748859e21a61140e9bff67e4527a8d35b4b6..5e14153433f5c7854a357aad4776b2aad4cd6fa0 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -883,7 +883,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return EntityCategory.WATER;
}
- throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Purpur."); // Purpur
+ throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Kaiiju."); // Purpur // Kaiiju
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index 5402098dce0d64d3dceea51f248d7d366850a74f..2b7a67c339994c34296f7057ffc8822b4aa0036b 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -504,7 +504,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 Kaiiju"); // Paper // Purpur // Kaiiju
// 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 fb87620c742ff7912f5e8ccd2a7930dd605576d9..0f56013165cd61023b4f30a4da424b701e14a8e2 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"); // Purpur
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/dev.kaiijumc.kaiiju/kaiiju-api/pom.properties"); // Purpur // Kaiiju
Properties properties = new Properties();
if (stream != null) {
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index c7c0ed8dfe58c841faf684a1fe228eeda6cd57b7..410ce2dc98c48871d2ddfb0195f2885adc18cba8 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -227,7 +227,7 @@ public class PurpurConfig {
deathMessageOnlyBroadcastToAffectedPlayer = getBoolean("settings.broadcasts.death.only-broadcast-to-affected-player", deathMessageOnlyBroadcastToAffectedPlayer);
}
- public static String serverModName = "Purpur";
+ public static String serverModName = "Kaiiju"; // Kaiiju
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 a810bfd3b8d6bd4d8f2ef8797e4281ae4fe8a67f..7e92d77edb448f2ec818bf4b876d3df56d6362cc 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 Kaiiju bug." ); // Paper // Purpur // Kaiiju
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 Kaiiju bug, please report this to https://github.com/KaiijuMC/Kaiiju/issues" ); // Purpur // Kaiiju
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, "Kaiiju version: " + Bukkit.getServer().getVersion() ); // Purpur // Kaiiju
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
@@ -185,12 +185,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
// Paper end
} else
{
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO KAIIJU - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Purpur // Kaiiju
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 Kaiiju!):" ); // Paper // Purpur // Kaiiju
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
this.dumpTickingInfo(); // Paper - log detailed tick information
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
@@ -206,7 +206,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
WatchdogThread.dumpThread( thread, log );
}
} else {
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PURPUR - THIS IS NOT A BUG OR A CRASH ---"); // Purpur
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO KAIIJU - THIS IS NOT A BUG OR A CRASH ---"); // Purpur // Kaiiju
}
log.log( Level.SEVERE, "------------------------------" );
diff --git a/src/main/resources/logo.png b/src/main/resources/logo.png
index 518591dd83289e041a16e2c2e7d7e7640d4b2e1b..d51e050fef81600d005e153c6a2a4c6ba7ff3388 100644
GIT binary patch
literal 17586
zcmce-Wl$VUur|8D0*f#1u)w0h-Lne>7I!DO27(25cUdIC-91=v_aMQ7yCt}XkPx`<
zxpi;V`SJb!x@xB9>8a|jnyTsUsqTr@P*cFerosjQ0C<WBIj#Tr`2P$L+JAF)lxgjM
z3}^>eg#!SM$v96I=>K7q4_XQ`fchDlV*mgRprNAk1_PZ48;cwlhYAf92L*tEMkqu`
zK#zvY2}C0Rg85Lf+0d|<@;vNc$%O(?iL(RzP=S;jZ=%piq_TZI0RU7+{`a|F&X`26
zh>4ldh((LN?LinMxt@+W!9lO!f$Yjj`Mw?~c>G1a&e>sMIg!yEQr_&M-l!OK9Ex#)
zTAFyo!c2Pk%vxDMa@ow71QsE8R`qoHw`FYbFg=A}5RKCBm02u$O$vNLHq{g`C7jx(
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=dic2S

View File

@@ -0,0 +1,253 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Fri, 10 Feb 2023 02:58:46 +0200
Subject: [PATCH] Rebranding
diff --git a/build.gradle.kts b/build.gradle.kts
index 215366d7cc3720805d2dfde0662372ecede8383c..24f16ac70f993b9645ff01473633f542e57b0fc0 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ plugins {
dependencies {
// Folia start
- implementation(project(":folia-api"))
+ implementation(project(":kaiiju-api")) // Kaiiju
implementation("io.papermc.paper:paper-mojangapi:1.19.3-R0.1-SNAPSHOT") {
exclude("io.papermc.paper", "paper-api")
}
@@ -68,7 +68,7 @@ tasks.jar {
attributes(
"Main-Class" to "org.bukkit.craftbukkit.Main",
"Implementation-Title" to "CraftBukkit",
- "Implementation-Version" to "git-Folia-$implementationVersion", // Folia
+ "Implementation-Version" to "git-Kaiiju-$implementationVersion", // Folia // Kaiiju
"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 58dc84b7b3b04c2d0b00fc5fac5303d3378b3467..a128b1fabd4aadfe26a8375903c0451d7a65983a 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("Folia", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page
+ Metrics metrics = new Metrics("Kaiiju", serverUUID, logFailedRequests, Bukkit.getLogger()); // Folia - we have our own bstats page // Kaiiju
metrics.addCustomChart(new Metrics.SimplePie("minecraft_version", () -> {
String minecraftVersion = Bukkit.getVersion();
@@ -612,6 +612,7 @@ public class Metrics {
paperVersion = "unknown";
}
metrics.addCustomChart(new Metrics.SimplePie("folia_version", () -> paperVersion)); // Folia - we have our own bstats page
+ metrics.addCustomChart(new Metrics.SimplePie("kaiiju_version", () -> (org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() != null) ? org.bukkit.craftbukkit.Main.class.getPackage().getImplementationVersion() : "unknown")); // Kaiiju
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 e2f704c115fd6e00960bb56bb0779f1100c89c17..95bc514df2022dde265b84490d3d0db002685024 100644
--- a/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
+++ b/src/main/java/com/destroystokyo/paper/PaperVersionFetcher.java
@@ -20,9 +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
private static final String GITHUB_BRANCH_NAME = "master";
- private static final String DOWNLOAD_PAGE = "https://papermc.io/downloads/paper";
+ // Kaiiju start
+ private static final String DOWNLOAD_PAGE = "https://github.com/KaiijuMC/Kaiiju/releases";
+ private static int distance = -2; public int distance() { return distance; }
+ // Kaiiju end
private static @Nullable String mcVer;
-
@Override
public long getCacheTime() {
return 720000;
@@ -31,8 +33,8 @@ public class PaperVersionFetcher implements VersionFetcher {
@Nonnull
@Override
public Component getVersionMessage(@Nonnull String serverVersion) {
- String[] parts = serverVersion.substring("git-Folia-".length()).split("[-\\s]"); // Folia
- final Component updateMessage = getUpdateStatusMessage("PaperMC/Folia", GITHUB_BRANCH_NAME, parts[0]); // Folia
+ String[] parts = serverVersion.substring("git-Kaiiju-".length()).split("[-\\s]"); // Folia // Kaiiju
+ final Component updateMessage = getUpdateStatusMessage("KaiijuMC/Kaiiju", "ver/" + getMinecraftVersion(), parts[0]); // Folia // Kaiiju
final Component history = getHistory();
return history != null ? TextComponent.ofChildren(updateMessage, Component.newline(), history) : updateMessage;
@@ -45,7 +47,7 @@ public class PaperVersionFetcher implements VersionFetcher {
String result = matcher.group();
mcVer = result.substring(0, result.length() - 2); // strip 'R' anchor and trailing '-'
} else {
- org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to PaperMC!");
+ org.bukkit.Bukkit.getLogger().warning("Unable to match version to pattern! Report to KaiijuMC!"); // Kaiiju
org.bukkit.Bukkit.getLogger().warning("Pattern: " + VER_PATTERN.toString());
org.bukkit.Bukkit.getLogger().warning("Version: " + org.bukkit.Bukkit.getBukkitVersion());
}
@@ -56,6 +58,7 @@ public class PaperVersionFetcher implements VersionFetcher {
private static Component getUpdateStatusMessage(@Nonnull String repo, @Nonnull String branch, @Nonnull String versionInfo) {
int distance;
+ /* // Kaiiju - disable jenkins/api checking
try {
int jenkinsBuild = Integer.parseInt(versionInfo);
distance = fetchDistanceFromSiteApi(jenkinsBuild, getMinecraftVersion());
@@ -63,6 +66,11 @@ public class PaperVersionFetcher implements VersionFetcher {
versionInfo = versionInfo.replace("\"", "");
distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
}
+ // Kaiiju start - disable jenkins/api checking
+ */
+ versionInfo = versionInfo.replace("\"", "");
+ distance = fetchDistanceFromGitHub(repo, branch, versionInfo);
+ // Kaiiju end
switch (distance) {
case -1:
diff --git a/src/main/java/com/destroystokyo/paper/console/PaperConsole.java b/src/main/java/com/destroystokyo/paper/console/PaperConsole.java
index c5d5648f4ca603ef2b1df723b58f9caf4dd3c722..1c7b5d91e914efbcfb50c6137c7760787e38ad94 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("Paper")
+ .appName("Kaiiju") // Kaiiju
.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 abe37c7c3c6f5ab73afd738ec78f06d7e4d2ed96..52fc6bb99f6024273c7438d01314b576da66bd1a 100644
--- a/src/main/java/net/minecraft/CrashReport.java
+++ b/src/main/java/net/minecraft/CrashReport.java
@@ -125,7 +125,7 @@ public class CrashReport {
stringbuilder.append("---- Minecraft Crash Report ----\n");
stringbuilder.append("// ");
stringbuilder.append(CrashReport.getErrorComment());
- stringbuilder.append("\n\n");
+ stringbuilder.append("// DO NOT REPORT THIS TO PAPER/FOLIA! REPORT TO KAIIJU INSTEAD!"); // Kaiiju
stringbuilder.append("Time: ");
stringbuilder.append(CrashReport.DATE_TIME_FORMATTER.format(ZonedDateTime.now()));
stringbuilder.append("\n");
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 11ff1bc559316da426070867f045720ebd8c1962..cc1a7c4d38874ec218f7151685ae6cc00295c2e4 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -995,7 +995,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
shutdownThread = Thread.currentThread();
org.spigotmc.WatchdogThread.doStop(); // Paper
if (false && !isSameThread()) { // Folia - region threading
- MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)");
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO KAIIJU)"); // Kaiiju
while (this.getRunningThread().isAlive()) {
this.getRunningThread().stop();
try {
@@ -1812,7 +1812,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
- return "Folia"; // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return "Kaiiju"; // Kaiiju - Kaiiju > // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}
public SystemReport fillSystemReport(SystemReport details) {
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 20af7484bf570d28cd9723fdbb1ec07657117367..753594551faa1bff4317386c3df927f486900dab 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -261,7 +261,7 @@ import javax.annotation.Nullable; // Paper
import javax.annotation.Nonnull; // Paper
public final class CraftServer implements Server {
- private final String serverName = "Folia"; // Folia // Paper
+ private final String serverName = "Kaiiju"; // Kaiiju // Folia // Paper
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/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
index 564c72d6351721505dbffaf5af732db2dd3210ac..957ae18874710ad0e10f4210fc819fe555437c01 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
@@ -886,7 +886,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
return EntityCategory.WATER;
}
- throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Spigot.");
+ throw new UnsupportedOperationException("Unsupported monster type: " + type + ". This is a bug, report this to Kaiiju."); // Kaiiju
}
@Override
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
index eb84a8dd97f92de4a7dd3826d9e124a442cba565..e24d653fafcd88e01786b77539c506bcf3751c2c 100644
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
@@ -501,7 +501,7 @@ public class CraftScheduler implements BukkitScheduler {
this.parsePending();
} else {
// this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
- task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Paper"); // Paper
+ task.getOwner().getLogger().log(Level.SEVERE, "Unexpected Async Task in the Sync Scheduler. Report this to Kaiiju"); // Paper // Kaiiju
// 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 e9b6ca3aa25e140467ae866d572483050ea3fa0e..5df2b0fceebaaa863f4f143c8f29e808b7f0c49b 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/dev.folia/folia-api/pom.properties"); // Folia
+ InputStream stream = Bukkit.class.getClassLoader().getResourceAsStream("META-INF/maven/dev.kaiijumc.kaiiju/kaiiju-api/pom.properties"); // Folia // Kaiiju
Properties properties = new Properties();
if (stream != null) {
diff --git a/src/main/java/org/spigotmc/WatchdogThread.java b/src/main/java/org/spigotmc/WatchdogThread.java
index 98fba0288be9ed2cb18ffba5cf81148157dd4fcf..9c1477cfa1a8074c4b3b8a365bb03c44eaa62972 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 Paper bug." ); // Paper
+ log.log( Level.SEVERE, "The server has stopped responding! This is (probably) not a Kaiiju bug." ); // Paper // Kaiiju
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 Paper bug, please report this to https://github.com/PaperMC/Paper/issues" );
+ log.log( Level.SEVERE, "If you are unsure or still think this is a Kaiiju bug, please report this to https://github.com/KaiijuMC/Kaiiju/issues" ); // Kaiiju
log.log( Level.SEVERE, "Be sure to include ALL relevant console errors and Minecraft crash reports" );
- log.log( Level.SEVERE, "Paper version: " + Bukkit.getServer().getVersion() );
+ log.log( Level.SEVERE, "Kaiiju version: " + Bukkit.getServer().getVersion() ); // Kaiiju
//
if ( net.minecraft.world.level.Level.lastPhysicsProblem != null )
{
@@ -185,12 +185,12 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
// Paper end
} else
{
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---");
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO KAIIJU - THIS IS NOT A BUG OR A CRASH - " + Bukkit.getServer().getVersion() + " ---"); // Kaiiju
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 Paper!):" ); // Paper
+ log.log( Level.SEVERE, "Server thread dump (Look for plugins here before reporting to Kaiiju!):" ); // Paper // Kaiiju
io.papermc.paper.chunk.system.scheduling.ChunkTaskScheduler.dumpAllChunkLoadInfo(isLongTimeout); // Paper // Paper - rewrite chunk system
this.dumpTickingInfo(); // Paper - log detailed tick information
WatchdogThread.dumpThread( ManagementFactory.getThreadMXBean().getThreadInfo( MinecraftServer.getServer().serverThread.getId(), Integer.MAX_VALUE ), log );
@@ -206,7 +206,7 @@ public final class WatchdogThread extends io.papermc.paper.util.TickThread // Pa
WatchdogThread.dumpThread( thread, log );
}
} else {
- log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO PAPER - THIS IS NOT A BUG OR A CRASH ---");
+ log.log(Level.SEVERE, "--- DO NOT REPORT THIS TO KAIIJU - THIS IS NOT A BUG OR A CRASH ---"); // Kaiiju
}
log.log( Level.SEVERE, "------------------------------" );

View File

@@ -1,7 +1,7 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Fri, 10 Feb 2023 05:53:10 +0200 Date: Fri, 10 Feb 2023 05:53:10 +0200
Subject: [PATCH] Kaiiju Configuration Subject: [PATCH] Empty configuration
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -207,7 +207,7 @@ index 0000000000000000000000000000000000000000..7da7e0aeb5eac9ac73a3570e716f1ceb
+} +}
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..dd4c3ca77acb3aeefc69b8eb948b8b202ff87a19 index 0000000000000000000000000000000000000000..87ca934473f3b9553c1b9b3ed60e0fa07838c711
--- /dev/null --- /dev/null
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java +++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -0,0 +1,125 @@ @@ -0,0 +1,125 @@
@@ -336,13 +336,12 @@ index 0000000000000000000000000000000000000000..dd4c3ca77acb3aeefc69b8eb948b8b20
+ return value.isEmpty() ? fallback : value; + return value.isEmpty() ? fallback : value;
+ } + }
+} +}
\ No newline at end of file
diff --git a/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java b/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java b/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..0dde8879856f8882f2840b4b8bfb5aa0b3f06b91 index 0000000000000000000000000000000000000000..6fac162e0ec057af9f3336314d5663554cef0490
--- /dev/null --- /dev/null
+++ b/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java +++ b/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java
@@ -0,0 +1,68 @@ @@ -0,0 +1,66 @@
+package dev.kaiijumc.kaiiju.command; +package dev.kaiijumc.kaiiju.command;
+ +
+import dev.kaiijumc.kaiiju.KaiijuConfig; +import dev.kaiijumc.kaiiju.KaiijuConfig;
@@ -381,26 +380,24 @@ index 0000000000000000000000000000000000000000..0dde8879856f8882f2840b4b8bfb5aa0
+ @Override + @Override
+ public boolean execute(CommandSender sender, String commandLabel, String[] args) { + public boolean execute(CommandSender sender, String commandLabel, String[] args) {
+ if (!testPermission(sender)) return true; + if (!testPermission(sender)) return true;
+ String prefix = ChatColor.of(Color.decode("#F25DF6")) + "Kaiiju » " + ChatColor.RESET;
+ +
+ if (args.length != 1) { + if (args.length != 1) {
+ sender.sendMessage(prefix + ChatColor.RED + "Usage: " + usageMessage); + sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
+ return false; + return false;
+ } + }
+ +
+ if (args[0].equalsIgnoreCase("reload")) { + if (args[0].equalsIgnoreCase("reload")) {
+ Command.broadcastCommandMessage(sender, prefix + ChatColor.RED + "Please note that this command is not supported and may cause issues."); + Command.broadcastCommandMessage(sender, ChatColor.RED + "Please note that this command is not supported and may cause issues.");
+ Command.broadcastCommandMessage(sender, prefix + ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server."); + Command.broadcastCommandMessage(sender, ChatColor.RED + "If you encounter any issues please use the /stop command to restart your server.");
+ +
+ MinecraftServer console = MinecraftServer.getServer(); + MinecraftServer console = MinecraftServer.getServer();
+ KaiijuConfig.reload((File) console.options.valueOf("kaiiju-settings")); + KaiijuConfig.reload((File) console.options.valueOf("kaiiju-settings"));
+ for (ServerLevel level : console.getAllLevels()) { + for (ServerLevel level : console.getAllLevels()) {
+ level.kaiijuConfig.reload(); + level.kaiijuConfig.reload();
+ level.resetBreedingCooldowns();
+ } + }
+ console.server.reloadCount++; + console.server.reloadCount++;
+ +
+ Command.broadcastCommandMessage(sender, prefix + ChatColor.GREEN + "Kaiiju config reload complete."); + Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Kaiiju config reload complete.");
+ } else if (args[0].equalsIgnoreCase("version")) { + } else if (args[0].equalsIgnoreCase("version")) {
+ Command verCmd = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version"); + Command verCmd = org.bukkit.Bukkit.getServer().getCommandMap().getCommand("version");
+ if (verCmd != null) { + if (verCmd != null) {
@@ -413,13 +410,13 @@ index 0000000000000000000000000000000000000000..0dde8879856f8882f2840b4b8bfb5aa0
+} +}
\ No newline at end of file \ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index fd1b0564d2d2b45128e6f2556fb93ee56bd683b5..948ae5f96b1d54e69b49f6314d11078f197c946e 100644 index 78ada86028bac06b62a7d70776a29705a3b11a06..ee75d828174ac1c84931bc087472fefd76073bdb 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java --- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -227,6 +227,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface @@ -218,6 +218,15 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
} thread.start(); // Paper - start console thread after MinecraftServer.console & PaperConfig are initialized
org.purpurmc.purpur.PurpurConfig.registerCommands(); io.papermc.paper.command.PaperCommands.registerCommands(this);
// Purpur end com.destroystokyo.paper.Metrics.PaperMetrics.startMetrics();
+ // Kaiiju start + // Kaiiju start
+ try { + try {
+ dev.kaiijumc.kaiiju.KaiijuConfig.init((java.io.File) options.valueOf("kaiiju-settings")); + dev.kaiijumc.kaiiju.KaiijuConfig.init((java.io.File) options.valueOf("kaiiju-settings"));
@@ -433,56 +430,57 @@ index fd1b0564d2d2b45128e6f2556fb93ee56bd683b5..948ae5f96b1d54e69b49f6314d11078f
io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider io.papermc.paper.brigadier.PaperBrigadierProviderImpl.INSTANCE.getClass(); // init PaperBrigadierProvider
// Paper end // Paper end
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index a9289072b048095330ea32d7c965e8dda61a36fc..bffd82b3d89e12f2c3d6a7e89f5a8ecd12dedc34 100644 index 8cf4428d8140fd03f0ad8fa1d148a04d8caefda8..fb71843793e699b2ccfaa3b7e4c2bb7d4826a706 100644
--- a/src/main/java/net/minecraft/world/level/Level.java --- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java +++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -174,6 +174,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { @@ -166,6 +166,8 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
// Paper end
public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray public final com.destroystokyo.paper.antixray.ChunkPacketBlockController chunkPacketBlockController; // Paper - Anti-Xray
public final org.purpurmc.purpur.PurpurWorldConfig purpurConfig; // Purpur
+ public final dev.kaiijumc.kaiiju.KaiijuWorldConfig kaiijuConfig; // Kaiiju + public final dev.kaiijumc.kaiiju.KaiijuWorldConfig kaiijuConfig; // Kaiiju
+
public final co.aikar.timings.WorldTimingsHandler timings; // Paper public final co.aikar.timings.WorldTimingsHandler timings; // Paper
public static BlockPos lastPhysicsProblem; // Spigot public static BlockPos lastPhysicsProblem; // Spigot
@@ -330,6 +331,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable { private org.spigotmc.TickLimiter entityLimiter;
@@ -293,6 +295,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
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 - Async-Anti-Xray - Pass executor
this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot this.spigotConfig = new org.spigotmc.SpigotWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName()); // Spigot
this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper this.paperConfig = paperWorldConfigCreator.apply(this.spigotConfig); // Paper
this.purpurConfig = new org.purpurmc.purpur.PurpurWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Purpur
+ this.kaiijuConfig = new dev.kaiijumc.kaiiju.KaiijuWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Kaiiju + this.kaiijuConfig = new dev.kaiijumc.kaiiju.KaiijuWorldConfig(((net.minecraft.world.level.storage.PrimaryLevelData) worlddatamutable).getLevelName(), env); // Kaiiju
this.playerBreedingCooldowns = this.getNewBreedingCooldownCache(); // Purpur
this.generator = gen; this.generator = gen;
this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env); this.world = new CraftWorld((ServerLevel) this, gen, biomeProvider, env);
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 2132954c6e8a32b33bb6b19344db047c32f109cc..fb690144143e6f23ca4064d84e6e0bbad059ceb5 100644 index 753594551faa1bff4317386c3df927f486900dab..714db83db78d5bd66d8353bf9b8c4a6b1734fce4 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -977,6 +977,7 @@ public final class CraftServer implements Server { @@ -1094,6 +1094,7 @@ public final class CraftServer implements Server {
org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot
this.console.paperConfigurations.reloadConfigs(this.console); this.console.paperConfigurations.reloadConfigs(this.console);
org.purpurmc.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur
+ dev.kaiijumc.kaiiju.KaiijuConfig.init((File) console.options.valueOf("kaiiju-settings")); // Kaiiju + dev.kaiijumc.kaiiju.KaiijuConfig.init((File) console.options.valueOf("kaiiju-settings")); // Kaiiju
for (ServerLevel world : this.console.getAllLevels()) { for (ServerLevel world : this.console.getAllLevels()) {
// world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty // world.serverLevelData.setDifficulty(config.difficulty); // Paper - per level difficulty
world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean)) world.setSpawnSettings(world.serverLevelData.getDifficulty() != Difficulty.PEACEFUL && config.spawnMonsters, config.spawnAnimals); // Paper - per level difficulty (from MinecraftServer#setDifficulty(ServerLevel, Difficulty, boolean))
@@ -993,6 +994,7 @@ public final class CraftServer implements Server { @@ -1109,6 +1110,7 @@ public final class CraftServer implements Server {
}
} }
world.spigotConfig.init(); // Spigot world.spigotConfig.init(); // Spigot
world.purpurConfig.init(); // Purpur
+ world.kaiijuConfig.init(); // Kaiiju + world.kaiijuConfig.init(); // Kaiiju
} }
Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper
@@ -1009,6 +1011,7 @@ public final class CraftServer implements Server { @@ -1124,6 +1126,7 @@ public final class CraftServer implements Server {
this.reloadData();
org.spigotmc.SpigotConfig.registerCommands(); // Spigot org.spigotmc.SpigotConfig.registerCommands(); // Spigot
io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper io.papermc.paper.command.PaperCommands.registerCommands(this.console); // Paper
org.purpurmc.purpur.PurpurConfig.registerCommands(); // Purpur
+ dev.kaiijumc.kaiiju.KaiijuConfig.registerCommands(); // Kaiiju + dev.kaiijumc.kaiiju.KaiijuConfig.registerCommands(); // Kaiiju
this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*"); this.overrideAllCommandBlockCommands = this.commandsConfiguration.getStringList("command-block-overrides").contains("*");
this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions"); this.ignoreVanillaPermissions = this.commandsConfiguration.getBoolean("ignore-vanilla-permissions");
@@ -2831,6 +2834,13 @@ public final class CraftServer implements Server { @@ -2893,6 +2896,13 @@ public final class CraftServer implements Server {
return CraftServer.this.console.paperConfigurations.createLegacyObject(CraftServer.this.console);
} }
// Purpur end
+ // Kaiiju start + // Kaiiju start
+ @Override + @Override
@@ -495,12 +493,12 @@ index 2132954c6e8a32b33bb6b19344db047c32f109cc..fb690144143e6f23ca4064d84e6e0bba
public void restart() { public void restart() {
org.spigotmc.RestartCommand.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 diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index 576cd8e20982bb20d10213b6c7a229428eec1c2f..190b4bc55d8b1e9983f7b77fd3545a59fa39e6f8 100644 index 717e292040ed7779eb4b6c5fa26665d3df9024e7..d8ca697663ace353e88bfabc8997b58230d3d811 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java --- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -180,6 +180,14 @@ public class Main { @@ -173,6 +173,14 @@ public class Main {
.describedAs("Yml file"); .describedAs("Jar file");
// Purpur end // Paper end
+ // Purpur Start + // Purpur Start
+ acceptsAll(asList("kaiiju", "kaiiju-settings"), "File for kaiiju settings") + acceptsAll(asList("kaiiju", "kaiiju-settings"), "File for kaiiju settings")

View File

@@ -1,14 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Fri, 10 Feb 2023 20:03:58 +0200 Date: Fri, 10 Feb 2023 20:03:58 +0200
Subject: [PATCH] Kaiiju RegionFormat Configuration Subject: [PATCH] Region format configuration
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index 7da7e0aeb5eac9ac73a3570e716f1ceb11fd7027..b86c90cc3601e666998cfa12f44515f605bb53eb 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -192,4 +192,10 @@ public class KaiijuConfig {
}
return builder.build();
}
+
+ public static boolean regionFormatDebug = false;
+
+ private static void regionFormatSettings() {
+ regionFormatDebug = getBoolean("region-format.debug", regionFormatDebug);
+ }
}
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index dd4c3ca77acb3aeefc69b8eb948b8b202ff87a19..b194f4dbebcbbf5bb4e026a0169e2d24806b46ec 100644 index 87ca934473f3b9553c1b9b3ed60e0fa07838c711..a6e7af5f4148e067660e9f5beeacde3a59a1de9c 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java --- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java +++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -4,9 +4,11 @@ import org.apache.commons.lang.BooleanUtils; @@ -1,12 +1,15 @@
package dev.kaiijumc.kaiiju;
+import dev.kaiijumc.kaiiju.region.RegionFileFormat;
import org.apache.commons.lang.BooleanUtils;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
@@ -20,21 +39,20 @@ index dd4c3ca77acb3aeefc69b8eb948b8b202ff87a19..b194f4dbebcbbf5bb4e026a0169e2d24
import static dev.kaiijumc.kaiiju.KaiijuConfig.log; import static dev.kaiijumc.kaiiju.KaiijuConfig.log;
@@ -122,4 +124,23 @@ public class KaiijuWorldConfig { @@ -122,4 +125,22 @@ public class KaiijuWorldConfig {
final Map<String, Object> value = getMap("world-settings." + worldName + "." + path, null); final Map<String, Object> value = getMap("world-settings." + worldName + "." + path, null);
return value.isEmpty() ? fallback : value; return value.isEmpty() ? fallback : value;
} }
+ +
+ public List<String> regionFormatList = Arrays.asList("ANVIL", "LINEAR"); + public RegionFileFormat regionFormatName = RegionFileFormat.ANVIL;
+ public String regionFormatName = "ANVIL";
+ public int regionFormatLinearCompressionLevel = 1; + public int regionFormatLinearCompressionLevel = 1;
+ +
+ private void regionFormatSettings() { + private void regionFormatSettings() {
+ regionFormatName = getString("region-format.format", regionFormatName).toUpperCase(); + regionFormatName = RegionFileFormat.fromString(getString("region-format.format", regionFormatName.name()));
+ if (!regionFormatList.contains(regionFormatName)) { + if (regionFormatName.equals(RegionFileFormat.INVALID)) {
+ log(Level.SEVERE, "Unknown region format in kaiiju.yml: " + regionFormatName); + log(Level.SEVERE, "Unknown region format in kaiiju.yml: " + regionFormatName);
+ log(Level.SEVERE, "Falling back to ANVIL region file format."); + log(Level.SEVERE, "Falling back to ANVIL region file format.");
+ regionFormatName = "ANVIL"; + regionFormatName = RegionFileFormat.ANVIL;
+ } + }
+ regionFormatLinearCompressionLevel = getInt("region-format.linear.compression-level", regionFormatLinearCompressionLevel); + regionFormatLinearCompressionLevel = getInt("region-format.linear.compression-level", regionFormatLinearCompressionLevel);
+ if (regionFormatLinearCompressionLevel > 23 || regionFormatLinearCompressionLevel < 1) { + if (regionFormatLinearCompressionLevel > 23 || regionFormatLinearCompressionLevel < 1) {
@@ -44,12 +62,33 @@ index dd4c3ca77acb3aeefc69b8eb948b8b202ff87a19..b194f4dbebcbbf5bb4e026a0169e2d24
+ } + }
+ } + }
} }
\ No newline at end of file diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/RegionFileFormat.java b/src/main/java/dev/kaiijumc/kaiiju/region/RegionFileFormat.java
new file mode 100644
index 0000000000000000000000000000000000000000..7164d9cd03186f0657783f83de3d6435cda2b17e
--- /dev/null
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/RegionFileFormat.java
@@ -0,0 +1,16 @@
+package dev.kaiijumc.kaiiju.region;
+
+public enum RegionFileFormat {
+ ANVIL,
+ LINEAR,
+ INVALID;
+
+ public static RegionFileFormat fromString(String format) {
+ for (RegionFileFormat rff : values()) {
+ if (rff.name().equalsIgnoreCase(format)) {
+ return rff;
+ }
+ }
+ return RegionFileFormat.INVALID;
+ }
+}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 40b4bd2f1a61c2d9a59c9c09b72713401969460b..b9998c288c4e8b6a244722915e44250b6550fd7e 100644 index cc1a7c4d38874ec218f7151685ae6cc00295c2e4..06233380f7580726753de34c1fb23d6347c9ac94 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java --- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -855,7 +855,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -893,7 +893,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
// Paper start - rewrite chunk system // Paper start - rewrite chunk system
worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force, close); worldserver.save((ProgressListener) null, flush, worldserver.noSave && !force, close);
if (flush) { if (flush) {
@@ -58,7 +97,7 @@ index 40b4bd2f1a61c2d9a59c9c09b72713401969460b..b9998c288c4e8b6a244722915e44250b
} }
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
} }
@@ -879,7 +879,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa @@ -917,7 +917,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
//MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", worldserver2.getChunkSource().chunkMap.getStorageName()); // Paper - move up //MinecraftServer.LOGGER.info("ThreadedAnvilChunkStorage ({}): All chunks are saved", worldserver2.getChunkSource().chunkMap.getStorageName()); // Paper - move up
} }

View File

@@ -1,20 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Fri, 10 Feb 2023 22:21:56 +0200 Date: Fri, 10 Feb 2023 22:21:56 +0200
Subject: [PATCH] Kaiiju RegionFormat Linear Subject: [PATCH] Add Linear region format
Linear is a region file format that uses ZSTD compression instead of
ZLIB.
This format saves about 50% of disk space.
Documentation: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools Documentation: https://github.com/xymb-endcrystalme/LinearRegionFileFormatTools
Copyright xymb@endcrystal.me
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/build.gradle.kts b/build.gradle.kts diff --git a/build.gradle.kts b/build.gradle.kts
index 7f1f4988a25a5ebac36c25c045c51eefecab6862..09f9a12da1807dd72a95378b4824d9a09f7ccbfe 100644 index 6d6b1973783604369c7ff95d552c43edf149a46a..a26cc214dccab8c9422f9a45e2a5eeda374c0ead 100644
--- a/build.gradle.kts --- a/build.gradle.kts
+++ b/build.gradle.kts +++ b/build.gradle.kts
@@ -13,6 +13,10 @@ dependencies { @@ -13,6 +13,10 @@ dependencies {
exclude("io.papermc.paper", "paper-api") exclude("io.papermc.paper", "paper-api")
} }
// Pufferfish end // Folia end
+ // Kaiiju start - Linear format + // Kaiiju start - Linear format
+ implementation("com.github.luben:zstd-jni:1.5.4-1") + implementation("com.github.luben:zstd-jni:1.5.4-1")
+ implementation("org.lz4:lz4-java:1.8.0") + implementation("org.lz4:lz4-java:1.8.0")
@@ -76,36 +77,19 @@ index 0000000000000000000000000000000000000000..249303116d3cfadd078ebf0ae6e44bf9
+} +}
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java b/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java b/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..a470609b107f46ffc3bb7b121525ca8b803b4322 index 0000000000000000000000000000000000000000..dcfbabf54b19a4c29d5c95830242c5c26bf2f4aa
--- /dev/null --- /dev/null
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java +++ b/src/main/java/dev/kaiijumc/kaiiju/region/AbstractRegionFileFactory.java
@@ -0,0 +1,46 @@ @@ -0,0 +1,29 @@
+package dev.kaiijumc.kaiiju.region; +package dev.kaiijumc.kaiiju.region;
+ +
+import net.minecraft.world.level.chunk.storage.RegionFile; +import net.minecraft.world.level.chunk.storage.RegionFile;
+import net.minecraft.world.level.chunk.storage.RegionFileVersion; +import net.minecraft.world.level.chunk.storage.RegionFileVersion;
+ +
+import java.io.File;
+import java.io.IOException; +import java.io.IOException;
+import java.nio.file.Path; +import java.nio.file.Path;
+ +
+public class AbstractRegionFileFactory { +public class AbstractRegionFileFactory {
+ public static AbstractRegionFile getAbstractRegionFile(Path file, Path directory, boolean dsync) throws IOException {
+ return getAbstractRegionFile(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
+ }
+
+ public static AbstractRegionFile getAbstractRegionFile(Path file, Path directory, boolean dsync, boolean canRecalcHeader) throws IOException {
+ return getAbstractRegionFile(file, directory, RegionFileVersion.VERSION_DEFLATE, dsync, canRecalcHeader);
+ }
+
+ public static AbstractRegionFile getAbstractRegionFile(Path file, Path directory, RegionFileVersion outputChunkStreamVersion, boolean dsync) throws IOException {
+ return getAbstractRegionFile(file, directory, outputChunkStreamVersion, dsync, false);
+ }
+
+ public static AbstractRegionFile getAbstractRegionFile(Path file, Path directory, RegionFileVersion outputChunkStreamVersion, boolean dsync, boolean canRecalcHeader) throws IOException {
+ return getAbstractRegionFile(1, file, directory, outputChunkStreamVersion, dsync, canRecalcHeader);
+ }
+
+ public static AbstractRegionFile getAbstractRegionFile(int linearCompression, Path file, Path directory, boolean dsync) throws IOException { + public static AbstractRegionFile getAbstractRegionFile(int linearCompression, Path file, Path directory, boolean dsync) throws IOException {
+ return getAbstractRegionFile(linearCompression, file, directory, RegionFileVersion.VERSION_DEFLATE, dsync); + return getAbstractRegionFile(linearCompression, file, directory, RegionFileVersion.VERSION_DEFLATE, dsync);
+ } + }
@@ -128,20 +112,18 @@ index 0000000000000000000000000000000000000000..a470609b107f46ffc3bb7b121525ca8b
+} +}
diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
new file mode 100644 new file mode 100644
index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1bb9d1967e index 0000000000000000000000000000000000000000..b7ce89429675bde7f037793305275f4bf89d0727
--- /dev/null --- /dev/null
+++ b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java +++ b/src/main/java/dev/kaiijumc/kaiiju/region/LinearRegionFile.java
@@ -0,0 +1,342 @@ @@ -0,0 +1,337 @@
+package dev.kaiijumc.kaiiju.region; +package dev.kaiijumc.kaiiju.region;
+ +
+import com.github.luben.zstd.ZstdInputStream; +import com.github.luben.zstd.ZstdInputStream;
+import com.github.luben.zstd.ZstdOutputStream; +import com.github.luben.zstd.ZstdOutputStream;
+import com.mojang.logging.LogUtils; +import com.mojang.logging.LogUtils;
+import dev.kaiijumc.kaiiju.KaiijuConfig;
+import net.jpountz.lz4.LZ4Compressor; +import net.jpountz.lz4.LZ4Compressor;
+import net.jpountz.lz4.LZ4Factory; +import net.jpountz.lz4.LZ4Factory;
+import net.jpountz.lz4.LZ4FastDecompressor; +import net.jpountz.lz4.LZ4FastDecompressor;
+import net.jpountz.xxhash.XXHashFactory;
+import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.CompoundTag;
+import net.minecraft.world.level.ChunkPos; +import net.minecraft.world.level.ChunkPos;
+import net.minecraft.world.level.chunk.ChunkStatus; +import net.minecraft.world.level.chunk.ChunkStatus;
@@ -154,15 +136,28 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+import java.nio.file.Path; +import java.nio.file.Path;
+import java.nio.file.StandardCopyOption; +import java.nio.file.StandardCopyOption;
+import java.util.ArrayList; +import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.concurrent.locks.ReentrantLock; +import java.util.concurrent.locks.ReentrantLock;
+ +
+public class LinearRegionFile extends Thread implements AbstractRegionFile { +public class LinearRegionFile extends Thread implements AbstractRegionFile {
+ private static final long SUPERBLOCK = -4323716122432332390L;
+ private static final byte VERSION = 2;
+ private static final int HEADER_SIZE = 32;
+ private static final int FOOTER_SIZE = 8;
+ private static final Logger LOGGER = LogUtils.getLogger(); + private static final Logger LOGGER = LogUtils.getLogger();
+ private final byte[][] buffer = new byte[32*32][]; + private static final List<Byte> SUPPORTED_VERSIONS = Arrays.asList((byte) 1, (byte) 2);
+ private final int[] bufferUncompressedSize = new int[32*32];
+ +
+
+ private final byte[][] buffer = new byte[1024][];
+ private final int[] bufferUncompressedSize = new int[1024];
+
+ private final int[] chunkTimestamps = new int[1024];
+ private final Object markedToSaveLock = new Object(); + private final Object markedToSaveLock = new Object();
+ private final ChunkStatus[] statuses = new ChunkStatus[32 * 32]; + private final ChunkStatus[] statuses = new ChunkStatus[1024];
+
+ private final LZ4Compressor compressor;
+ private final LZ4FastDecompressor decompressor;
+ +
+ private boolean markedToSave = false; + private boolean markedToSave = false;
+ private boolean close = false; + private boolean close = false;
@@ -183,76 +178,60 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ public LinearRegionFile(Path file, int compression) throws IOException { + public LinearRegionFile(Path file, int compression) throws IOException {
+ this.regionFile = file; + this.regionFile = file;
+ this.compressionLevel = compression; + this.compressionLevel = compression;
+
+ this.compressor = LZ4Factory.fastestInstance().fastCompressor();
+ this.decompressor = LZ4Factory.fastestInstance().fastDecompressor();
+
+ File regionFile = new File(this.regionFile.toString()); + File regionFile = new File(this.regionFile.toString());
+ +
+ LZ4Compressor compressor = LZ4Factory.fastestInstance().fastCompressor(); + Arrays.fill(this.bufferUncompressedSize, 0);
+
+ for (int i = 0; i < 32 * 32; i++)
+ this.bufferUncompressedSize[i] = 0;
+ +
+ if(regionFile.canRead()) { + if(regionFile.canRead()) {
+ long fileLength = file.toFile().length();
+ FileInputStream fileStream = new FileInputStream(regionFile); + FileInputStream fileStream = new FileInputStream(regionFile);
+ DataInputStream rawDataStream = new DataInputStream(fileStream); + DataInputStream rawDataStream = new DataInputStream(fileStream);
+ +
+ long SUPERBLOCK = -4323716122432332390L;
+ byte VERSION = 1;
+ int HEADER_SIZE = 32;
+ int FOOTER_SIZE = 8;
+
+ long superBlock = rawDataStream.readLong(); + long superBlock = rawDataStream.readLong();
+ + if (superBlock != SUPERBLOCK)
+ if (superBlock != SUPERBLOCK) { + throw new RuntimeException("Invalid superblock: " + superBlock + " file " + file);
+ System.out.println(file);
+ System.out.println("SUPERBLOCK INVALID!");
+ return;
+ }
+ +
+ byte version = rawDataStream.readByte(); + byte version = rawDataStream.readByte();
+ if (!SUPPORTED_VERSIONS.contains(version))
+ throw new RuntimeException("Invalid version: " + version + " file " + file);
+ +
+ if (version != VERSION) { + // Skip newestTimestamp (Long) + Compression level (Byte) + Chunk count (Short): Unused.
+ System.out.println(file); + rawDataStream.skipBytes(11);
+ System.out.println("VERSION INVALID!");
+ return;
+ }
+ +
+ rawDataStream.readLong(); // newestTimestamp
+ rawDataStream.readByte(); // Compression level
+ rawDataStream.readShort(); // Chunk count
+ int dataCount = rawDataStream.readInt(); + int dataCount = rawDataStream.readInt();
+ long fileLength = file.toFile().length();
+ if (fileLength != HEADER_SIZE + dataCount + FOOTER_SIZE)
+ throw new IOException("Invalid file length: " + this.regionFile + " " + fileLength + " " + (HEADER_SIZE + dataCount + FOOTER_SIZE));
+ +
+ if (fileLength != HEADER_SIZE + dataCount + FOOTER_SIZE) { + rawDataStream.skipBytes(8); // Skip data hash (Long): Unused.
+ throw new IOException("File length invalid " + this.regionFile + " " + fileLength + " " + (HEADER_SIZE + dataCount + FOOTER_SIZE));
+ }
+ +
+ rawDataStream.readLong(); // Data Hash
+ byte[] rawCompressed = new byte[dataCount]; + byte[] rawCompressed = new byte[dataCount];
+
+ rawDataStream.readFully(rawCompressed, 0, dataCount); + rawDataStream.readFully(rawCompressed, 0, dataCount);
+ +
+ superBlock = rawDataStream.readLong(); + superBlock = rawDataStream.readLong();
+ + if (superBlock != SUPERBLOCK)
+ if (superBlock != SUPERBLOCK) {
+ throw new IOException("Footer superblock invalid " + this.regionFile); + throw new IOException("Footer superblock invalid " + this.regionFile);
+ }
+ +
+ DataInputStream dataStream = new DataInputStream(new ZstdInputStream(new ByteArrayInputStream(rawCompressed))); + DataInputStream dataStream = new DataInputStream(new ZstdInputStream(new ByteArrayInputStream(rawCompressed)));
+ +
+ int[] starts = new int[32 * 32]; + int[] starts = new int[1024];
+ for(int i = 0 ; i < 32 * 32 ; i++) { + for(int i = 0; i < 1024; i++) {
+ starts[i] = dataStream.readInt(); + starts[i] = dataStream.readInt();
+ dataStream.readInt(); // Skip timestamps + dataStream.skipBytes(4); // Skip timestamps (Int): Unused.
+ } + }
+ +
+ for(int i = 0 ; i < 32 * 32 ; i++) { + for(int i = 0; i < 1024; i++) {
+ if(starts[i] > 0) { + if(starts[i] > 0) {
+ int size = starts[i]; + int size = starts[i];
+ byte[] b = new byte[size]; + byte[] b = new byte[size];
+ dataStream.readFully(b, 0, size); + dataStream.readFully(b, 0, size);
+ +
+ int maxCompressedLength = compressor.maxCompressedLength(size); + int maxCompressedLength = this.compressor.maxCompressedLength(size);
+ byte[] compressed = new byte[maxCompressedLength]; + byte[] compressed = new byte[maxCompressedLength];
+ int compressedLength = compressor.compress(b, 0, size, compressed, 0, maxCompressedLength); + int compressedLength = this.compressor.compress(b, 0, size, compressed, 0, maxCompressedLength);
+ b = new byte[compressedLength]; + b = new byte[compressedLength];
+ System.arraycopy(compressed, 0, b, 0, compressedLength); + System.arraycopy(compressed, 0, b, 0, compressedLength);
+ +
@@ -292,9 +271,7 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ } + }
+ for(int i = 0 ; i < 100 ; i++) { + for(int i = 0 ; i < 100 ; i++) {
+ Thread.sleep(100); + Thread.sleep(100);
+ if(close) { + if(close) return;
+ return;
+ }
+ } + }
+ } + }
+ } catch(InterruptedException ignored) {} + } catch(InterruptedException ignored) {}
@@ -305,12 +282,9 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ } + }
+ +
+ public synchronized void flush() throws IOException { + public synchronized void flush() throws IOException {
+ if(!isMarkedToSave()) + if(!isMarkedToSave()) return;
+ return;
+ +
+ long SUPERBLOCK = -4323716122432332390L; + long timestamp = getTimestamp();
+ byte VERSION = 1;
+ long timestamp = System.currentTimeMillis() / 1000L;
+ short chunkCount = 0; + short chunkCount = 0;
+ +
+ File tempFile = new File(regionFile.toString() + ".tmp"); + File tempFile = new File(regionFile.toString() + ".tmp");
@@ -327,23 +301,21 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ dataStream.writeLong(timestamp); + dataStream.writeLong(timestamp);
+ dataStream.writeByte(this.compressionLevel); + dataStream.writeByte(this.compressionLevel);
+ +
+ LZ4FastDecompressor decompressor = LZ4Factory.fastestInstance().fastDecompressor();
+
+ ArrayList<byte[]> byteBuffers = new ArrayList<>(); + ArrayList<byte[]> byteBuffers = new ArrayList<>();
+ for(int i = 0 ; i < 32 * 32 ; i++) { + for(int i = 0; i < 1024; i++) {
+ if(this.bufferUncompressedSize[i] != 0) { + if(this.bufferUncompressedSize[i] != 0) {
+ chunkCount += 1; + chunkCount += 1;
+ byte[] content = new byte[bufferUncompressedSize[i]]; + byte[] content = new byte[bufferUncompressedSize[i]];
+ decompressor.decompress(buffer[i], 0, content, 0, bufferUncompressedSize[i]); + this.decompressor.decompress(buffer[i], 0, content, 0, bufferUncompressedSize[i]);
+ +
+ byteBuffers.add(content); + byteBuffers.add(content);
+ } else byteBuffers.add(null); + } else byteBuffers.add(null);
+ } + }
+ for(int i = 0 ; i < 32 * 32 ; i++) { + for(int i = 0; i < 1024; i++) {
+ zstdDataStream.writeInt(this.bufferUncompressedSize[i]); + zstdDataStream.writeInt(this.bufferUncompressedSize[i]); // Write uncompressed size
+ zstdDataStream.writeInt(0); + zstdDataStream.writeInt(this.chunkTimestamps[i]); // Write timestamp
+ } + }
+ for(int i = 0 ; i < 32 * 32 ; i++) { + for(int i = 0; i < 1024; i++) {
+ if(byteBuffers.get(i) != null) + if(byteBuffers.get(i) != null)
+ zstdDataStream.write(byteBuffers.get(i), 0, byteBuffers.get(i).length); + zstdDataStream.write(byteBuffers.get(i), 0, byteBuffers.get(i).length);
+ } + }
@@ -354,11 +326,14 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ byte[] compressed = zstdByteArray.toByteArray(); + byte[] compressed = zstdByteArray.toByteArray();
+ +
+ dataStream.writeInt(compressed.length); + dataStream.writeInt(compressed.length);
+ dataStream.writeLong(XXHashFactory.fastestInstance().hash64().hash(compressed, 0, compressed.length, 0)); // TODO: Hash the contents, not the whole thing + dataStream.writeLong(0);
+ +
+ dataStream.write(compressed, 0, compressed.length); + dataStream.write(compressed, 0, compressed.length);
+ dataStream.writeLong(SUPERBLOCK); + dataStream.writeLong(SUPERBLOCK);
+ +
+ dataStream.flush();
+ fileStream.getFD().sync();
+ fileStream.getChannel().force(true); // Ensure atomicity on Btrfs
+ dataStream.close(); + dataStream.close();
+ +
+ fileStream.close(); + fileStream.close();
@@ -370,23 +345,23 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ } + }
+ +
+ public synchronized void write(ChunkPos pos, ByteBuffer buffer) { + public synchronized void write(ChunkPos pos, ByteBuffer buffer) {
+ LZ4Compressor compressor = LZ4Factory.fastestInstance().fastCompressor();
+ try { + try {
+ byte[] b = toByteArray(new ByteArrayInputStream(buffer.array())); + byte[] b = toByteArray(new ByteArrayInputStream(buffer.array()));
+ int uncompressedSize = b.length; + int uncompressedSize = b.length;
+ +
+ int maxCompressedLength = compressor.maxCompressedLength(b.length); + int maxCompressedLength = this.compressor.maxCompressedLength(b.length);
+ byte[] compressed = new byte[maxCompressedLength]; + byte[] compressed = new byte[maxCompressedLength];
+ int compressedLength = compressor.compress(b, 0, b.length, compressed, 0, maxCompressedLength); + int compressedLength = this.compressor.compress(b, 0, b.length, compressed, 0, maxCompressedLength);
+ b = new byte[compressedLength]; + b = new byte[compressedLength];
+ System.arraycopy(compressed, 0, b, 0, compressedLength); + System.arraycopy(compressed, 0, b, 0, compressedLength);
+ +
+ this.buffer[getChunkIndex(pos.x, pos.z)] = b; + int index = getChunkIndex(pos.x, pos.z);
+ this.buffer[index] = b;
+ this.chunkTimestamps[index] = getTimestamp();
+ this.bufferUncompressedSize[getChunkIndex(pos.x, pos.z)] = uncompressedSize; + this.bufferUncompressedSize[getChunkIndex(pos.x, pos.z)] = uncompressedSize;
+ } catch (IOException e) { + } catch (IOException e) {
+ LOGGER.error("Chunk write IOException " + e + " " + this.regionFile); + LOGGER.error("Chunk write IOException " + e + " " + this.regionFile);
+ } + }
+
+ markToSave(); + markToSave();
+ } + }
+ +
@@ -424,9 +399,8 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ @Nullable + @Nullable
+ public synchronized DataInputStream getChunkDataInputStream(ChunkPos pos) { + public synchronized DataInputStream getChunkDataInputStream(ChunkPos pos) {
+ if(this.bufferUncompressedSize[getChunkIndex(pos.x, pos.z)] != 0) { + if(this.bufferUncompressedSize[getChunkIndex(pos.x, pos.z)] != 0) {
+ LZ4FastDecompressor decompressor = LZ4Factory.fastestInstance().fastDecompressor();
+ byte[] content = new byte[bufferUncompressedSize[getChunkIndex(pos.x, pos.z)]]; + byte[] content = new byte[bufferUncompressedSize[getChunkIndex(pos.x, pos.z)]];
+ decompressor.decompress(this.buffer[getChunkIndex(pos.x, pos.z)], 0, content, 0, bufferUncompressedSize[getChunkIndex(pos.x, pos.z)]); + this.decompressor.decompress(this.buffer[getChunkIndex(pos.x, pos.z)], 0, content, 0, bufferUncompressedSize[getChunkIndex(pos.x, pos.z)]);
+ return new DataInputStream(new ByteArrayInputStream(content)); + return new DataInputStream(new ByteArrayInputStream(content));
+ } + }
+ return null; + return null;
@@ -440,6 +414,7 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ int i = getChunkIndex(pos.x, pos.z); + int i = getChunkIndex(pos.x, pos.z);
+ this.buffer[i] = null; + this.buffer[i] = null;
+ this.bufferUncompressedSize[i] = 0; + this.bufferUncompressedSize[i] = 0;
+ this.chunkTimestamps[i] = getTimestamp();
+ markToSave(); + markToSave();
+ } + }
+ +
@@ -457,7 +432,11 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ } + }
+ +
+ private static int getChunkIndex(int x, int z) { + private static int getChunkIndex(int x, int z) {
+ return (x & 31) + (z & 31) * 32; + return (x & 31) + ((z & 31) << 5);
+ }
+
+ private static int getTimestamp() {
+ return (int) (System.currentTimeMillis() / 1000L);
+ } + }
+ +
+ public boolean recalculateHeader() { + public boolean recalculateHeader() {
@@ -475,7 +454,7 @@ index 0000000000000000000000000000000000000000..2e0d10ded886e82c09700a1c6602cd1b
+ } + }
+} +}
diff --git a/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java b/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java diff --git a/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java b/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
index a08cde4eefe879adcee7c4118bc38f98c5097ed0..1cfc20b7496f93aff1d6c2387dc5bb8bacab8dc8 100644 index 8a11e10b01fa012b2f98b1c193c53251e848f909..61001e76b38f8647b33e73b5cc15b4b6785cf49a 100644
--- a/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java --- a/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
+++ b/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java +++ b/src/main/java/io/papermc/paper/chunk/system/io/RegionFileIOThread.java
@@ -811,7 +811,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread { @@ -811,7 +811,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
@@ -487,17 +466,17 @@ index a08cde4eefe879adcee7c4118bc38f98c5097ed0..1cfc20b7496f93aff1d6c2387dc5bb8b
if (file == null) { // null if no regionfile exists if (file == null) { // null if no regionfile exists
return Boolean.FALSE; return Boolean.FALSE;
} }
@@ -819,7 +819,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread { @@ -824,7 +824,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
return file.hasChunk(chunkPos) ? Boolean.TRUE : Boolean.FALSE; return Boolean.FALSE;
}); } // else: it either exists or is not known, fall back to checking the loaded region file
} else {
- return taskController.computeForRegionFileIfLoaded(chunkX, chunkZ, (final RegionFile file) -> { - return taskController.computeForRegionFileIfLoaded(chunkX, chunkZ, (final RegionFile file) -> {
+ return taskController.computeForRegionFileIfLoaded(chunkX, chunkZ, (final dev.kaiijumc.kaiiju.region.AbstractRegionFile file) -> { // Kaiiju + return taskController.computeForRegionFileIfLoaded(chunkX, chunkZ, (final dev.kaiijumc.kaiiju.region.AbstractRegionFile file) -> { // Kaiiju
if (file == null) { // null if not loaded if (file == null) { // null if not loaded
// not sure at this point, let the I/O thread figure it out
return Boolean.TRUE; return Boolean.TRUE;
} @@ -1126,9 +1126,9 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
@@ -1116,9 +1116,9 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread { return this.getCache().doesRegionFileNotExistNoIO(new ChunkPos(chunkX, chunkZ));
return !this.tasks.isEmpty();
} }
- public <T> T computeForRegionFile(final int chunkX, final int chunkZ, final boolean existingOnly, final Function<RegionFile, T> function) { - public <T> T computeForRegionFile(final int chunkX, final int chunkZ, final boolean existingOnly, final Function<RegionFile, T> function) {
@@ -508,7 +487,7 @@ index a08cde4eefe879adcee7c4118bc38f98c5097ed0..1cfc20b7496f93aff1d6c2387dc5bb8b
synchronized (cache) { synchronized (cache) {
try { try {
regionFile = cache.getRegionFile(new ChunkPos(chunkX, chunkZ), existingOnly, true); regionFile = cache.getRegionFile(new ChunkPos(chunkX, chunkZ), existingOnly, true);
@@ -1131,19 +1131,19 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread { @@ -1141,19 +1141,19 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
return function.apply(regionFile); return function.apply(regionFile);
} finally { } finally {
if (regionFile != null) { if (regionFile != null) {
@@ -532,7 +511,7 @@ index a08cde4eefe879adcee7c4118bc38f98c5097ed0..1cfc20b7496f93aff1d6c2387dc5bb8b
} }
} }
@@ -1151,7 +1151,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread { @@ -1161,7 +1161,7 @@ public final class RegionFileIOThread extends PrioritisedQueueExecutorThread {
return function.apply(regionFile); return function.apply(regionFile);
} finally { } finally {
if (regionFile != null) { if (regionFile != null) {
@@ -542,16 +521,15 @@ index a08cde4eefe879adcee7c4118bc38f98c5097ed0..1cfc20b7496f93aff1d6c2387dc5bb8b
} }
} }
diff --git a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java diff --git a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
index 95cac7edae8ac64811fc6a2f6b97dd4a0fceb0b0..d21077fdcdeb14860ef6f05b7586650051f6d44b 100644 index 513833c2ea23df5b079d157bc5cb89d5c9754c0b..abf5e2a06af9853b58ac9107cd6e9787c4185c66 100644
--- a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java --- a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
+++ b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java +++ b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
@@ -83,9 +83,13 @@ public class ThreadedWorldUpgrader { @@ -84,8 +84,13 @@ public class ThreadedWorldUpgrader {
}
LOGGER.info("Found " + regionFiles.length + " regionfiles to convert"); LOGGER.info("Found " + regionFiles.length + " regionfiles to convert");
LOGGER.info("Starting conversion now for world " + this.worldName); LOGGER.info("Starting conversion now for world " + this.worldName);
-
+ // Kaiiju start + // Kaiiju start
+ String formatName = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatName; + dev.kaiijumc.kaiiju.region.RegionFileFormat formatName = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatName;
+ int linearCompression = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatLinearCompressionLevel; + int linearCompression = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatLinearCompressionLevel;
+ LOGGER.info("Using format " + formatName + " (" + linearCompression + ")"); + LOGGER.info("Using format " + formatName + " (" + linearCompression + ")");
+ // Kaiiju end + // Kaiiju end
@@ -562,10 +540,10 @@ index 95cac7edae8ac64811fc6a2f6b97dd4a0fceb0b0..d21077fdcdeb14860ef6f05b75866500
long expectedChunks = (long)regionFiles.length * (32L * 32L); long expectedChunks = (long)regionFiles.length * (32L * 32L);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 75965afd7b4bed23a5ecf618c7f91ff5e7ffd92f..4f4a94f60c60eb8bf4214bfcfe6f963e16b39c98 100644 index 916bfdfb13d8f8093e1908a7c35344b83d0ee0ac..61c6bc2859235874aefac71e9e55162f0a89f29f 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java --- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -291,7 +291,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -269,7 +269,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end // Paper end
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) { public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
@@ -573,8 +551,8 @@ index 75965afd7b4bed23a5ecf618c7f91ff5e7ffd92f..4f4a94f60c60eb8bf4214bfcfe6f963e
+ super(world.getLevel().kaiijuConfig.regionFormatName, world.getLevel().kaiijuConfig.regionFormatLinearCompressionLevel, session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); // Kaiiju + super(world.getLevel().kaiijuConfig.regionFormatName, world.getLevel().kaiijuConfig.regionFormatLinearCompressionLevel, session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); // Kaiiju
// Paper - rewrite chunk system // Paper - rewrite chunk system
this.tickingGenerated = new AtomicInteger(); this.tickingGenerated = new AtomicInteger();
this.playerMap = new PlayerMap(); //this.playerMap = new PlayerMap(); // Folia - region threading
@@ -336,7 +336,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -314,7 +314,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lightEngine = new ThreadedLevelLightEngine(chunkProvider, this, this.level.dimensionType().hasSkyLight(), null, null); // Paper - rewrite chunk system this.lightEngine = new ThreadedLevelLightEngine(chunkProvider, this, this.level.dimensionType().hasSkyLight(), null, null); // Paper - rewrite chunk system
this.distanceManager = new ChunkMap.ChunkDistanceManager(executor, mainThreadExecutor); this.distanceManager = new ChunkMap.ChunkDistanceManager(executor, mainThreadExecutor);
this.overworldDataStorage = persistentStateManagerFactory; this.overworldDataStorage = persistentStateManagerFactory;
@@ -583,7 +561,7 @@ index 75965afd7b4bed23a5ecf618c7f91ff5e7ffd92f..4f4a94f60c60eb8bf4214bfcfe6f963e
this.setViewDistance(viewDistance); this.setViewDistance(viewDistance);
// Paper start // Paper start
this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new); this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
@@ -950,13 +950,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -850,13 +850,13 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper start - chunk status cache "api" // Paper start - chunk status cache "api"
public ChunkStatus getChunkStatusOnDiskIfCached(ChunkPos chunkPos) { public ChunkStatus getChunkStatusOnDiskIfCached(ChunkPos chunkPos) {
@@ -599,7 +577,7 @@ index 75965afd7b4bed23a5ecf618c7f91ff5e7ffd92f..4f4a94f60c60eb8bf4214bfcfe6f963e
if (regionFile == null || !regionFileCache.chunkExists(chunkPos)) { if (regionFile == null || !regionFileCache.chunkExists(chunkPos)) {
return null; return null;
@@ -974,7 +974,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -874,7 +874,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
} }
public void updateChunkStatusOnDisk(ChunkPos chunkPos, @Nullable CompoundTag compound) throws IOException { public void updateChunkStatusOnDisk(ChunkPos chunkPos, @Nullable CompoundTag compound) throws IOException {
@@ -609,14 +587,13 @@ index 75965afd7b4bed23a5ecf618c7f91ff5e7ffd92f..4f4a94f60c60eb8bf4214bfcfe6f963e
regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound)); regionFile.setStatus(chunkPos.x, chunkPos.z, ChunkSerializer.getStatus(compound));
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index b396a329e753f42b3878736b6b14bafda02d3744..906d394bbb80b9069645d01a319a9fab24c42288 100644 index b126435b07572e7b8f41647a0179164b680e9e64..19fb8ca8a6f699ce596103070db726fcb427865e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java --- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java +++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -390,9 +390,8 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -426,8 +426,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
private final EntityRegionFileStorage entityStorage;
private static final class EntityRegionFileStorage extends net.minecraft.world.level.chunk.storage.RegionFileStorage { private static final class EntityRegionFileStorage extends net.minecraft.world.level.chunk.storage.RegionFileStorage {
-
- public EntityRegionFileStorage(Path directory, boolean dsync) { - public EntityRegionFileStorage(Path directory, boolean dsync) {
- super(directory, dsync); - super(directory, dsync);
+ public EntityRegionFileStorage(String format, int linearCompression, Path directory, boolean dsync) { // Kaiiju + public EntityRegionFileStorage(String format, int linearCompression, Path directory, boolean dsync) { // Kaiiju
@@ -624,7 +601,7 @@ index b396a329e753f42b3878736b6b14bafda02d3744..906d394bbb80b9069645d01a319a9fab
} }
protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException { protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException {
@@ -583,7 +582,7 @@ public class ServerLevel extends Level implements WorldGenLevel { @@ -666,7 +666,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end // CraftBukkit end
boolean flag2 = minecraftserver.forceSynchronousWrites(); boolean flag2 = minecraftserver.forceSynchronousWrites();
DataFixer datafixer = minecraftserver.getFixerUpper(); DataFixer datafixer = minecraftserver.getFixerUpper();
@@ -634,18 +611,9 @@ index b396a329e753f42b3878736b6b14bafda02d3744..906d394bbb80b9069645d01a319a9fab
// this.entityManager = new PersistentEntitySectionManager<>(Entity.class, new ServerLevel.EntityCallbacks(), entitypersistentstorage, this.entitySliceManager); // Paper // Paper - rewrite chunk system // this.entityManager = new PersistentEntitySectionManager<>(Entity.class, new ServerLevel.EntityCallbacks(), entitypersistentstorage, this.entitySliceManager); // Paper // Paper - rewrite chunk system
StructureTemplateManager structuretemplatemanager = minecraftserver.getStructureManager(); StructureTemplateManager structuretemplatemanager = minecraftserver.getStructureManager();
diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
index 759b125cc1251b9b4f1f443c9f70c482ef5b32f8..74bc03e43096c865bba36b15aa248b9dc3481828 100644 index e0bfeebeaac1aaea64bc07cdfdf7790e3e43ca7b..ac35e7eb8cb5f19391a18eb9d6b5ba26769ce2f6 100644
--- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java --- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
+++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java +++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
@@ -41,7 +41,7 @@ import net.minecraft.world.level.chunk.storage.RegionFile;
import net.minecraft.world.level.dimension.LevelStem;
import net.minecraft.world.level.storage.DimensionDataStorage;
import net.minecraft.world.level.storage.LevelStorageSource;
-import org.slf4j.Logger;
+import org.bukkit.Bukkit;import org.bukkit.craftbukkit.CraftWorld;import org.slf4j.Logger;
public class WorldUpgrader {
@@ -61,7 +61,7 @@ public class WorldUpgrader { @@ -61,7 +61,7 @@ public class WorldUpgrader {
private volatile int skipped; private volatile int skipped;
private final Object2FloatMap<ResourceKey<LevelStem>> progressMap = Object2FloatMaps.synchronize(new Object2FloatOpenCustomHashMap(Util.identityStrategy())); // CraftBukkit private final Object2FloatMap<ResourceKey<LevelStem>> progressMap = Object2FloatMaps.synchronize(new Object2FloatOpenCustomHashMap(Util.identityStrategy())); // CraftBukkit
@@ -655,21 +623,21 @@ index 759b125cc1251b9b4f1f443c9f70c482ef5b32f8..74bc03e43096c865bba36b15aa248b9d
private final DimensionDataStorage overworldDataStorage; private final DimensionDataStorage overworldDataStorage;
public WorldUpgrader(LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, Registry<LevelStem> dimensionOptionsRegistry, boolean eraseCache) { public WorldUpgrader(LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, Registry<LevelStem> dimensionOptionsRegistry, boolean eraseCache) {
@@ -115,8 +115,11 @@ public class WorldUpgrader { @@ -116,7 +116,12 @@ public class WorldUpgrader {
while (iterator1.hasNext()) {
ResourceKey<LevelStem> resourcekey1 = (ResourceKey) iterator1.next(); // CraftBukkit ResourceKey<LevelStem> resourcekey1 = (ResourceKey) iterator1.next(); // CraftBukkit
Path path = this.levelStorage.getDimensionPath((ResourceKey) null); // CraftBukkit Path path = this.levelStorage.getDimensionPath((ResourceKey) null); // CraftBukkit
-
- builder1.put(resourcekey1, new ChunkStorage(path.resolve("region"), this.dataFixer, true)); - builder1.put(resourcekey1, new ChunkStorage(path.resolve("region"), this.dataFixer, true));
+ // Kaiiju start + // Kaiiju start
+ String worldName = this.levelStorage.getLevelId(); + String worldName = this.levelStorage.getLevelId();
+ String formatName = ((CraftWorld) Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatName; + dev.kaiijumc.kaiiju.region.RegionFileFormat formatName = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatName;
+ builder1.put(resourcekey1, new ChunkStorage(formatName, 6, path.resolve("region"), this.dataFixer, true)); + int linearCompression = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatLinearCompressionLevel;
+ builder1.put(resourcekey1, new ChunkStorage(formatName, linearCompression, path.resolve("region"), this.dataFixer, true));
+ // Kaiiju end + // Kaiiju end
} }
ImmutableMap<ResourceKey<LevelStem>, ChunkStorage> immutablemap1 = builder1.build(); // CraftBukkit ImmutableMap<ResourceKey<LevelStem>, ChunkStorage> immutablemap1 = builder1.build(); // CraftBukkit
@@ -235,7 +238,7 @@ public class WorldUpgrader { @@ -235,7 +240,7 @@ public class WorldUpgrader {
File file = this.levelStorage.getDimensionPath((ResourceKey) null).toFile(); // CraftBukkit File file = this.levelStorage.getDimensionPath((ResourceKey) null).toFile(); // CraftBukkit
File file1 = new File(file, "region"); File file1 = new File(file, "region");
File[] afile = file1.listFiles((file2, s) -> { File[] afile = file1.listFiles((file2, s) -> {
@@ -678,42 +646,45 @@ index 759b125cc1251b9b4f1f443c9f70c482ef5b32f8..74bc03e43096c865bba36b15aa248b9d
}); });
if (afile == null) { if (afile == null) {
@@ -254,7 +257,7 @@ public class WorldUpgrader { @@ -254,7 +259,11 @@ public class WorldUpgrader {
int l = Integer.parseInt(matcher.group(2)) << 5; int l = Integer.parseInt(matcher.group(2)) << 5;
try { try {
- RegionFile regionfile = new RegionFile(file2.toPath(), file1.toPath(), true); - RegionFile regionfile = new RegionFile(file2.toPath(), file1.toPath(), true);
+ dev.kaiijumc.kaiiju.region.AbstractRegionFile regionfile = dev.kaiijumc.kaiiju.region.AbstractRegionFileFactory.getAbstractRegionFile(file2.toPath(), file1.toPath(), true); // Kaiiju + // Kaiiju start
+ String worldName = this.levelStorage.getLevelId();
+ int linearCompression = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatLinearCompressionLevel;
+ dev.kaiijumc.kaiiju.region.AbstractRegionFile regionfile = dev.kaiijumc.kaiiju.region.AbstractRegionFileFactory.getAbstractRegionFile(linearCompression, file2.toPath(), file1.toPath(), true);
+ // Kaiiju end
try { try {
for (int i1 = 0; i1 < 32; ++i1) { for (int i1 = 0; i1 < 32; ++i1) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
index 8950b220b9a3512cd4667beb7bdec0e82e07edc6..71b38521fd2039bb2ddfdc5dc89341282869ce30 100644 index 5150d447c9dc2f539446749c8bee102050bab4ed..187ff795192c7eb56dffafa1ff6fa3068ac341c3 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java --- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java +++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
@@ -57,8 +57,8 @@ public class PoiManager extends SectionStorage<PoiSection> { @@ -59,8 +59,8 @@ public class PoiManager extends SectionStorage<PoiSection> {
// Paper end - rewrite chunk system // Paper end - rewrite chunk system
- public PoiManager(Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) { - public PoiManager(Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) {
- super(path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world); - super(path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world);
+ public PoiManager(String formatName, int linearCompression, Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) { // Kaiiju + public PoiManager(dev.kaiijumc.kaiiju.region.RegionFileFormat formatName, int linearCompression, Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) { // Kaiiju
+ super(formatName, linearCompression, path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world); // Kaiiju + super(formatName, linearCompression, path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world); // Kaiiju
this.world = (net.minecraft.server.level.ServerLevel)world; // Paper - rewrite chunk system this.world = (net.minecraft.server.level.ServerLevel)world; // Paper - rewrite chunk system
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
index 5a425be023d77f0370d102dfb52427147849ac1a..5396d6944cee6c3075fcfd030510254461569120 100644 index 8ebecb588058da174b0e0e19e54fcddfeeca1422..1d880f27dd147da683fc30ed6f1bfa43ecdb7d93 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -37,11 +37,12 @@ public class ChunkStorage implements AutoCloseable { @@ -37,11 +37,11 @@ public class ChunkStorage implements AutoCloseable {
public final RegionFileStorage regionFileCache; public final RegionFileStorage regionFileCache;
// Paper end - async chunk loading // Paper end - async chunk loading
- public ChunkStorage(Path directory, DataFixer dataFixer, boolean dsync) { - public ChunkStorage(Path directory, DataFixer dataFixer, boolean dsync) {
+ public ChunkStorage(String format, int linearCompression, Path directory, DataFixer dataFixer, boolean dsync) { // Kaiiju + public ChunkStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, Path directory, DataFixer dataFixer, boolean dsync) { // Kaiiju
this.fixerUpper = dataFixer; this.fixerUpper = dataFixer;
+
// Paper start - async chunk io // Paper start - async chunk io
// remove IO worker // remove IO worker
- this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - nuke IOWorker // Paper - this.regionFileCache = new RegionFileStorage(directory, dsync, true); // Paper - nuke IOWorker // Paper
@@ -783,10 +754,10 @@ index dcfe090c269d4cbcc2eb1b6f85392848bb34656c..d42c320179ae055b8675d1ce6ce1788e
try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) { try (DataInputStream out = new DataInputStream(new java.io.BufferedInputStream(new InflaterInputStream(Files.newInputStream(file))))) {
return NbtIo.read((java.io.DataInput) out); return NbtIo.read((java.io.DataInput) out);
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 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 bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f65a2188d 100644 index 81554c321a78258ff78da3801f00d0fb90b9e113..b35a6a7daf768af3bc453fe18deec823f4b63a3a 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/RegionFileStorage.java
@@ -22,17 +22,25 @@ public class RegionFileStorage implements AutoCloseable { @@ -22,9 +22,13 @@ public class RegionFileStorage implements AutoCloseable {
public static final String ANVIL_EXTENSION = ".mca"; public static final String ANVIL_EXTENSION = ".mca";
private static final int MAX_CACHE_SIZE = 256; private static final int MAX_CACHE_SIZE = 256;
@@ -795,20 +766,24 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
private final Path folder; private final Path folder;
private final boolean sync; private final boolean sync;
+ // Kaiiju start - Per world chunk format + // Kaiiju start - Per world chunk format
+ public final String format; + public final dev.kaiijumc.kaiiju.region.RegionFileFormat format;
+ public final int linearCompression; + public final int linearCompression;
+ // Kaiiju end + // Kaiiju end
private final boolean isChunkData; // Paper private final boolean isChunkData; // Paper
// Paper start - cache regionfile does not exist state
@@ -56,11 +60,15 @@ public class RegionFileStorage implements AutoCloseable {
}
// Paper end - cache regionfile does not exist state
- protected RegionFileStorage(Path directory, boolean dsync) { // Paper - protected constructor - protected RegionFileStorage(Path directory, boolean dsync) { // Paper - protected constructor
+ protected RegionFileStorage(String format, int linearCompression, Path directory, boolean dsync) { // Paper - protected constructor + protected RegionFileStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, Path directory, boolean dsync) { // Paper - protected constructor
// Paper start - add isChunkData param // Paper start - add isChunkData param
- this(directory, dsync, false); - this(directory, dsync, false);
+ this(format, linearCompression, directory, dsync, false); + this(format, linearCompression, directory, dsync, false);
} }
- RegionFileStorage(Path directory, boolean dsync, boolean isChunkData) { - RegionFileStorage(Path directory, boolean dsync, boolean isChunkData) {
+ RegionFileStorage(String format, int linearCompression, Path directory, boolean dsync, boolean isChunkData) { // Kaiiju + RegionFileStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, Path directory, boolean dsync, boolean isChunkData) { // Kaiiju
+ // Kaiiju start + // Kaiiju start
+ this.format = format; + this.format = format;
+ this.linearCompression = linearCompression; + this.linearCompression = linearCompression;
@@ -816,19 +791,19 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
this.isChunkData = isChunkData; this.isChunkData = isChunkData;
// Paper end - add isChunkData param // Paper end - add isChunkData param
this.folder = directory; this.folder = directory;
@@ -42,7 +50,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -71,7 +79,7 @@ public class RegionFileStorage implements AutoCloseable {
// Paper start @Nullable
public static @Nullable ChunkPos getRegionFileCoordinates(Path file) { public static ChunkPos getRegionFileCoordinates(Path file) {
String fileName = file.getFileName().toString(); String fileName = file.getFileName().toString();
- if (!fileName.startsWith("r.") || !fileName.endsWith(".mca")) { - if (!fileName.startsWith("r.") || !fileName.endsWith(".mca")) {
+ if (!fileName.startsWith("r.") || !fileName.endsWith(".mca") || !fileName.endsWith(".linear")) { // Kaiiju + if (!fileName.startsWith("r.") || !fileName.endsWith(".mca") || !fileName.endsWith(".linear")) { // Kaiiju
return null; return null;
} }
@@ -62,49 +70,66 @@ public class RegionFileStorage implements AutoCloseable { @@ -93,29 +101,29 @@ public class RegionFileStorage implements AutoCloseable {
} // Paper end
}
// Paper start
- public synchronized RegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) { - public synchronized RegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) {
+ public synchronized dev.kaiijumc.kaiiju.region.AbstractRegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) { // Kaiiju + public synchronized dev.kaiijumc.kaiiju.region.AbstractRegionFile getRegionFileIfLoaded(ChunkPos chunkcoordintpair) { // Kaiiju
return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ())); return this.regionCache.getAndMoveToFirst(ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()));
@@ -848,7 +823,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
- public synchronized RegionFile getRegionFile(ChunkPos chunkcoordintpair, boolean existingOnly, boolean lock) throws IOException { - public synchronized RegionFile getRegionFile(ChunkPos chunkcoordintpair, boolean existingOnly, boolean lock) throws IOException {
+ public synchronized dev.kaiijumc.kaiiju.region.AbstractRegionFile getRegionFile(ChunkPos chunkcoordintpair, boolean existingOnly, boolean lock) throws IOException { // Kaiiju + public synchronized dev.kaiijumc.kaiiju.region.AbstractRegionFile getRegionFile(ChunkPos chunkcoordintpair, boolean existingOnly, boolean lock) throws IOException { // Kaiiju
// Paper end // Paper end
long i = ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()); long i = ChunkPos.asLong(chunkcoordintpair.getRegionX(), chunkcoordintpair.getRegionZ()); final long regionPos = i; // Paper - OBFHELPER
- RegionFile regionfile = (RegionFile) this.regionCache.getAndMoveToFirst(i); - RegionFile regionfile = (RegionFile) this.regionCache.getAndMoveToFirst(i);
+ dev.kaiijumc.kaiiju.region.AbstractRegionFile regionfile = this.regionCache.getAndMoveToFirst(i); // Kaiiju + dev.kaiijumc.kaiiju.region.AbstractRegionFile regionfile = this.regionCache.getAndMoveToFirst(i); // Kaiiju
@@ -861,18 +836,21 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
} }
// Paper end // Paper end
return regionfile; return regionfile;
} else { @@ -126,28 +134,49 @@ public class RegionFileStorage implements AutoCloseable {
}
// Paper end - cache regionfile does not exist state
if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - configurable if (this.regionCache.size() >= io.papermc.paper.configuration.GlobalConfiguration.get().misc.regionFileCacheSize) { // Paper - configurable
- ((RegionFile) this.regionCache.removeLast()).close(); - ((RegionFile) this.regionCache.removeLast()).close();
+ this.regionCache.removeLast().close(); // Kaiiju + this.regionCache.removeLast().close(); // Kaiiju
} }
FileUtil.createDirectoriesSafe(this.folder); // Paper - only create directory if not existing only - moved down
Path path = this.folder; Path path = this.folder;
int j = chunkcoordintpair.getRegionX(); int j = chunkcoordintpair.getRegionX();
- Path path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca"); // Paper - diff on change - Path path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca"); // Paper - diff on change
- if (existingOnly && !java.nio.file.Files.exists(path1)) return null; // CraftBukkit - if (existingOnly && !java.nio.file.Files.exists(path1)) { // Paper start - cache regionfile does not exist state
- RegionFile regionfile1 = new RegionFile(path1, this.folder, this.sync, this.isChunkData); // Paper - allow for chunk regionfiles to regen header - this.markNonExisting(regionPos);
- return null; // CraftBukkit
+ // Kaiiju start - Polyglot + // Kaiiju start - Polyglot
+ //Path path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca"); // Paper - diff on change + //Path path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca"); // Paper - diff on change
+ Path path1; + Path path1;
@@ -881,17 +859,29 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
+ Path linear = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".linear"); + Path linear = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".linear");
+ if (java.nio.file.Files.exists(anvil)) path1 = anvil; + if (java.nio.file.Files.exists(anvil)) path1 = anvil;
+ else if (java.nio.file.Files.exists(linear)) path1 = linear; + else if (java.nio.file.Files.exists(linear)) path1 = linear;
+ else return null; + else {
+ } else { + this.markNonExisting(regionPos);
+ return null;
+ }
+ // Kaiiju end
} else {
+ // Kaiiju start - Polyglot
+ String extension = switch (this.format) { + String extension = switch (this.format) {
+ case "LINEAR" -> "linear"; + case LINEAR -> "linear";
+ default -> "mca"; + default -> "mca";
+ }; + };
+ path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + "." + extension); + path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + "." + extension);
+ } + // Kaiiju end
+ //if (existingOnly && !java.nio.file.Files.exists(path1)) return null; // CraftBukkit this.createRegionFile(regionPos);
}
+ // Kaiiju start - Polyglot
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.regionFormatDebug)
+ org.bukkit.Bukkit.getLogger().info("Opening file " + path1 + " with format " + this.format + " (existingOnly = " + existingOnly + ")");
+ // Kaiiju end + // Kaiiju end
+ +
// Paper end - cache regionfile does not exist state
FileUtil.createDirectoriesSafe(this.folder); // Paper - only create directory if not existing only - moved from above
- RegionFile regionfile1 = new RegionFile(path1, this.folder, this.sync, this.isChunkData); // Paper - allow for chunk regionfiles to regen header
+ dev.kaiijumc.kaiiju.region.AbstractRegionFile regionfile1 = dev.kaiijumc.kaiiju.region.AbstractRegionFileFactory.getAbstractRegionFile(this.linearCompression, path1, this.folder, this.sync, this.isChunkData); // Paper - allow for chunk regionfiles to regen header // Kaiiju + dev.kaiijumc.kaiiju.region.AbstractRegionFile regionfile1 = dev.kaiijumc.kaiiju.region.AbstractRegionFileFactory.getAbstractRegionFile(this.linearCompression, path1, this.folder, this.sync, this.isChunkData); // Paper - allow for chunk regionfiles to regen header // Kaiiju
this.regionCache.putAndMoveToFirst(i, regionfile1); this.regionCache.putAndMoveToFirst(i, regionfile1);
@@ -903,7 +893,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
} }
// Paper end // Paper end
return regionfile1; return regionfile1;
@@ -132,7 +157,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -175,7 +204,7 @@ public class RegionFileStorage implements AutoCloseable {
} }
@@ -912,7 +902,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
synchronized (regionfile) { synchronized (regionfile) {
try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) { try (DataInputStream datainputstream = regionfile.getChunkDataInputStream(chunkCoordinate)) {
CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z); CompoundTag oversizedData = regionfile.getOversizedData(chunkCoordinate.x, chunkCoordinate.z);
@@ -179,14 +204,14 @@ public class RegionFileStorage implements AutoCloseable { @@ -222,14 +251,14 @@ public class RegionFileStorage implements AutoCloseable {
@Nullable @Nullable
public CompoundTag read(ChunkPos pos) throws IOException { public CompoundTag read(ChunkPos pos) throws IOException {
// CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing // CraftBukkit start - SPIGOT-5680: There's no good reason to preemptively create files on read, save that for writing
@@ -929,7 +919,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
// We add the regionfile parameter to avoid the potential deadlock (on fileLock) if we went back to obtain a regionfile // We add the regionfile parameter to avoid the potential deadlock (on fileLock) if we went back to obtain a regionfile
// if we decide to re-read // if we decide to re-read
// Paper end // Paper end
@@ -196,7 +221,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -239,7 +268,7 @@ public class RegionFileStorage implements AutoCloseable {
// Paper start // Paper start
if (regionfile.isOversized(pos.x, pos.z)) { if (regionfile.isOversized(pos.x, pos.z)) {
@@ -938,7 +928,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
return readOversizedChunk(regionfile, pos); return readOversizedChunk(regionfile, pos);
} }
// Paper end // Paper end
@@ -210,12 +235,12 @@ public class RegionFileStorage implements AutoCloseable { @@ -253,12 +282,12 @@ public class RegionFileStorage implements AutoCloseable {
if (this.isChunkData) { if (this.isChunkData) {
ChunkPos chunkPos = ChunkSerializer.getChunkCoordinate(nbttagcompound); ChunkPos chunkPos = ChunkSerializer.getChunkCoordinate(nbttagcompound);
if (!chunkPos.equals(pos)) { if (!chunkPos.equals(pos)) {
@@ -954,7 +944,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
return null; return null;
} }
} }
@@ -249,13 +274,13 @@ public class RegionFileStorage implements AutoCloseable { @@ -292,13 +321,13 @@ public class RegionFileStorage implements AutoCloseable {
return nbttagcompound; return nbttagcompound;
} finally { // Paper start } finally { // Paper start
@@ -970,7 +960,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
if (regionfile == null) { if (regionfile == null) {
return; return;
} }
@@ -285,7 +310,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -328,7 +357,7 @@ public class RegionFileStorage implements AutoCloseable {
} }
protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException { protected void write(ChunkPos pos, @Nullable CompoundTag nbt) throws IOException {
@@ -979,7 +969,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
if (nbt == null && regionfile == null) { if (nbt == null && regionfile == null) {
return; return;
} }
@@ -335,7 +360,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -378,7 +407,7 @@ public class RegionFileStorage implements AutoCloseable {
} }
// Paper end // Paper end
} finally { // Paper start } finally { // Paper start
@@ -988,7 +978,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
} // Paper end } // Paper end
} }
@@ -344,7 +369,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -387,7 +416,7 @@ public class RegionFileStorage implements AutoCloseable {
ObjectIterator objectiterator = this.regionCache.values().iterator(); ObjectIterator objectiterator = this.regionCache.values().iterator();
while (objectiterator.hasNext()) { while (objectiterator.hasNext()) {
@@ -997,7 +987,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
try { try {
regionfile.close(); regionfile.close();
@@ -360,7 +385,7 @@ public class RegionFileStorage implements AutoCloseable { @@ -403,7 +432,7 @@ public class RegionFileStorage implements AutoCloseable {
ObjectIterator objectiterator = this.regionCache.values().iterator(); ObjectIterator objectiterator = this.regionCache.values().iterator();
while (objectiterator.hasNext()) { while (objectiterator.hasNext()) {
@@ -1007,7 +997,7 @@ index bd502ca721de0cab438d995efa00ad0554c0d2fe..ee4005cd62da567d5701d59ddceb212f
regionfile.flush(); regionfile.flush();
} }
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
index d783072bc964e45c308197e6f79874eb4a09f871..261613054a4ba0e78ad1aec819d743eaaae01cf2 100644 index 5561b8499a0503b850974b1dc309edfb80219549..9394d191c56aab78e63fd3f283efedd69384e323 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java --- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java +++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
@@ -47,8 +47,8 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl @@ -47,8 +47,8 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl
@@ -1016,16 +1006,16 @@ index d783072bc964e45c308197e6f79874eb4a09f871..261613054a4ba0e78ad1aec819d743ea
- public SectionStorage(Path path, Function<Runnable, Codec<R>> codecFactory, Function<Runnable, R> factory, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean dsync, RegistryAccess dynamicRegistryManager, LevelHeightAccessor world) { - public SectionStorage(Path path, Function<Runnable, Codec<R>> codecFactory, Function<Runnable, R> factory, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean dsync, RegistryAccess dynamicRegistryManager, LevelHeightAccessor world) {
- super(path, dsync); // Paper - remove mojang I/O thread - super(path, dsync); // Paper - remove mojang I/O thread
+ public SectionStorage(String format, int linearCompression, Path path, Function<Runnable, Codec<R>> codecFactory, Function<Runnable, R> factory, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean dsync, RegistryAccess dynamicRegistryManager, LevelHeightAccessor world) { // Kaiiju + public SectionStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, Path path, Function<Runnable, Codec<R>> codecFactory, Function<Runnable, R> factory, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean dsync, RegistryAccess dynamicRegistryManager, LevelHeightAccessor world) { // Kaiiju
+ super(format, linearCompression, path, dsync); // Paper - remove mojang I/O thread // Kaiiju + super(format, linearCompression, path, dsync); // Paper - remove mojang I/O thread // Kaiiju
this.codec = codecFactory; this.codec = codecFactory;
this.factory = factory; this.factory = factory;
this.fixerUpper = dataFixer; this.fixerUpper = dataFixer;
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
index 9b5323edd99848b73ea0e34230e7bec8dc23be8c..619c7713d573e8f438ea23a3fcb185a98abf5100 100644 index 23b8dde3cd185b372d4adc97201a422cebbbe804..6012ea6d3fb6e731ff491ef134085013c2c6075c 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
@@ -552,7 +552,7 @@ public class CraftWorld extends CraftRegionAccessor implements World { @@ -561,7 +561,7 @@ public class CraftWorld extends CraftRegionAccessor implements World {
return true; return true;
} }

View File

@@ -1,16 +1,16 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 16 Feb 2023 01:38:59 +0200 Date: Thu, 16 Feb 2023 01:38:59 +0200
Subject: [PATCH] Kaiiju Network Configuration Subject: [PATCH] Network configuration
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index 7da7e0aeb5eac9ac73a3570e716f1ceb11fd7027..2791fe6cc78cc13d969a903134c08e992a6ecdca 100644 index b86c90cc3601e666998cfa12f44515f605bb53eb..7c6d43d8a360530344ef296f4477750c8a298607 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java --- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java +++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -192,4 +192,7 @@ public class KaiijuConfig { @@ -198,4 +198,7 @@ public class KaiijuConfig {
} private static void regionFormatSettings() {
return builder.build(); regionFormatDebug = getBoolean("region-format.debug", regionFormatDebug);
} }
+ +
+ private static void networkSettings() { + private static void networkSettings() {

View File

@@ -1,358 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Sat, 11 Feb 2023 06:29:15 +0200
Subject: [PATCH] Kaiiju Lobotomize Animal
Inspired by "Lobotomized animals" by @KioProject123
Checks might be a nuisance to performance.
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 907fdfb368c87bfe7b4374bb0b5f49d5ff095339..b99b438b92587f23c77c5321d5d23e76dc5450de 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -144,6 +144,17 @@ public class KaiijuWorldConfig {
}
}
+ public boolean lobotomizeAnimalEnabled = false;
+ public int lobotomizeAnimalCheckInterval = 100;
+ public boolean lobotomizeAnimalCheckCanJump = true;
+ public boolean lobotomizeAnimalLookAtPlayer = false;
+ public boolean lobotomizeAnimalFloat = true;
+
private void lobotomizeSettings() {
+ lobotomizeAnimalEnabled = getBoolean("lobotomize.animal.enabled", lobotomizeAnimalEnabled);
+ lobotomizeAnimalCheckInterval = getInt("lobotomize.animal.check-interval", lobotomizeAnimalCheckInterval);
+ lobotomizeAnimalCheckCanJump = getBoolean("lobotomize.animal.check-can-jump", lobotomizeAnimalCheckCanJump);
+ lobotomizeAnimalLookAtPlayer = getBoolean("lobotomize.animal.look-at-player", lobotomizeAnimalLookAtPlayer);
+ lobotomizeAnimalFloat = getBoolean("lobotomize.animal.float", lobotomizeAnimalFloat);
}
}
\ No newline at end of file
diff --git a/src/main/java/dev/kaiijumc/kaiiju/entity/Lobotomized.java b/src/main/java/dev/kaiijumc/kaiiju/entity/Lobotomized.java
new file mode 100644
index 0000000000000000000000000000000000000000..805df3e27cfbbdf3525c96942afca12d50abc350
--- /dev/null
+++ b/src/main/java/dev/kaiijumc/kaiiju/entity/Lobotomized.java
@@ -0,0 +1,73 @@
+package dev.kaiijumc.kaiiju.entity;
+
+import net.minecraft.core.BlockPos;
+import net.minecraft.world.entity.LivingEntity;
+import net.minecraft.world.level.Level;
+import net.minecraft.world.level.block.state.BlockState;
+import net.minecraft.world.level.pathfinder.PathComputationType;
+
+public class Lobotomized {
+ private boolean isLobotomized = false;
+ private int notLobotomizedCount = 0;
+
+ public boolean isLobotomized() {
+ return this.isLobotomized;
+ }
+
+ public void setLobotomized(boolean b) {
+ this.isLobotomized = b;
+ }
+
+ public boolean checkLobotomized(LivingEntity entity) {
+ Level level = entity.getLevel();
+ int interval = level.kaiijuConfig.lobotomizeAnimalCheckInterval;
+ if (this.notLobotomizedCount > 3) {
+ // check half as often if not lobotomized for the last 3+ consecutive checks
+ interval *= 2;
+ }
+ if ((entity.getId() + entity.tickCount) % interval == 0) {
+ this.isLobotomized = entity.isOnGround() && !canTravelFrom(entity, level, entity.getBbHeight() <= 1.0F);
+
+ if (this.isLobotomized) {
+ this.notLobotomizedCount = 0;
+ } else {
+ this.notLobotomizedCount++;
+ }
+ }
+ return this.isLobotomized;
+ }
+
+ private boolean canTravelFrom(LivingEntity entity, Level level, boolean ignoreTop) {
+ BlockPos pos = new BlockPos(entity.getX(), entity.getY() + 0.5D, entity.getZ());
+ return canTravelTo(entity, pos.east(), level, ignoreTop)
+ || canTravelTo(entity, pos.west(), level, ignoreTop)
+ || canTravelTo(entity, pos.north(), level, ignoreTop)
+ || canTravelTo(entity, pos.south(), level, ignoreTop);
+ }
+
+ private boolean canTravelTo(LivingEntity entity, BlockPos pos, Level level, boolean ignoreTop) {
+ BlockState top;
+ // Check if mob can jump over block
+ if (level.kaiijuConfig.lobotomizeAnimalCheckCanJump && canJump(entity, level, ignoreTop)) {
+ top = level.getBlockStateIfLoaded(pos.above());
+ if (top == null) return false;
+ if (top.isPathfindable(level, pos, net.minecraft.world.level.pathfinder.PathComputationType.LAND)) {
+ if (ignoreTop) return true;
+ net.minecraft.world.level.block.state.BlockState above = level.getBlockState(pos.above(2));
+ if (above.isPathfindable(level, pos, net.minecraft.world.level.pathfinder.PathComputationType.LAND)) return true;
+ }
+ }
+ BlockState bottom = level.getBlockStateIfLoaded(pos);
+ if (bottom == null) return false; // Chunk not loaded
+ if (!bottom.isPathfindable(level, pos, PathComputationType.LAND)) return false;
+ if (ignoreTop) return true;
+ top = level.getBlockState(pos.above());
+ return top.isPathfindable(level, pos, PathComputationType.LAND);
+ }
+
+ private boolean canJump(LivingEntity entity, Level level, boolean ignoreTop) {
+ BlockPos pos = new BlockPos(entity.getX(), entity.getY() + 2.5D, entity.getZ());
+ net.minecraft.world.level.block.Block above = level.getBlockIfLoaded(pos);
+ return !above.hasCollision;
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index b2e4b5c463ceb19356da18e7fc52d20801b674cd..32ea0b1542ef374db3290e01978d7965715b9de6 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -308,6 +308,8 @@ public abstract class LivingEntity extends Entity {
this.brain = this.makeBrain(new Dynamic(dynamicopsnbt, (Tag) dynamicopsnbt.createMap((Map) ImmutableMap.of(dynamicopsnbt.createString("memories"), (Tag) dynamicopsnbt.emptyMap()))));
}
+ public boolean isLobotomized() { return false; } // Kaiiju
+
protected void initAttributes() {}// Purpur
public Brain<?> getBrain() {
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
index 7093c62be53fe99ed9880fc8ddaa07440fe4f715..2acbb26af2c24b2f4c569d55e8ba44a068fd9d86 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FloatGoal.java
@@ -16,6 +16,7 @@ public class FloatGoal extends Goal {
@Override
public boolean canUse() {
+ if (!this.mob.getLevel().kaiijuConfig.lobotomizeAnimalFloat && this.mob.isLobotomized()) return false; // Kaiiju
return this.mob.isInWater() && this.mob.getFluidHeight(FluidTags.WATER) > this.mob.getFluidJumpThreshold() || this.mob.isInLava();
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/FollowParentGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/FollowParentGoal.java
index a668d5263586f955a5656ac66bcc7fe8cc51fe00..c195e60a7773f106775cded4f1c3ed51a69ca2f5 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/FollowParentGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/FollowParentGoal.java
@@ -21,6 +21,7 @@ public class FollowParentGoal extends Goal {
@Override
public boolean canUse() {
+ if (this.animal.isLobotomized()) return false; // Kaiiju
if (this.animal.getAge() >= 0) {
return false;
} else {
@@ -51,6 +52,7 @@ public class FollowParentGoal extends Goal {
@Override
public boolean canContinueToUse() {
+ if (this.animal.isLobotomized()) return false; // Kaiiju
if (this.animal.getAge() >= 0) {
return false;
} else if (!this.parent.isAlive()) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.java
index 8b189d7587303263efa1790066e5a83edd45f9d7..1304fc96834e4ce7156076fd893993a0aa75cbbc 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/LookAtPlayerGoal.java
@@ -48,6 +48,7 @@ public class LookAtPlayerGoal extends Goal {
@Override
public boolean canUse() {
+ if (!mob.getLevel().kaiijuConfig.lobotomizeAnimalLookAtPlayer && this.mob.isLobotomized()) return false; // Kaiiju
if (this.mob.getRandom().nextFloat() >= this.probability) {
return false;
} else {
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/PanicGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/PanicGoal.java
index 268b7457c2a93af6d36c1c5f623c5856f94a7af1..f1469e424f7bdf4e5813f250c0eae673db0b9049 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/PanicGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/PanicGoal.java
@@ -29,6 +29,7 @@ public class PanicGoal extends Goal {
@Override
public boolean canUse() {
+ if (this.mob.isLobotomized()) return false; // Kaiiju
if (!this.shouldPanic()) {
return false;
} else {
@@ -81,6 +82,7 @@ public class PanicGoal extends Goal {
@Override
public boolean canContinueToUse() {
+ if (this.mob.isLobotomized()) return false; // Kaiiju
// CraftBukkit start - introduce a temporary timeout hack until this is fixed properly
if ((this.mob.tickCount - this.mob.lastHurtByMobTimestamp) > 100) {
this.mob.setLastHurtByMob((LivingEntity) null);
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java
index 216929c838446c3c14d9b9906ffa625ef35fcbc8..3ea2e7c44018ec63b8f17fd3e5e3a23e2b1f72e4 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/RandomStrollGoal.java
@@ -35,6 +35,7 @@ public class RandomStrollGoal extends Goal {
@Override
public boolean canUse() {
+ if (this.mob.isLobotomized()) return false; // Kaiiju
if (this.mob.isVehicle()) {
return false;
} else {
@@ -68,6 +69,7 @@ public class RandomStrollGoal extends Goal {
@Override
public boolean canContinueToUse() {
+ if (this.mob.isLobotomized()) return false; // Kaiiju
return !this.mob.getNavigation().isDone() && !this.mob.isVehicle();
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java b/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java
index 2cbc9adc8e417def48be03d08174a5833068ec65..3234d5bf3b9ae01dbe8e26a0a3f21ff875fe6769 100644
--- a/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java
+++ b/src/main/java/net/minecraft/world/entity/ai/goal/TemptGoal.java
@@ -43,6 +43,7 @@ public class TemptGoal extends Goal {
@Override
public boolean canUse() {
+ if (this.mob.isLobotomized()) return false; // Kaiiju
if (this.calmDown > 0) {
--this.calmDown;
return false;
@@ -67,6 +68,7 @@ public class TemptGoal extends Goal {
@Override
public boolean canContinueToUse() {
+ if (this.mob.isLobotomized()) return false; // Kaiiju
if (this.canScare()) {
if (this.mob.distanceToSqr((Entity) this.player) < 36.0D) {
if (this.player.distanceToSqr(this.px, this.py, this.pz) > 0.010000000000000002D) {
diff --git a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
index 2f2d9bb31194618ef5bba39cd1cbe7c4919e82c5..0d8f1f063b76357374022e4496ce0646757b150e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
+++ b/src/main/java/net/minecraft/world/entity/ai/navigation/PathNavigation.java
@@ -197,6 +197,7 @@ public abstract class PathNavigation {
// Paper end
public boolean moveTo(Entity entity, double speed) {
+ if (this.mob.isLobotomized()) return false; // Kaiiju
// Paper start - Pathfinding optimizations
if (this.pathfindFailures > 10 && this.path == null && net.minecraft.server.MinecraftServer.currentTick < this.lastFailure + 40) {
return false;
@@ -217,6 +218,7 @@ public abstract class PathNavigation {
}
public boolean moveTo(@Nullable Path path, double speed) {
+ if (this.mob.isLobotomized()) return false; // Kaiiju
if (path == null) {
this.path = null;
return false;
diff --git a/src/main/java/net/minecraft/world/entity/animal/Animal.java b/src/main/java/net/minecraft/world/entity/animal/Animal.java
index 2ac88f06ebb79e515cd9934ac1e3e2c8003d9e3c..d89c0db4c4173d8558dc4f8b15ddb5815ef7c09e 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Animal.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Animal.java
@@ -13,7 +13,6 @@ import net.minecraft.tags.BlockTags;
import net.minecraft.util.RandomSource;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
-import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.AgeableMob;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.ExperienceOrb;
@@ -39,6 +38,7 @@ public abstract class Animal extends AgeableMob {
@Nullable
public UUID loveCause;
public ItemStack breedItem; // CraftBukkit - Add breedItem variable
+ protected dev.kaiijumc.kaiiju.entity.Lobotomized lobotomized = new dev.kaiijumc.kaiiju.entity.Lobotomized(); // Kaiiju
public abstract int getPurpurBreedTime(); // Purpur
protected Animal(EntityType<? extends Animal> type, Level world) {
@@ -74,8 +74,32 @@ public abstract class Animal extends AgeableMob {
}
}
+ this.lobotomized.checkLobotomized(this); // Kaiiju
}
+ // Kaiiju start
+ @Override
+ public void travel(net.minecraft.world.phys.Vec3 vec3) {
+ if (!this.isLobotomized() || net.minecraft.server.MinecraftServer.currentTick % 100 == 0) {
+ super.travel(vec3);
+ }
+ }
+
+ @Override
+ public boolean isCollidable(boolean ignoreClimbing) {
+ if (!this.isLobotomized() || net.minecraft.server.MinecraftServer.currentTick % 20 == 0) {
+ return super.isCollidable(ignoreClimbing);
+ }
+ return false;
+ }
+
+ @Override
+ public boolean isLobotomized() {
+ if (!this.level.kaiijuConfig.lobotomizeAnimalEnabled) return false;
+ return this.lobotomized.isLobotomized();
+ }
+ // Kaiiju end
+
/* CraftBukkit start
// Function disabled as it has no special function anymore after
// setSitting is disabled.
@@ -102,6 +126,7 @@ public abstract class Animal extends AgeableMob {
if (this.loveCause != null) {
nbt.putUUID("LoveCause", this.loveCause);
}
+ nbt.putBoolean("Kaiiju.Lobotomized", this.lobotomized.isLobotomized()); // Kaiiju
}
@@ -115,6 +140,13 @@ public abstract class Animal extends AgeableMob {
super.readAdditionalSaveData(nbt);
this.inLove = nbt.getInt("InLove");
this.loveCause = nbt.hasUUID("LoveCause") ? nbt.getUUID("LoveCause") : null;
+ // Kaiiju start
+ boolean isLobotomized = nbt.getBoolean("Kaiiju.Lobotomized");
+ this.lobotomized.setLobotomized(isLobotomized);
+ if (isLobotomized) {
+ this.onGround = true;
+ }
+ // Kaiiju end
}
public static boolean checkAnimalSpawnRules(EntityType<? extends Animal> type, LevelAccessor world, MobSpawnType spawnReason, BlockPos pos, RandomSource random) {
diff --git a/src/main/java/net/minecraft/world/entity/animal/Bee.java b/src/main/java/net/minecraft/world/entity/animal/Bee.java
index 87bd7991a81a2e30ecfccb60e614d7f13acd3744..1c2db953155498606f1e052580e7aa9ca846a53c 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Bee.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Bee.java
@@ -1047,6 +1047,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override
public boolean canBeeUse() {
+ if (Bee.this.isLobotomized()) return false; // Kaiiju
return Bee.this.remainingCooldownBeforeLocatingNewHive == 0 && !Bee.this.hasHive() && Bee.this.wantsToEnterHive();
}
@@ -1113,6 +1114,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override
public boolean canBeeUse() {
+ if (Bee.this.isLobotomized()) return false; // Kaiiju
return Bee.this.hivePos != null && !Bee.this.hasRestriction() && Bee.this.wantsToEnterHive() && !this.hasReachedTarget(Bee.this.hivePos) && Bee.this.level.getBlockState(Bee.this.hivePos).is(BlockTags.BEEHIVES);
}
@@ -1229,6 +1231,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override
public boolean canBeeUse() {
+ if (Bee.this.isLobotomized()) return false; // Kaiiju
return Bee.this.savedFlowerPos != null && !Bee.this.hasRestriction() && this.wantsToGoToKnownFlower() && Bee.this.isFlowerValid(Bee.this.savedFlowerPos) && !Bee.this.closerThan(Bee.this.savedFlowerPos, 2);
}
@@ -1281,6 +1284,7 @@ public class Bee extends Animal implements NeutralMob, FlyingAnimal {
@Override
public boolean canBeeUse() {
+ if (Bee.this.isLobotomized()) return false; // Kaiiju
return Bee.this.getCropsGrownSincePollination() >= 10 ? false : (Bee.this.random.nextFloat() < 0.3F ? false : Bee.this.hasNectar() && Bee.this.isHiveValid());
}

View File

@@ -1,29 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 16 Feb 2023 01:49:54 +0200 Date: Thu, 16 Feb 2023 01:49:54 +0200
Subject: [PATCH] Purpur Network Send Null Entity Packets Subject: [PATCH] Send null entity packets
This is from Purpur. Don't send null entity packets.
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index 2791fe6cc78cc13d969a903134c08e992a6ecdca..276c0e2936dfd3ca752deb65c80565c477f65e7f 100644 index 7c6d43d8a360530344ef296f4477750c8a298607..ab08e11f13921163b8ff1ff51ff9e9b86d2b47c7 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java --- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java +++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -193,6 +193,8 @@ public class KaiijuConfig { @@ -198,7 +198,10 @@ public class KaiijuConfig {
return builder.build(); private static void regionFormatSettings() {
regionFormatDebug = getBoolean("region-format.debug", regionFormatDebug);
} }
+
+ public static boolean sendNullEntityPackets = true; + public static boolean sendNullEntityPackets = true;
private static void networkSettings() { private static void networkSettings() {
+ sendNullEntityPackets = getBoolean("network.send-null-entity-packets", sendNullEntityPackets); + sendNullEntityPackets = getBoolean("network.send-null-entity-packets", sendNullEntityPackets);
} }
} }
diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java diff --git a/src/main/java/net/minecraft/server/level/ServerEntity.java b/src/main/java/net/minecraft/server/level/ServerEntity.java
index 0f9a3a6c05fee59c29764f0c0d7a6cb8a2a861b1..9d0a52bf600583ecbf80c2233a01ff43e609266f 100644 index 6670e657e08e130f7e0368f418379fd1ece00cdf..5558d87ef182f82be7877455dd027082c6a80632 100644
--- a/src/main/java/net/minecraft/server/level/ServerEntity.java --- a/src/main/java/net/minecraft/server/level/ServerEntity.java
+++ b/src/main/java/net/minecraft/server/level/ServerEntity.java +++ b/src/main/java/net/minecraft/server/level/ServerEntity.java
@@ -186,6 +186,11 @@ public class ServerEntity { @@ -201,6 +201,11 @@ public class ServerEntity {
this.teleportDelay = 0; flag4 = true;
packet1 = new ClientboundTeleportEntityPacket(this.entity); flag5 = true;
} }
+ // Kaiiju start - Don't send null move entity packets + // Kaiiju start - Don't send null move entity packets
+ if (!dev.kaiijumc.kaiiju.KaiijuConfig.sendNullEntityPackets && isNullMovePacket(packet1)) { + if (!dev.kaiijumc.kaiiju.KaiijuConfig.sendNullEntityPackets && isNullMovePacket(packet1)) {
@@ -33,8 +36,8 @@ index 0f9a3a6c05fee59c29764f0c0d7a6cb8a2a861b1..9d0a52bf600583ecbf80c2233a01ff43
} }
if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) { if ((this.trackDelta || this.entity.hasImpulse || this.entity instanceof LivingEntity && ((LivingEntity) this.entity).isFallFlying()) && this.tickCount > 0) {
@@ -252,6 +257,20 @@ public class ServerEntity { @@ -273,6 +278,20 @@ public class ServerEntity {
});
} }
+ // Kaiiju start - Don't send null move entity packets + // Kaiiju start - Don't send null move entity packets
@@ -50,7 +53,7 @@ index 0f9a3a6c05fee59c29764f0c0d7a6cb8a2a861b1..9d0a52bf600583ecbf80c2233a01ff43
+ return false; + return false;
+ } + }
+ // Kaiiju end + // Kaiiju end
+ +
public void removePairing(ServerPlayer player) { public void removePairing(ServerPlayer player) {
this.entity.stopSeenByPlayer(player); this.entity.stopSeenByPlayer(player);
player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()})); player.connection.send(new ClientboundRemoveEntitiesPacket(new int[]{this.entity.getId()}));

View File

@@ -0,0 +1,73 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Fri, 31 Mar 2023 01:52:44 +0300
Subject: [PATCH] Alternate Keepalive
Don't kick players because 1 keepalive is lost.
This patch is from Purpur.
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index ab08e11f13921163b8ff1ff51ff9e9b86d2b47c7..b42a3466f145a92608c8746fd4beb529b4a60b01 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -200,8 +200,10 @@ public class KaiijuConfig {
}
public static boolean sendNullEntityPackets = true;
+ public static boolean alternateKeepAlive = false;
private static void networkSettings() {
sendNullEntityPackets = getBoolean("network.send-null-entity-packets", sendNullEntityPackets);
+ alternateKeepAlive = getBoolean("network.alternate-keepalive", alternateKeepAlive);
}
}
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 82ffef34b596a98faa245ba401e67add9d9ac7d0..b2ed157a17cada4887e543a23ee65642eb54637e 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -263,6 +263,7 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
private long keepAliveTime = Util.getMillis();
private boolean keepAlivePending;
private long keepAliveChallenge;
+ private it.unimi.dsi.fastutil.longs.LongList keepAlives = new it.unimi.dsi.fastutil.longs.LongArrayList(); // Kaiiju
// CraftBukkit start - multithreaded fields
private final AtomicInteger chatSpamTickCount = new AtomicInteger();
private final java.util.concurrent.atomic.AtomicInteger tabSpamLimiter = new java.util.concurrent.atomic.AtomicInteger(); // Paper - configurable tab spam limits
@@ -355,6 +356,20 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
long currentTime = Util.getMillis();
long elapsedTime = currentTime - this.keepAliveTime;
+ // Kaiiju start
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.alternateKeepAlive) {
+ if (elapsedTime >= 1000L) { // 1 second
+ if (!processedDisconnect && keepAlives.size() * 1000L >= KEEPALIVE_LIMIT) {
+ LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName());
+ disconnect(Component.translatable("disconnect.timeout"), org.bukkit.event.player.PlayerKickEvent.Cause.TIMEOUT);
+ } else {
+ keepAliveTime = currentTime; // hijack this field for 1 second intervals
+ keepAlives.add(currentTime); // currentTime is ID
+ send(new ClientboundKeepAlivePacket(currentTime));
+ }
+ }
+ } else
+ // Kaiiju end
if (this.keepAlivePending) {
if (!this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // check keepalive limit, don't fire if already disconnected
ServerGamePacketListenerImpl.LOGGER.warn("{} was kicked due to keepalive timeout!", this.player.getScoreboardName()); // more info
@@ -3514,6 +3529,16 @@ public class ServerGamePacketListenerImpl implements ServerPlayerConnection, Tic
@Override
public void handleKeepAlive(ServerboundKeepAlivePacket packet) {
+ // Kaiiju start
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.alternateKeepAlive) {
+ long id = packet.getId();
+ if (keepAlives.size() > 0 && keepAlives.contains(id)) {
+ int ping = (int) (Util.getMillis() - id);
+ player.latency = (player.latency * 3 + ping) / 4;
+ keepAlives.clear(); // we got a valid response, lets roll with it and forget the rest
+ }
+ } else
+ // Kaiiju end
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit // Paper - This shouldn't be on the main thread
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
int i = (int) (Util.getMillis() - this.keepAliveTime);

View File

@@ -1,176 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: kugge <sofiane.djerbi38@gmail.com>
Date: Mon, 13 Feb 2023 00:53:40 +0100
Subject: [PATCH] Kaiiju Lobotomize Villager
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index b99b438b92587f23c77c5321d5d23e76dc5450de..104f19cced8fb3b692e3a4772360d9eba3bdd6f2 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -149,6 +149,13 @@ public class KaiijuWorldConfig {
public boolean lobotomizeAnimalCheckCanJump = true;
public boolean lobotomizeAnimalLookAtPlayer = false;
public boolean lobotomizeAnimalFloat = true;
+ public boolean lobotomizeVillagerEnabled = false;
+ public int lobotomizeVillagerCheckInterval = 100;
+ public boolean lobotomizeVillagerDoRaids = true;
+ public boolean lobotomizeVillagerCheckCanJump = true;
+ public boolean lobotomizeVillagerCheckOnBed = true;
+ public boolean lobotomizeVillagerCheckJobSite = true;
+ public boolean lobotomizeVillagerCheckBedNearby = true;
private void lobotomizeSettings() {
lobotomizeAnimalEnabled = getBoolean("lobotomize.animal.enabled", lobotomizeAnimalEnabled);
@@ -156,5 +163,12 @@ public class KaiijuWorldConfig {
lobotomizeAnimalCheckCanJump = getBoolean("lobotomize.animal.check-can-jump", lobotomizeAnimalCheckCanJump);
lobotomizeAnimalLookAtPlayer = getBoolean("lobotomize.animal.look-at-player", lobotomizeAnimalLookAtPlayer);
lobotomizeAnimalFloat = getBoolean("lobotomize.animal.float", lobotomizeAnimalFloat);
+ lobotomizeVillagerEnabled = getBoolean("lobotomize.villager.enabled", lobotomizeVillagerEnabled);
+ lobotomizeVillagerDoRaids = getBoolean("lobotomize.villager.do-raids", lobotomizeVillagerDoRaids);
+ lobotomizeVillagerCheckInterval = getInt("lobotomize.villager.check-interval", lobotomizeVillagerCheckInterval);
+ lobotomizeVillagerCheckCanJump = getBoolean("lobotomize.villager.check-can-jump", lobotomizeVillagerCheckCanJump);
+ lobotomizeVillagerCheckOnBed = getBoolean("lobotomize.villager.check-on-bed", lobotomizeVillagerCheckOnBed);
+ lobotomizeVillagerCheckJobSite = getBoolean("lobotomize.villager.check-job-site", lobotomizeVillagerCheckJobSite);
+ lobotomizeVillagerCheckBedNearby = getBoolean("lobotomize.villager.check-bed-nearby", lobotomizeVillagerCheckBedNearby);
}
}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/world/entity/npc/Villager.java b/src/main/java/net/minecraft/world/entity/npc/Villager.java
index aed1d9ccffe471b6c2a1d52d2d3d097f6431318b..f1a66bda9949eff5f8e420d28d23f47aec3d4587 100644
--- a/src/main/java/net/minecraft/world/entity/npc/Villager.java
+++ b/src/main/java/net/minecraft/world/entity/npc/Villager.java
@@ -200,14 +200,14 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
private boolean checkLobotomized() {
- int interval = this.level.purpurConfig.villagerLobotomizeCheckInterval;
+ int interval = this.level.kaiijuConfig.lobotomizeVillagerCheckInterval; // Kaiiju
if (this.notLobotomizedCount > 3) {
// check half as often if not lobotomized for the last 3+ consecutive checks
interval *= 2;
}
- if (this.level.getGameTime() % interval == 0) {
+ if ((this.getId() + this.tickCount) % interval == 0) { // Kaiiju - Avoid check lags
// offset Y for short blocks like dirt_path/farmland
- this.isLobotomized = !canTravelFrom(new BlockPos(getX(), getY() + 0.0625D, getZ()));
+ this.isLobotomized = needLobotomy(); // Kaiiju - Override
if (this.isLobotomized) {
this.notLobotomizedCount = 0;
@@ -219,9 +219,80 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
}
private boolean canTravelFrom(BlockPos pos) {
- return canTravelTo(pos.east()) || canTravelTo(pos.west()) || canTravelTo(pos.north()) || canTravelTo(pos.south());
+ return canInteractAt(pos.east()) || canInteractAt(pos.west()) || canInteractAt(pos.north()) || canInteractAt(pos.south()); // Kaiiju
}
+ // Kaiiju start - Customize canTravelTo checks
+ private boolean needLobotomy() {
+ if (this.isSleeping()) return false;
+ if (this.level.kaiijuConfig.lobotomizeVillagerCheckOnBed && isOnBed()) return false;
+ return !canTravelFrom(new BlockPos(getX(), getY() + 0.5D, getZ()));
+ }
+
+ private boolean canInteractAt(BlockPos pos) {
+ net.minecraft.world.level.block.state.BlockState top = null;
+ // Check if mob can jump over block
+ if (this.level.kaiijuConfig.lobotomizeVillagerCheckCanJump && this.canJump()) {
+ top = this.level.getBlockStateIfLoaded(pos.above());
+ if (top == null) return false;
+ if (top.isPathfindable(level, pos, net.minecraft.world.level.pathfinder.PathComputationType.LAND)) {
+ net.minecraft.world.level.block.state.BlockState above = this.level.getBlockState(pos.above(2));
+ if (above.isPathfindable(level, pos, net.minecraft.world.level.pathfinder.PathComputationType.LAND)) return true;
+ }
+ }
+ // Otherwise, check if mob can interact with bottom block
+ net.minecraft.world.level.block.state.BlockState bottom = this.level.getBlockStateIfLoaded(pos);
+ if (bottom == null) return false;
+ net.minecraft.world.level.block.Block bottomBlock = bottom.getBlock();
+ if (isTallBlock(bottomBlock)) return false;
+ if (this.level.kaiijuConfig.lobotomizeVillagerCheckBedNearby && isBed(bottomBlock)) return true;
+ if (this.level.kaiijuConfig.lobotomizeVillagerCheckJobSite && isInteractiveJobSite(bottomBlock, this.getVillagerData().getProfession())) return true;
+ // If he can't interact, check if he can travel
+ if (!bottom.isPathfindable(level, pos, net.minecraft.world.level.pathfinder.PathComputationType.LAND)) return false;
+ if (top == null) top = this.level.getBlockState(pos.above());
+ return top.isPathfindable(level, pos, net.minecraft.world.level.pathfinder.PathComputationType.LAND);
+ }
+
+ private boolean canJump() {
+ BlockPos pos = new BlockPos(getX(), getY() + 2.5D, getZ());
+ net.minecraft.world.level.block.Block above = this.level.getBlockIfLoaded(pos);
+ return !above.hasCollision;
+ }
+
+ private boolean isOnBed() {
+ BlockPos pos = new BlockPos(getX(), getY() - 0.5D, getZ());
+ net.minecraft.world.level.block.Block below = this.level.getBlockIfLoaded(pos);
+ return isBed(below);
+ }
+
+ private static boolean isBed(net.minecraft.world.level.block.Block block) {
+ return block instanceof net.minecraft.world.level.block.BedBlock;
+ }
+
+ private boolean isInteractiveJobSite(net.minecraft.world.level.block.Block block, VillagerProfession profession) {
+ if (this.lastTradedPlayer == null) return false;
+ return (block instanceof net.minecraft.world.level.block.BlastFurnaceBlock && profession != VillagerProfession.ARMORER) ||
+ (block instanceof net.minecraft.world.level.block.SmokerBlock && profession != VillagerProfession.BUTCHER) ||
+ (block instanceof net.minecraft.world.level.block.CartographyTableBlock && profession != VillagerProfession.CARTOGRAPHER) ||
+ (block instanceof net.minecraft.world.level.block.BrewingStandBlock && profession != VillagerProfession.CLERIC) ||
+ (block instanceof net.minecraft.world.level.block.ComposterBlock && profession != VillagerProfession.FARMER) ||
+ (block instanceof net.minecraft.world.level.block.BarrelBlock && profession != VillagerProfession.FISHERMAN) ||
+ (block instanceof net.minecraft.world.level.block.FletchingTableBlock && profession != VillagerProfession.FLETCHER) ||
+ (block instanceof net.minecraft.world.level.block.CauldronBlock && profession != VillagerProfession.LEATHERWORKER) ||
+ (block instanceof net.minecraft.world.level.block.LecternBlock && profession != VillagerProfession.LIBRARIAN) ||
+ (block instanceof net.minecraft.world.level.block.StonecutterBlock && profession != VillagerProfession.MASON) ||
+ (block instanceof net.minecraft.world.level.block.LoomBlock && profession != VillagerProfession.SHEPHERD) ||
+ (block instanceof net.minecraft.world.level.block.SmithingTableBlock && profession != VillagerProfession.TOOLSMITH) ||
+ (block instanceof net.minecraft.world.level.block.GrindstoneBlock && profession != VillagerProfession.WEAPONSMITH);
+ }
+
+ private static boolean isTallBlock(net.minecraft.world.level.block.Block block) {
+ return block instanceof net.minecraft.world.level.block.FenceBlock ||
+ block instanceof net.minecraft.world.level.block.FenceGateBlock ||
+ block instanceof net.minecraft.world.level.block.WallBlock;
+ }
+ // Kaiiju end
+
private boolean canTravelTo(BlockPos pos) {
net.minecraft.world.level.block.state.BlockState state = this.level.getBlockStateIfLoaded(pos);
if (state == null) {
@@ -337,7 +408,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
protected void mobTick(boolean inactive) {
//this.level.getProfiler().push("villagerBrain"); // Purpur
// Purpur start
- if (this.level.purpurConfig.villagerLobotomizeEnabled) {
+ if (this.level.kaiijuConfig.lobotomizeVillagerEnabled) { // Kaiiju - Override
// treat as inactive if lobotomized
inactive = inactive || checkLobotomized();
} else {
@@ -380,7 +451,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
this.lastTradedPlayer = null;
}
- if (!inactive && !this.isNoAi() && this.random.nextInt(100) == 0) { // Paper
+ if ((!inactive || (this.level.kaiijuConfig.lobotomizeVillagerDoRaids && this.isLobotomized)) && !this.isNoAi() && this.random.nextInt(100) == 0) { // Paper // Kaiiju
Raid raid = ((ServerLevel) this.level).getRaidAt(this.blockPosition());
if (raid != null && raid.isActive() && !raid.isOver()) {
@@ -647,6 +718,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
if (this.assignProfessionWhenSpawned) {
nbt.putBoolean("AssignProfessionWhenSpawned", true);
}
+ nbt.putBoolean("Kaiiju.Lobotomized", this.isLobotomized()); // Kaiiju
}
@@ -687,6 +759,7 @@ public class Villager extends AbstractVillager implements ReputationEventHandler
if (nbt.contains("AssignProfessionWhenSpawned")) {
this.assignProfessionWhenSpawned = nbt.getBoolean("AssignProfessionWhenSpawned");
}
+ this.isLobotomized = nbt.getBoolean("Kaiiju.Lobotomized"); // Kaiiju
}

View File

@@ -1,11 +1,11 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com> From: kugge <sofiane.djerbi38@gmail.com>
Date: Sat, 11 Feb 2023 02:10:20 +0200 Date: Wed, 21 Jun 2023 17:26:24 +0200
Subject: [PATCH] Kaiiju Lobotomize Configuration Subject: [PATCH] Optimization Configuration
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index b194f4dbebcbbf5bb4e026a0169e2d24806b46ec..907fdfb368c87bfe7b4374bb0b5f49d5ff095339 100644 index a6e7af5f4148e067660e9f5beeacde3a59a1de9c..6bd14857e0b0ef233f17f1a6e3e0fb313d59f641 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java --- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java +++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -143,4 +143,7 @@ public class KaiijuWorldConfig { @@ -143,4 +143,7 @@ public class KaiijuWorldConfig {
@@ -13,7 +13,6 @@ index b194f4dbebcbbf5bb4e026a0169e2d24806b46ec..907fdfb368c87bfe7b4374bb0b5f49d5
} }
} }
+ +
+ private void lobotomizeSettings() { + private void optimizationSettings() {
+ } + }
} }
\ No newline at end of file

View File

@@ -0,0 +1,30 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Sat, 8 Apr 2023 23:32:34 +0300
Subject: [PATCH] Gameplay Configuration
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index b42a3466f145a92608c8746fd4beb529b4a60b01..6d0e1edfb7d3c020f70f6a194f16e836b462c4de 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -206,4 +206,7 @@ public class KaiijuConfig {
sendNullEntityPackets = getBoolean("network.send-null-entity-packets", sendNullEntityPackets);
alternateKeepAlive = getBoolean("network.alternate-keepalive", alternateKeepAlive);
}
+
+ private static void gameplaySettings() {
+ }
}
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 6bd14857e0b0ef233f17f1a6e3e0fb313d59f641..05f9c01131e78927d88f1170c3eda4adf25ac8ba 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -146,4 +146,7 @@ public class KaiijuWorldConfig {
private void optimizationSettings() {
}
+
+ private void gameplaySettings() {
+ }
}

View File

@@ -1,20 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 16 Feb 2023 21:28:49 +0200
Subject: [PATCH] Kaiiju Lithium Configuration
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index 276c0e2936dfd3ca752deb65c80565c477f65e7f..98c11996a4f052e4e8f1b2782e214817a7999677 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -197,4 +197,9 @@ public class KaiijuConfig {
private static void networkSettings() {
sendNullEntityPackets = getBoolean("network.send-null-entity-packets", sendNullEntityPackets);
}
+
+ public static boolean lithiumEnable = true;
+ private static void lithiumSettings() {
+ lithiumEnable = getBoolean("lithium.enable", lithiumEnable);
+ }
}

View File

@@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xymb <xymb@endcrystal.me>
Date: Sat, 8 Apr 2023 23:38:13 +0300
Subject: [PATCH] Shulker drop contents when destroyed
Don't drop shulker contents when shulker items are destroyed (by cactus,
lava..)
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 05f9c01131e78927d88f1170c3eda4adf25ac8ba..55dcbb48450b24f80e0a04bedeb54f64e94ebb9e 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -144,7 +144,10 @@ public class KaiijuWorldConfig {
}
}
+ public boolean shulkerBoxDropContentsWhenDestroyed = true;
+
private void optimizationSettings() {
+ shulkerBoxDropContentsWhenDestroyed = getBoolean("optimization.shulker-box-drop-contents-when-destroyed", shulkerBoxDropContentsWhenDestroyed);
}
private void gameplaySettings() {
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
index ebee8de2ed831755b6fd154f6cc77ac993839bb9..ce5faefe3b67087509833800f0472f14131f2011 100644
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
@@ -288,7 +288,7 @@ public class BlockItem extends Item {
@Override
public void onDestroyed(ItemEntity entity) {
- if (this.block instanceof ShulkerBoxBlock) {
+ if (this.block instanceof ShulkerBoxBlock && entity.level().kaiijuConfig.shulkerBoxDropContentsWhenDestroyed) { // Kaiiju
ItemStack itemstack = entity.getItem();
CompoundTag nbttagcompound = BlockItem.getBlockEntityData(itemstack);

View File

@@ -1,125 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 16 Feb 2023 21:34:37 +0200
Subject: [PATCH] Lithium Math FastUtil
Author: JellySquid
Licence: LGPL-3.0
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index 98c11996a4f052e4e8f1b2782e214817a7999677..259f7bdca1b9f59dd148492f8f8fe7dc959e55d9 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -199,7 +199,9 @@ public class KaiijuConfig {
}
public static boolean lithiumEnable = true;
+ public static boolean lithiumMathFastUtil = true;
private static void lithiumSettings() {
lithiumEnable = getBoolean("lithium.enable", lithiumEnable);
+ lithiumMathFastUtil = getBoolean("lithium.math.fast-util", lithiumMathFastUtil) && lithiumEnable;
}
}
diff --git a/src/main/java/net/minecraft/core/AxisCycle.java b/src/main/java/net/minecraft/core/AxisCycle.java
index b5d8a60dc78a76c0a55bfc30cc49d26857bd914a..dd8d98acf21bb676e86f9befb45fd09e1b14a01d 100644
--- a/src/main/java/net/minecraft/core/AxisCycle.java
+++ b/src/main/java/net/minecraft/core/AxisCycle.java
@@ -35,6 +35,18 @@ public enum AxisCycle {
@Override
public Direction.Axis cycle(Direction.Axis axis) {
+ // Kaiiju start - Lithium
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.lithiumMathFastUtil){
+ switch (axis.ordinal()) {
+ case 0: //X
+ return Direction.Axis.Y;
+ case 1: //Y
+ return Direction.Axis.Z;
+ case 2: //Z
+ return Direction.Axis.X;
+ }
+ }
+ // Kaiiju end
return AXIS_VALUES[Math.floorMod(axis.ordinal() + 1, 3)];
}
@@ -56,6 +68,18 @@ public enum AxisCycle {
@Override
public Direction.Axis cycle(Direction.Axis axis) {
+ // Kaiiju start - Lithium
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.lithiumMathFastUtil){
+ switch (axis.ordinal()) {
+ case 0: //X
+ return Direction.Axis.Z;
+ case 1: //Y
+ return Direction.Axis.X;
+ case 2: //Z
+ return Direction.Axis.Y;
+ }
+ }
+ // Kaiiju end
return AXIS_VALUES[Math.floorMod(axis.ordinal() - 1, 3)];
}
diff --git a/src/main/java/net/minecraft/core/Direction.java b/src/main/java/net/minecraft/core/Direction.java
index a4dc96b1a3bf309584657e3a1e7dfaea967f9425..09c1989dc3b12d9488b8869e71f2a4890656cc36 100644
--- a/src/main/java/net/minecraft/core/Direction.java
+++ b/src/main/java/net/minecraft/core/Direction.java
@@ -191,6 +191,7 @@ public enum Direction implements StringRepresentable {
}
public Direction getOpposite() {
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.lithiumMathFastUtil) return VALUES[this.oppositeIndex]; // Kaiiju
return from3DDataValue(this.oppositeIndex);
}
@@ -453,6 +454,7 @@ public enum Direction implements StringRepresentable {
}
public static Direction getRandom(RandomSource random) {
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.lithiumMathFastUtil) return VALUES[random.nextInt(VALUES.length)]; // Kaiiju
return Util.getRandom(VALUES, random);
}
diff --git a/src/main/java/net/minecraft/world/phys/AABB.java b/src/main/java/net/minecraft/world/phys/AABB.java
index cfb2e46b34b2982d6724f18214557fc80cf4adfa..4fae201f57dc23ed0e25f17739f97133a7f7534c 100644
--- a/src/main/java/net/minecraft/world/phys/AABB.java
+++ b/src/main/java/net/minecraft/world/phys/AABB.java
@@ -81,10 +81,36 @@ public class AABB {
}
public double min(Direction.Axis axis) {
+ // Kaiiju start - Lithium
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.lithiumMathFastUtil){
+ switch (axis.ordinal()) {
+ case 0: //X
+ return this.minX;
+ case 1: //Y
+ return this.minY;
+ case 2: //Z
+ return this.minZ;
+ }
+ throw new IllegalArgumentException();
+ }
+ // Kaiiju end
return axis.choose(this.minX, this.minY, this.minZ);
}
public double max(Direction.Axis axis) {
+ // Kaiiju start - Lithium
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.lithiumMathFastUtil){
+ switch (axis.ordinal()) {
+ case 0: //X
+ return this.maxX;
+ case 1: //Y
+ return this.maxY;
+ case 2: //Z
+ return this.maxZ;
+ }
+ throw new IllegalArgumentException();
+ }
+ // Kaiiju end
return axis.choose(this.maxX, this.maxY, this.maxZ);
}

View File

@@ -0,0 +1,33 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Sun, 9 Apr 2023 17:06:46 +0300
Subject: [PATCH] Server mod name
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index 6d0e1edfb7d3c020f70f6a194f16e836b462c4de..9fb33b35b4d6842ca8597f77a4116e3983ebfbcb 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -207,6 +207,9 @@ public class KaiijuConfig {
alternateKeepAlive = getBoolean("network.alternate-keepalive", alternateKeepAlive);
}
+ public static String serverModName = "Kaiiju";
+
private static void gameplaySettings() {
+ serverModName = getString("gameplay.server-mod-name", serverModName);
}
}
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
index 06233380f7580726753de34c1fb23d6347c9ac94..1b3f895b51b634ee9cf69cdbbfd7a1e600de16f0 100644
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
@@ -1812,7 +1812,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
@DontObfuscate
public String getServerModName() {
- return "Kaiiju"; // Kaiiju - Kaiiju > // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
+ return dev.kaiijumc.kaiiju.KaiijuConfig.serverModName; // Kaiiju - Kaiiju > // Folia - Folia > // Paper - Paper > // Spigot - Spigot > // CraftBukkit - cb > vanilla!
}
public SystemReport fillSystemReport(SystemReport details) {

View File

@@ -0,0 +1,227 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xymb <xymb@endcrystal.me>
Date: Fri, 14 Apr 2023 02:12:58 +0200
Subject: [PATCH] Crash on broken symlink
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 55dcbb48450b24f80e0a04bedeb54f64e94ebb9e..f3f824d0ab1a2a72825c40b67192386479a0b34c 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -127,6 +127,7 @@ public class KaiijuWorldConfig {
}
public RegionFileFormat regionFormatName = RegionFileFormat.ANVIL;
+ public boolean linearCrashOnBrokenSymlink = true;
public int regionFormatLinearCompressionLevel = 1;
private void regionFormatSettings() {
@@ -142,6 +143,7 @@ public class KaiijuWorldConfig {
log(Level.SEVERE, "Falling back to compression level 1.");
regionFormatLinearCompressionLevel = 1;
}
+ linearCrashOnBrokenSymlink = getBoolean("region-format.linear.crash-on-broken-symlink", linearCrashOnBrokenSymlink);
}
public boolean shulkerBoxDropContentsWhenDestroyed = true;
diff --git a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
index abf5e2a06af9853b58ac9107cd6e9787c4185c66..389c68c0becd2f69dc1004d0b383f1a8784214c0 100644
--- a/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
+++ b/src/main/java/io/papermc/paper/world/ThreadedWorldUpgrader.java
@@ -87,10 +87,11 @@ public class ThreadedWorldUpgrader {
// Kaiiju start
dev.kaiijumc.kaiiju.region.RegionFileFormat formatName = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatName;
int linearCompression = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatLinearCompressionLevel;
+ boolean linearCrashOnBrokenSymlink = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.linearCrashOnBrokenSymlink;
LOGGER.info("Using format " + formatName + " (" + linearCompression + ")");
// Kaiiju end
final WorldInfo info = new WorldInfo(() -> worldPersistentData,
- new ChunkStorage(formatName, linearCompression, regionFolder.toPath(), this.dataFixer, false), this.removeCaches, this.dimensionType, this.generatorKey); // Kaiiju
+ new ChunkStorage(formatName, linearCompression, linearCrashOnBrokenSymlink, regionFolder.toPath(), this.dataFixer, false), this.removeCaches, this.dimensionType, this.generatorKey); // Kaiiju
long expectedChunks = (long)regionFiles.length * (32L * 32L);
diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java
index 61c6bc2859235874aefac71e9e55162f0a89f29f..24bd63c596c9f61f1e89ec5b001b7cb7a29a09ff 100644
--- a/src/main/java/net/minecraft/server/level/ChunkMap.java
+++ b/src/main/java/net/minecraft/server/level/ChunkMap.java
@@ -269,7 +269,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
// Paper end
public ChunkMap(ServerLevel world, LevelStorageSource.LevelStorageAccess session, DataFixer dataFixer, StructureTemplateManager structureTemplateManager, Executor executor, BlockableEventLoop<Runnable> mainThreadExecutor, LightChunkGetter chunkProvider, ChunkGenerator chunkGenerator, ChunkProgressListener worldGenerationProgressListener, ChunkStatusUpdateListener chunkStatusChangeListener, Supplier<DimensionDataStorage> persistentStateManagerFactory, int viewDistance, boolean dsync) {
- super(world.getLevel().kaiijuConfig.regionFormatName, world.getLevel().kaiijuConfig.regionFormatLinearCompressionLevel, session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); // Kaiiju
+ super(world.getLevel().kaiijuConfig.regionFormatName, world.getLevel().kaiijuConfig.regionFormatLinearCompressionLevel, world.getLevel().kaiijuConfig.linearCrashOnBrokenSymlink, session.getDimensionPath(world.dimension()).resolve("region"), dataFixer, dsync); // Kaiiju
// Paper - rewrite chunk system
this.tickingGenerated = new AtomicInteger();
//this.playerMap = new PlayerMap(); // Folia - region threading
@@ -314,7 +314,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider
this.lightEngine = new ThreadedLevelLightEngine(chunkProvider, this, this.level.dimensionType().hasSkyLight(), null, null); // Paper - rewrite chunk system
this.distanceManager = new ChunkMap.ChunkDistanceManager(executor, mainThreadExecutor);
this.overworldDataStorage = persistentStateManagerFactory;
- this.poiManager = new PoiManager(this.level.kaiijuConfig.regionFormatName, this.level.kaiijuConfig.regionFormatLinearCompressionLevel, path.resolve("poi"), dataFixer, dsync, iregistrycustom, world); // Kaiiju
+ this.poiManager = new PoiManager(this.level.kaiijuConfig.regionFormatName, this.level.kaiijuConfig.regionFormatLinearCompressionLevel, this.level.kaiijuConfig.linearCrashOnBrokenSymlink, path.resolve("poi"), dataFixer, dsync, iregistrycustom, world); // Kaiiju
this.setViewDistance(viewDistance);
// Paper start
this.dataRegionManager = new io.papermc.paper.chunk.SingleThreadChunkRegionManager(this.level, 2, (1.0 / 3.0), 1, 6, "Data", DataRegionData::new, DataRegionSectionData::new);
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 4774d3f357d62b0818b4713f8085d05be09eaa5c..1bbd8b475cdc57fb15ca05ffe122220a5539da10 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -426,8 +426,8 @@ public class ServerLevel extends Level implements WorldGenLevel {
private static final class EntityRegionFileStorage extends net.minecraft.world.level.chunk.storage.RegionFileStorage {
- public EntityRegionFileStorage(String format, int linearCompression, Path directory, boolean dsync) { // Kaiiju
- super(format, linearCompression, directory, dsync); // Kaiiju
+ public EntityRegionFileStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, boolean linearCrashOnBrokenSymlink, Path directory, boolean dsync) { // Kaiiju
+ super(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync); // Kaiiju
}
protected void write(ChunkPos pos, net.minecraft.nbt.CompoundTag nbt) throws IOException {
@@ -666,7 +666,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// CraftBukkit end
boolean flag2 = minecraftserver.forceSynchronousWrites();
DataFixer datafixer = minecraftserver.getFixerUpper();
- this.entityStorage = new EntityRegionFileStorage(this.getLevel().kaiijuConfig.regionFormatName, this.getLevel().kaiijuConfig.regionFormatLinearCompressionLevel, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), flag2); // Paper - rewrite chunk system //EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(this, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, minecraftserver); // Kaiiju
+ this.entityStorage = new EntityRegionFileStorage(this.getLevel().kaiijuConfig.regionFormatName, this.getLevel().kaiijuConfig.regionFormatLinearCompressionLevel, this.getLevel().kaiijuConfig.linearCrashOnBrokenSymlink, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), flag2); // Paper - rewrite chunk system //EntityPersistentStorage<Entity> entitypersistentstorage = new EntityStorage(this, convertable_conversionsession.getDimensionPath(resourcekey).resolve("entities"), datafixer, flag2, minecraftserver); // Kaiiju
// this.entityManager = new PersistentEntitySectionManager<>(Entity.class, new ServerLevel.EntityCallbacks(), entitypersistentstorage, this.entitySliceManager); // Paper // Paper - rewrite chunk system
StructureTemplateManager structuretemplatemanager = minecraftserver.getStructureManager();
diff --git a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
index ac35e7eb8cb5f19391a18eb9d6b5ba26769ce2f6..a9c6ca7c621bb2431bcf0ae879b192f748bf931b 100644
--- a/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
+++ b/src/main/java/net/minecraft/util/worldupdate/WorldUpgrader.java
@@ -120,7 +120,8 @@ public class WorldUpgrader {
String worldName = this.levelStorage.getLevelId();
dev.kaiijumc.kaiiju.region.RegionFileFormat formatName = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatName;
int linearCompression = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.regionFormatLinearCompressionLevel;
- builder1.put(resourcekey1, new ChunkStorage(formatName, linearCompression, path.resolve("region"), this.dataFixer, true));
+ boolean linearCrashOnBrokenSymlink = ((org.bukkit.craftbukkit.CraftWorld) org.bukkit.Bukkit.getWorld(worldName)).getHandle().kaiijuConfig.linearCrashOnBrokenSymlink;
+ builder1.put(resourcekey1, new ChunkStorage(formatName, linearCompression, linearCrashOnBrokenSymlink, path.resolve("region"), this.dataFixer, true));
// Kaiiju end
}
diff --git a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
index 187ff795192c7eb56dffafa1ff6fa3068ac341c3..b9cf3b9f2cdb554d267c6dc3436e011c7e607228 100644
--- a/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
+++ b/src/main/java/net/minecraft/world/entity/ai/village/poi/PoiManager.java
@@ -59,8 +59,8 @@ public class PoiManager extends SectionStorage<PoiSection> {
// Paper end - rewrite chunk system
- public PoiManager(dev.kaiijumc.kaiiju.region.RegionFileFormat formatName, int linearCompression, Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) { // Kaiiju
- super(formatName, linearCompression, path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world); // Kaiiju
+ public PoiManager(dev.kaiijumc.kaiiju.region.RegionFileFormat formatName, int linearCompression, boolean linearCrashOnBrokenSymlink, Path path, DataFixer dataFixer, boolean dsync, RegistryAccess registryManager, LevelHeightAccessor world) { // Kaiiju
+ super(formatName, linearCompression, linearCrashOnBrokenSymlink, path, PoiSection::codec, PoiSection::new, dataFixer, DataFixTypes.POI_CHUNK, dsync, registryManager, world); // Kaiiju
this.world = (net.minecraft.server.level.ServerLevel)world; // Paper - rewrite chunk system
}
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
index 1d880f27dd147da683fc30ed6f1bfa43ecdb7d93..41598adf6d49a44bcaadfff3797221460a6d93ba 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/ChunkStorage.java
@@ -37,11 +37,11 @@ public class ChunkStorage implements AutoCloseable {
public final RegionFileStorage regionFileCache;
// Paper end - async chunk loading
- public ChunkStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, Path directory, DataFixer dataFixer, boolean dsync) { // Kaiiju
+ public ChunkStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, boolean linearCrashOnBrokenSymlink, Path directory, DataFixer dataFixer, boolean dsync) { // Kaiiju
this.fixerUpper = dataFixer;
// Paper start - async chunk io
// remove IO worker
- this.regionFileCache = new RegionFileStorage(format, linearCompression, directory, dsync, true); // Paper - nuke IOWorker // Paper
+ this.regionFileCache = new RegionFileStorage(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync, true); // Paper - nuke IOWorker // Paper
// Paper end - async chunk io
}
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 b35a6a7daf768af3bc453fe18deec823f4b63a3a..8409293b3f329715d6dff3d455c6a484d5b133ee 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
@@ -20,6 +20,7 @@ import net.minecraft.world.level.ChunkPos;
public class RegionFileStorage implements AutoCloseable {
+ private static final org.slf4j.Logger LOGGER = com.mojang.logging.LogUtils.getLogger(); // Kaiiju
public static final String ANVIL_EXTENSION = ".mca";
private static final int MAX_CACHE_SIZE = 256;
public final Long2ObjectLinkedOpenHashMap<dev.kaiijumc.kaiiju.region.AbstractRegionFile> regionCache = new Long2ObjectLinkedOpenHashMap(); // Kaiiju
@@ -28,6 +29,7 @@ public class RegionFileStorage implements AutoCloseable {
// Kaiiju start - Per world chunk format
public final dev.kaiijumc.kaiiju.region.RegionFileFormat format;
public final int linearCompression;
+ public final boolean linearCrashOnBrokenSymlink;
// Kaiiju end
private final boolean isChunkData; // Paper
@@ -60,14 +62,15 @@ public class RegionFileStorage implements AutoCloseable {
}
// Paper end - cache regionfile does not exist state
- protected RegionFileStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, Path directory, boolean dsync) { // Paper - protected constructor
+ protected RegionFileStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, boolean linearCrashOnBrokenSymlink, Path directory, boolean dsync) { // Paper - protected constructor
// Paper start - add isChunkData param
- this(format, linearCompression, directory, dsync, false);
+ this(format, linearCompression, linearCrashOnBrokenSymlink, directory, dsync, false);
}
- RegionFileStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, Path directory, boolean dsync, boolean isChunkData) { // Kaiiju
+ RegionFileStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, boolean linearCrashOnBrokenSymlink, Path directory, boolean dsync, boolean isChunkData) { // Kaiiju
// Kaiiju start
this.format = format;
this.linearCompression = linearCompression;
+ this.linearCrashOnBrokenSymlink = linearCrashOnBrokenSymlink;
// Kaiiju end
this.isChunkData = isChunkData;
// Paper end - add isChunkData param
@@ -111,6 +114,20 @@ public class RegionFileStorage implements AutoCloseable {
return regionfile != null ? regionfile.hasChunk(pos) : false;
}
+ // Kaiiju start
+ private void guardAgainstBrokenSymlinks(Path path) throws IOException {
+ if (!linearCrashOnBrokenSymlink) return;
+ if (!this.format.equals("LINEAR")) return;
+ if (!java.nio.file.Files.isSymbolicLink(path)) return;
+ Path link = java.nio.file.Files.readSymbolicLink(path);
+ if (!java.nio.file.Files.exists(link) || !java.nio.file.Files.isReadable(link)) {
+ LOGGER.error("Linear region file {} is a broken symbolic link, crashing to prevent data loss", path);
+ net.minecraft.server.MinecraftServer.getServer().halt(false);
+ throw new IOException("Linear region file " + path + " is a broken symbolic link, crashing to prevent data loss");
+ }
+ }
+ // Kaiiju end
+
public synchronized dev.kaiijumc.kaiiju.region.AbstractRegionFile getRegionFile(ChunkPos chunkcoordintpair, boolean existingOnly) throws IOException { // CraftBukkit // Kaiiju
return this.getRegionFile(chunkcoordintpair, existingOnly, false);
}
@@ -146,6 +163,7 @@ public class RegionFileStorage implements AutoCloseable {
if (existingOnly) {
Path anvil = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".mca");
Path linear = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + ".linear");
+ guardAgainstBrokenSymlinks(linear);
if (java.nio.file.Files.exists(anvil)) path1 = anvil;
else if (java.nio.file.Files.exists(linear)) path1 = linear;
else {
@@ -161,6 +179,7 @@ public class RegionFileStorage implements AutoCloseable {
};
path1 = path.resolve("r." + j + "." + chunkcoordintpair.getRegionZ() + "." + extension);
// Kaiiju end
+ guardAgainstBrokenSymlinks(path1); // Kaiiju - Crash on broken symlink
this.createRegionFile(regionPos);
}
// Kaiiju start - Polyglot
diff --git a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
index 9394d191c56aab78e63fd3f283efedd69384e323..dcfe4a285cc5865be3b0c1b8104b722895135dd0 100644
--- a/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
+++ b/src/main/java/net/minecraft/world/level/chunk/storage/SectionStorage.java
@@ -47,8 +47,8 @@ public class SectionStorage<R> extends RegionFileStorage implements AutoCloseabl
public final RegistryAccess registryAccess; // Paper - rewrite chunk system
protected final LevelHeightAccessor levelHeightAccessor;
- public SectionStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, Path path, Function<Runnable, Codec<R>> codecFactory, Function<Runnable, R> factory, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean dsync, RegistryAccess dynamicRegistryManager, LevelHeightAccessor world) { // Kaiiju
- super(format, linearCompression, path, dsync); // Paper - remove mojang I/O thread // Kaiiju
+ public SectionStorage(dev.kaiijumc.kaiiju.region.RegionFileFormat format, int linearCompression, boolean linearCrashOnBrokenSymlink, Path path, Function<Runnable, Codec<R>> codecFactory, Function<Runnable, R> factory, DataFixer dataFixer, DataFixTypes dataFixTypes, boolean dsync, RegistryAccess dynamicRegistryManager, LevelHeightAccessor world) { // Kaiiju
+ super(format, linearCompression, linearCrashOnBrokenSymlink, path, dsync); // Paper - remove mojang I/O thread // Kaiiju
this.codec = codecFactory;
this.factory = factory;
this.fixerUpper = dataFixer;

View File

@@ -1,144 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Fri, 17 Feb 2023 00:34:31 +0200
Subject: [PATCH] Lithium Math SineLut
Author: JellySquid
Licence: LGPL-3.0
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index 259f7bdca1b9f59dd148492f8f8fe7dc959e55d9..a4f9f31941ddd119dca74f3e23bf8507ee4b7369 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -200,8 +200,10 @@ public class KaiijuConfig {
public static boolean lithiumEnable = true;
public static boolean lithiumMathFastUtil = true;
+ public static boolean lithiumMathSineLut = true;
private static void lithiumSettings() {
lithiumEnable = getBoolean("lithium.enable", lithiumEnable);
lithiumMathFastUtil = getBoolean("lithium.math.fast-util", lithiumMathFastUtil) && lithiumEnable;
+ lithiumMathSineLut = getBoolean("lithium.math.sine-lut", lithiumMathSineLut) && lithiumEnable;
}
}
diff --git a/src/main/java/me/jellysquid/mods/lithium/common/util/math/CompactSineLUT.java b/src/main/java/me/jellysquid/mods/lithium/common/util/math/CompactSineLUT.java
new file mode 100644
index 0000000000000000000000000000000000000000..ccb45e94ea6d1a627df786fb88baec7edd1f2427
--- /dev/null
+++ b/src/main/java/me/jellysquid/mods/lithium/common/util/math/CompactSineLUT.java
@@ -0,0 +1,90 @@
+package me.jellysquid.mods.lithium.common.util.math;
+
+import net.minecraft.util.Mth;
+
+/**
+ * A replacement for the sine angle lookup table used in {@link MathHelper}, both reducing the size of LUT and improving
+ * the access patterns for common paired sin/cos operations.
+ *
+ * sin(-x) = -sin(x)
+ * ... to eliminate negative angles from the LUT.
+ *
+ * sin(x) = sin(pi/2 - x)
+ * ... to eliminate supplementary angles from the LUT.
+ *
+ * Using these identities allows us to reduce the LUT from 64K entries (256 KB) to just 16K entries (64 KB), enabling
+ * it to better fit into the CPU's caches at the expense of some cycles on the fast path. The implementation has been
+ * tightly optimized to avoid branching where possible and to use very quick integer operations.
+ *
+ * Generally speaking, reducing the size of a lookup table is always a good optimization, but since we need to spend
+ * extra CPU cycles trying to maintain parity with vanilla, there is the potential risk that this implementation ends
+ * up being slower than vanilla when the lookup table is able to be kept in cache memory.
+ *
+ * Unlike other "fast math" implementations, the values returned by this class are *bit-for-bit identical* with those
+ * from {@link MathHelper}. Validation is performed during runtime to ensure that the table is correct.
+ *
+ * @author coderbot16 Author of the original (and very clever) implementation in Rust:
+ * https://gitlab.com/coderbot16/i73/-/tree/master/i73-trig/src
+ * @author jellysquid3 Additional optimizations, port to Java
+ */
+public class CompactSineLUT {
+ private static final int[] SINE_TABLE_INT = new int[16384 + 1];
+ private static final float SINE_TABLE_MIDPOINT;
+
+ static {
+ final float[] SINE_TABLE = Mth.getSinTable();
+ // Copy the sine table, covering to raw int bits
+ for (int i = 0; i < SINE_TABLE_INT.length; i++) {
+ SINE_TABLE_INT[i] = Float.floatToRawIntBits(SINE_TABLE[i]);
+ }
+
+ SINE_TABLE_MIDPOINT = SINE_TABLE[SINE_TABLE.length / 2];
+
+ // Test that the lookup table is correct during runtime
+ for (int i = 0; i < SINE_TABLE.length; i++) {
+ float expected = SINE_TABLE[i];
+ float value = lookup(i);
+
+ if (expected != value) {
+ throw new IllegalArgumentException(String.format("LUT error at index %d (expected: %s, found: %s)", i, expected, value));
+ }
+ }
+ }
+
+ // [VanillaCopy] MathHelper#sin(float)
+ public static float sin(float f) {
+ return lookup((int) (f * 10430.378f) & 0xFFFF);
+ }
+
+ // [VanillaCopy] MathHelper#cos(float)
+ public static float cos(float f) {
+ return lookup((int) (f * 10430.378f + 16384.0f) & 0xFFFF);
+ }
+
+ private static float lookup(int index) {
+ // A special case... Is there some way to eliminate this?
+ if (index == 32768) {
+ return SINE_TABLE_MIDPOINT;
+ }
+
+ // Trigonometric identity: sin(-x) = -sin(x)
+ // Given a domain of 0 <= x <= 2*pi, just negate the value if x > pi.
+ // This allows the sin table size to be halved.
+ int neg = (index & 0x8000) << 16;
+
+ // All bits set if (pi/2 <= x), none set otherwise
+ // Extracts the 15th bit from 'half'
+ int mask = (index << 17) >> 31;
+
+ // Trigonometric identity: sin(x) = sin(pi/2 - x)
+ int pos = (0x8001 & mask) + (index ^ mask);
+
+ // Wrap the position in the table. Moving this down to immediately before the array access
+ // seems to help the Hotspot compiler optimize the bit math better.
+ pos &= 0x7fff;
+
+ // Fetch the corresponding value from the LUT and invert the sign bit as needed
+ // This directly manipulate the sign bit on the float bits to simplify logic
+ return Float.intBitsToFloat(SINE_TABLE_INT[pos] ^ neg);
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/util/Mth.java b/src/main/java/net/minecraft/util/Mth.java
index 618f19d70a61062ed5989ec6cf0c036f2e047466..dd320f3a3f2b51a723a2fcc65d477a22c0901455 100644
--- a/src/main/java/net/minecraft/util/Mth.java
+++ b/src/main/java/net/minecraft/util/Mth.java
@@ -45,11 +45,19 @@ public class Mth {
return (float)((int)(value * f)) / f;
}
+ // Kaiiju start
+ public static float[] getSinTable() {
+ return SIN;
+ }
+ // Kaiiju end
+
public static float sin(float value) {
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.lithiumMathSineLut) return me.jellysquid.mods.lithium.common.util.math.CompactSineLUT.sin(value); // Kaiiju
return SIN[(int)(value * 10430.378F) & '\uffff'];
}
public static float cos(float value) {
+ if (dev.kaiijumc.kaiiju.KaiijuConfig.lithiumMathSineLut) return me.jellysquid.mods.lithium.common.util.math.CompactSineLUT.cos(value); // Kaiiju
return SIN[(int)(value * 10430.378F + 16384.0F) & '\uffff'];
}

View File

@@ -0,0 +1,36 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Sun, 23 Apr 2023 15:34:30 +0300
Subject: [PATCH] Toggle void trading
Don't close trading windows when the villager is unloaded.
You should set chunk-unloads to 0s in paper config file to enable void
trading. Or use Kaiivoid plugin.
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index f3f824d0ab1a2a72825c40b67192386479a0b34c..95ed6cb7b94797187d1011cab344e187b39d9193 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -152,6 +152,9 @@ public class KaiijuWorldConfig {
shulkerBoxDropContentsWhenDestroyed = getBoolean("optimization.shulker-box-drop-contents-when-destroyed", shulkerBoxDropContentsWhenDestroyed);
}
+ public boolean fixVoidTrading = true;
+
private void gameplaySettings() {
+ fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 1bbd8b475cdc57fb15ca05ffe122220a5539da10..7f39e36037d55278d15399196459e51b885c5d1e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -2838,7 +2838,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
// Spigot Start
if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder && (!(entity instanceof ServerPlayer) || entity.getRemovalReason() != Entity.RemovalReason.KILLED)) { // SPIGOT-6876: closeInventory clears death message
// Paper start
- if (entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) {
+ if (entity.level().kaiijuConfig.fixVoidTrading && entity.getBukkitEntity() instanceof org.bukkit.inventory.Merchant merchant && merchant.getTrader() != null) { // Kaiiju
merchant.getTrader().closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED);
}
// Paper end

View File

@@ -0,0 +1,218 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 27 Apr 2023 03:49:08 +0300
Subject: [PATCH] Toggle optimize hoppers
Paper optimize hoppers patch break a lot of technical redstone farms because of piston updates. (Example: twiti888 wood farm)
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 95ed6cb7b94797187d1011cab344e187b39d9193..72bcf8e35593bb54079b6cbd9238acdcd43c3e46 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -153,8 +153,10 @@ public class KaiijuWorldConfig {
}
public boolean fixVoidTrading = true;
+ public boolean optimizeHoppers = true;
private void gameplaySettings() {
fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
+ optimizeHoppers = getBoolean("gameplay.optimize-hoppers", optimizeHoppers);
}
}
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 4825a74ce4893dafdb70ae1badf3d2e1930d01a1..762b763f271c3208b4f8a7e346897207ec5beb6c 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
@@ -401,49 +401,51 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
if (HopperBlockEntity.isFullContainer(iinventory1, enumdirection)) {
return false;
} else {
+ // Kaiiju start - Toggle paper broken redstone
// Paper start - replace logic; MAKE SURE TO CHECK FOR DIFFS ON UPDATES
- return hopperPush(world, iinventory1, enumdirection, hopper);
- // for (int i = 0; i < iinventory.getContainerSize(); ++i) {
- // if (!iinventory.getItem(i).isEmpty()) {
- // ItemStack itemstack = iinventory.getItem(i).copy();
- // // ItemStack itemstack1 = addItem(iinventory, iinventory1, iinventory.removeItem(i, 1), enumdirection);
-
- // // CraftBukkit start - Call event when pushing items into other inventories
- // CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot
-
- // Inventory destinationInventory;
- // // Have to special case large chests as they work oddly
- // if (iinventory1 instanceof CompoundContainer) {
- // destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((CompoundContainer) iinventory1);
- // } else if (iinventory1.getOwner() != null) {
- // destinationInventory = iinventory1.getOwner().getInventory();
- // } else {
- // destinationInventory = new CraftInventory(iinventory);
- // }
-
- // InventoryMoveItemEvent event = new InventoryMoveItemEvent(iinventory.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true);
- // world.getCraftServer().getPluginManager().callEvent(event);
- // if (event.isCancelled()) {
- // hopper.setItem(i, itemstack);
- // hopper.setCooldown(world.spigotConfig.hopperTransfer); // Spigot
- // return false;
- // }
- // int origCount = event.getItem().getAmount(); // Spigot
- // ItemStack itemstack1 = HopperBlockEntity.addItem(iinventory, iinventory1, CraftItemStack.asNMSCopy(event.getItem()), enumdirection);
+ if (world.kaiijuConfig.optimizeHoppers) return hopperPush(world, iinventory1, enumdirection, hopper);
+ for (int i = 0; i < iinventory.getContainerSize(); ++i) {
+ if (!iinventory.getItem(i).isEmpty()) {
+ ItemStack itemstack = iinventory.getItem(i).copy();
+ // ItemStack itemstack1 = addItem(iinventory, iinventory1, iinventory.removeItem(i, 1), enumdirection);
+
+ // CraftBukkit start - Call event when pushing items into other inventories
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot
+
+ Inventory destinationInventory;
+ // Have to special case large chests as they work oddly
+ if (iinventory1 instanceof CompoundContainer) {
+ destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((CompoundContainer) iinventory1);
+ } else if (iinventory1.getOwner() != null) {
+ destinationInventory = iinventory1.getOwner().getInventory();
+ } else {
+ destinationInventory = new CraftInventory(iinventory);
+ }
+
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(iinventory.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true);
+ world.getCraftServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ hopper.setItem(i, itemstack);
+ hopper.setCooldown(world.spigotConfig.hopperTransfer); // Spigot
+ return false;
+ }
+ int origCount = event.getItem().getAmount(); // Spigot
+ ItemStack itemstack1 = HopperBlockEntity.addItem(iinventory, iinventory1, CraftItemStack.asNMSCopy(event.getItem()), enumdirection);
// CraftBukkit end
- // if (itemstack1.isEmpty()) {
- // iinventory1.setChanged();
- // return true;
- // }
+ if (itemstack1.isEmpty()) {
+ iinventory1.setChanged();
+ return true;
+ }
- // itemstack.shrink(origCount - itemstack1.getCount()); // Spigot
- // iinventory.setItem(i, itemstack);
- // }
- // }
+ itemstack.shrink(origCount - itemstack1.getCount()); // Spigot
+ iinventory.setItem(i, itemstack);
+ }
+ }
- // return false;
+ return false;
// Paper end
+ // Kaiiju end
}
}
}
@@ -467,6 +469,12 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
if (iinventory != null) {
Direction enumdirection = Direction.DOWN;
+ // Kaiiju start - toggle paper broken redstone
+ if (!world.kaiijuConfig.optimizeHoppers)
+ return HopperBlockEntity.isEmptyContainer(iinventory, enumdirection) ? false : HopperBlockEntity.getSlots(iinventory, enumdirection).anyMatch((i) -> {
+ return HopperBlockEntity.a(hopper, iinventory, i, enumdirection, world); // Spigot
+ });
+ // Kaiiju end
// Paper start - optimize hoppers and remove streams
worldData.skipPullModeEventFire = worldData.skipHopperEvents; // Folia - region threading
return !HopperBlockEntity.isEmptyContainer(iinventory, enumdirection) && anyMatch(iinventory, enumdirection, (item, i) -> {
@@ -499,48 +507,50 @@ public class HopperBlockEntity extends RandomizableContainerBlockEntity implemen
private static boolean a(Hopper ihopper, Container iinventory, int i, Direction enumdirection, Level world) { // Spigot
ItemStack itemstack = iinventory.getItem(i);
+ // Kaiiju start - toggle paper broken redstone
// Paper start - replace pull logic; MAKE SURE TO CHECK FOR DIFFS WHEN UPDATING
if (!itemstack.isEmpty() && HopperBlockEntity.canTakeItemFromContainer(ihopper, iinventory, itemstack, i, enumdirection)) { // If this logic changes, update above. this is left unused incase reflective plugins
- return hopperPull(world, ihopper, iinventory, itemstack, i);
- // ItemStack itemstack1 = itemstack.copy();
- // // ItemStack itemstack2 = addItem(iinventory, ihopper, iinventory.removeItem(i, 1), (EnumDirection) null);
- // // CraftBukkit start - Call event on collection of items from inventories into the hopper
- // CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot
-
- // Inventory sourceInventory;
- // // Have to special case large chests as they work oddly
- // if (iinventory instanceof CompoundContainer) {
- // sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((CompoundContainer) iinventory);
- // } else if (iinventory.getOwner() != null) {
- // sourceInventory = iinventory.getOwner().getInventory();
- // } else {
- // sourceInventory = new CraftInventory(iinventory);
- // }
-
- // InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, oitemstack.clone(), ihopper.getOwner().getInventory(), false);
-
- // Bukkit.getServer().getPluginManager().callEvent(event);
- // if (event.isCancelled()) {
- // iinventory.setItem(i, itemstack1);
-
- // if (ihopper instanceof HopperBlockEntity) {
- // ((HopperBlockEntity) ihopper).setCooldown(world.spigotConfig.hopperTransfer); // Spigot
- // }
-
- // return false;
- // }
- // int origCount = event.getItem().getAmount(); // Spigot
- // ItemStack itemstack2 = HopperBlockEntity.addItem(iinventory, ihopper, CraftItemStack.asNMSCopy(event.getItem()), null);
- // // CraftBukkit end
-
- // if (itemstack2.isEmpty()) {
- // iinventory.setChanged();
- // return true;
- // }
-
- // itemstack1.shrink(origCount - itemstack2.getCount()); // Spigot
- // iinventory.setItem(i, itemstack1);
+ if (world.kaiijuConfig.optimizeHoppers) return hopperPull(world, ihopper, iinventory, itemstack, i);
+ ItemStack itemstack1 = itemstack.copy();
+ // ItemStack itemstack2 = addItem(iinventory, ihopper, iinventory.removeItem(i, 1), (EnumDirection) null);
+ // CraftBukkit start - Call event on collection of items from inventories into the hopper
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(iinventory.removeItem(i, world.spigotConfig.hopperAmount)); // Spigot
+
+ Inventory sourceInventory;
+ // Have to special case large chests as they work oddly
+ if (iinventory instanceof CompoundContainer) {
+ sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((CompoundContainer) iinventory);
+ } else if (iinventory.getOwner() != null) {
+ sourceInventory = iinventory.getOwner().getInventory();
+ } else {
+ sourceInventory = new CraftInventory(iinventory);
+ }
+
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, oitemstack.clone(), ihopper.getOwner().getInventory(), false);
+
+ Bukkit.getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled()) {
+ iinventory.setItem(i, itemstack1);
+
+ if (ihopper instanceof HopperBlockEntity) {
+ ((HopperBlockEntity) ihopper).setCooldown(world.spigotConfig.hopperTransfer); // Spigot
+ }
+
+ return false;
+ }
+ int origCount = event.getItem().getAmount(); // Spigot
+ ItemStack itemstack2 = HopperBlockEntity.addItem(iinventory, ihopper, CraftItemStack.asNMSCopy(event.getItem()), null);
+ // CraftBukkit end
+
+ if (itemstack2.isEmpty()) {
+ iinventory.setChanged();
+ return true;
+ }
+
+ itemstack1.shrink(origCount - itemstack2.getCount()); // Spigot
+ iinventory.setItem(i, itemstack1);
// Paper end
+ // Kaiiju end
}
return false;

View File

@@ -0,0 +1,35 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 4 May 2023 19:53:33 +0300
Subject: [PATCH] Toggle tick level when empty
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 72bcf8e35593bb54079b6cbd9238acdcd43c3e46..9802039d34eb1717b712c9041fd9f602fccae236 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -154,9 +154,11 @@ public class KaiijuWorldConfig {
public boolean fixVoidTrading = true;
public boolean optimizeHoppers = true;
+ public boolean tickWhenEmpty = true;
private void gameplaySettings() {
fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
optimizeHoppers = getBoolean("gameplay.optimize-hoppers", optimizeHoppers);
+ tickWhenEmpty = getBoolean("gameplay.tick-when-empty", tickWhenEmpty);
}
}
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 7f39e36037d55278d15399196459e51b885c5d1e..66509fa23bfcde70abd3917eb774cf48d5d6da93 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -798,7 +798,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
timings.doSounds.stopTiming(); // Spigot
regionizedWorldData.setHandlingTick(false); // Folia - regionised ticking
gameprofilerfiller.pop();
- boolean flag = true || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players
+ boolean flag = kaiijuConfig.tickWhenEmpty || !this.players.isEmpty() || !this.getForcedChunks().isEmpty(); // CraftBukkit - this prevents entity cleanup, other issues on servers with no players // Kaiiju - i don't think so
if (flag) {
this.resetEmptyTime();

View File

@@ -0,0 +1,44 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Sun, 7 May 2023 20:04:06 +0300
Subject: [PATCH] Toggle break redstone on top of trap doors early
That patch break vanilla mechanics such as portal slicing.
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 9802039d34eb1717b712c9041fd9f602fccae236..3355935bbf8059d8a539dcefb84e3c0785314ce2 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -155,10 +155,12 @@ public class KaiijuWorldConfig {
public boolean fixVoidTrading = true;
public boolean optimizeHoppers = true;
public boolean tickWhenEmpty = true;
+ public boolean breakRedstoneOnTopOfTrapDoorsEarly = true;
private void gameplaySettings() {
fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
optimizeHoppers = getBoolean("gameplay.optimize-hoppers", optimizeHoppers);
tickWhenEmpty = getBoolean("gameplay.tick-when-empty", tickWhenEmpty);
+ breakRedstoneOnTopOfTrapDoorsEarly = getBoolean("gameplay.break-redstone-on-top-of-trap-doors-early", breakRedstoneOnTopOfTrapDoorsEarly);
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
index b9e3c9cd709d42bced85436720ccc7b9c7e49552..5e6d64408a5da3f337d32bb8ac5ac2532b04490c 100644
--- a/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TrapDoorBlock.java
@@ -125,6 +125,7 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
}
// CraftBukkit end
boolean open = (Boolean) state.getValue(TrapDoorBlock.OPEN) != flag1; // Paper - break redstone on trapdoors early
+ if (world.kaiijuConfig.breakRedstoneOnTopOfTrapDoorsEarly) { // Kaiiju - trigger break redstone on trapdoors early
// Paper start - break redstone on trapdoors early
// note: this must run before any state for this block/its neighborus are written to the world
// we allow the redstone event to fire so that plugins can block
@@ -143,6 +144,7 @@ public class TrapDoorBlock extends HorizontalDirectionalBlock implements SimpleW
}
}
// Paper end - break redstone on trapdoors early
+ } // Kaiiju - trigger break redstone on trapdoors early
if (open) { // Paper - break redstone on trapdoors early
state = (BlockState) state.setValue(TrapDoorBlock.OPEN, flag1);
this.playSound((Player) null, world, pos, flag1);

View File

@@ -0,0 +1,139 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Wed, 10 May 2023 16:30:38 +0300
Subject: [PATCH] Strip raytracing for EntityLiving#hasLineOfSight
This has been benchmarked on a huge gold farm.
Resulting in significative performance improvements.
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 511ec694f3336a5d7276d171dd2345ed2ea1acac..10c7f5c6fc0e5cb8aafbe125dd68635a37b7b1b9 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -3663,7 +3663,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
Vec3 vec3d1 = new Vec3(entity.getX(), entity.getEyeY(), entity.getZ());
// Paper - diff on change - used in CraftLivingEntity#hasLineOfSight(Location) and CraftWorld#lineOfSightExists
- return vec3d1.distanceToSqr(vec3d) > 128D * 128D ? false : this.level().clip(new ClipContext(vec3d, vec3d1, ClipContext.Block.COLLIDER, ClipContext.Fluid.NONE, this)).getType() == HitResult.Type.MISS;
+ return !(vec3d1.distanceToSqr(vec3d) > 128D * 128D) && this.level().rayTraceDirect(vec3d, vec3d1, net.minecraft.world.phys.shapes.CollisionContext.of(this)) == net.minecraft.world.phys.BlockHitResult.Type.MISS; // Paper - use distanceToSqr // Kaiiju - Pufferfish - Strip raytracing
}
}
diff --git a/src/main/java/net/minecraft/world/level/BlockGetter.java b/src/main/java/net/minecraft/world/level/BlockGetter.java
index 0e8746759752b692668886370181aa5db1fd0bb0..5e2f5e9c21009a71f671955df7a4135ce5cf5b08 100644
--- a/src/main/java/net/minecraft/world/level/BlockGetter.java
+++ b/src/main/java/net/minecraft/world/level/BlockGetter.java
@@ -68,6 +68,17 @@ public interface BlockGetter extends LevelHeightAccessor {
});
}
+ // Kaiiju start - Pufferfish - broken down variant of below rayTraceBlock, used by World#rayTraceDirect
+ @Nullable
+ default net.minecraft.world.phys.BlockHitResult.Type rayTraceBlockDirect(Vec3 vec3d, Vec3 vec3d1, BlockPos blockposition, BlockState iblockdata, net.minecraft.world.phys.shapes.CollisionContext voxelshapecoll) {
+ if (iblockdata.isAir()) return null;
+ VoxelShape voxelshape = ClipContext.Block.COLLIDER.get(iblockdata, this, blockposition, voxelshapecoll);
+ net.minecraft.world.phys.BlockHitResult movingobjectpositionblock = this.clipWithInteractionOverride(vec3d, vec3d1, blockposition, voxelshape, iblockdata);
+
+ return movingobjectpositionblock == null ? null : movingobjectpositionblock.getType();
+ }
+ // Kaiiju end
+
// CraftBukkit start - moved block handling into separate method for use by Block#rayTrace
default BlockHitResult clip(ClipContext raytrace1, BlockPos blockposition) {
// Paper start - Prevent raytrace from loading chunks
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
index fb71843793e699b2ccfaa3b7e4c2bb7d4826a706..42727a50ae11cd4d4aa65eb57638bfb164f1e4ac 100644
--- a/src/main/java/net/minecraft/world/level/Level.java
+++ b/src/main/java/net/minecraft/world/level/Level.java
@@ -432,6 +432,91 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
return null;
}
+ // Kaiiju start - Pufferfish - broken down method of raytracing for EntityLiving#hasLineOfSight, replaces IBlockAccess#rayTrace(RayTrace)
+ public net.minecraft.world.phys.BlockHitResult.Type rayTraceDirect(net.minecraft.world.phys.Vec3 vec3d, net.minecraft.world.phys.Vec3 vec3d1, net.minecraft.world.phys.shapes.CollisionContext voxelshapecoll) {
+ // most of this code comes from IBlockAccess#a(RayTrace, BiFunction, Function), but removes the needless functions
+ if (vec3d.equals(vec3d1)) {
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
+ }
+
+ double endX = Mth.lerp(-1.0E-7D, vec3d1.x, vec3d.x);
+ double endY = Mth.lerp(-1.0E-7D, vec3d1.y, vec3d.y);
+ double endZ = Mth.lerp(-1.0E-7D, vec3d1.z, vec3d.z);
+
+ double startX = Mth.lerp(-1.0E-7D, vec3d.x, vec3d1.x);
+ double startY = Mth.lerp(-1.0E-7D, vec3d.y, vec3d1.y);
+ double startZ = Mth.lerp(-1.0E-7D, vec3d.z, vec3d1.z);
+
+ int currentX = Mth.floor(startX);
+ int currentY = Mth.floor(startY);
+ int currentZ = Mth.floor(startZ);
+
+ BlockPos.MutableBlockPos currentBlock = new BlockPos.MutableBlockPos(currentX, currentY, currentZ);
+
+ LevelChunk chunk = this.getChunkIfLoaded(currentBlock);
+ if (chunk == null) {
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
+ }
+
+ net.minecraft.world.phys.BlockHitResult.Type initialCheck = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getBlockState(currentBlock), voxelshapecoll);
+
+ if (initialCheck != null) {
+ return initialCheck;
+ }
+
+ double diffX = endX - startX;
+ double diffY = endY - startY;
+ double diffZ = endZ - startZ;
+
+ int xDirection = Mth.sign(diffX);
+ int yDirection = Mth.sign(diffY);
+ int zDirection = Mth.sign(diffZ);
+
+ double normalizedX = xDirection == 0 ? Double.MAX_VALUE : (double) xDirection / diffX;
+ double normalizedY = yDirection == 0 ? Double.MAX_VALUE : (double) yDirection / diffY;
+ double normalizedZ = zDirection == 0 ? Double.MAX_VALUE : (double) zDirection / diffZ;
+
+ double normalizedXDirection = normalizedX * (xDirection > 0 ? 1.0D - Mth.frac(startX) : Mth.frac(startX));
+ double normalizedYDirection = normalizedY * (yDirection > 0 ? 1.0D - Mth.frac(startY) : Mth.frac(startY));
+ double normalizedZDirection = normalizedZ * (zDirection > 0 ? 1.0D - Mth.frac(startZ) : Mth.frac(startZ));
+
+ net.minecraft.world.phys.BlockHitResult.Type result;
+
+ do {
+ if (normalizedXDirection > 1.0D && normalizedYDirection > 1.0D && normalizedZDirection > 1.0D) {
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
+ }
+
+ if (normalizedXDirection < normalizedYDirection) {
+ if (normalizedXDirection < normalizedZDirection) {
+ currentX += xDirection;
+ normalizedXDirection += normalizedX;
+ } else {
+ currentZ += zDirection;
+ normalizedZDirection += normalizedZ;
+ }
+ } else if (normalizedYDirection < normalizedZDirection) {
+ currentY += yDirection;
+ normalizedYDirection += normalizedY;
+ } else {
+ currentZ += zDirection;
+ normalizedZDirection += normalizedZ;
+ }
+
+ currentBlock.set(currentX, currentY, currentZ);
+ if (chunk.getPos().x != currentBlock.getX() >> 4 || chunk.getPos().z != currentBlock.getZ() >> 4) {
+ chunk = this.getChunkIfLoaded(currentBlock);
+ if (chunk == null) {
+ return net.minecraft.world.phys.BlockHitResult.Type.MISS;
+ }
+ }
+ result = this.rayTraceBlockDirect(vec3d, vec3d1, currentBlock, chunk.getBlockState(currentBlock), voxelshapecoll);
+ } while (result == null);
+
+ return result;
+ }
+ // Kaiiju end
+
public boolean isInWorldBounds(BlockPos pos) {
return pos.isInsideBuildHeightAndWorldBoundsHorizontal(this); // Paper - use better/optimized check
}

View File

@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Wed, 10 May 2023 17:58:37 +0300
Subject: [PATCH] Fix off thread spider addEffect
diff --git a/src/main/java/net/minecraft/world/entity/monster/Spider.java b/src/main/java/net/minecraft/world/entity/monster/Spider.java
index 05432184077752b1d0cb764a5e39ed875748b2d6..74a68ae68e3c774a63d0a5478dfcda6e7894a514 100644
--- a/src/main/java/net/minecraft/world/entity/monster/Spider.java
+++ b/src/main/java/net/minecraft/world/entity/monster/Spider.java
@@ -180,7 +180,9 @@ public class Spider extends Monster {
MobEffect mobeffectlist = entityspider_groupdataspider.effect;
if (mobeffectlist != null) {
+ this.getBukkitEntity().taskScheduler.schedule(task -> { // Kaiiju - Fix off thread spider add effect
this.addEffect(new MobEffectInstance(mobeffectlist, -1), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.SPIDER_SPAWN); // CraftBukkit
+ }, null, 1); // Kaiiju - Fix off thread spider add effect
}
}

View File

@@ -0,0 +1,141 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 11 May 2023 05:02:40 +0300
Subject: [PATCH] Add SIMD utilities
Patch from Pufferfish
diff --git a/build.gradle.kts b/build.gradle.kts
index f213706442537201de0d74ca8a51cc93cb9d5220..1615346024037f2abe0fcfcfc5ea7713505bebca 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -60,6 +60,12 @@ dependencies {
}
val craftbukkitPackageVersion = "1_20_R1" // Paper
+// Kaiiju start - Pufferfish - SIMD utilities
+tasks.withType<JavaCompile> {
+ val compilerArgs = options.compilerArgs
+ compilerArgs.add("--add-modules=jdk.incubator.vector")
+}
+// Kaiiju end
tasks.jar {
archiveClassifier.set("dev")
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
new file mode 100644
index 0000000000000000000000000000000000000000..586b4cd007b3b106966524e2697edddf88e3ac9d
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDChecker.java
@@ -0,0 +1,59 @@
+package gg.pufferfish.pufferfish.simd;
+
+import org.bukkit.Bukkit;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+import jdk.incubator.vector.FloatVector;
+import jdk.incubator.vector.IntVector;
+import jdk.incubator.vector.VectorSpecies;
+
+/**
+ * Basically, java is annoying and we have to push this out to its own class.
+ */
+public class SIMDChecker {
+
+ public static boolean canEnable(Logger logger) {
+ try {
+ if (SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19) {
+ return false;
+ } else {
+ SIMDDetection.testRun = true;
+
+ VectorSpecies<Integer> ISPEC = IntVector.SPECIES_PREFERRED;
+ VectorSpecies<Float> FSPEC = FloatVector.SPECIES_PREFERRED;
+
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + ISPEC.vectorBitSize() + " bits (int)");
+ logger.log(Level.INFO, "Max SIMD vector size on this system is " + FSPEC.vectorBitSize() + " bits (float)");
+
+ if (ISPEC.elementSize() < 2 || FSPEC.elementSize() < 2) {
+ logger.log(Level.WARNING, "SIMD is not properly supported on this system!");
+ return false;
+ }
+
+ return true;
+ }
+ } catch (NoClassDefFoundError | Exception ignored) {} // Basically, we don't do anything. This lets us detect if it's not functional and disable it.
+ return false;
+ }
+
+ public static void simdWarning() {
+ // Attempt to detect vectorization
+ try {
+ SIMDDetection.isEnabled = SIMDDetection.canEnable(Bukkit.getLogger());
+ SIMDDetection.versionLimited = SIMDDetection.getJavaVersion() != 17 && SIMDDetection.getJavaVersion() != 18 && SIMDDetection.getJavaVersion() != 19;
+ } catch (NoClassDefFoundError | Exception ignored) {
+ ignored.printStackTrace();
+ }
+
+ if (SIMDDetection.isEnabled) {
+ Bukkit.getLogger().info("SIMD operations detected as functional. Will replace some operations with faster versions.");
+ } else if (SIMDDetection.versionLimited) {
+ Bukkit.getLogger().warning("Will not enable SIMD! These optimizations are only safely supported on Java 17, Java 18, and Java 19.");
+ } else {
+ Bukkit.getLogger().warning("SIMD operations are available for your server, but are not configured!");
+ Bukkit.getLogger().warning("To enable additional optimizations, add \"--add-modules=jdk.incubator.vector\" to your startup flags, BEFORE the \"-jar\".");
+ Bukkit.getLogger().warning("If you have already added this flag, then SIMD operations are not supported on your JVM or CPU.");
+ Bukkit.getLogger().warning("Debug: Java: " + System.getProperty("java.version") + ", test run: " + SIMDDetection.testRun);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
new file mode 100644
index 0000000000000000000000000000000000000000..758fa97304a32bf17935c86dc03cbf50606935d8
--- /dev/null
+++ b/src/main/java/gg/pufferfish/pufferfish/simd/SIMDDetection.java
@@ -0,0 +1,32 @@
+package gg.pufferfish.pufferfish.simd;
+
+import java.util.logging.Logger;
+
+public class SIMDDetection {
+
+ public static boolean isEnabled = false;
+ public static boolean versionLimited = false;
+ public static boolean testRun = false;
+
+ public static boolean canEnable(Logger logger) {
+ try {
+ return SIMDChecker.canEnable(logger);
+ } catch (NoClassDefFoundError | Exception ignored) {
+ return false;
+ }
+ }
+
+ public static int getJavaVersion() {
+ // https://stackoverflow.com/a/2591122
+ String version = System.getProperty("java.version");
+ if(version.startsWith("1.")) {
+ version = version.substring(2, 3);
+ } else {
+ int dot = version.indexOf(".");
+ if(dot != -1) { version = version.substring(0, dot); }
+ }
+ version = version.split("-")[0]; // Azul is stupid
+ return Integer.parseInt(version);
+ }
+
+}
\ No newline at end of file
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index ee75d828174ac1c84931bc087472fefd76073bdb..991e4c19763a34a6fead88363e007c2d11aad836 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -225,6 +225,7 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.error("Unable to load server configuration", e);
return false;
}
+ gg.pufferfish.pufferfish.simd.SIMDChecker.simdWarning();
dev.kaiijumc.kaiiju.KaiijuConfig.registerCommands();
// Kaiiju end
com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now

View File

@@ -0,0 +1,37 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 11 May 2023 17:12:34 +0300
Subject: [PATCH] Toggle shared random for players
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
index 9fb33b35b4d6842ca8597f77a4116e3983ebfbcb..51a49fc98147eef7bb50e7a2c71e0e8ed75e3dd6 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuConfig.java
@@ -208,8 +208,10 @@ public class KaiijuConfig {
}
public static String serverModName = "Kaiiju";
+ public static boolean sharedRandomForPlayers = true;
private static void gameplaySettings() {
serverModName = getString("gameplay.server-mod-name", serverModName);
+ sharedRandomForPlayers = getBoolean("gameplay.shared-random-for-players", sharedRandomForPlayers);
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index deaf4b65b6c9f3dbab6578c25fb78ca84507f70b..cdf669fc1065632033fab4154f0113474b984152 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -566,6 +566,11 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
this.bb = Entity.INITIAL_AABB;
this.stuckSpeedMultiplier = Vec3.ZERO;
this.nextStep = 1.0F;
+ // Kaiiju start - Toggle shared random for players
+ if (!dev.kaiijumc.kaiiju.KaiijuConfig.sharedRandomForPlayers && this instanceof Player)
+ this.random = RandomSource.create();
+ else
+ // Kaiiju end
this.random = SHARED_RANDOM; // Paper
this.remainingFireTicks = -this.getFireImmuneTicks();
this.fluidHeight = new Object2DoubleArrayMap(2);

View File

@@ -0,0 +1,42 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Sun, 14 May 2023 18:50:57 +0300
Subject: [PATCH] Kick player instead of crashing
diff --git a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
index 7b664f32868028758d0c6ee1eaa82efcd83661d2..8b325c764df7003f8e6984a85267cd78fc7672ed 100644
--- a/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
+++ b/src/main/java/io/papermc/paper/chunk/system/RegionizedPlayerChunkLoader.java
@@ -485,7 +485,12 @@ public class RegionizedPlayerChunkLoader {
new ChunkPos(chunkX, chunkZ), new MutableObject<>(), false, true); // unloaded, loaded
return;
}
- throw new IllegalStateException();
+ // Kaiiju - Kick player instead of crashing
+ String errorMsg = "Already sent chunk [" + chunkX + ", " + chunkZ + "] in world " + this.world;
+ this.player.getBukkitEntity().kickPlayer(errorMsg);
+ org.bukkit.Bukkit.getLogger().severe(errorMsg);
+ // throw new IllegalStateException();
+ // Kaiiju end
}
private void sendUnloadChunk(final int chunkX, final int chunkZ) {
diff --git a/src/main/java/net/minecraft/server/level/ChunkHolder.java b/src/main/java/net/minecraft/server/level/ChunkHolder.java
index 18f438eec03cabc1614ab807081cff6b18fb09a8..df3869d7aee9c1c880319251b40879c8802c72b4 100644
--- a/src/main/java/net/minecraft/server/level/ChunkHolder.java
+++ b/src/main/java/net/minecraft/server/level/ChunkHolder.java
@@ -129,7 +129,12 @@ public class ChunkHolder {
public void addPlayer(ServerPlayer player) {
if (!this.playersSentChunkTo.add(player)) {
- throw new IllegalStateException("Already sent chunk " + this.pos + " in world '" + this.chunkMap.level.getWorld().getName() + "' to player " + player);
+ // Kaiiju start - Kick player instead of crashing
+ String errorMsg = "Already sent chunk " + this.pos + " in world " + this.chunkMap.level.getWorld().getName();
+ player.getBukkitEntity().kickPlayer(errorMsg);
+ org.bukkit.Bukkit.getLogger().severe(errorMsg);
+ //throw new IllegalStateException("Already sent chunk " + this.pos + " in world '" + this.chunkMap.level.getWorld().getName() + "' to player " + player);
+ // Kaiiju end
}
}

View File

@@ -0,0 +1,38 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 18 May 2023 15:50:40 +0300
Subject: [PATCH] Toggle fix TripWire state inconsistency
This allow string duplication
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 3355935bbf8059d8a539dcefb84e3c0785314ce2..5c87df0fd68e4971201836b6301d526378271af5 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -156,11 +156,13 @@ public class KaiijuWorldConfig {
public boolean optimizeHoppers = true;
public boolean tickWhenEmpty = true;
public boolean breakRedstoneOnTopOfTrapDoorsEarly = true;
+ public boolean fixTripWireStateInconsistency = true;
private void gameplaySettings() {
fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
optimizeHoppers = getBoolean("gameplay.optimize-hoppers", optimizeHoppers);
tickWhenEmpty = getBoolean("gameplay.tick-when-empty", tickWhenEmpty);
breakRedstoneOnTopOfTrapDoorsEarly = getBoolean("gameplay.break-redstone-on-top-of-trap-doors-early", breakRedstoneOnTopOfTrapDoorsEarly);
+ fixTripWireStateInconsistency = getBoolean("gameplay.fix-tripwire-state-inconsistency", fixTripWireStateInconsistency);
}
}
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
index 7f60175bf671d282c11e9084670d2bb900968255..baa6d2bb3a4bec920cb8b57cb08d706929985ea9 100644
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
@@ -74,7 +74,7 @@ public class TripWireBlock extends Block {
@Override
public void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
if (!moved && !state.is(newState.getBlock())) {
- this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true), true); // Paper - fix state inconsistency
+ this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true), world.kaiijuConfig.fixTripWireStateInconsistency); // Paper - fix state inconsistency // Kaiiju - Toggle this
}
}

View File

@@ -0,0 +1,368 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xymb <xymb@endcrystal.me>
Date: Sun, 21 May 2023 15:55:04 +0200
Subject: [PATCH] Entity ticking throttling & removal to prevent lag.
diff --git a/build.gradle.kts b/build.gradle.kts
index 1615346024037f2abe0fcfcfc5ea7713505bebca..d24f5fdc6a8c34774933a5cd8bfed8571299bd35 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -17,6 +17,7 @@ dependencies {
implementation("com.github.luben:zstd-jni:1.5.4-1")
implementation("org.lz4:lz4-java:1.8.0")
// Kaiiju end
+ implementation("io.github.classgraph:classgraph:4.8.158") // Kaiiju - Entity throttling & Removal
// Paper start
implementation("org.jline:jline-terminal-jansi:3.21.0")
implementation("net.minecrell:terminalconsoleappender:1.3.0")
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuEntityLimits.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuEntityLimits.java
new file mode 100644
index 0000000000000000000000000000000000000000..887ea85ca2a03796bfa5bf62f27d1a7abd7fbc29
--- /dev/null
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuEntityLimits.java
@@ -0,0 +1,139 @@
+package dev.kaiijumc.kaiiju;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.logging.Level;
+
+import com.google.common.base.Throwables;
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+import io.github.classgraph.ClassGraph;
+import io.github.classgraph.ClassInfo;
+import io.github.classgraph.ScanResult;
+import org.slf4j.Logger;
+
+import com.mojang.logging.LogUtils;
+import net.minecraft.world.entity.Entity;
+import org.bukkit.Bukkit;
+import org.bukkit.configuration.InvalidConfigurationException;
+import org.bukkit.configuration.file.YamlConfiguration;
+
+@SuppressWarnings("unused")
+public class KaiijuEntityLimits {
+ private static final Logger LOGGER = LogUtils.getLogger();
+
+ protected static final String HEADER =
+ "Per region entity limits for Kaiiju.\n"
+ + "If there are more of particular entity type in a region than limit, entity ticking will be throttled.\n"
+ + "Example: for Wither limit 100 & 300 Withers in a region -> 100 Withers tick every tick & every Wither ticks every 3 ticks.\n"
+ + "Available entities: GlowSquid, Ambient, Bat, Animal, Bee, Cat, Chicken, Cod, Cow, Dolphin, Fish, FishSchool, Fox, Golem, IronGolem, "
+ + "MushroomCow, Ocelot, Panda, Parrot, Perchable, Pig, PolarBear, PufferFish, Rabbit, Salmon, Sheep, Snowman, Squid, TropicalFish, Turtle, "
+ + "WaterAnimal, Wolf, Allay, Axolotl, Camel, Frog, Tadpole, Goat, Horse, HorseAbstract, HorseChestedAbstract, HorseDonkey, HorseMule, "
+ + "HorseSkeleton, HorseZombie, Llama, LlamaTrader, Sniffer, EnderCrystal, EnderDragon, Wither, ArmorStand, Hanging, ItemFrame, Leash, "
+ + "Painting, GlowItemFrame, FallingBlock, Item, TNTPrimed, Blaze, CaveSpider, Creeper, Drowned, Enderman, Endermite, Evoker, Ghast, "
+ + "GiantZombie, Guardian, GuardianElder, IllagerAbstract, IllagerIllusioner, IllagerWizard, MagmaCube, Monster, MonsterPatrolling, Phantom, "
+ + "PigZombie, Pillager, Ravager, Shulker, Silverfish, Skeleton, SkeletonAbstract, SkeletonStray, SkeletonWither, Slime, Spider, Strider, Vex, "
+ + "Vindicator, Witch, Zoglin, Zombie, ZombieHusk, ZombieVillager, Hoglin, Piglin, PiglinAbstract, PiglinBrute, Warden, Villager, "
+ + "VillagerTrader, Arrow, DragonFireball, Egg, EnderPearl, EnderSignal, EvokerFangs, Fireball, FireballFireball, Fireworks, FishingHook, "
+ + "LargeFireball, LlamaSpit, Potion, Projectile, ProjectileThrowable, ShulkerBullet, SmallFireball, Snowball, SpectralArrow, ThrownExpBottle, "
+ + "ThrownTrident, TippedArrow, WitherSkull, Raider, ChestBoat, Boat, MinecartAbstract, MinecartChest, MinecartCommandBlock, MinecartContainer, "
+ + "MinecartFurnace, MinecartHopper, MinecartMobSpawner, MinecartRideable, MinecartTNT\n";
+ protected static File ENTITY_LIMITS_FILE;
+ public static YamlConfiguration entityLimitsConfig;
+
+ protected static Map<Class<? extends Entity>, EntityLimit> entityLimits;
+
+ static final String ENTITY_PREFIX = "Entity";
+
+ public static void init(File entityLimitsFile) {
+ init(entityLimitsFile, true);
+ }
+
+ public static void reload(File entityLimitsFile) {
+ init(entityLimitsFile, false);
+ }
+
+ private static void init(File entityLimitsFile, boolean setup) {
+ ENTITY_LIMITS_FILE = entityLimitsFile;
+ entityLimitsConfig = new YamlConfiguration();
+
+ if (entityLimitsFile.exists()) {
+ try {
+ entityLimitsConfig.load(ENTITY_LIMITS_FILE);
+ } catch (InvalidConfigurationException ex) {
+ Bukkit.getLogger().log(Level.SEVERE, "Could not load kaiiju_entity_limits.yml, please correct your syntax errors", ex);
+ throw Throwables.propagate(ex);
+ } catch (IOException ignore) {}
+ } else {
+ if (setup) {
+ entityLimitsConfig.options().header(HEADER);
+ entityLimitsConfig.options().copyDefaults(true);
+ entityLimitsConfig.set("Wither.limit", 1000);
+ entityLimitsConfig.set("Wither.removal", 5000);
+ entityLimitsConfig.set("Axolotl.limit", 1000);
+ entityLimitsConfig.set("Axolotl.removal", 5000);
+ try {
+ entityLimitsConfig.save(ENTITY_LIMITS_FILE);
+ } catch (IOException ex) {
+ Bukkit.getLogger().log(Level.SEVERE, "Could not save " + ENTITY_LIMITS_FILE, ex);
+ }
+ }
+ }
+
+ entityLimits = new Object2ObjectOpenHashMap<>();
+ try (ScanResult scanResult = new ClassGraph().enableAllInfo().acceptPackages("net.minecraft.world.entity").scan()) {
+ Map<String, ClassInfo> entityClasses = new HashMap<>();
+ for (ClassInfo classInfo : scanResult.getAllClasses()) {
+ Class<?> entityClass = Class.forName(classInfo.getName());
+ if (Entity.class.isAssignableFrom(entityClass)) {
+ String entityName = extractEntityName(entityClass.getSimpleName());
+ entityClasses.put(entityName, classInfo);
+ }
+ }
+
+ for (String key : entityLimitsConfig.getKeys(false)) {
+ if (!entityClasses.containsKey(key)) {
+ LOGGER.error("Unknown entity '" + key + "' in kaiiju-entity-limits.yml, skipping");
+ continue;
+ }
+ int limit = entityLimitsConfig.getInt(key + ".limit");
+ int removal = entityLimitsConfig.getInt(key + ".removal");
+
+ if (limit < 1) {
+ LOGGER.error(key + " has a limit less than the minimum of 1, ignoring");
+ continue;
+ }
+ if (removal <= limit && removal != -1) {
+ LOGGER.error(key + " has a removal limit that is less than or equal to its limit, setting removal to limit * 10");
+ removal = limit * 10;
+ }
+
+ entityLimits.put((Class<? extends Entity>) Class.forName(entityClasses.get(key).getName()), new EntityLimit(limit, removal));
+ }
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public static EntityLimit getEntityLimit(Entity entity) {
+ return entityLimits.get(entity.getClass());
+ }
+
+ private static String extractEntityName(String input) {
+ int prefixLength = ENTITY_PREFIX.length();
+
+ if (input.length() <= prefixLength || !input.startsWith(ENTITY_PREFIX)) {
+ return input;
+ } else {
+ return input.substring(prefixLength);
+ }
+ }
+
+ public record EntityLimit(int limit, int removal) {
+ @Override
+ public String toString() {
+ return "EntityLimit{limit=" + limit + ", removal=" + removal + "}";
+ }
+ }
+}
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuEntityThrottler.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuEntityThrottler.java
new file mode 100644
index 0000000000000000000000000000000000000000..eb690efacf083e4ff3e321578b12c534e6a40196
--- /dev/null
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuEntityThrottler.java
@@ -0,0 +1,84 @@
+package dev.kaiijumc.kaiiju;
+
+import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;
+import net.minecraft.world.entity.Entity;
+import io.papermc.paper.threadedregions.RegionizedWorldData;
+
+public class KaiijuEntityThrottler {
+ private static class TickInfo {
+ int currentTick;
+ int continueFrom;
+ int toTick;
+ int toRemove;
+ }
+
+ public static class EntityThrottlerReturn {
+ public boolean skip;
+ public boolean remove;
+ }
+
+ private final Object2ObjectOpenHashMap<KaiijuEntityLimits.EntityLimit, TickInfo> entityLimitTickInfoMap = new Object2ObjectOpenHashMap<>();
+
+ public void tickLimiterStart() {
+ for (TickInfo tickInfo : entityLimitTickInfoMap.values()) {
+ tickInfo.currentTick = 0;
+ }
+ }
+
+ public EntityThrottlerReturn tickLimiterShouldSkip(Entity entity) {
+ EntityThrottlerReturn retVal = new EntityThrottlerReturn();
+ if (entity.isRemoved()) return retVal;
+ KaiijuEntityLimits.EntityLimit entityLimit = KaiijuEntityLimits.getEntityLimit(entity);
+
+ if (entityLimit != null) {
+ TickInfo tickInfo = entityLimitTickInfoMap.computeIfAbsent(entityLimit, el -> {
+ TickInfo newTickInfo = new TickInfo();
+ newTickInfo.toTick = entityLimit.limit();
+ return newTickInfo;
+ });
+
+ tickInfo.currentTick++;
+ if (tickInfo.currentTick <= tickInfo.toRemove && entityLimit.removal() > 0) {
+ retVal.skip = false;
+ retVal.remove = true;
+ return retVal;
+ }
+
+ if (tickInfo.currentTick < tickInfo.continueFrom) {
+ retVal.skip = true;
+ return retVal;
+ }
+ if (tickInfo.currentTick - tickInfo.continueFrom < tickInfo.toTick) {
+ retVal.skip = false;
+ return retVal;
+ }
+ retVal.skip = true;
+ return retVal;
+ } else {
+ retVal.skip = false;
+ return retVal;
+ }
+ }
+
+ public void tickLimiterFinish(RegionizedWorldData regionizedWorldData) {
+ for (var entry : entityLimitTickInfoMap.entrySet()) {
+ KaiijuEntityLimits.EntityLimit entityLimit = entry.getKey();
+ TickInfo tickInfo = entry.getValue();
+
+ int additionals = 0;
+ int nextContinueFrom = tickInfo.continueFrom + tickInfo.toTick;
+ if (nextContinueFrom >= tickInfo.currentTick) {
+ additionals = entityLimit.limit() - (tickInfo.currentTick - tickInfo.continueFrom);
+ nextContinueFrom = 0;
+ }
+ tickInfo.continueFrom = nextContinueFrom;
+ tickInfo.toTick = entityLimit.limit() + additionals;
+
+ if (tickInfo.toRemove == 0 && tickInfo.currentTick > entityLimit.removal()) {
+ tickInfo.toRemove = tickInfo.currentTick - entityLimit.removal();
+ } else if (tickInfo.toRemove != 0) {
+ tickInfo.toRemove = 0;
+ }
+ }
+ }
+}
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 5c87df0fd68e4971201836b6301d526378271af5..ecae04b0cc317b154b29ca80a7246dc19e5d67ba 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -147,9 +147,11 @@ public class KaiijuWorldConfig {
}
public boolean shulkerBoxDropContentsWhenDestroyed = true;
+ public boolean enableEntityThrottling = false;
private void optimizationSettings() {
shulkerBoxDropContentsWhenDestroyed = getBoolean("optimization.shulker-box-drop-contents-when-destroyed", shulkerBoxDropContentsWhenDestroyed);
+ enableEntityThrottling = getBoolean("optimization.enable-entity-throttling", enableEntityThrottling);
}
public boolean fixVoidTrading = true;
diff --git a/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java b/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java
index 6fac162e0ec057af9f3336314d5663554cef0490..efecc7e132c67577577c99bfcf98e2b4ddae14ab 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/command/KaiijuCommand.java
@@ -1,6 +1,7 @@
package dev.kaiijumc.kaiiju.command;
import dev.kaiijumc.kaiiju.KaiijuConfig;
+import dev.kaiijumc.kaiiju.KaiijuEntityLimits;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerLevel;
import net.md_5.bungee.api.ChatColor;
@@ -48,6 +49,7 @@ public class KaiijuCommand extends Command {
MinecraftServer console = MinecraftServer.getServer();
KaiijuConfig.reload((File) console.options.valueOf("kaiiju-settings"));
+ KaiijuEntityLimits.reload((File) console.options.valueOf("kaiiju-entity-limits"));
for (ServerLevel level : console.getAllLevels()) {
level.kaiijuConfig.reload();
}
diff --git a/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java b/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java
index 65c4e158d81ac5c5788cf4dcb379061aebd23dcd..223bf699d76e53b131b47256df288db60141fd9e 100644
--- a/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java
+++ b/src/main/java/io/papermc/paper/threadedregions/RegionizedWorldData.java
@@ -296,6 +296,7 @@ public final class RegionizedWorldData {
private final ReferenceList<Entity> allEntities = new ReferenceList<>();
private final IteratorSafeOrderedReferenceSet<Entity> entityTickList = new IteratorSafeOrderedReferenceSet<>();
private final IteratorSafeOrderedReferenceSet<Mob> navigatingMobs = new IteratorSafeOrderedReferenceSet<>();
+ public final dev.kaiijumc.kaiiju.KaiijuEntityThrottler entityThrottler = new dev.kaiijumc.kaiiju.KaiijuEntityThrottler(); // Kaiiju
// block ticking
private final ObjectLinkedOpenHashSet<BlockEventData> blockEvents = new ObjectLinkedOpenHashSet<>();
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
index 991e4c19763a34a6fead88363e007c2d11aad836..24a2d3f496727790f63cb66a2534d4423555fa3c 100644
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
@@ -225,6 +225,12 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
DedicatedServer.LOGGER.error("Unable to load server configuration", e);
return false;
}
+ try {
+ dev.kaiijumc.kaiiju.KaiijuEntityLimits.init((java.io.File) options.valueOf("kaiiju-entity-limits"));
+ } catch (Exception e) {
+ DedicatedServer.LOGGER.error("Unable to load entity limits", e);
+ return false;
+ }
gg.pufferfish.pufferfish.simd.SIMDChecker.simdWarning();
dev.kaiijumc.kaiiju.KaiijuConfig.registerCommands();
// Kaiiju end
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
index 66509fa23bfcde70abd3917eb774cf48d5d6da93..8fd9e3cee5a671ef8425311371cde57449ef1d8e 100644
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
@@ -822,6 +822,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
} // Folia end - region threading
}
+ if (kaiijuConfig.enableEntityThrottling) regionizedWorldData.entityThrottler.tickLimiterStart(); // Kaiiju
org.spigotmc.ActivationRange.activateEntities(this); // Spigot
timings.entityTick.startTiming(); // Spigot
regionizedWorldData.forEachTickingEntity((entity) -> { // Folia - regionised ticking
@@ -844,6 +845,13 @@ public class ServerLevel extends Level implements WorldGenLevel {
entity.stopRiding();
}
+ // Kaiiju start
+ if (kaiijuConfig.enableEntityThrottling) {
+ dev.kaiijumc.kaiiju.KaiijuEntityThrottler.EntityThrottlerReturn throttle = regionizedWorldData.entityThrottler.tickLimiterShouldSkip(entity);
+ if (throttle.remove) entity.remove(Entity.RemovalReason.DISCARDED);
+ if (throttle.skip) return;
+ }
+ // Kaiiju end
gameprofilerfiller.push("tick");
this.guardEntityTick(this::tickNonPassenger, entity);
gameprofilerfiller.pop();
@@ -851,6 +859,7 @@ public class ServerLevel extends Level implements WorldGenLevel {
}
}
});
+ if (kaiijuConfig.enableEntityThrottling) regionizedWorldData.entityThrottler.tickLimiterFinish(regionizedWorldData); // Kaiiju
timings.entityTick.stopTiming(); // Spigot
timings.tickEntities.stopTiming(); // Spigot
gameprofilerfiller.pop();
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
index d8ca697663ace353e88bfabc8997b58230d3d811..c3bb81238afeafa3d59147f21c60022052142977 100644
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
@@ -179,6 +179,11 @@ public class Main {
.ofType(File.class)
.defaultsTo(new File("kaiiju.yml"))
.describedAs("Yml file");
+ acceptsAll(asList("kaiiju", "kaiiju-entity-limits"), "File for kaiiju's entity limits")
+ .withRequiredArg()
+ .ofType(File.class)
+ .defaultsTo(new File("kaiiju-entity-limits.yml"))
+ .describedAs("Yml file");
// Purpur end
// Paper start

View File

@@ -0,0 +1,55 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Thu, 18 May 2023 20:05:49 +0300
Subject: [PATCH] Toggle safe teleportation
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index ecae04b0cc317b154b29ca80a7246dc19e5d67ba..68074cc41c1e4cd06f2562d44947b63722d5af50 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -159,6 +159,7 @@ public class KaiijuWorldConfig {
public boolean tickWhenEmpty = true;
public boolean breakRedstoneOnTopOfTrapDoorsEarly = true;
public boolean fixTripWireStateInconsistency = true;
+ public boolean safeTeleporting = true;
private void gameplaySettings() {
fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
@@ -166,5 +167,6 @@ public class KaiijuWorldConfig {
tickWhenEmpty = getBoolean("gameplay.tick-when-empty", tickWhenEmpty);
breakRedstoneOnTopOfTrapDoorsEarly = getBoolean("gameplay.break-redstone-on-top-of-trap-doors-early", breakRedstoneOnTopOfTrapDoorsEarly);
fixTripWireStateInconsistency = getBoolean("gameplay.fix-tripwire-state-inconsistency", fixTripWireStateInconsistency);
+ safeTeleporting = getBoolean("gameplay.safe-teleportation", safeTeleporting);
}
}
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index cdf669fc1065632033fab4154f0113474b984152..6941b28b7b5a7ab0e9c950cfa3a5ed224438a65c 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -3953,6 +3953,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
protected boolean tryEndPortal() {
io.papermc.paper.util.TickThread.ensureTickThread(this, "Cannot portal entity async");
+ if (!this.level.kaiijuConfig.safeTeleporting && !(this instanceof net.minecraft.world.entity.player.Player)) return false; // Kaiiju - Unsafe teleportation
BlockPos pos = this.portalBlock;
ServerLevel world = this.portalWorld;
this.portalBlock = null;
diff --git a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
index 41d7cff39fc37955877668337689b4b26cd8c7cf..fe21ef0a2c451564694de915f6f4e61dbfeed712 100644
--- a/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
+++ b/src/main/java/net/minecraft/world/level/block/EndPortalBlock.java
@@ -53,6 +53,13 @@ public class EndPortalBlock extends BaseEntityBlock {
// return; // CraftBukkit - always fire event in case plugins wish to change it
}
+ // Kaiiju start - Unsafe teleportation
+ if (!entity.level().kaiijuConfig.safeTeleporting && !(entity instanceof net.minecraft.world.entity.player.Player)) {
+ entity.endPortalLogicAsync();
+ return;
+ }
+ // Kaiiju end
+
// Paper start - move all of this logic into portal tick
entity.portalWorld = ((ServerLevel)world);
entity.portalBlock = pos.immutable();

View File

@@ -0,0 +1,47 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Sun, 28 May 2023 01:51:52 +0300
Subject: [PATCH] Toggle sand duplication
diff --git a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
index 68074cc41c1e4cd06f2562d44947b63722d5af50..be32a516c1ee0f95790b8a96c465045ca4355c76 100644
--- a/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
+++ b/src/main/java/dev/kaiijumc/kaiiju/KaiijuWorldConfig.java
@@ -160,6 +160,7 @@ public class KaiijuWorldConfig {
public boolean breakRedstoneOnTopOfTrapDoorsEarly = true;
public boolean fixTripWireStateInconsistency = true;
public boolean safeTeleporting = true;
+ public boolean sandDuplication = false;
private void gameplaySettings() {
fixVoidTrading = getBoolean("gameplay.fix-void-trading", fixVoidTrading);
@@ -168,5 +169,6 @@ public class KaiijuWorldConfig {
breakRedstoneOnTopOfTrapDoorsEarly = getBoolean("gameplay.break-redstone-on-top-of-trap-doors-early", breakRedstoneOnTopOfTrapDoorsEarly);
fixTripWireStateInconsistency = getBoolean("gameplay.fix-tripwire-state-inconsistency", fixTripWireStateInconsistency);
safeTeleporting = getBoolean("gameplay.safe-teleportation", safeTeleporting);
+ sandDuplication = getBoolean("gameplay.sand-duplication", sandDuplication);
}
}
diff --git a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
index 6e35afb9e5314de69e78d819913418ab144bec52..6cff3410c2851aeb808994a4bf830a0db32a9a37 100644
--- a/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
+++ b/src/main/java/net/minecraft/world/entity/item/FallingBlockEntity.java
@@ -131,7 +131,7 @@ public class FallingBlockEntity extends Entity {
@Override
public void tick() {
// Paper start - fix sand duping
- if (this.isRemoved()) {
+ if (!this.level().kaiijuConfig.sandDuplication && this.isRemoved()) { // Kaiiju - Toggle sand duplication
return;
}
// Paper end - fix sand duping
@@ -148,7 +148,7 @@ public class FallingBlockEntity extends Entity {
this.move(MoverType.SELF, this.getDeltaMovement());
// Paper start - fix sand duping
- if (this.isRemoved()) {
+ if (!this.level().kaiijuConfig.sandDuplication && this.isRemoved()) { // Kaiiju - Toggle sand duplication
return;
}
// Paper end - fix sand duping

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Fri, 19 May 2023 03:38:03 +0300
Subject: [PATCH] Vanilla end portal teleportation
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 6941b28b7b5a7ab0e9c950cfa3a5ed224438a65c..7dcba5ed8ad3cda9951c6193273261754e8ef63b 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -4041,10 +4041,15 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
(chunks) -> {
ServerLevel.makeObsidianPlatform(destination, null, targetPos);
+ // Kaiiju start - Vanilla end teleportation
+ Vec3 finalPos;
+ if (this instanceof Player) finalPos = Vec3.atBottomCenterOf(targetPos.below());
+ else finalPos = Vec3.atBottomCenterOf(targetPos);
+ // Kaiiju end
// the portal obsidian is placed at targetPos.y - 2, so if we want to place the entity
// on the obsidian, we need to spawn at targetPos.y - 1
portalInfoCompletable.complete(
- new PortalInfo(Vec3.atBottomCenterOf(targetPos.below()), Vec3.ZERO, 90.0f, 0.0f, destination, null)
+ new PortalInfo(finalPos, this.getDeltaMovement(), 90.0f, 0.0f, destination, null) // Kaiiju - Vanilla end teleportation
);
}
);

View File

@@ -0,0 +1,22 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xymb <xymb@endcrystal.me>
Date: Sat, 17 Jun 2023 19:52:29 +0300
Subject: [PATCH] Swap distanceToSqr and EntitySelector
diff --git a/src/main/java/net/minecraft/world/level/EntityGetter.java b/src/main/java/net/minecraft/world/level/EntityGetter.java
index b1a6a66ed02706c1adc36dcedfa415f5a24a25a0..bed6f316f4186895fd2e72ff114c4db1e0f53cf1 100644
--- a/src/main/java/net/minecraft/world/level/EntityGetter.java
+++ b/src/main/java/net/minecraft/world/level/EntityGetter.java
@@ -147,9 +147,10 @@ public interface EntityGetter {
// Paper start
default boolean hasNearbyAlivePlayerThatAffectsSpawning(double x, double y, double z, double range) {
for (Player player : this.getLocalPlayers()) { // Folia - region threading
- if (EntitySelector.PLAYER_AFFECTS_SPAWNING.test(player)) { // combines NO_SPECTATORS and LIVING_ENTITY_STILL_ALIVE with an "affects spawning" check
+ if (true || EntitySelector.PLAYER_AFFECTS_SPAWNING.test(player)) { // combines NO_SPECTATORS and LIVING_ENTITY_STILL_ALIVE with an "affects spawning" check // Kaiiju - Move this down
double distanceSqr = player.distanceToSqr(x, y, z);
if (range < 0.0D || distanceSqr < range * range) {
+ if (EntitySelector.PLAYER_AFFECTS_SPAWNING.test(player)) // Kaiiju
return true;
}
}

View File

@@ -0,0 +1,34 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Xymb <xymb@endcrystal.me>
Date: Sat, 17 Jun 2023 21:03:04 +0300
Subject: [PATCH] Use Math.floor instead of fastfloor
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index 38441121cf7cdc1d64ef9fc17ae76dc16fbf96f2..3f76e1bc0c08775353d22b7d928536aba9c8ad1d 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -164,13 +164,19 @@ public final class MCUtil {
}
public static int fastFloor(double x) {
- int truncated = (int)x;
- return x < (double)truncated ? truncated - 1 : truncated;
+ // Kaiiju start - Use Math.floor instead of fastfloor
+ return (int)Math.floor(x); // Kaiiju
+ //int truncated = (int)x;
+ //return x < (double)truncated ? truncated - 1 : truncated;
+ // Kaiiju end
}
public static int fastFloor(float x) {
- int truncated = (int)x;
- return x < (double)truncated ? truncated - 1 : truncated;
+ // Kaiiju start - Use Math.floor instead of fastfloor
+ return (int)Math.floor(x); // Kaiiju
+ //int truncated = (int)x;
+ //return x < (double)truncated ? truncated - 1 : truncated;
+ // Kaiiju end
}
public static float normalizeYaw(float f) {

View File

@@ -0,0 +1,27 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Sun, 18 Jun 2023 18:10:19 +0300
Subject: [PATCH] Allow user to enable moving into unloaded chunks
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
index a00201eca053ef69b8d903fdb9538444baf85465..bb9f088e3b7b90ab38d794433fc5d30d39e12c76 100644
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
@@ -415,14 +415,14 @@ public class WorldConfiguration extends ConfigurationPart {
public class Chunks extends Post {
@Override
public void postProcess() {
- this.preventMovingIntoUnloadedChunks = true;
+ //this.preventMovingIntoUnloadedChunks = true; // Kaiiju - Don't
}
// Folia end - region threading - force prevent moving into unloaded chunks
public AutosavePeriod autoSaveInterval = AutosavePeriod.def();
public int maxAutoSaveChunksPerTick = 24;
public int fixedChunkInhabitedTime = -1;
- public boolean preventMovingIntoUnloadedChunks = false;
+ public boolean preventMovingIntoUnloadedChunks = true; // Kaiiju - True not False
public Duration delayChunkUnloadsBy = Duration.of("10s");
public Reference2IntMap<EntityType<?>> entityPerChunkSaveLimit = Util.make(new Reference2IntOpenHashMap<>(BuiltInRegistries.ENTITY_TYPE.size()), map -> {
map.defaultReturnValue(-1);

View File

@@ -0,0 +1,20 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Mon, 19 Jun 2023 01:49:00 +0300
Subject: [PATCH] Don't pathfind outside region
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java b/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
index 1ab77f3518d1df30f66ae44d7d4fa69e5b32d93a..98bf17441da3169d49de55fe89d79ebe250a2b7e 100644
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/MoveToTargetSink.java
@@ -107,7 +107,9 @@ public class MoveToTargetSink extends Behavior<Mob> {
private boolean tryComputePath(Mob entity, WalkTarget walkTarget, long time) {
BlockPos blockPos = walkTarget.getTarget().currentBlockPosition();
+ if (io.papermc.paper.util.TickThread.isTickThreadFor((ServerLevel) entity.level(), blockPos)) // Kaiiju - Don't pathfind outside region
this.path = entity.getNavigation().createPath(blockPos, 0);
+ else this.path = null; // Kaiiju - Don't pathfind outside region
this.speedModifier = walkTarget.getSpeedModifier();
Brain<?> brain = entity.getBrain();
if (this.reachedTarget(entity, walkTarget)) {

View File

@@ -0,0 +1,32 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Mon, 19 Jun 2023 21:30:19 +0300
Subject: [PATCH] Don't spam recipe changes on update
diff --git a/src/main/java/net/minecraft/server/PlayerAdvancements.java b/src/main/java/net/minecraft/server/PlayerAdvancements.java
index acc49f66bf34e2507d0ee6fec0a56b11bfc68f46..6c705189b84542db584039763821b222df03e5d1 100644
--- a/src/main/java/net/minecraft/server/PlayerAdvancements.java
+++ b/src/main/java/net/minecraft/server/PlayerAdvancements.java
@@ -147,7 +147,7 @@ public class PlayerAdvancements {
if (advancement == null) {
// CraftBukkit start
if (entry.getKey().getNamespace().equals("minecraft")) {
- PlayerAdvancements.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.playerSavePath);
+ //PlayerAdvancements.LOGGER.warn("Ignored advancement '{}' in progress file {} - it doesn't exist anymore?", entry.getKey(), this.playerSavePath); // Kaiiju - We already know, don't spam.
}
// CraftBukkit end
} else {
diff --git a/src/main/java/net/minecraft/stats/ServerRecipeBook.java b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
index ea29e07a105f3ba6a878bdccf36e7eaf66280280..8bbb5feea4190344fd6b3a3ae9f1c3cae578b9a6 100644
--- a/src/main/java/net/minecraft/stats/ServerRecipeBook.java
+++ b/src/main/java/net/minecraft/stats/ServerRecipeBook.java
@@ -125,7 +125,7 @@ public class ServerRecipeBook extends RecipeBook {
Optional<? extends Recipe<?>> optional = recipeManager.byKey(minecraftkey);
if (!optional.isPresent()) {
- ServerRecipeBook.LOGGER.error("Tried to load unrecognized recipe: {} removed now.", minecraftkey);
+ //ServerRecipeBook.LOGGER.error("Tried to load unrecognized recipe: {} removed now.", minecraftkey); // Kaiiju - We already know, don't spam.
} else {
handler.accept((Recipe) optional.get());
}

View File

@@ -0,0 +1,18 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Wed, 21 Jun 2023 04:15:44 +0300
Subject: [PATCH] Fix visual respawn issue
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
index 10c7f5c6fc0e5cb8aafbe125dd68635a37b7b1b9..6f589e7e4bbed0b2fa87403c86f18d36672cf1d0 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
@@ -633,6 +633,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
++this.deathTime;
if (this.deathTime >= 20 && !this.level().isClientSide() && !this.isRemoved() && !this.broadcastedDeath) { // Folia - region threading
this.level().broadcastEntityEvent(this, (byte) 60);
+ this.broadcastedDeath = true; // Kaiiju - Fix respawn issue / Visual bug
if (!(this instanceof ServerPlayer)) this.remove(Entity.RemovalReason.KILLED); // Folia - region threading - don't remove, we want the tick scheduler to be running
if ((this instanceof ServerPlayer)) this.unRide(); // Folia - region threading - unmount player when dead
}

View File

@@ -0,0 +1,101 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Sofiane H. Djerbi" <46628754+kugge@users.noreply.github.com>
Date: Wed, 19 Apr 2023 02:37:04 +0300
Subject: [PATCH] Static Distance WIP
diff --git a/src/main/java/io/papermc/paper/chunk/PlayerChunkLoader.java b/src/main/java/io/papermc/paper/chunk/PlayerChunkLoader.java
index e77972c4c264100ffdd824bfa2dac58dbbc6d678..cddacd6d5bbe97641bd23f5c067012907d9c5c01 100644
--- a/src/main/java/io/papermc/paper/chunk/PlayerChunkLoader.java
+++ b/src/main/java/io/papermc/paper/chunk/PlayerChunkLoader.java
@@ -75,6 +75,17 @@ public final class PlayerChunkLoader {
return data.getTargetSendViewDistance();
}
+ // Kaiiju start - Static distance
+ public static int getStaticDistance(final ServerPlayer player) {
+ final ServerLevel level = (ServerLevel)player.level;
+ final PlayerLoaderData data = level.chunkSource.chunkMap.playerChunkManager.getData(player);
+ if (data == null) {
+ return level.chunkSource.chunkMap.playerChunkManager.getTargetStaticDistance();
+ }
+ return data.getTargetSendViewDistance();
+ }
+ // Kaiiju end
+
protected final ChunkMap chunkMap;
protected final Reference2ObjectLinkedOpenHashMap<ServerPlayer, PlayerLoaderData> playerMap = new Reference2ObjectLinkedOpenHashMap<>(512, 0.7f);
protected final ReferenceLinkedOpenHashSet<PlayerLoaderData> chunkSendQueue = new ReferenceLinkedOpenHashSet<>(512, 0.7f);
@@ -132,6 +143,12 @@ public final class PlayerChunkLoader {
// no throttling is applied below this VD for loading
+ // Kaiiju start - Static distance
+ public final PlayerAreaMap staticMap;
+ protected int rawStaticDistance = -1;
+ // Kaiiju end
+
+
/**
* The chunks to be sent to players, provided they're send-ready. Send-ready means the chunk and its 1 radius neighbours are loaded.
*/
@@ -190,6 +207,12 @@ public final class PlayerChunkLoader {
return this.rawSendDistance == -1 ? this.getLoadDistance() : this.rawSendDistance;
}
+ // Kaiiju start - Static distance
+ public int getTargetStaticDistance() {
+ return this.rawStaticDistance == -1 ? this.getStaticDistance() : this.rawStaticDistance;
+ }
+ // Kaiiju end
+
public void setTargetSendDistance(final int distance) {
this.setSendDistance(distance);
}
@@ -231,6 +254,16 @@ public final class PlayerChunkLoader {
this.rawTickDistance = distance;
}
+ // Kaiiju start - Static distance
+ public void setStaticDistance(final int distance) {
+ this.rawStaticDistance = distance;
+ }
+
+ public int getStaticDistance() {
+ return this.rawStaticDistance;
+ }
+ // Kaiiju end
+
/*
Players have 3 different types of view distance:
1. Sending view distance
@@ -256,7 +289,13 @@ public final class PlayerChunkLoader {
public PlayerChunkLoader(final ChunkMap chunkMap, final PooledLinkedHashSets<ServerPlayer> pooledHashSets) {
this.chunkMap = chunkMap;
+ // Kaiiju start - Static distance
this.broadcastMap = new PlayerAreaMap(pooledHashSets,
+ null,
+ (ServerPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ,
+ com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> newState) -> {});
+ // Kaiiju end
+ this.staticMap = new PlayerAreaMap(pooledHashSets,
null,
(ServerPlayer player, int rangeX, int rangeZ, int currPosX, int currPosZ, int prevPosX, int prevPosZ,
com.destroystokyo.paper.util.misc.PooledLinkedHashSets.PooledObjectLinkedOpenHashSet<ServerPlayer> newState) -> {
@@ -807,6 +846,7 @@ public final class PlayerChunkLoader {
protected int sendViewDistance = -1;
protected int loadViewDistance = -1;
protected int tickViewDistance = -1;
+ protected int staticViewDistance = -1; // Kaiiju
protected long nextChunkSendTarget;
@@ -932,6 +972,7 @@ public final class PlayerChunkLoader {
this.loader.loadMap.remove(this.player);
this.loader.loadTicketCleanup.remove(this.player);
this.loader.tickMap.remove(this.player);
+ this.loader.staticMap.remove(this.player); // Kaiiju
}
protected int getClientViewDistance() {