Files
sasheg dev 9980c1561d Игрок: хитбокс 1.45 в шифте и прыжок с места 1.5
- RsxPlayerTuning: высота при подкрадывании 1.45 (ванилла 1.65), прыжок с
  места 1.5, в движении ванильные 1.25, высота глаз в шифте 1.37.
- RsxPlayer: прыжок по наличию горизонтального ввода, глаза при подкрадывании.
- Патч в EntityPlayer.updateSize: высота при подкрадывании из нашего класса.
- Импульс прыжка считается обратным счетом по физике ваниллы.

AABB: редактор хитбоксов и их отрисовка

- Протокол: Hitbox (имя, зона, min/max, поворот), пакеты Hitboxes,
  HitboxInstances и HitboxesReload.
- Сервер: HitboxRegistry читает JSON-файл (world/hitboxes.json, можно
  указать --hitboxes), перечитывает его по запросу клиента и шлет наборы
  игрокам. Сломанный файл не стирает рабочие коробки, а объясняет причину.
- Клиент: RsxHitboxDebug рисует коробки через RenderGlobal.drawBoundingBox
  с подписями DebugRenderer, красит зоны (голова красная, тело желтое, ноги
  синие). Команды: /rsx hitboxes on|off|reload|list|show NAME.
- Новый модуль rsx-plugin-api с интерфейсом Hitboxes: плагин может
  зарегистрировать свои коробки. У сервера появился скрипт сборки.

Тесты: протокол 34, сервер 80 (было 74). Форк собирается чисто, 3279 классов.
2026-10-21 22:31:16 +03:00

74 lines
2.5 KiB
PowerShell

# Builds rsx-plugin-api into dist\.
#
# The API is the way a plugin talks to the server. It is a separate module on
# purpose: the server and the plugin both compile against it, and neither
# needs the other.
#
# NOTE: ASCII on purpose. Windows PowerShell 5.1 reads a .ps1 with no byte order
# mark using the system ANSI code page, which mangles UTF-8 and breaks the
# parser. Keep script messages English.
$ErrorActionPreference = 'Stop'
$Repo = Split-Path -Parent $PSScriptRoot
if (-not $Repo) { $Repo = $PSCommandPath | Split-Path -Parent | Split-Path -Parent }
$Workspace = Split-Path -Parent $Repo
$Dist = Join-Path $Repo 'dist'
$Out = Join-Path $Repo 'build'
function Say($text) { Write-Host " $text" -ForegroundColor Cyan }
if (-not (Get-Command javac -ErrorAction SilentlyContinue)) {
Write-Host ' A JDK (javac) is required.' -ForegroundColor Red
exit 1
}
New-Item -ItemType Directory -Force -Path $Dist, $Out | Out-Null
# The API speaks about items and boxes, so it is compiled against the
# protocol: the same jar the server and the client use.
$Protocol = Join-Path $Workspace 'rsx-protocol\build\classes'
if (-not (Test-Path $Protocol)) {
Write-Host " Missing dependency: $Protocol" -ForegroundColor Red
Write-Host ' Build rsx-protocol first.' -ForegroundColor Red
exit 1
}
$mainOut = Join-Path $Out 'classes'
Remove-Item $mainOut -Recurse -Force -ErrorAction SilentlyContinue
New-Item -ItemType Directory -Force -Path $mainOut | Out-Null
$mainFiles = @(Get-ChildItem (Join-Path $Repo 'src\main\java') -Recurse -Filter '*.java' |
ForEach-Object { $_.FullName })
if ($mainFiles.Count -eq 0) {
Write-Host ' No sources found.' -ForegroundColor Red
exit 1
}
& javac -encoding UTF-8 --release 17 -Xlint:-options -nowarn -cp $Protocol -d $mainOut $mainFiles
if ($LASTEXITCODE -ne 0) {
Write-Host ' The plugin API failed to compile.' -ForegroundColor Red
exit 1
}
Say "plugin API compiled ($($mainFiles.Count) files)"
$manifest = Join-Path $Out 'manifest.txt'
@"
Manifest-Version: 1.0
Implementation-Title: RustNotMC plugin API
Implementation-Version: 0.1.0
"@ | Set-Content -LiteralPath $manifest -Encoding ASCII
$jar = Join-Path $Dist 'rsx-plugin-api.jar'
if (Test-Path -LiteralPath $jar) { Remove-Item -LiteralPath $jar -Force }
& jar cfm $jar $manifest -C $mainOut .
if ($LASTEXITCODE -ne 0) {
Write-Host ' Could not package the jar.' -ForegroundColor Red
exit 1
}
Say "rsx-plugin-api.jar ($((Get-Item $jar).Length) bytes)"
Write-Host ''
Write-Host ' Done:' -ForegroundColor Green
Write-Host " $jar"