Commit Graph

19591 Commits

Author SHA1 Message Date
SashegDev 1a2f3bbde7 feat(delta): void dimension at 2:1 coordinate scale, plus World#convertLocation
Build Delta / Build paperclip jar (push) Successful in 7m57s
Мир пустоты как кастомное измерение датапаком и пересчёт координат между
мирами с разным масштабом.

Механизм масштаба — тот же, что у Незера: поле coordinate_scale в типе
измерения, а пересчёт при переходе равен делению масштаба источника на
масштаб назначения. Для пустоты нужно ровно 2.0, то есть один блок пустоты
на два блока оверворлда. Проверено на сервере: coord scale overworld=1.0
void=2.0.

Биом сделан своим (delta_void:void), а не переопределением ванильного
minecraft:the_void. Переопределение трогало бы данные Mojang и конфликтовало
с любыми другими датапаками. Отличия от ванильного — только цвета:
sky_color и fog_color в ноль, плюс выключенный туман и вода.

Что потребовалось по дороге, все три ошибки поймал сервер, а не я:

1. У типа измерения в 1.21.8 обязательное поле logical_height. Без него
   сервер отказывается стартовать: "No key logical_height".

2. Файл измерения не принимает дискриминатор "type": "minecraft:dimension".
   Кодек LevelStem читает поле type как ССЫЛКУ на тип измерения, и мой
   дискриминатор уходил в неё как имя типа. Правильно — "type" со значением
   delta_void:void.

3. getAllLevels() живёт на MinecraftServer, а не на DedicatedServer, который
   отдаёт CraftServer#getHandle(). И dimensionType() в Paper уже разворачивает
   Holder, так что .value() там не нужен и ломает компиляцию.

Отдельно: World#getCoordinateScale() в Paper УЖЕ есть, причём реализован
ровно так, как я собрался писать. Для чтения масштаба ядро менять не нужно.
А вот пересчёта координат в API нет ни в Paper, ни в Bukkit: Player#teleport
его не делает, потому что телепорт не портал. Добавлен default-метод
World#convertLocation с той же формулой, что и ванильная, и без изменения Y.

Хорошая новость про отказ сервера: на битый датапак он не стартует, а
падает в safeMode. Тихая загрузка сломанной генерации была бы хуже.

Диагностика частиц всё ещё в CraftWorld, снимается после проверки прицела.
2026-10-15 21:55:19 +00:00
SashegDev e6a95a0f85 feat(delta): let plugins send particles beyond the vanilla 32-block cut
Build Delta / Build paperclip jar (push) Successful in 8m22s
Частицы не долетали дальше 32 блоков, при том что механика способностей бьёт
на 120. Игрок дальше 32 блоков не видел прицела вообще, но удар приходил.

Причина оказалась на стороне сервера, а не клиента. В ServerLevel есть
    if (blockPos.closerToCenterThan(pos, longDistance ? 512.0 : 32.0))
где longDistance это параметр alwaysShow. По умолчанию он false, то есть 32
блока. Но Bukkit-API этот флаг не открывает: в CraftWorld.spawnParticle он
захардкожен в false, а параметр force уходит в overrideLimiter. То есть ни
один плагин на Paper не мог отправить частицу дальше 32 блоков.

Само поле alwaysShow сериализуется в ClientboundLevelParticlesPacket, поэтому
клиент со своей стороны отсечку тоже снимает — тем же механизмом, что и
ванильная команда /particle в режиме display.

Что сделано:

1. World#spawnParticleLongDistance(...) — default-метод, а не абстрактный.
   Причина: абстрактный метод в интерфейсе World ломает бинарную совместимость
   с любой сторонней реализацией. Фолбэк здесь ведёт себя как обычный
   spawnParticle, то есть деградация — «слишком короткая дальность», а не
   «частиц нет».

2. CraftWorld переопределяет его. Дистанция применяется фильтрацией списка
   получателей ДО вызова ServerLevel, а не патчем самого ServerLevel:
   sendParticlesSource принимает готовый receivers, поэтому достаточно отсечь
   его самим. Ванильная проверка остаётся нетронутой. Это принципиально —
   меньше правок в ванильных патчах, меньше риска конфликтов.

3. Конфиг extended-particle-distance перестал быть мёртвым. Раньше он был
   объявлен в DeltaConfig и выводился в /delta, но нигде не читался при отправке
   частиц, поэтому переключатель не делал ничего. Теперь он работает как
   потолок: плагин запрашивает сколько нужно, сервер режет до 128.
   extendedParticleDistanceEnabled=false возвращает стоковые 32.

Замер: /delta теперь показывает "extended distance 128.0 blocks" вместо "off".
2026-10-05 17:30:57 +00:00
SashegDev 42f48fea43 perf(config): document and justify the heap-shrink flags
Build Delta / Build paperclip jar (push) Successful in 7m3s
Добавлен -XX:MaxHeapFreeRatio=30 -XX:MinHeapFreeRatio=10 в start.sh на проде
и зафиксирован в README с замерами, потому что флаги JVM не переносятся
копированием конфигов — при переезде они теряются молча.

Замер, мир 18 МБ, 0 игроков, 100 с простоя:

              коммит   живые   RSS
  без флагов   630 МБ  278 МБ  0.99 ГБ
  с флагами    389 МБ  274 МБ  0.69 ГБ

Минус 300 МБ RSS без единого ручного GC.

Причина была не в отсутствии Full GC: jcmd GC.run отрабатывает, живые падают
289 -> 248 МБ, но коммит остаётся на 725 МБ. G1 сжимает кучу только когда
свободно выше MaxHeapFreeRatio, а он по умолчанию 70. При 630 МБ коммита
свободно было 56% — ниже порога, и 350 МБ держались вечно.

Паузы Mixed (то, что ест кадр в рантайме) не ухудшились: median 11.0 -> 9.8,
p95 28.3 -> 28.1, max 38.1 -> 28.7 мс. Concurrent-циклов стало больше
(11 -> 18), общий p95 по всем паузам в одном прогоне вырос 126 -> 270 мс —
это замер без игроков, под нагрузкой флаг ещё предстоит перемерить.

DisableExplicitGC оставлен намеренно: он делает System.gc() no-op, и именно
поэтому освобождение сделано флагом, а не вызовом GC. README теперь
описывает профиль как 15-25 игроков с пиком 34, а не 30-40.
2026-10-04 13:55:14 +00:00
SashegDev be3bfc2369 perf(config): 2 chunk workers instead of 1, gen-parallelism on
Build Delta / Build paperclip jar (push) Successful in 7m9s
worker-threads: -1 means "auto", and auto on 4 cores resolves to ONE worker.
MoonriseCommon.adjustWorkerThreads halves availableProcessors and then, if the
result is <= 4, collapses it further - 4/2=2, and 2<=3 becomes 1. That single
thread generated the spawn region serially.

Measured on zern.cc (4 vCPU, 8 GB), same jar, same flags, cold world vs warm:

                    before   after
  cold, overworld     6770ms  2944ms
  cold, nether        1368ms   888ms
  cold, total         38.5s   24.9s
  warm, overworld     1084ms   803ms
  warm, total         16.4s   12.2s

gen-parallelism "default" already resolved to true at startup, so it is now
spelled out rather than left to string comparison at boot.

3 workers is deliberately NOT set here. The main thread plus Netty share the
same 4 cores, and going to 3 trades main-thread headroom for generation that
does not happen every tick. That needs a profile, not a guess.

Also recorded the corollary: player-max-concurrent-chunk-generates is a rate
limiter, not an accelerator. Speeding up generation without raising it just
makes the engine faster behind a throttle that was sized for the old speed.
2026-10-03 11:58:59 +00:00
SashegDev 5186c9b0e2 docs: update README for the audio, display and persistence work
Build Delta / Build paperclip jar (push) Successful in 8m2s
The README still described decoupled sound range as planned and had no
`/delta displaylead`, no mention of the config being writable, and a command
list containing a `/delta reload` that does not exist.

Also corrects two claims that no longer hold:
- the Display tracking clamp is in org.spigotmc.TrackingRange, not
  ChunkMap.TrackedEntity. That was a deliberate choice: TrackingRange is
  git-tracked Paper source, so the decompiled Minecraft tree stays untouched.
- the new Bukkit methods are default methods, so plugins referencing them keep
  working on stock Paper instead of failing with NoSuchMethodError.
2026-09-30 12:53:09 +00:00
SashegDev dac80386b5 fix(delta): make the audio and config patches actually compile, add DeltaDisplay
Build Delta / Build paperclip jar (push) Successful in 7m49s
0373806e2 and 0817a5706 were pushed but never built, so the server jar was
broken on main. Six compile errors, all in code that had never run:

- ClientboundSoundPacket takes Holder<SoundEvent> in 1.21, not SoundEvent.
- CraftWorld has no getServer(); the vanilla handle does.
- Server has no paperConfigurations()/registryAccess() - Configurations is
  reachable through the console, and saveGlobalSection lives on Configurations
  (GlobalConfiguration is a ConfigurationPart, i.e. the data, not the writer).
- ServerPlayer.server is private.

DeltaSound pumped delayed packets through BukkitScheduler, which requires a
live Plugin, and Delta as a core has none. It now uses GlobalRegionScheduler
with a null plugin, which exists precisely for core tasks. Delays are counted
in game ticks via Bukkit#getCurrentTick rather than System.nanoTime, so they
no longer stretch under lag. The pump cancels itself once the queue drains.

New DeltaDisplay holds the predictive-teleport policy (lead range, default,
application) and /delta displaylead tunes it. Honest about its scope:
Display#setTeleportDuration is already stock Bukkit, so Delta adds no new API
to plugins and breaks no compatibility - it centralises the policy and reports
it. The position shift itself is done by the plugin, per visual, along that
visual's own trajectory.

DeltaBuild now registers the existing features in the startup banner instead of
printing "no custom features registered". The banner is emitted from a static
initialiser before paper-global.yml is parsed, so the strings describe the
mechanism and point at /delta status for live values rather than printing
defaults as if they were the running configuration.
2026-09-30 12:41:35 +00:00
SashegDev 0817a57065 feat(delta): playSoundAttenuated - wave propagation + normalized decay, one packet per player
Build Delta / Build paperclip jar (push) Failing after 5m24s
2026-09-30 10:39:11 +00:00
SashegDev 0373806e25 feat(delta): config persistence via Configurations.saveGlobalSection + decoupled sound range API
Build Delta / Build paperclip jar (push) Failing after 5m52s
2026-09-30 10:00:20 +00:00
SashegDev f55129436b fix(delta): /delta has no persistence (Paper exposes no public config writer); runtime-only + clear
Build Delta / Build paperclip jar (push) Successful in 8m24s
2026-09-30 09:42:40 +00:00
SashegDev ec31787ea0 fix(delta): public class name must match file name (Delta -> DeltaConfig)
Build Delta / Build paperclip jar (push) Failing after 5m21s
2026-09-30 09:31:57 +00:00
SashegDev a039ea62a9 feat(delta): hook Display tracking budget through TrackingRange (no MC patch needed)
Build Delta / Build paperclip jar (push) Failing after 5m14s
2026-09-30 09:26:22 +00:00
SashegDev 342eaadf39 feat(delta): /delta command, Display tracking budget, global delta config; rewrite README for Delta
Build Delta / Build paperclip jar (push) Failing after 4m52s
2026-09-30 09:16:06 +00:00
SashegDev e226182932 ci: builder image ships git identity (applyFeaturePatches commits) 2026-09-30 09:16:06 +00:00
SashegDev 9741cbccf9 ci: build in delta-builder:jdk21 image (JDK21 + node) - plain temurin lacks node for checkout action 2026-09-30 09:16:06 +00:00
SashegDev a56c29c3fd Delta banner + DeltaBuild 2026-09-30 09:16:06 +00:00
SashegDev a87830e51f ci: replace Paper GitHub workflows with Gitea-native build workflow (split applyPatches/build) 2026-09-30 09:16:06 +00:00
SashegDev cf3afa851a branding: keep Brand-Id papermc:paper for plugin compat, Brand-Name Delta 2026-09-30 09:16:06 +00:00
SashegDev 37c88fe6a1 revert group/version to upstream format (Versioning reads pom.properties by group path; Delta identity lives in manifest/jar/banner) 2026-09-30 09:16:06 +00:00
SashegDev 90399370d4 branding: Paper -> Delta (group, version, jar/manifest, fill project id) 2026-09-30 09:16:05 +00:00
SashegDev e0457487fe config fixes: drop invalid misc spawn-limit key, pin config-version 31 2026-09-30 09:16:05 +00:00
SashegDev af1a55b1e7 add tuned server configs for 4 vCPU / 8 GB / 40 players (tracking, activation, hopper, chunk IO) 2026-09-30 09:16:05 +00:00
Jason Penilla 29c8822d90 Remove no longer needed MC-210802 fix (#13059)
Build Paper / build (push) Failing after 1s
Build Paper / Event File (push) Failing after 1s
2025-09-06 14:38:29 -07:00
Lulu13022002 19156cdd3b Give the right amount of experience after mending (#13047) 2025-09-06 13:49:56 -07:00
Spottedleaf 9aaaadffaa Backport DFU changes from snapshots
When converting to components:
 - Remove enchantments with levels <= 0
 - Remove the item name if it is not valid JSON
 - Remove lore entries that are not valid JSON
2025-09-03 14:59:39 -07:00
Spottedleaf 78aecfebaf Do not remove plugin chunk tickets on shutdown
The chunk system may not be responsive in a shutdown (i.e
watchdog timeout). Therefore, we should avoid interacting
with the chunk system to increase the odds of a graceful
shutdown.
2025-09-03 14:25:27 -07:00
Jason Penilla 65641d1006 Only log name instead of full profile for configuration phase disconnects (#13038) 2025-08-29 13:32:10 -07:00
Emil 49ca2d2d76 chore: remove experimental status from Damageable#damage (#13021) 2025-08-29 18:15:29 +01:00
Jason Penilla 63cd4af408 Fix createProfile not always returning a new profile (#13036) 2025-08-29 09:42:35 -07:00
Jason Penilla 704107c3dd Resend frozen ticks when cancelling EntityInsideBlockEvent for powder snow fixes #13033 (#13035) 2025-08-28 18:11:29 -07:00
Jason Penilla 9d1d0ef3f3 Add and call RegionizedServerInitEvent from Folia (#13034) 2025-08-28 18:09:09 -07:00
Jason Penilla b6168b7ccc Get console Brig suggestions from main thread fixes #13027 (#13028) 2025-08-28 17:25:42 -07:00
Shane Freeder 51706e5ac1 Fixed DyeItem sheep dye hunk 2025-08-25 02:49:26 +01:00
Aeltumn 614e9acfca Improve APIs around riptide tridents (#12996)
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2025-08-23 21:12:30 +00:00
MCdragonmaster 52d9a2216c [ci skip] Fix typo in Display javadoc (#13010) 2025-08-23 20:59:05 +00:00
Strokkur24 42b653b197 Expose more argument types (#12665)
Co-authored-by: Bjarne Koll <git@lynxplay.dev>
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2025-08-23 21:10:41 +01:00
Strokkur24 5622c9dd73 Expose attribute sentiment (#12974)
Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
2025-08-23 17:15:16 +00:00
Pedro a9e7674933 Support for showNotification in PlayerRecipeDiscoverEvent (#12992) 2025-08-23 17:53:46 +01:00
MC_XiaoHei ea014f7a77 feat: add stuckEntityPoiRetryDelay config (#12949)
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
2025-08-23 09:39:19 -07:00
Warrior 79cf1353b9 Ignore HopperInventorySearchEvent when it has no listeners (#13009) 2025-08-23 16:25:40 +00:00
Lulu13022002 1922be9074 Update custom tags (#12183) 2025-08-23 16:53:07 +01:00
Pedro b0da38c278 Repository details in RuntimeException for MavenLibraryResolver#addRepository (#12939) 2025-08-22 11:25:08 +01:00
Moulberry 38fe16b5f2 Fix missing reason in disconnectAsync (#13001) 2025-08-21 22:13:31 +01:00
Moulberry f866a5fd54 Use LinkedHashMap in ChannelInitializeListenerHolder (#13000) 2025-08-19 17:53:03 +02:00
Esophose 616a8795ea Add LootTable to BlockDispenseLootEvent (#12917) 2025-08-17 15:53:00 +01:00
Strokkur24 47f983f430 Add allow-remote-ender-dragon-respawning setting (#12602) 2025-08-17 13:49:30 +02:00
Pedro b200237c7d Fix clone return for Paper PlayerProfile (#12984) 2025-08-15 21:56:54 +01:00
David a22447a555 Added getWorldPath to World API (#12952) 2025-08-15 21:39:09 +01:00
Warrior a743e6b1c7 [ci skip] Clarify tab completion ordering in event jd (#12965) 2025-08-15 21:33:10 +01:00
Warrior 2456ff26ed [ci skip] Update javadoc for tinted leaves particle (#12962) 2025-08-15 21:30:16 +01:00
Emil 651fa124c5 Fix cancelled EnderDragonShootFireballEvent playing sound (#12977) 2025-08-15 21:55:31 +02:00