Add sweeping twinblade and animated seven-hit combat gauntlets

This commit is contained in:
2026-09-13 10:13:18 +03:00
commit 4ff0ed89b5
167 changed files with 6650 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
.gradle/
build/
.idea/
*.log
*.hprof
__pycache__/
+10
View File
@@ -0,0 +1,10 @@
# AstraWeapons — серверный мод NeoForge
- Minecraft 26.2, NeoForge 26.2.0.79, Java 25+. Серверный мод, ванильный клиент и ресурспак AstraPlus.
- Исходники оружия и его ресурсы принадлежат AstraWeapons. AstraPlus предоставляет общие контент, чары, модели и сборку пака.
- Сохранять идентификатор старого твинблейда `astraplus:netherite_twinblade` для совместимости миров и чар.
- После изменений выполнить сборку и проверки; установить JAR прямо в `C:\Users\ScarPC\Documents\NeoForge Server 26.2\mods`.
- Прежний JAR именно AstraWeapons переносить в уникальный `old-mods/YYYYMMDD-HHMMSS/`; архив не перезаписывать. Сравнить SHA-256 сборки и установленного JAR.
- Не использовать отложенную установку, не изменять миры, существующие настройки и Paper-сервер.
- Проверять diff, коммитить только изменения задачи. Push — только по запросу. Не коммитить build, .gradle, логи, тестовые миры и резервные копии; Gradle wrapper входит в репозиторий.
- В итоговом ответе указать установку, архив, коммит и ограничения проверок.
+42
View File
@@ -0,0 +1,42 @@
# AstraWeapons
Серверный мод для Minecraft 26.2 / NeoForge 26.2.0.79 / Java 25+.
Требуется AstraPlus 0.5.67+. Клиенту нужны ванильный Minecraft 26.2 и ресурспак AstraPlus; AstraWeapons на клиент не устанавливается.
Выдача:
```text
/astraplus give @s astraplus:netherite_twinblade
/astraplus give @s astraweapons:gauntlets
```
Твинблейд перенесён из AstraPlus с сохранением ID, существующих предметов, моделей, определений и четырёх чар.
Полностью заряженная ЛКМ начинает замах на 2 тика, затем наносит 7 урона каждой допустимой цели в секторе 180° до 3 блоков.
«Размах» расширяет радиус до 4/5 блоков. Отмена атаки, стены, союзники, PvP, броня, щиты, криты и обычные чары учитываются.
Смена оружия/слота, выход, смерть и смена измерения отменяют незавершённый замах.
Вместо частиц используется временная vanilla item-display с анимированной текстурой дуги, в том числе огненный вариант при «Заговоре огня».
Положение оружия в руке проходит через шесть модельных кадров; геометрия попадания остаётся серверной.
Боевые перчатки: базовый урон 3, скорость 4 атаки/с, откат 5 тиков (0,25 с), небольшая область ±28° до 2,2 блока.
Серия: левый → правый → левый → правый → левый хук → правый апперкот → правый выпад.
Урон без брони/критов/чар: **3 / 3 / 3 / 3 / 3 / 4,2 / 6**. Дальность выпада — 2,55 блока.
Промах расходует удар серии; пауза больше 24 тиков или смена оружия сбрасывают серию.
Слишком ранние клики не наносят урон, не продвигают серию и не продлевают откат.
Собственный тип урона пропускает обычную паузу между повреждениями, но не игнорирует щит, броню или отмену события урона.
Пока перчатки выбраны, предмет из второй руки переносится в свободный слот инвентаря. Вторая рука физически пуста и получает только сетевую модель перчатки.
Нельзя использовать предмет второй руки, обменять руки клавишей F или положить туда предмет через интерфейс.
При полном инвентаре экипировка отклоняется: оба исходных предмета сохраняются обменом между руками, и игрок получает подсказку освободить слот.
Визуальные предметы не записываются в инвентарь, сохранения или выпадение; творческие пакеты с визуальными копиями отклоняются.
При снятии перчаток вторая рука снова доступна; перенесённый предмет остаётся в инвентаре.
`config/astraweapons.json` создаётся при первом запуске. Начальные настройки твинблейда наследуются из прежнего `config/astraplus.json`, который не переписывается.
Недостающие ресурсы и определения устанавливаются в общие каталоги AstraPlus до загрузки чар/сборки пака. Существующие пользовательские файлы сохраняются.
После установки JAR нужен перезапуск сервера и принятие обновлённого ресурспака. При отключённой автоматической сборке выполните `/astraplus build`.
Модели рук анимируются средствами ресурспака и сетевых пакетов; базовые движения рук самого ванильного персонажа сохраняются.
Авторы заимствованных моделей и звуков указаны в [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md), в JAR, ресурспаке и описании перчаток.
Сборка: сначала `AstraPlus/gradlew build`, затем `gradlew build verificationJar` в AstraWeapons.
Проверка: `tools/verify-server.ps1` запускает отдельный тестовый мир; `tools/capture-client.ps1` проверяет модели/OGG реальным клиентом и сохраняет кадры рук.
Не устанавливайте JAR `*-verification.jar` на рабочий сервер.
+15
View File
@@ -0,0 +1,15 @@
# Third-party assets
Gauntlet model and textures: **joshieman**, **Gallant Gauntlets 1.1.2** (Fabric, Minecraft 1.21.1).
Source supplied by the user: `gauntlets-1.1.2-1.21.1`.
Project: https://www.curseforge.com/minecraft/mc-mods/gauntlets/files/5800931
Original geometry and iron textures are retained. Changes: resource namespace, vanilla 26.2 item presentation, and new display-transform animation frames by AstraDev.
The source metadata declares ARR. The bundled `LICENSE_gauntlets` is preserved verbatim; this attribution does not relicense the original assets.
Gauntlet sounds: **Mojang Studios / Double Eleven / Microsoft**, **Minecraft Dungeons**.
Reference and sound filenames: https://minecraft.wiki/w/Dungeons:Gauntlets
Minecraft Wiki refused direct downloads (HTTP 403); the identical named original game wave assets were obtained from the user's local Dungeons installation. OGG data are unmodified.
`gauntlet-audio-provenance.json` lists source names, Wiki file references, and SHA-256 hashes.
Twinblade texture/model: retained from the existing user-provided AstraPlus resource pack. Original credit information was not present in that resource.
Crescent hit texture and pose animation JSON: AstraDev, authored for AstraWeapons.
+50
View File
@@ -0,0 +1,50 @@
plugins {
java
id("net.neoforged.moddev") version "2.0.146"
}
group = "online.astradev"
version = "0.1.0"
repositories { mavenCentral() }
dependencies {
compileOnly(files(providers.gradleProperty("astraPlusJar").orElse("../AstraPlus/build/libs/AstraPlus-0.5.67.jar")))
testImplementation("org.junit.jupiter:junit-jupiter:5.11.4")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:1.11.4")
}
neoForge {
version = "26.2.0.79"
mods { create("astraweapons") { sourceSet(sourceSets.main.get()) } }
}
java { toolchain.languageVersion.set(JavaLanguageVersion.of(25)); withSourcesJar() }
tasks.withType<JavaCompile>().configureEach { options.encoding = "UTF-8"; options.release.set(25) }
tasks.processResources {
inputs.property("modVersion", project.version)
filesMatching("META-INF/neoforge.mods.toml") { expand("version" to project.version) }
}
tasks.test { useJUnitPlatform() }
sourceSets.test {
compileClasspath += sourceSets.main.get().compileClasspath
runtimeClasspath += sourceSets.main.get().compileClasspath
}
val verification = sourceSets.create("verification") {
compileClasspath += sourceSets.main.get().output + sourceSets.main.get().compileClasspath
runtimeClasspath += output + compileClasspath
}
tasks.register<Jar>("verificationJar") { from(verification.output); archiveClassifier.set("verification") }
val clientVerification = sourceSets.create("clientVerification") {
compileClasspath += sourceSets.main.get().compileClasspath.filter { !it.name.startsWith("AstraPlus-") }
runtimeClasspath += output + compileClasspath + sourceSets.main.get().runtimeClasspath
}
neoForge {
mods { create("astraweapons_client_verify") { sourceSet(clientVerification) } }
runs {
create("weaponsCaptureClient") {
client(); sourceSet.set(clientVerification)
loadedMods.set(setOf(mods.getByName("astraweapons_client_verify")))
gameDirectory.set(file(providers.gradleProperty("captureClientDirectory").orElse("build/capture-client").get()))
systemProperty("astraweapons.captureServer", providers.gradleProperty("captureServerDirectory").orElse("build/capture-server").get())
systemProperty("astraweapons.capturePort", providers.gradleProperty("capturePort").orElse("26705").get())
programArgument("--width"); programArgument("960");programArgument("--height"); programArgument("540")
programArgument("--username");programArgument("WeaponReview")
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

+83
View File
@@ -0,0 +1,83 @@
# История твинблейда в AstraPlus до переноса
Это архивное описание поведения версий AstraPlus 0.5.3–0.5.8.
Текущее поведение, текстурная дуга и замах описаны в [README AstraWeapons](../README.md).
Выдать: `/astraplus give @s astraplus:netherite_twinblade`.
Отдельный предмет на основе незеритового меча. Урон — 7 (у обычного незеритового меча 8),
скорость — 1,6 атаки/с. Прочность и обычные свойства незеритового меча наследуются.
В спокойном бою без брони, чар и критов это 11,2 против 12,8 урона/с.
При полностью восстановленной ванильной атаке взмах поражает живые цели в переднем
полукруге: ±90° по горизонтали относительно взгляда. Проверяется досягаемость меча,
дополнительно ограниченная 3 блоками от глаз до хитбокса, и видимость цели.
Союзники, наблюдатели и игроки с запрещённым PvP исключены.
Взмах в воздух также работает; взмах при работе с блоком не вызывает атаку по области.
Каждая цель получает отдельный полноценный удар мечом в тот же серверный тик.
Нет деления урона, отложенного второго попадания или сброса кадров неуязвимости.
Броня, щиты, чары, криты и события отмены урона работают через ванильную атаку.
Обычный вторичный sweep меча отключён только для этого предмета.
Незаряженное попадание — слабый одиночный удар с ванильным расходом заряда.
Дуга видна как тонкая полоса мелких частиц со звуком. Угол и радиус попадания не уменьшены.
Отбрасывание живых целей направлено вперёд по взмаху, включая дополнительную «Отдачу»;
ванильное сопротивление отбрасыванию сохраняется. Движимые неживые сущности (предметы,
транспорт, снаряды и обычные стойки) получают импульс вперёд без дополнительного урона.
Они не считаются противниками для бонусов зачарований. Маркерные стойки исключены.
В 0.5.8 индикатор в иконке удалён вместе с обновлением его состояния. В слоте видна
только исходная текстура оружия. Готовность атаки по-прежнему определяется ванильным зарядом.
## Зачарования
Чары доступны на столе зачарований и в книгах, переносятся на твинблейд через наковальню.
На другие предметы, включая обычный незеритовый меч, не накладываются.
| Чары | Уровни | Действие |
| --- | --- | --- |
| Размах (`astraplus:reach`) | I–II | +1/+2 блока досягаемости широкого взмаха: до 4/5 блоков. Угол 180°, полная зарядка, видимость и щиты сохраняются. Совместим с остальными чарами твинблейда. |
| Жатва (`astraplus:reaping`) | I–III | +10/20/30% урона всем целям дуги при двух и более подходящих противниках; одиночной цели бонуса нет. Третья цель процент не увеличивает. |
| Инерция (`astraplus:inertia`) | I–II | После двух и более успешных попаданий восстановление этого взмаха короче на 10/20%. Промах и одиночный удар сбрасывают ускорение; бонус не накапливается. |
| Зацеп (`astraplus:hook`) | I–II | Скорость задетых целей ниже на 15/25% в течение 10 тиков (0,5 с). Повторный удар обновляет срок, не складывая силу. Не запрещает атаки, прыжки или щит. |
Жатва и Инерция несовместимы; Зацеп совместим с обеими. Полностью заблокированная щитом
или неуязвимая цель не открывает бонус Жатвы. Инерция и Зацеп учитывают успешные удары.
Острота, Небесная кара, Бич членистоногих, Заговор огня, Отдача, Добыча и прочие обычные
эффекты меча проходят через ванильную обработку для каждой цели. «Разящий клинок»
(`minecraft:sweeping_edge`) запрещён: для усиления собственной дуги используется Жатва.
При запуске 0.5.3 автоматически добавляются отсутствующие файлы:
- `astraplus/contents/astraplus/items/netherite_twinblade.json`;
- `astraplus/resources/assets/astraplus/models/item/netherite_twinblade.json`;
- `astraplus/resources/assets/astraplus/textures/item/netherite_twinblade.png`.
В 0.5.6 стандартные масштабы GUI `[4,4,1]` и `[1,1,1]` исправляются на `[1.5,1.5,1]`
с центрированием `[1.9,1.9,0]`, чтобы сам клинок занимал большую часть слота; исходная модель сохраняется
в `astraplus/backups/twinblade-model-<UUID>.json`. Остальные трансформации и определения
сохраняются. Предмет независим от остальных определений,
скриптов и модов. Текстура взята из предоставленного пака, трансформации отображения —
из `big_sword_generated.json`; всё перенесено в пространство `astraplus`, обычный меч
не меняется. Ресурсы попадают в стандартную сборку AstraPlus/AstraPacks.
Визуальная дуга 0.5.6 содержит 57 небольших частиц вместо 19: она плотнее и заметнее,
без возвращения крупных частиц, закрывающих экран. Геометрия попаданий не меняется.
С 0.5.7 GUI использует ту же предоставленную текстуру: UV-координаты исключают
прозрачные поля, а плоская грань с фронтальным освещением убирает объёмное затенение.
Рисунок и файл текстуры не изменяются.
В руке сохраняется предоставленная модель. Если в редакторе выбрана другая модель,
её GUI-изображение не заменяется.
В 0.5.8 плотность эффекта увеличена до 148 частиц на взмах (вместо 57).
«Размах» расширяет только широкий удар, не увеличивая дальность работы с блоками.
Проверки: `gradlew build verificationJar`; на изолированном сервере тестовый JAR
поддерживает `-Dastraplus.isolatedVerification=true -Dastraplus.twinbladeVerification=true`.
Успешный боевой тест пишет `twinblade-result.txt` и завершает тестовый сервер.
Определения трёх чар доступны во вкладке «Зачарования» AstraPlusEditor 0.3.3.
Это экземпляры общей [системы пользовательских зачарований](enchantments.md), а не
встроенные условия только одного оружия. При пользовательских моделях несколько
хитбоксов одного моба объединяются в одну цель; повреждение и отбрасывание получает моб.
+20
View File
@@ -0,0 +1,20 @@
# Проверка выпуска 0.1.0
Проверено 13 сентября 2026 на Minecraft 26.2 / NeoForge 26.2.0.79 вместе с AstraPlus 0.5.67.
- JUnit: AstraPlus — 223, AstraWeapons — 7; ошибок и пропусков нет.
- Изолированный сервер: сектор твинблейда, задержка замаха, расход заряда, попадания по нескольким целям, щиты, старые чары, скрытые владельцы моделей.
- Перчатки: точный урон всех семи ударов, быстрые повторные попадания, защита от повторного пакета, малая область, сброс серии, щиты, сохранение предмета второй руки и отказ при полном инвентаре (включая две перчатки).
- Повторный запуск тестового мира прошёл: определения, чары и пакет ресурсов снова загрузились.
- Настоящий клиент без игровых модов AstraPlus/AstraWeapons загрузил 35 модельных деревьев без отсутствующих моделей/текстур; декодировал 23 исходных OGG и сохранил 21 кадр.
- На кадрах вручную проверены обе перчатки, апперкот, замах твинблейда и видимая текстурная дуга перед игроком. Для кадров длительность поз увеличена; игровая скорость задаётся боевыми обработчиками.
Последняя серверная проверка: `build/verify-20260913-101207-71b862`.
Клиентская проверка: `build/weapons-capture-20260913-101106-8330f9`.
Полные журналы и временные миры исключены из Git.
![Перчатки в обеих руках](review/gauntlets.png)
![Апперкот](review/uppercut.png)
![Твинблейд и текстурная дуга](review/twinblade-slash.png)
Проверки выполнялись на отдельном сервере. Рабочий сервер не перезапускался; активация обновлённых модов и принятие нового ресурспака требуются после установки.
Binary file not shown.
+10
View File
@@ -0,0 +1,10 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=acd53f1edaf02f1a8ff99879f8a34b302661a057d9b063ae9e35b552f804d20a
Vendored
+248
View File
@@ -0,0 +1,248 @@
#!/bin/sh
#
# Copyright © 2015 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
# gradlew 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 gradlew
#
# 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/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
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
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
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 optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# 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" "$@"
Vendored
+82
View File
@@ -0,0 +1,82 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem gradlew startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables, and ensure extensions are enabled
setlocal EnableExtensions
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
"%COMSPEC%" /c exit 1
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
"%COMSPEC%" /c exit 1
:execute
@rem Setup the command line
@rem Execute gradlew
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
@rem which allows us to clear the local environment before executing the java command
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
:exitWithErrorLevel
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
"%COMSPEC%" /c exit %ERRORLEVEL%
+2
View File
@@ -0,0 +1,2 @@
pluginManagement { repositories { gradlePluginPortal(); maven("https://maven.neoforged.net/releases") } }
rootProject.name = "AstraWeapons"
@@ -0,0 +1,69 @@
package online.astradev.weapons.verification.client;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashSet;
import java.util.concurrent.CompletableFuture;
import net.minecraft.client.Minecraft;
import net.minecraft.client.sounds.JOrbisAudioStream;
import net.minecraft.resources.Identifier;
/** Decodes every shipped sample with the actual client codec, without blocking rendering. */
final class WeaponsAudioCheck {
private WeaponsAudioCheck() {}
static CompletableFuture<Integer> start(Minecraft minecraft) {
var resources = minecraft.getResourceManager();
Path report = minecraft.gameDirectory.toPath().resolve("weapons-audio-result.json");
return CompletableFuture.supplyAsync(() -> {
try {
var sounds = resources.listResources("sounds", id -> id.getNamespace().equals("astraweapons") && id.getPath().endsWith(".ogg"));
if (sounds.isEmpty()) throw new IllegalStateException("Dungeons audio samples are absent");
var referenced = new HashSet<Identifier>();
try (var reader = resources.getResourceOrThrow(Identifier.parse("astraweapons:sounds.json")).openAsReader()) {
var catalog = JsonParser.parseReader(reader).getAsJsonObject();
for (var entry : catalog.entrySet()) for (var sample : entry.getValue().getAsJsonObject().getAsJsonArray("sounds")) {
if (sample.isJsonObject() && sample.getAsJsonObject().has("type")
&& sample.getAsJsonObject().get("type").getAsString().equals("event")) continue;
String value = sample.isJsonPrimitive() ? sample.getAsString() : sample.getAsJsonObject().get("name").getAsString();
var name = Identifier.parse(value);
var file = Identifier.fromNamespaceAndPath(name.getNamespace(), "sounds/" + name.getPath() + ".ogg");
if (!sounds.containsKey(file)) throw new IllegalStateException("Missing audio sample for " + entry.getKey() + ": " + file);
referenced.add(file);
}
}
var samples = new JsonArray();
for (var entry : sounds.entrySet().stream().sorted(java.util.Map.Entry.comparingByKey()).toList()) {
try (var stream = new JOrbisAudioStream(entry.getValue().open())) {
var format = stream.getFormat();
int channels = format.getChannels();
if (channels != 1 && channels != 2) throw new IllegalStateException("Unsupported channels: " + entry.getKey());
if (!Float.isFinite(format.getSampleRate()) || format.getSampleRate() <= 0) throw new IllegalStateException("Invalid sample rate: " + entry.getKey());
long[] count = {0}; double[] energy = {0}, peak = {0};
while (stream.readChunk(value -> {
if (!Float.isFinite(value)) throw new IllegalStateException("Non-finite audio: " + entry.getKey());
count[0]++; energy[0] += (double)value * value; peak[0] = Math.max(peak[0], Math.abs(value));
})) { /* Consume the complete bitstream, not just its Ogg header. */ }
if (count[0] == 0 || count[0] % channels != 0) throw new IllegalStateException("Empty or incomplete decoded audio: " + entry.getKey());
var sample = new JsonObject(); sample.addProperty("file", entry.getKey().toString());
sample.addProperty("channels", channels); sample.addProperty("sample_rate", format.getSampleRate());
sample.addProperty("frames", count[0] / channels);
sample.addProperty("seconds", count[0] / (channels * (double)format.getSampleRate()));
sample.addProperty("rms", Math.sqrt(energy[0] / count[0])); sample.addProperty("peak", peak[0]);
sample.addProperty("referenced", referenced.contains(entry.getKey())); samples.add(sample);
}
}
var result = new JsonObject(); result.addProperty("status", "PASS");
result.addProperty("codec", "Minecraft 26.2 JOrbisAudioStream");
result.addProperty("decoded_files", samples.size()); result.addProperty("referenced_files", referenced.size());
result.add("samples", samples); Files.writeString(report, result.toString());
return samples.size();
} catch (Exception failure) {
throw new java.util.concurrent.CompletionException("Dungeons audio decoding failed", failure);
}
});
}
}
@@ -0,0 +1,97 @@
package online.astradev.weapons.verification.client;
import java.nio.file.*;
import com.google.gson.JsonParser;
import com.mojang.serialization.JsonOps;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.*;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.multiplayer.resolver.ServerAddress;
import net.minecraft.client.renderer.item.*;
import net.minecraft.resources.Identifier;
import net.neoforged.fml.common.Mod;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.fml.ModList;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.client.event.ClientTickEvent;
@Mod(value="astraweapons_client_verify",dist=Dist.CLIENT)
public final class WeaponsCapture {
private final Path server=Path.of(System.getProperty("astraweapons.captureServer"));
private boolean connecting,done;
private int age,stage,models,ticks;
private java.util.concurrent.CompletableFuture<Integer> audio;
public WeaponsCapture() { NeoForge.EVENT_BUS.addListener(this::tick); }
private void tick(ClientTickEvent.Post event) {
if(done)return;
var mc=Minecraft.getInstance();
try {
if(++ticks>6000)throw new IllegalStateException("Capture timeout");
if(Files.exists(server.resolve("capture-failure.txt")))throw new IllegalStateException(Files.readString(server.resolve("capture-failure.txt")));
if(!connecting) {
if(mc.gui.overlay()!=null || !mc.isGameLoadFinished())return;
if(ModList.get().isLoaded("astraplus") || ModList.get().isLoaded("astraweapons"))throw new IllegalStateException("Gameplay mods must not load on capture client");
org.lwjgl.glfw.GLFW.glfwHideWindow(mc.getWindow().handle());
for(var e:mc.getResourceManager().listResources("items",id->id.getPath().endsWith(".json") &&
(id.getNamespace().equals("astraweapons") || id.toString().equals("astraplus:items/netherite_twinblade.json"))).entrySet()) {
try(var reader=e.getValue().openAsReader()) { ClientItem.CODEC.parse(JsonOps.INSTANCE,JsonParser.parseReader(reader)).getOrThrow(); }
String path=e.getKey().getPath();
var id=Identifier.fromNamespaceAndPath(e.getKey().getNamespace(),path.substring(6,path.length()-5));
inspect(mc.getModelManager().getItemModel(id),id,0);
models++;
}
if(models<35)throw new IllegalStateException("Incomplete weapons resource pack: "+models);
audio=WeaponsAudioCheck.start(mc);
var address="127.0.0.1:"+System.getProperty("astraweapons.capturePort","26705");
ConnectScreen.startConnecting(mc.gui.screen(),mc,ServerAddress.parseString(address),new ServerData("Isolated weapons capture",address,ServerData.Type.OTHER),false,null);
connecting=true;return;
}
if(mc.gui.screen() instanceof DisconnectedScreen)throw new IllegalStateException("Disconnected during capture");
if(mc.player==null || mc.level==null || mc.gui.overlay()!=null)return;
mc.gui.toastManager().clear();
if(stage>6) {
if(!audio.isDone())return;
long count;
try(var files=Files.list(mc.gameDirectory.toPath().resolve("screenshots"))) {count=files.filter(f->f.getFileName().toString().startsWith("weapons-")).count();}
if(count<21)return;
finish("PASS: "+models+" client item codecs/baked models, "+audio.join()+" original audio samples, 21 hand/area screenshots");return;
}
if(!Files.exists(server.resolve("capture-stage-"+stage+".txt")))return;
++age;
if(age==35||age==55||age==75) {
if(stage==6 && age>40) {
var displays=new com.google.gson.JsonArray();
for(var e:mc.level.entitiesForRendering()) if(e instanceof net.minecraft.world.entity.Display.ItemDisplay d) {
var state=d.itemRenderState();
if(state!=null) {var row=new com.google.gson.JsonObject();row.addProperty("model",String.valueOf(state.itemStack().get(net.minecraft.core.component.DataComponents.ITEM_MODEL)));row.addProperty("position",d.position().toString());row.addProperty("age",d.tickCount);displays.add(row);}
}
Files.writeString(mc.gameDirectory.toPath().resolve("slash-displays-"+age+".json"),displays.toString());
if(displays.isEmpty())throw new IllegalStateException("No textured slash received by client");
}
net.minecraft.client.Screenshot.grab(mc.gameDirectory,"weapons-"+stage+"-"+age+".png",mc.gameRenderer.mainRenderTarget(),1,ignored->{});
}
if(age>=90) { Files.writeString(server.resolve("capture-ack-"+stage+".txt"),"done");stage++;age=0; }
} catch(Throwable error) { error.printStackTrace();finish("FAIL: "+error); }
}
private void finish(String result) {
done=true;
try { Files.writeString(Minecraft.getInstance().gameDirectory.toPath().resolve("weapons-client-result.txt"),result);Files.writeString(server.resolve("capture-finished.txt"),result); }
catch(Exception e){throw new RuntimeException(e);}
Minecraft.getInstance().stop();
}
@SuppressWarnings("unchecked")
private static void inspect(ItemModel baked,Identifier id,int depth) throws Exception {
if(depth>6 || baked instanceof MissingItemModel)throw new IllegalStateException("Missing/nested model "+id);
if(baked instanceof SelectItemModel<?>) {
var field=SelectItemModel.class.getDeclaredField("models");field.setAccessible(true);
var selector=(SelectItemModel.ModelSelector<Object>)field.get(baked);
for(var context:net.minecraft.world.item.ItemDisplayContext.values()) inspect(selector.get(context,null),id,depth+1);
} else if(baked instanceof CuboidItemModelWrapper) {
var field=CuboidItemModelWrapper.class.getDeclaredField("quads");field.setAccessible(true);
var quads=(net.minecraft.client.resources.model.geometry.QuadCollection)field.get(baked);
if(quads.getAll().isEmpty())throw new IllegalStateException("Empty model "+id);
for(var quad:quads.getAll()) if(quad.materialInfo().sprite().contents().name().equals(
net.minecraft.client.renderer.texture.MissingTextureAtlasSprite.getLocation()))throw new IllegalStateException("Missing baked texture "+id);
}
}
}
@@ -0,0 +1,7 @@
modLoader="javafml"
loaderVersion="[11,)"
license="All Rights Reserved"
[[mods]]
modId="astraweapons_client_verify"
version="1.0.0"
displayName="Isolated vanilla weapons renderer"
@@ -0,0 +1,51 @@
package online.astradev.weapons;
import net.neoforged.api.distmarker.Dist;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.loading.FMLPaths;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.server.ServerStoppingEvent;
import net.neoforged.neoforge.event.server.ServerAboutToStartEvent;
import net.neoforged.neoforge.event.tick.ServerTickEvent;
import online.astradev.weapons.behavior.*;
import online.astradev.weapons.resource.*;
import online.astradev.plus.api.*;
@Mod(value="astraweapons", dist=Dist.DEDICATED_SERVER)
public final class AstraWeapons {
private static WeaponsConfig settings = new WeaponsConfig();
public static WeaponsConfig settings() { return settings; }
public AstraWeapons() {
// Constructor precedes datapack discovery: enchantments must exist before registry loading.
try { WeaponsResources.install(FMLPaths.GAMEDIR.get()); }
catch (java.io.IOException e) { throw new IllegalStateException("Cannot install AstraWeapons content", e); }
ItemPresentation.register(TwinbladeCombat.ID, TwinbladeResources::itemModel);
ItemPresentation.register(GauntletCombat.ID, model -> WeaponsResources.gauntletModel(model));
online.astradev.weapons.content.enchantment.TwinbladeEnchantments.registerRules();
MeleeAttackHooks.register(new MeleeAttackHooks.Handler() {
public boolean active(net.minecraft.world.entity.player.Player p) { return TwinbladeCombat.striking(p) || GauntletCombat.striking(p); }
public boolean allowed(net.minecraft.world.entity.player.Player p, net.minecraft.world.entity.Entity t) {
return TwinbladeCombat.striking(p) ? TwinbladeCombat.attackAllowed(p,t) : GauntletCombat.attackAllowed(p,t);
}
public boolean hurt(net.minecraft.world.entity.player.Player p, net.minecraft.world.entity.Entity t, net.minecraft.world.damagesource.DamageSource s, float d) {
return TwinbladeCombat.striking(p) ? TwinbladeCombat.hurt(p,t,s,d) : GauntletCombat.hurt(p,t,s,d);
}
});
NeoForge.EVENT_BUS.register(new TwinbladeCombat());
NeoForge.EVENT_BUS.register(new GauntletCombat());
NeoForge.EVENT_BUS.addListener(EventPriority.HIGHEST, this::start);
NeoForge.EVENT_BUS.addListener(this::tick);
NeoForge.EVENT_BUS.addListener(this::stop);
}
private void start(ServerAboutToStartEvent event) {
try { settings = WeaponsConfig.load(FMLPaths.GAMEDIR.get()); }
catch (java.io.IOException e) { throw new IllegalStateException("Cannot load AstraWeapons settings", e); }
}
private void tick(ServerTickEvent.Post event) {
TwinbladeCombat.tick(); GauntletCombat.tick(event.getServer()); WeaponPresentation.tick(event.getServer()); SlashDisplay.updateAll();
}
private void stop(ServerStoppingEvent event) {
TwinbladeCombat.close(); GauntletCombat.close(); WeaponPresentation.close(event.getServer()); SlashDisplay.close();
}
}
@@ -0,0 +1,39 @@
package online.astradev.weapons;
import java.nio.file.Files;
import java.nio.file.Path;
import online.astradev.plus.config.PlusConfig;
import online.astradev.plus.io.PlusFiles;
public final class WeaponsConfig {
public boolean twinblade = true, twinbladeSounds = true;
public double twinbladeReach = 3;
public int gauntletCooldownTicks = 5, comboResetTicks = 24;
public double gauntletReach = 2.2;
public static WeaponsConfig load(Path root) throws java.io.IOException {
Path path = root.resolve("config/astraweapons.json");
if (!Files.exists(path)) {
var defaults = new WeaponsConfig();
Path legacy = root.resolve("config/astraplus.json");
if (Files.exists(legacy)) {
var json = PlusFiles.readJson(legacy, 1024 * 1024);
if (json.has("gameplay")) {
var g = json.getAsJsonObject("gameplay");
if (g.has("twinblade")) defaults.twinblade = g.get("twinblade").getAsBoolean();
if (g.has("twinbladeSounds")) defaults.twinbladeSounds = g.get("twinbladeSounds").getAsBoolean();
if (g.has("twinbladeReach")) defaults.twinbladeReach = g.get("twinbladeReach").getAsDouble();
}
}
defaults.validate();
PlusFiles.write(path, PlusConfig.JSON.toJson(defaults).getBytes(java.nio.charset.StandardCharsets.UTF_8));
}
var value = PlusConfig.JSON.fromJson(PlusFiles.readJson(path, 65536), WeaponsConfig.class);
value.validate(); return value;
}
private void validate() {
if (!Double.isFinite(twinbladeReach) || twinbladeReach <= 0 || twinbladeReach > 64
|| !Double.isFinite(gauntletReach) || gauntletReach <= 0 || gauntletReach > 3
|| gauntletCooldownTicks < 4 || gauntletCooldownTicks > 20 || comboResetTicks < gauntletCooldownTicks || comboResetTicks > 100)
throw new IllegalArgumentException("Invalid AstraWeapons combat settings");
}
}
@@ -0,0 +1,13 @@
package online.astradev.weapons.behavior;
/** Seven deliberate strikes. A miss consumes a step; a pause or weapon change starts over. */
public final class Combo {
private Combo() {}
public static double multiplier(int step) { return step == 5 ? 1.4 : step == 6 ? 2.0 : 1.0; }
public static boolean left(int step) { return step == 0 || step == 2 || step == 4; }
public static String pose(int step) { return step == 4 ? "hook" : step == 5 ? "uppercut" : step == 6 ? "lunge" : "jab"; }
public static boolean within(double fx, double fz, double dx, double dz) {
double distance = Math.hypot(dx, dz);
return distance < 0.25 || (fx * dx + fz * dz) / distance >= Math.cos(Math.toRadians(28));
}
}
@@ -0,0 +1,133 @@
package online.astradev.weapons.behavior;
import java.util.*;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.*;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.damagesource.*;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.*;
import net.minecraft.world.phys.Vec3;
import net.neoforged.bus.api.*;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.entity.player.*;
import online.astradev.plus.content.PlusContent;
import online.astradev.plus.content.enchantment.CustomEnchantments;
import online.astradev.plus.model.ModelCarrier;
import online.astradev.weapons.AstraWeapons;
import online.astradev.weapons.resource.WeaponPresentation;
public final class GauntletCombat {
public static final String ID = "astraweapons:gauntlets";
private static final ResourceKey<DamageType> DAMAGE = ResourceKey.create(Registries.DAMAGE_TYPE, Identifier.parse("astraweapons:gauntlet"));
private record Chain(ItemStack weapon, long last, int next, int slot, Object dimension) {}
private static final Map<UUID, Chain> CHAINS = new HashMap<>();
private static final Map<UUID, Batch> BATCHES = new HashMap<>();
private static final class Batch {
final Set<Integer> accepted = new HashSet<>();
final int step;
CustomEnchantments.Attack enchantments;
boolean hit;
Batch(int step) { this.step = step; }
}
public static boolean holds(Player p) { return p.getMainHandItem().is(Items.IRON_SWORD) && ID.equals(PlusContent.id(p.getMainHandItem())); }
public static boolean striking(Player p) { return BATCHES.containsKey(p.getUUID()); }
@SubscribeEvent(priority=EventPriority.LOWEST)
public void attack(AttackEntityEvent e) {
if (!e.isCanceled() && e.getEntity() instanceof ServerPlayer p && holds(p) && !striking(p)) {
e.setCanceled(true); strike(p, e.getTarget());
}
}
@SubscribeEvent(priority=EventPriority.LOWEST)
public void sweep(SweepAttackEvent e) { if (holds(e.getEntity())) { e.setSweeping(false); e.setCanceled(true); } }
@SubscribeEvent(priority=EventPriority.HIGHEST)
public void useItem(PlayerInteractEvent.RightClickItem e) {
if (holds(e.getEntity()) && e.getHand() == InteractionHand.OFF_HAND) e.setCanceled(true);
}
@SubscribeEvent(priority=EventPriority.HIGHEST)
public void useBlock(PlayerInteractEvent.RightClickBlock e) {
if (holds(e.getEntity()) && e.getHand() == InteractionHand.OFF_HAND) e.setCanceled(true);
}
@SubscribeEvent(priority=EventPriority.HIGHEST)
public void useEntity(PlayerInteractEvent.EntityInteract e) {
if (holds(e.getEntity()) && e.getHand() == InteractionHand.OFF_HAND) e.setCanceled(true);
}
public static void strike(ServerPlayer p) { strike(p, null); }
private static void strike(ServerPlayer p, Entity primary) {
if (!holds(p) || striking(p) || p.isSpectator() || !p.isAlive() || !WeaponPresentation.reserveOffhand(p)) return;
var config = AstraWeapons.settings();
long now = p.level().getGameTime();
var chain = CHAINS.get(p.getUUID());
if (chain != null && now - chain.last < config.gauntletCooldownTicks) return;
if (p.getAttackStrengthScale(0) < .99f) return;
var weapon = p.getMainHandItem();
int step = chain != null && chain.weapon == weapon && now - chain.last <= config.comboResetTicks
&& chain.slot == p.getInventory().getSelectedSlot() && chain.dimension == p.level() ? chain.next : 0;
CHAINS.put(p.getUUID(), new Chain(weapon,now,(step+1)%7,p.getInventory().getSelectedSlot(),p.level()));
var batch = new Batch(step);
double yaw = Math.toRadians(p.getYRot());
Vec3 forward = new Vec3(-Math.sin(yaw),0,Math.cos(yaw));
double reach = Math.min(config.gauntletReach + (step == 6 ? .35 : 0), p.entityInteractionRange());
var targets = p.level().getEntities(p,p.getBoundingBox().inflate(reach), candidate -> {
if (ModelCarrier.isHidden(candidate)) return false;
Entity owner = ModelCarrier.owner(candidate), target = owner == null ? candidate : owner;
return target instanceof LivingEntity && target != p && target.isAlive() && !target.isSpectator()
&& !(target instanceof net.minecraft.world.entity.decoration.ArmorStand)
&& !p.isAlliedTo(target) && (!(target instanceof Player other) || p.canHarmPlayer(other))
&& candidate.getBoundingBox().distanceToSqr(p.getEyePosition()) <= reach*reach
&& Combo.within(forward.x,forward.z,candidate.getX()-p.getX(),candidate.getZ()-p.getZ())
&& p.hasLineOfSight(candidate);
}).stream().map(e -> { Entity owner = ModelCarrier.owner(e); return owner == null ? e : owner; }).distinct().toList();
BATCHES.put(p.getUUID(),batch);
boolean sprinting = p.isSprinting();
try {
for (var target : targets) {
var e = new AttackEntityEvent(p,target);
if (target != primary) NeoForge.EVENT_BUS.post(e);
if (!e.isCanceled()) batch.accepted.add(target.getId());
}
batch.enchantments = CustomEnchantments.beginAttack(p,weapon,false,batch.accepted.size());
for (var target : targets) {
if (!batch.accepted.contains(target.getId())) continue;
if (weapon.isEmpty() || p.getMainHandItem() != weapon) break;
p.setSprinting(sprinting); p.attack(target);
}
} finally {
BATCHES.remove(p.getUUID()); p.onAttack();
if (batch.enchantments != null) batch.enchantments.finish();
}
WeaponPresentation.animate(p,Combo.pose(step),Combo.left(step),config.gauntletCooldownTicks);
sound(p,step == 6 ? "swing_kick" : step == 5 ? "swing_medium" : "swing_short",.7f);
if (batch.hit) sound(p,step == 6 ? "hit_kick" : step == 5 ? "hit_medium" : "hit_light",.8f);
p.swing(Combo.left(step) ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND,true);
}
public static boolean attackAllowed(Player p,Entity t) { return BATCHES.get(p.getUUID()).accepted.contains(t.getId()); }
public static boolean hurt(Player p,Entity t,DamageSource source,float damage) {
Batch batch = BATCHES.get(p.getUUID());
var ownSource = new DamageSource(p.registryAccess().lookupOrThrow(Registries.DAMAGE_TYPE).getOrThrow(DAMAGE),p);
float amount = (float)(damage * Combo.multiplier(batch.step));
if (batch.enchantments != null) amount = batch.enchantments.modifyDamage(t,amount);
boolean hit = t.hurtOrSimulate(ownSource,amount);
if (hit && t instanceof LivingEntity living) {
batch.hit = true;
if (batch.enchantments != null) batch.enchantments.hit(living);
}
return hit;
}
private static void sound(ServerPlayer p,String name,float volume) {
p.level().playSound(null,p.getX(),p.getY(),p.getZ(),net.minecraft.sounds.SoundEvent.createVariableRangeEvent(
Identifier.parse("astraweapons:gauntlets."+name)),p.getSoundSource(),volume,1f);
}
public static void tick(MinecraftServer server) {
CHAINS.entrySet().removeIf(e -> {
var p = server.getPlayerList().getPlayer(e.getKey());
return p == null || !holds(p) || !p.isAlive() || p.level() != e.getValue().dimension
|| p.getMainHandItem() != e.getValue().weapon || p.getInventory().getSelectedSlot() != e.getValue().slot
|| p.level().getGameTime()-e.getValue().last > AstraWeapons.settings().comboResetTicks;
});
}
public static void close() { CHAINS.clear(); BATCHES.clear(); }
}
@@ -0,0 +1,211 @@
package online.astradev.weapons.behavior;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import net.minecraft.core.registries.Registries;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import net.minecraft.world.item.enchantment.Enchantments;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.core.component.DataComponents;
import net.minecraft.world.entity.item.ItemEntity;
import net.minecraft.world.entity.projectile.Projectile;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.sounds.SoundEvents;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.decoration.ArmorStand;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.phys.Vec3;
import net.neoforged.bus.api.EventPriority;
import net.neoforged.bus.api.SubscribeEvent;
import net.neoforged.neoforge.event.entity.player.AttackEntityEvent;
import net.neoforged.neoforge.event.entity.player.SweepAttackEvent;
import online.astradev.plus.AstraPlus;
import online.astradev.plus.content.enchantment.CustomEnchantments;
import net.neoforged.neoforge.common.NeoForge;
import net.neoforged.neoforge.event.entity.living.LivingKnockBackEvent;
import online.astradev.plus.model.ModelCarrier;
/** One synchronous batch of ordinary sword hits, retaining shields and per-target damage events. */
public final class TwinbladeCombat {
public static final String ID = "astraplus:netherite_twinblade";
private record Pending(ServerPlayer player, net.minecraft.world.item.ItemStack weapon, int slot, Object level, long due, Entity primary) {}
private static final java.util.Map<UUID, Pending> PENDING = new java.util.HashMap<>();
private static final Set<UUID> STRIKING = new HashSet<>();
private static final java.util.Map<UUID, Batch> BATCHES = new java.util.HashMap<>();
private static final class Batch {
final Vec3 direction;
final Set<Integer> accepted = new HashSet<>();
CustomEnchantments.Attack enchantments;
int opponents;
Entity current;
Batch(ServerPlayer player, Vec3 direction) {
this.direction = direction;
}
}
public static boolean striking(Player player) { return STRIKING.contains(player.getUUID()); }
public static boolean holdsTwinblade(Player player) {
if (!online.astradev.weapons.AstraWeapons.settings().twinblade) return false;
var content = AstraPlus.content();
var entry = content == null ? null : content.item(player.getMainHandItem());
return entry != null && ID.equals(entry.definition().id);
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void attack(AttackEntityEvent event) {
if (event.isCanceled() || !(event.getEntity() instanceof ServerPlayer player)
|| player.isSpectator() || striking(player) || !holdsTwinblade(player)) { return; }
if (PENDING.containsKey(player.getUUID())) { event.setCanceled(true); return; }
// Uncharged clicks retain the normal sword's weak single-target attack.
if (player.getAttackStrengthScale(0) < 1) { return; }
event.setCanceled(true);
strike(player, event.getTarget());
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void sweep(SweepAttackEvent event) {
if (holdsTwinblade(event.getEntity())) {
event.setSweeping(false);
event.setCanceled(true);
}
}
public static void strike(ServerPlayer player) {
strike(player, null);
}
private static void strike(ServerPlayer player, Entity primary) {
if (striking(player) || PENDING.containsKey(player.getUUID()) || player.isSpectator() || !holdsTwinblade(player)
|| player.getAttackStrengthScale(0) < 1) return;
PENDING.put(player.getUUID(),new Pending(player,player.getMainHandItem(),player.getInventory().getSelectedSlot(),player.level(),player.level().getGameTime()+2,primary));
online.astradev.weapons.resource.WeaponPresentation.animate(player,"twinblade",false,7);
}
public static void tick() {
for (Pending pending : java.util.List.copyOf(PENDING.values())) {
ServerPlayer p = pending.player;
if (!p.isAlive() || p.isRemoved() || p.level()!=pending.level || p.getMainHandItem()!=pending.weapon
|| p.getInventory().getSelectedSlot()!=pending.slot || !holdsTwinblade(p)) {
PENDING.remove(p.getUUID()); continue;
}
if (p.level().getGameTime()>=pending.due) {
PENDING.remove(p.getUUID()); perform(p,pending.primary);
}
}
}
public static void close() { PENDING.clear();STRIKING.clear();BATCHES.clear(); }
private static void perform(ServerPlayer player, Entity primary) {
if (player.getAttackStrengthScale(0)<1 || player.isSpectator()) return;
var level = player.level();
var weapon = player.getMainHandItem();
// Capture before attacking: the last hit can break the weapon.
boolean fiery = EnchantmentHelper.getItemEnchantmentLevel(
level.registryAccess().lookupOrThrow(Registries.ENCHANTMENT).getOrThrow(Enchantments.FIRE_ASPECT), weapon) > 0;
Vec3 origin = player.position();
double yaw = Math.toRadians(player.getYRot());
Vec3 forward = new Vec3(-Math.sin(yaw), 0, Math.cos(yaw));
double reachBonus = CustomEnchantments.sweepReachBonus(weapon);
double reach = Math.min(online.astradev.weapons.AstraWeapons.settings().twinbladeReach, player.entityInteractionRange()) + reachBonus;
var targets = level.getEntities(player, player.getBoundingBox().inflate(reach), candidate -> {
if (ModelCarrier.isHidden(candidate)) return false;
Entity owner = ModelCarrier.owner(candidate), target = owner == null ? candidate : owner;
return target != player && target.isAlive() && movable(target) && !target.isSpectator()
&& !player.isAlliedTo(target) && !(target instanceof ArmorStand stand && stand.isMarker())
&& (!(target instanceof Player other) || player.canHarmPlayer(other))
&& inFront(forward.x, forward.z, candidate.getX() - origin.x, candidate.getZ() - origin.z)
&& candidate.getBoundingBox().distanceToSqr(player.getEyePosition()) <= reach * reach
&& player.isWithinAttackRange(weapon, candidate.getBoundingBox(), reachBonus) && player.hasLineOfSight(candidate);
}).stream().map(candidate -> { Entity owner = ModelCarrier.owner(candidate); return owner == null ? candidate : owner; }).distinct().toList();
STRIKING.add(player.getUUID());
Batch batch = new Batch(player, forward);
BATCHES.put(player.getUUID(), batch);
boolean sprinting = player.isSprinting();
try {
// Resolve ordinary attack vetoes once before choosing the multi-target bonus.
for (Entity target : targets) {
var attack = new AttackEntityEvent(player, target);
if (target != primary) { NeoForge.EVENT_BUS.post(attack); }
if (!attack.isCanceled()) {
batch.accepted.add(target.getId());
if (target instanceof LivingEntity living && !(living instanceof ArmorStand)
&& canDamage(player, living)) { batch.opponents++; }
}
}
batch.enchantments = CustomEnchantments.beginAttack(player, weapon, true, batch.opponents);
// No delayed callbacks, invulnerability resets, raw damage or vanilla secondary sweep.
for (Entity target : targets) {
if (!batch.accepted.contains(target.getId())) { continue; }
if (weapon.isEmpty() || player.getMainHandItem() != weapon) { break; }
batch.current = target;
if (!(target instanceof LivingEntity) || target instanceof ArmorStand) {
target.push(forward.scale(0.4).add(0, 0.1, 0));
target.hurtMarked = true;
continue;
}
// Vanilla ends sprinting on a hit; do not turn subsequent airborne hits into criticals.
player.setSprinting(sprinting);
player.attack(target);
}
} finally {
STRIKING.remove(player.getUUID());
BATCHES.remove(player.getUUID());
player.onAttack();
if (batch.enchantments != null) { batch.enchantments.finish(); }
}
if (online.astradev.weapons.AstraWeapons.settings().twinbladeSounds) level.playSound(null, player.getX(), player.getY(), player.getZ(),
SoundEvents.PLAYER_ATTACK_SWEEP, player.getSoundSource(), 1, 0.9f);
online.astradev.weapons.resource.SlashDisplay.spawn(player,reach,fiery);
}
static boolean inFront(double forwardX, double forwardZ, double dx, double dz) {
return forwardX * dx + forwardZ * dz >= -1.0e-9;
}
private static boolean movable(Entity entity) {
return entity instanceof LivingEntity || entity.isPushable() || entity instanceof ItemEntity || entity instanceof Projectile;
}
private static boolean canDamage(ServerPlayer player, LivingEntity target) {
var source = player.getMainHandItem().getDamageSource(player);
if (target.isInvulnerableTo(player.level(), source) || target.invulnerableTime > 10) { return false; }
var blocking = target.getItemBlockingWith();
if (blocking == null) { return true; }
var blocks = blocking.get(DataComponents.BLOCKS_ATTACKS);
if (blocks == null) { return true; }
Vec3 view = Vec3.directionFromRotation(0, target.getYHeadRot());
Vec3 toPlayer = player.position().subtract(target.position()).multiply(1, 0, 1).normalize();
double angle = Math.acos(Math.clamp(toPlayer.dot(view), -1, 1));
return blocks.resolveBlockedDamage(source, 1, angle) < 1;
}
public static boolean attackAllowed(Player player, Entity target) {
Batch batch = BATCHES.get(player.getUUID());
return batch == null ? net.neoforged.neoforge.common.CommonHooks.onPlayerAttackTarget(player, target)
: batch.accepted.contains(target.getId());
}
public static boolean hurt(Player player, Entity target, DamageSource source, float damage) {
Batch batch = BATCHES.get(player.getUUID());
boolean current = batch != null && batch.current == target;
CustomEnchantments.Attack enchants = current ? batch.enchantments
: player instanceof ServerPlayer serverPlayer ? CustomEnchantments.beginAttack(serverPlayer, player.getMainHandItem(), false, 1) : null;
if (enchants != null) { damage = enchants.modifyDamage(target, damage); }
boolean hit = target.hurtOrSimulate(source, damage);
if (enchants != null && hit && target instanceof LivingEntity living) { enchants.hit(living); }
if (!current && enchants != null) { CustomEnchantments.completeAfterChargeReset(enchants); }
return hit;
}
@SubscribeEvent(priority = EventPriority.LOWEST)
public void knockback(LivingKnockBackEvent event) {
if (event.isCanceled()) { return; }
for (Batch batch : BATCHES.values()) {
if (batch.current == event.getEntity()) {
event.setRatioX(-batch.direction.x); event.setRatioZ(-batch.direction.z); return;
}
}
}
}
@@ -0,0 +1,50 @@
package online.astradev.weapons.content;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.List;
import online.astradev.plus.io.PlusFiles;
/** Adds the standalone weapon to existing installations without replacing user content. */
public final class TwinbladeContent {
private TwinbladeContent() {}
public static void install(Path root) throws IOException {
for (String relative : List.of(
"contents/astraplus/items/netherite_twinblade.json",
"resources/assets/astraplus/models/item/netherite_twinblade.json",
"resources/assets/astraplus/textures/item/netherite_twinblade.png")) {
Path target = root.resolve("astraplus").resolve(relative);
PlusFiles.rejectLinks(target);
if (Files.exists(target)) {
if (relative.equals("resources/assets/astraplus/models/item/netherite_twinblade.json")) { fixInventoryScale(root, target); }
continue;
}
try (var input = TwinbladeContent.class.getResourceAsStream("/defaults/" + relative)) {
if (input == null) { throw new IOException("Missing twinblade resource: " + relative); }
Files.createDirectories(target.getParent());
Files.copy(input, target);
}
}
}
private static void fixInventoryScale(Path root, Path target) throws IOException {
var model = PlusFiles.readJson(target, 1024 * 1024);
if (!model.has("display") || !model.getAsJsonObject("display").has("gui")) { return; }
var gui = model.getAsJsonObject("display").getAsJsonObject("gui");
if (!gui.has("scale")) { return; }
var scale = gui.getAsJsonArray("scale");
if (scale.size() != 3 || scale.get(2).getAsDouble() != 1) { return; }
double previous = scale.get(0).getAsDouble();
if ((previous != 1 && previous != 4) || scale.get(1).getAsDouble() != previous) { return; }
for (String field : List.of("translation", "rotation")) {
if (gui.has(field) && gui.getAsJsonArray(field).asList().stream().anyMatch(value -> value.getAsDouble() != 0)) { return; }
}
Path backup = root.resolve("astraplus/backups/twinblade-model-" + java.util.UUID.randomUUID() + ".json");
PlusFiles.rejectLinks(backup); Files.createDirectories(backup.getParent()); Files.copy(target, backup);
gui.add("scale", com.google.gson.JsonParser.parseString("[1.5,1.5,1]"));
gui.add("translation", com.google.gson.JsonParser.parseString("[1.9,1.9,0]"));
PlusFiles.write(target, online.astradev.plus.config.PlusConfig.JSON.toJson(model).getBytes(java.nio.charset.StandardCharsets.UTF_8));
}
}
@@ -0,0 +1,30 @@
package online.astradev.weapons.content.enchantment;
import online.astradev.plus.content.enchantment.EnchantmentRules;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.Identifier;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.enchantment.EnchantmentHelper;
import online.astradev.weapons.behavior.TwinbladeCombat;
import online.astradev.plus.content.PlusContent;
public final class TwinbladeEnchantments {
private TwinbladeEnchantments() {}
public static void registerRules() {
EnchantmentRules.restrict("minecraft:sweeping_edge", stack -> !isTwinblade(stack));
}
public static boolean isTwinblade(ItemStack stack) {
return stack.is(Items.NETHERITE_SWORD) && TwinbladeCombat.ID.equals(PlusContent.id(stack));
}
public static int level(ServerPlayer player, String name) {
if (!isTwinblade(player.getMainHandItem())) { return 0; }
var enchantment = player.registryAccess().lookupOrThrow(Registries.ENCHANTMENT).get(Identifier.fromNamespaceAndPath("astraplus", name));
return enchantment.map(value -> Math.min(value.value().getMaxLevel(), EnchantmentHelper.getItemEnchantmentLevel(value, player.getMainHandItem()))).orElse(0);
}
}
@@ -0,0 +1,13 @@
package online.astradev.weapons.mixin;
import net.minecraft.world.entity.Display;
import net.minecraft.util.Brightness;
import com.mojang.math.Transformation;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
@Mixin(Display.class)
public interface DisplayAccess {
@Invoker("setTransformation") void astraweapons$transform(Transformation value);
@Invoker("setBrightnessOverride") void astraweapons$brightness(Brightness value);
}
@@ -0,0 +1,35 @@
package online.astradev.weapons.mixin;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.network.protocol.game.*;
import net.minecraft.world.inventory.ContainerInput;
import org.spongepowered.asm.mixin.*;
import org.spongepowered.asm.mixin.injection.*;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import online.astradev.weapons.behavior.GauntletCombat;
import online.astradev.weapons.resource.WeaponPresentation;
@Mixin(ServerGamePacketListenerImpl.class)
public abstract class GauntletInventoryMixin {
@Shadow public ServerPlayer player;
// Each injection occurs AFTER vanilla's packet thread validation.
@Inject(method="handleContainerClick",at=@At(value="INVOKE",target="Lnet/minecraft/server/level/ServerPlayer;resetLastActionTime()V"),cancellable=true)
private void astraweapons$slot(ServerboundContainerClickPacket p,CallbackInfo ci) {
if(GauntletCombat.holds(player) && (p.containerId()==0 && p.slotNum()==45 || p.containerInput()==ContainerInput.SWAP && p.buttonNum()==40)) {
player.containerMenu.sendAllDataToRemote(); WeaponPresentation.sync(player); ci.cancel();
}
}
@Inject(method="handlePlayerAction",at=@At(value="INVOKE",target="Lnet/minecraft/server/level/ServerPlayer;resetLastActionTime()V"),cancellable=true)
private void astraweapons$swap(ServerboundPlayerActionPacket p,CallbackInfo ci) {
if(GauntletCombat.holds(player) && p.getAction()==ServerboundPlayerActionPacket.Action.SWAP_ITEM_WITH_OFFHAND) {
WeaponPresentation.sync(player); ci.cancel();
}
}
@Inject(method="handleSetCreativeModeSlot",at=@At(value="INVOKE",target="Lnet/minecraft/server/level/ServerPlayer;hasInfiniteMaterials()Z"),cancellable=true)
private void astraweapons$creative(ServerboundSetCreativeModeSlotPacket p,CallbackInfo ci) {
if(WeaponPresentation.ghost(p.itemStack()) || GauntletCombat.holds(player) && p.slotNum()==45) {
player.inventoryMenu.sendAllDataToRemote(); WeaponPresentation.sync(player); ci.cancel();
}
}
}
@@ -0,0 +1,31 @@
package online.astradev.weapons.mixin;
import net.minecraft.network.protocol.game.ServerboundSwingPacket;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.phys.HitResult;
import online.astradev.weapons.behavior.TwinbladeCombat;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
/** Vanilla clients send no server-side left-click-air event; the swing packet is the available hook. */
@Mixin(ServerGamePacketListenerImpl.class)
public abstract class TwinbladeSwingMixin {
@Shadow public ServerPlayer player;
@Inject(method = "handleAnimate", at = @At(value = "INVOKE",
target = "Lnet/minecraft/server/level/ServerPlayer;swing(Lnet/minecraft/world/InteractionHand;)V"))
private void astraplus$airSwing(ServerboundSwingPacket packet, CallbackInfo ci) {
if (packet.getHand() != InteractionHand.MAIN_HAND || player.isSpectator()
|| (!TwinbladeCombat.holdsTwinblade(player) && !online.astradev.weapons.behavior.GauntletCombat.holds(player))) { return; }
// Mining/interacting with a block is not an air attack. Entity-hit packets already consume charge.
if (player.pick(player.blockInteractionRange(), 1, false).getType() == HitResult.Type.BLOCK) { return; }
// Run after packet thread validation, but before vanilla swing resets the attack charge.
if (online.astradev.weapons.behavior.GauntletCombat.holds(player)) online.astradev.weapons.behavior.GauntletCombat.strike(player);
else TwinbladeCombat.strike(player);
}
}
@@ -0,0 +1,18 @@
package online.astradev.weapons.mixin;
import net.minecraft.server.network.ServerCommonPacketListenerImpl;
import net.minecraft.server.network.ServerGamePacketListenerImpl;
import net.minecraft.network.protocol.Packet;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.*;
import online.astradev.weapons.resource.WeaponPresentation;
@Mixin(ServerCommonPacketListenerImpl.class)
public abstract class WeaponPacketsMixin {
@ModifyVariable(method="send(Lnet/minecraft/network/protocol/Packet;Lio/netty/channel/ChannelFutureListener;)V",at=@At("HEAD"),argsOnly=true)
private Packet<?> astraweapons$hands(Packet<?> packet) {
if ((Object)this instanceof ServerGamePacketListenerImpl listener && listener.player.level().getServer().isSameThread())
return WeaponPresentation.project(listener.player,packet);
return packet;
}
}
@@ -0,0 +1,17 @@
package online.astradev.weapons.mixin;
import net.minecraft.server.level.ServerPlayer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import online.astradev.weapons.behavior.GauntletCombat;
import online.astradev.weapons.behavior.TwinbladeCombat;
/** Charge belongs to accepted custom strikes, not rejected/duplicate animation packets. */
@Mixin(ServerPlayer.class)
public abstract class WeaponSwingChargeMixin {
@Redirect(method="swing(Lnet/minecraft/world/InteractionHand;)V",at=@At(value="INVOKE",target="Lnet/minecraft/server/level/ServerPlayer;resetAttackStrengthTicker()V"))
private void astraweapons$charge(ServerPlayer player) {
if(!GauntletCombat.holds(player) && !TwinbladeCombat.holdsTwinblade(player)) player.resetAttackStrengthTicker();
}
}
@@ -0,0 +1,46 @@
package online.astradev.weapons.resource;
import java.util.*;
import net.minecraft.core.component.DataComponents;
import net.minecraft.resources.Identifier;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.entity.*;
import net.minecraft.world.item.*;
import net.minecraft.world.level.storage.ValueOutput;
import com.mojang.math.Transformation;
import org.joml.*;
/** A two-sided textured crescent in the actual hit sector; never a particle cloud. */
public final class SlashDisplay extends Display.ItemDisplay {
private static final List<SlashDisplay> ACTIVE = new ArrayList<>();
private final long expires;
private final ServerPlayer owner;
private SlashDisplay(ServerPlayer p,double reach,boolean fiery) {
super(EntityTypes.ITEM_DISPLAY,p.level()); owner=p; expires=p.level().getGameTime()+5;
setNoGravity(true);setInvulnerable(true);
setPos(p.getX(),p.getY()+1,p.getZ());
// Vanilla ItemDisplayRenderer adds a 180-degree item rotation; compensate so +Z is the hit sector.
setYRot(p.getYRot()+180);
var item=new ItemStack(Items.PAPER);
item.set(DataComponents.ITEM_MODEL,Identifier.parse("astraweapons:slash"+(fiery?"_fire":"")));
getSlot(0).set(item);
((online.astradev.weapons.mixin.DisplayAccess)(Object)this).astraweapons$transform(new Transformation(new Vector3f(),new Quaternionf(),new Vector3f((float)reach*2),new Quaternionf()));
((online.astradev.weapons.mixin.DisplayAccess)(Object)this).astraweapons$brightness(new net.minecraft.util.Brightness(15,15));
addTag("astraweapons:slash");
}
public static void spawn(ServerPlayer player,double reach,boolean fiery) {
var display=new SlashDisplay(player,reach,fiery);
if(player.level().addFreshEntity(display)) ACTIVE.add(display);
}
public static void updateAll() {
ACTIVE.removeIf(display -> {
if(display.isRemoved() || !display.owner.isAlive() || display.owner.level()!=display.level() || display.level().getGameTime()>=display.expires) {
display.discard();return true;
}
return false;
});
}
public static void close() { ACTIVE.forEach(Entity::discard);ACTIVE.clear(); }
@Override public boolean shouldBeSaved() { return false; }
@Override public boolean saveAsPassenger(ValueOutput output) { return false; }
}
@@ -0,0 +1,38 @@
package online.astradev.weapons.resource;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.TreeMap;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
/** GUI presentation of the supplied twinblade texture, without status overlays. */
public final class TwinbladeResources {
private TwinbladeResources() {}
public static Map<String, byte[]> generate() {
Map<String, byte[]> files = new TreeMap<>();
// Reuse the supplied texture, cropping only its transparent border via UV coordinates.
files.put("assets/astraplus/models/internal/twinblade_gui.json", bytes("""
{"parent":"astraplus:item/netherite_twinblade","gui_light":"front",
"display":{"gui":{"rotation":[0,0,0],"translation":[0,0,0],"scale":[1,1,1]}},
"elements":[{"from":[1,1.736842,8],"to":[15,14.263158,8],"shade":false,
"faces":{"south":{"uv":[2,5,11.5,13.5],"texture":"#layer0"}}}]}
"""));
return files;
}
public static JsonObject itemModel(String modelId) {
JsonObject base = model(modelId.equals("astraplus:item/netherite_twinblade") ? "astraplus:internal/twinblade_gui" : modelId);
JsonObject select = new JsonObject(); select.addProperty("type", "minecraft:select");
select.addProperty("property", "minecraft:display_context"); select.add("fallback", model(modelId));
JsonObject gui = new JsonObject(); gui.addProperty("when", "gui"); gui.add("model", base);
JsonArray cases = new JsonArray(); cases.add(gui); select.add("cases", cases);
return select;
}
private static JsonObject model(String id) {
JsonObject value = new JsonObject(); value.addProperty("type", "minecraft:model"); value.addProperty("model", id); return value;
}
private static byte[] bytes(String text) { return text.getBytes(StandardCharsets.UTF_8); }
}
@@ -0,0 +1,138 @@
package online.astradev.weapons.resource;
import java.util.*;
import com.mojang.datafixers.util.Pair;
import net.minecraft.core.component.DataComponents;
import net.minecraft.network.protocol.Packet;
import net.minecraft.network.protocol.game.*;
import net.minecraft.resources.Identifier;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.item.*;
import online.astradev.weapons.behavior.GauntletCombat;
import online.astradev.weapons.behavior.TwinbladeCombat;
/** Packet-only hand models: no ghost stack is ever inserted, saved, consumed or dropped. */
public final class WeaponPresentation {
private record Animation(ItemStack weapon, String pose, boolean left, long start, int ticks, Object level) {}
private static final Map<UUID,Animation> ANIMATIONS = new HashMap<>();
private static final Set<UUID> WEARING = new HashSet<>();
private static final Identifier GHOST = Identifier.parse("astraweapons:gauntlet_offhand");
private WeaponPresentation() {}
public static boolean reserveOffhand(ServerPlayer p) {
if (!GauntletCombat.holds(p)) return false;
ItemStack off = p.getOffhandItem();
if (off.isEmpty()) return true;
int free = p.getInventory().getFreeSlot();
if (free < 0) {
// Preserve both stacks even with a full inventory. The player must make room first.
if (GauntletCombat.ID.equals(online.astradev.plus.content.PlusContent.id(off))) {
if (p.tickCount % 20 == 0) p.sendSystemMessage(net.minecraft.network.chat.Component.literal("Для боевых перчаток освободите один слот инвентаря."),true);
return false;
}
p.setItemInHand(InteractionHand.OFF_HAND,p.getMainHandItem());
p.setItemInHand(InteractionHand.MAIN_HAND,off);
p.sendSystemMessage(net.minecraft.network.chat.Component.literal("Для боевых перчаток освободите один слот инвентаря."),true);
sync(p); return false;
}
p.stopUsingItem();
p.getInventory().setItem(free,off);
p.setItemInHand(InteractionHand.OFF_HAND,ItemStack.EMPTY);
p.inventoryMenu.broadcastChanges();
return true;
}
public static void animate(ServerPlayer p,String pose,boolean left,int ticks) {
ANIMATIONS.put(p.getUUID(),new Animation(p.getMainHandItem(),pose,left,p.level().getGameTime(),ticks,p.level())); sync(p);
}
private static ItemStack visual(ServerPlayer p,ItemStack original,boolean offhand) {
boolean gloves = GauntletCombat.holds(p) && p.getOffhandItem().isEmpty() && !p.isSpectator() && p.isAlive();
var animation = ANIMATIONS.get(p.getUUID());
boolean animating = animation != null && animation.weapon == p.getMainHandItem() && animation.level == p.level();
if (offhand) {
if (!gloves) return original;
var ghost = new ItemStack(Items.PAPER);
ghost.set(DataComponents.ITEM_NAME,net.minecraft.network.chat.Component.literal("Левая боевая перчатка"));
ghost.set(DataComponents.ITEM_MODEL,animating && animation.left ? frame(p,animation) : GHOST);
return ghost;
}
if (animating && (!gloves || !animation.left)) {
var copy = original.copy(); copy.set(DataComponents.ITEM_MODEL,frame(p,animation)); return copy;
}
return original;
}
private static Identifier frame(ServerPlayer p,Animation animation) {
int elapsed = (int)(p.level().getGameTime()-animation.start);
int frame = Math.clamp(elapsed*6/Math.max(1,animation.ticks),0,5);
return Identifier.parse("astraweapons:animation/"+animation.pose+"_"+frame);
}
/** Used only by the outgoing packet mixin on the server thread. */
public static Packet<?> project(ServerPlayer viewer,Packet<?> packet) {
if (packet instanceof ClientboundBundlePacket bundle) {
var packets = new ArrayList<Packet<? super ClientGamePacketListener>>();
for (var nested : bundle.subPackets()) {
@SuppressWarnings("unchecked") var projected = (Packet<? super ClientGamePacketListener>)project(viewer,nested);
packets.add(projected);
}
return new ClientboundBundlePacket(packets);
}
if (packet instanceof ClientboundSetEquipmentPacket e && viewer.level().getEntity(e.getEntity()) instanceof ServerPlayer owner) {
var slots = new ArrayList<Pair<EquipmentSlot,ItemStack>>();
boolean hasOffhand=false;
for (var slot:e.getSlots()) {
if(slot.getFirst()==EquipmentSlot.OFFHAND) hasOffhand=true;
var stack = slot.getFirst()==EquipmentSlot.MAINHAND ? visual(owner,slot.getSecond(),false)
: slot.getFirst()==EquipmentSlot.OFFHAND ? visual(owner,slot.getSecond(),true) : slot.getSecond();
slots.add(Pair.of(slot.getFirst(),stack));
}
if (!hasOffhand && GauntletCombat.holds(owner)) slots.add(Pair.of(EquipmentSlot.OFFHAND,visual(owner,owner.getOffhandItem(),true)));
return new ClientboundSetEquipmentPacket(e.getEntity(),slots);
}
if (packet instanceof ClientboundSetPlayerInventoryPacket p) {
if (p.slot()==40) return new ClientboundSetPlayerInventoryPacket(40,visual(viewer,p.contents(),true));
if (p.slot()==viewer.getInventory().getSelectedSlot()) return new ClientboundSetPlayerInventoryPacket(p.slot(),visual(viewer,p.contents(),false));
}
if (packet instanceof ClientboundContainerSetSlotPacket p && p.getContainerId()==0) {
if (p.getSlot()==45 || p.getSlot()==36+viewer.getInventory().getSelectedSlot())
return new ClientboundContainerSetSlotPacket(0,p.getStateId(),p.getSlot(),visual(viewer,p.getItem(),p.getSlot()==45));
}
if (packet instanceof ClientboundContainerSetContentPacket p && p.containerId()==0 && p.items().size()>45) {
var items = new ArrayList<>(p.items());
items.set(45,visual(viewer,items.get(45),true));
int main = 36+viewer.getInventory().getSelectedSlot(); items.set(main,visual(viewer,items.get(main),false));
return new ClientboundContainerSetContentPacket(p.containerId(),p.stateId(),items,p.carriedItem());
}
return packet;
}
public static boolean ghost(ItemStack stack) {
var id=stack.get(DataComponents.ITEM_MODEL);
return id!=null && (id.equals(GHOST) || id.getNamespace().equals("astraweapons") && id.getPath().startsWith("animation/"));
}
public static void sync(ServerPlayer p) {
if (p.connection==null) return;
p.connection.send(new ClientboundSetPlayerInventoryPacket(40,p.getOffhandItem()));
p.connection.send(new ClientboundSetPlayerInventoryPacket(p.getInventory().getSelectedSlot(),p.getMainHandItem()));
p.level().getChunkSource().sendToTrackingPlayers(p,new ClientboundSetEquipmentPacket(p.getId(),List.of(
Pair.of(EquipmentSlot.MAINHAND,p.getMainHandItem()),Pair.of(EquipmentSlot.OFFHAND,p.getOffhandItem()))));
}
public static void tick(MinecraftServer server) {
var online=new HashSet<UUID>();
for(var p:server.getPlayerList().getPlayers()) {
online.add(p.getUUID());
boolean wearing=GauntletCombat.holds(p) && p.isAlive() && !p.isSpectator() && reserveOffhand(p);
boolean changed=wearing ? WEARING.add(p.getUUID()) : WEARING.remove(p.getUUID());
var animation=ANIMATIONS.get(p.getUUID());
if(animation!=null) {
if(!p.isAlive() || p.level()!=animation.level || p.getMainHandItem()!=animation.weapon || p.level().getGameTime()-animation.start>=animation.ticks)
ANIMATIONS.remove(p.getUUID());
sync(p);
} else if(changed) sync(p);
}
WEARING.retainAll(online); ANIMATIONS.keySet().retainAll(online);
}
public static void close(MinecraftServer server) {
ANIMATIONS.clear(); WEARING.clear();
// Projection naturally ends when the connection closes; no stored items need restoration.
}
}
@@ -0,0 +1,40 @@
package online.astradev.weapons.resource;
import java.io.*;
import java.nio.file.*;
import java.nio.charset.StandardCharsets;
import com.google.gson.*;
import online.astradev.plus.io.PlusFiles;
/** Seeds missing addon files before registry/pack loading; preserves user-edited definitions and assets. */
public final class WeaponsResources {
private WeaponsResources() {}
public static void install(Path root) throws IOException {
online.astradev.weapons.content.TwinbladeContent.install(root);
try(var input=WeaponsResources.class.getResourceAsStream("/weapons-index.txt")) {
if(input==null) throw new IOException("Missing weapons resource index");
for(String relative:new String(input.readAllBytes(),StandardCharsets.UTF_8).lines().filter(s->!s.isBlank()).toList()) {
Path target=root.resolve("astraplus").resolve(relative).normalize();
if(!target.startsWith(root.resolve("astraplus").normalize())) throw new IOException("Invalid resource path");
PlusFiles.rejectLinks(target);
if(Files.exists(target)) continue;
try(var resource=WeaponsResources.class.getResourceAsStream("/defaults/"+relative)) {
if(resource==null) throw new IOException("Missing weapons resource: "+relative);
Files.createDirectories(target.getParent());Files.copy(resource,target);
}
}
}
for(var resource:TwinbladeResources.generate().entrySet()) {
Path target=root.resolve("astraplus/resources").resolve(resource.getKey());
PlusFiles.rejectLinks(target);
if(!Files.exists(target)) PlusFiles.write(target,resource.getValue());
}
}
public static JsonObject gauntletModel(String model) {
return JsonParser.parseString("""
{"type":"minecraft:select","property":"minecraft:display_context",
"cases":[{"when":["gui","ground","fixed"],"model":{"type":"minecraft:model","model":"astraweapons:item/iron_gauntlet_2d"}}],
"fallback":{"type":"minecraft:model","model":"PLACEHOLDER"}}
""".replace("PLACEHOLDER",model)).getAsJsonObject();
}
}
+407
View File
@@ -0,0 +1,407 @@
Attribution-NonCommercial 4.0 International
=======================================================================
Creative Commons Corporation ("Creative Commons") is not a law firm and
does not provide legal services or legal advice. Distribution of
Creative Commons public licenses does not create a lawyer-client or
other relationship. Creative Commons makes its licenses and related
information available on an "as-is" basis. Creative Commons gives no
warranties regarding its licenses, any material licensed under their
terms and conditions, or any related information. Creative Commons
disclaims all liability for damages resulting from their use to the
fullest extent possible.
Using Creative Commons Public Licenses
Creative Commons public licenses provide a standard set of terms and
conditions that creators and other rights holders may use to share
original works of authorship and other material subject to copyright
and certain other rights specified in the public license below. The
following considerations are for informational purposes only, are not
exhaustive, and do not form part of our licenses.
Considerations for licensors: Our public licenses are
intended for use by those authorized to give the public
permission to use material in ways otherwise restricted by
copyright and certain other rights. Our licenses are
irrevocable. Licensors should read and understand the terms
and conditions of the license they choose before applying it.
Licensors should also secure all rights necessary before
applying our licenses so that the public can reuse the
material as expected. Licensors should clearly mark any
material not subject to the license. This includes other CC-
licensed material, or material used under an exception or
limitation to copyright. More considerations for licensors:
wiki.creativecommons.org/Considerations_for_licensors
Considerations for the public: By using one of our public
licenses, a licensor grants the public permission to use the
licensed material under specified terms and conditions. If
the licensor's permission is not necessary for any reason--for
example, because of any applicable exception or limitation to
copyright--then that use is not regulated by the license. Our
licenses grant only permissions under copyright and certain
other rights that a licensor has authority to grant. Use of
the licensed material may still be restricted for other
reasons, including because others have copyright or other
rights in the material. A licensor may make special requests,
such as asking that all changes be marked or described.
Although not required by our licenses, you are encouraged to
respect those requests where reasonable. More considerations
for the public:
wiki.creativecommons.org/Considerations_for_licensees
=======================================================================
Creative Commons Attribution-NonCommercial 4.0 International Public
License
By exercising the Licensed Rights (defined below), You accept and agree
to be bound by the terms and conditions of this Creative Commons
Attribution-NonCommercial 4.0 International Public License ("Public
License"). To the extent this Public License may be interpreted as a
contract, You are granted the Licensed Rights in consideration of Your
acceptance of these terms and conditions, and the Licensor grants You
such rights in consideration of benefits the Licensor receives from
making the Licensed Material available under these terms and
conditions.
Section 1 -- Definitions.
a. Adapted Material means material subject to Copyright and Similar
Rights that is derived from or based upon the Licensed Material
and in which the Licensed Material is translated, altered,
arranged, transformed, or otherwise modified in a manner requiring
permission under the Copyright and Similar Rights held by the
Licensor. For purposes of this Public License, where the Licensed
Material is a musical work, performance, or sound recording,
Adapted Material is always produced where the Licensed Material is
synched in timed relation with a moving image.
b. Adapter's License means the license You apply to Your Copyright
and Similar Rights in Your contributions to Adapted Material in
accordance with the terms and conditions of this Public License.
c. Copyright and Similar Rights means copyright and/or similar rights
closely related to copyright including, without limitation,
performance, broadcast, sound recording, and Sui Generis Database
Rights, without regard to how the rights are labeled or
categorized. For purposes of this Public License, the rights
specified in Section 2(b)(1)-(2) are not Copyright and Similar
Rights.
d. Effective Technological Measures means those measures that, in the
absence of proper authority, may not be circumvented under laws
fulfilling obligations under Article 11 of the WIPO Copyright
Treaty adopted on December 20, 1996, and/or similar international
agreements.
e. Exceptions and Limitations means fair use, fair dealing, and/or
any other exception or limitation to Copyright and Similar Rights
that applies to Your use of the Licensed Material.
f. Licensed Material means the artistic or literary work, database,
or other material to which the Licensor applied this Public
License.
g. Licensed Rights means the rights granted to You subject to the
terms and conditions of this Public License, which are limited to
all Copyright and Similar Rights that apply to Your use of the
Licensed Material and that the Licensor has authority to license.
h. Licensor means the individual(s) or entity(ies) granting rights
under this Public License.
i. NonCommercial means not primarily intended for or directed towards
commercial advantage or monetary compensation. For purposes of
this Public License, the exchange of the Licensed Material for
other material subject to Copyright and Similar Rights by digital
file-sharing or similar means is NonCommercial provided there is
no payment of monetary compensation in connection with the
exchange.
j. Share means to provide material to the public by any means or
process that requires permission under the Licensed Rights, such
as reproduction, public display, public performance, distribution,
dissemination, communication, or importation, and to make material
available to the public including in ways that members of the
public may access the material from a place and at a time
individually chosen by them.
k. Sui Generis Database Rights means rights other than copyright
resulting from Directive 96/9/EC of the European Parliament and of
the Council of 11 March 1996 on the legal protection of databases,
as amended and/or succeeded, as well as other essentially
equivalent rights anywhere in the world.
l. You means the individual or entity exercising the Licensed Rights
under this Public License. Your has a corresponding meaning.
Section 2 -- Scope.
a. License grant.
1. Subject to the terms and conditions of this Public License,
the Licensor hereby grants You a worldwide, royalty-free,
non-sublicensable, non-exclusive, irrevocable license to
exercise the Licensed Rights in the Licensed Material to:
a. reproduce and Share the Licensed Material, in whole or
in part, for NonCommercial purposes only; and
b. produce, reproduce, and Share Adapted Material for
NonCommercial purposes only.
2. Exceptions and Limitations. For the avoidance of doubt, where
Exceptions and Limitations apply to Your use, this Public
License does not apply, and You do not need to comply with
its terms and conditions.
3. Term. The term of this Public License is specified in Section
6(a).
4. Media and formats; technical modifications allowed. The
Licensor authorizes You to exercise the Licensed Rights in
all media and formats whether now known or hereafter created,
and to make technical modifications necessary to do so. The
Licensor waives and/or agrees not to assert any right or
authority to forbid You from making technical modifications
necessary to exercise the Licensed Rights, including
technical modifications necessary to circumvent Effective
Technological Measures. For purposes of this Public License,
simply making modifications authorized by this Section 2(a)
(4) never produces Adapted Material.
5. Downstream recipients.
a. Offer from the Licensor -- Licensed Material. Every
recipient of the Licensed Material automatically
receives an offer from the Licensor to exercise the
Licensed Rights under the terms and conditions of this
Public License.
b. No downstream restrictions. You may not offer or impose
any additional or different terms or conditions on, or
apply any Effective Technological Measures to, the
Licensed Material if doing so restricts exercise of the
Licensed Rights by any recipient of the Licensed
Material.
6. No endorsement. Nothing in this Public License constitutes or
may be construed as permission to assert or imply that You
are, or that Your use of the Licensed Material is, connected
with, or sponsored, endorsed, or granted official status by,
the Licensor or others designated to receive attribution as
provided in Section 3(a)(1)(A)(i).
b. Other rights.
1. Moral rights, such as the right of integrity, are not
licensed under this Public License, nor are publicity,
privacy, and/or other similar personality rights; however, to
the extent possible, the Licensor waives and/or agrees not to
assert any such rights held by the Licensor to the limited
extent necessary to allow You to exercise the Licensed
Rights, but not otherwise.
2. Patent and trademark rights are not licensed under this
Public License.
3. To the extent possible, the Licensor waives any right to
collect royalties from You for the exercise of the Licensed
Rights, whether directly or through a collecting society
under any voluntary or waivable statutory or compulsory
licensing scheme. In all other cases the Licensor expressly
reserves any right to collect such royalties, including when
the Licensed Material is used other than for NonCommercial
purposes.
Section 3 -- License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the
following conditions.
a. Attribution.
1. If You Share the Licensed Material (including in modified
form), You must:
a. retain the following if it is supplied by the Licensor
with the Licensed Material:
i. identification of the creator(s) of the Licensed
Material and any others designated to receive
attribution, in any reasonable manner requested by
the Licensor (including by pseudonym if
designated);
ii. a copyright notice;
iii. a notice that refers to this Public License;
iv. a notice that refers to the disclaimer of
warranties;
v. a URI or hyperlink to the Licensed Material to the
extent reasonably practicable;
b. indicate if You modified the Licensed Material and
retain an indication of any previous modifications; and
c. indicate the Licensed Material is licensed under this
Public License, and include the text of, or the URI or
hyperlink to, this Public License.
2. You may satisfy the conditions in Section 3(a)(1) in any
reasonable manner based on the medium, means, and context in
which You Share the Licensed Material. For example, it may be
reasonable to satisfy the conditions by providing a URI or
hyperlink to a resource that includes the required
information.
3. If requested by the Licensor, You must remove any of the
information required by Section 3(a)(1)(A) to the extent
reasonably practicable.
4. If You Share Adapted Material You produce, the Adapter's
License You apply must not prevent recipients of the Adapted
Material from complying with this Public License.
Section 4 -- Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that
apply to Your use of the Licensed Material:
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
to extract, reuse, reproduce, and Share all or a substantial
portion of the contents of the database for NonCommercial purposes
only;
b. if You include all or a substantial portion of the database
contents in a database in which You have Sui Generis Database
Rights, then the database in which You have Sui Generis Database
Rights (but not its individual contents) is Adapted Material; and
c. You must comply with the conditions in Section 3(a) if You Share
all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not
replace Your obligations under this Public License where the Licensed
Rights include other Copyright and Similar Rights.
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
c. The disclaimer of warranties and limitation of liability provided
above shall be interpreted in a manner that, to the extent
possible, most closely approximates an absolute disclaimer and
waiver of all liability.
Section 6 -- Term and Termination.
a. This Public License applies for the term of the Copyright and
Similar Rights licensed here. However, if You fail to comply with
this Public License, then Your rights under this Public License
terminate automatically.
b. Where Your right to use the Licensed Material has terminated under
Section 6(a), it reinstates:
1. automatically as of the date the violation is cured, provided
it is cured within 30 days of Your discovery of the
violation; or
2. upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any
right the Licensor may have to seek remedies for Your violations
of this Public License.
c. For the avoidance of doubt, the Licensor may also offer the
Licensed Material under separate terms or conditions or stop
distributing the Licensed Material at any time; however, doing so
will not terminate this Public License.
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
License.
Section 7 -- Other Terms and Conditions.
a. The Licensor shall not be bound by any additional or different
terms or conditions communicated by You unless expressly agreed.
b. Any arrangements, understandings, or agreements regarding the
Licensed Material not stated herein are separate from and
independent of the terms and conditions of this Public License.
Section 8 -- Interpretation.
a. For the avoidance of doubt, this Public License does not, and
shall not be interpreted to, reduce, limit, restrict, or impose
conditions on any use of the Licensed Material that could lawfully
be made without permission under this Public License.
b. To the extent possible, if any provision of this Public License is
deemed unenforceable, it shall be automatically reformed to the
minimum extent necessary to make it enforceable. If the provision
cannot be reformed, it shall be severed from this Public License
without affecting the enforceability of the remaining terms and
conditions.
c. No term or condition of this Public License will be waived and no
failure to comply consented to unless expressly agreed to by the
Licensor.
d. Nothing in this Public License constitutes or may be interpreted
as a limitation upon, or waiver of, any privileges and immunities
that apply to the Licensor or You, including from the legal
processes of any jurisdiction or authority.
=======================================================================
Creative Commons is not a party to its public
licenses. Notwithstanding, Creative Commons may elect to apply one of
its public licenses to material it publishes and in those instances
will be considered the “Licensor.” The text of the Creative Commons
public licenses is dedicated to the public domain under the CC0 Public
Domain Dedication. Except for the limited purpose of indicating that
material is shared under a Creative Commons public license or as
otherwise permitted by the Creative Commons policies published at
creativecommons.org/policies, Creative Commons does not authorize the
use of the trademark "Creative Commons" or any other trademark or logo
of Creative Commons without its prior written consent including,
without limitation, in connection with any unauthorized modifications
to any of its public licenses or any other arrangements,
understandings, or agreements concerning use of licensed material. For
the avoidance of doubt, this paragraph does not form part of the
public licenses.
Creative Commons may be contacted at creativecommons.org.
@@ -0,0 +1,26 @@
modLoader="javafml"
loaderVersion="[11,)"
license="All Rights Reserved; third-party assets: see THIRD_PARTY_NOTICES.md"
[[mods]]
modId="astraweapons"
version="${version}"
displayName="AstraWeapons"
description='''Server-side twinblade and combo gauntlets for vanilla clients with AstraPlus resources.'''
[[mixins]]
config="astraweapons.mixins.json"
[[dependencies.astraweapons]]
modId="neoforge"
type="required"
versionRange="[26.2.0.79,26.3)"
side="SERVER"
[[dependencies.astraweapons]]
modId="minecraft"
type="required"
versionRange="[26.2,26.3)"
side="SERVER"
[[dependencies.astraweapons]]
modId="astraplus"
type="required"
versionRange="[0.5.67,0.6)"
ordering="AFTER"
side="SERVER"
+15
View File
@@ -0,0 +1,15 @@
# Third-party assets
Gauntlet model and textures: **joshieman**, **Gallant Gauntlets 1.1.2** (Fabric, Minecraft 1.21.1).
Source supplied by the user: `gauntlets-1.1.2-1.21.1`.
Project: https://www.curseforge.com/minecraft/mc-mods/gauntlets/files/5800931
Original geometry and iron textures are retained. Changes: resource namespace, vanilla 26.2 item presentation, and new display-transform animation frames by AstraDev.
The source metadata declares ARR. The bundled `LICENSE_gauntlets` is preserved verbatim; this attribution does not relicense the original assets.
Gauntlet sounds: **Mojang Studios / Double Eleven / Microsoft**, **Minecraft Dungeons**.
Reference and sound filenames: https://minecraft.wiki/w/Dungeons:Gauntlets
Minecraft Wiki refused direct downloads (HTTP 403); the identical named original game wave assets were obtained from the user's local Dungeons installation. OGG data are unmodified.
`gauntlet-audio-provenance.json` lists source names, Wiki file references, and SHA-256 hashes.
Twinblade texture/model: retained from the existing user-provided AstraPlus resource pack. Original credit information was not present in that resource.
Crescent hit texture and pose animation JSON: AstraDev, authored for AstraWeapons.
@@ -0,0 +1,7 @@
{
"required": true,
"package": "online.astradev.weapons.mixin",
"compatibilityLevel": "JAVA_25",
"mixins": ["DisplayAccess", "TwinbladeSwingMixin", "WeaponSwingChargeMixin", "WeaponPacketsMixin", "GauntletInventoryMixin"],
"injectors": {"defaultRequire": 1}
}
@@ -0,0 +1 @@
{"message_id":"player","scaling":"never","exhaustion":0.1}
@@ -0,0 +1 @@
{"replace":false,"values":["astraweapons:gauntlet"]}
@@ -0,0 +1,6 @@
{
"id": "astraplus:hook", "name": "Зацеп", "maxLevel": 2,
"items": ["astraplus:netherite_twinblade"], "slots": ["mainhand"], "conflicts": [],
"acquisition": {"table": true, "loot": true, "trading": true},
"effects": [{"type": "slow", "values": [0.15, 0.25], "duration": 10}]
}
@@ -0,0 +1,7 @@
{
"id": "astraplus:inertia", "name": "Инерция", "maxLevel": 2,
"items": ["astraplus:netherite_twinblade"], "slots": ["mainhand"],
"conflicts": ["astraplus:reaping"],
"acquisition": {"table": true, "loot": true, "trading": true},
"effects": [{"type": "recovery", "values": [0.1, 0.2], "minTargets": 2, "sweepOnly": true}]
}
@@ -0,0 +1,6 @@
{
"id": "astraplus:reach", "name": "Размах", "maxLevel": 2,
"items": ["astraplus:netherite_twinblade"], "slots": ["mainhand"], "conflicts": [],
"acquisition": {"table": true, "loot": true, "trading": true},
"effects": [{"type": "sweep_reach", "values": [1, 2]}]
}
@@ -0,0 +1,7 @@
{
"id": "astraplus:reaping", "name": "Жатва", "maxLevel": 3,
"items": ["astraplus:netherite_twinblade"], "slots": ["mainhand"],
"conflicts": ["astraplus:inertia"],
"acquisition": {"table": true, "loot": true, "trading": true},
"effects": [{"type": "damage_bonus", "values": [0.1, 0.2, 0.3], "minTargets": 2, "sweepOnly": true}]
}
@@ -0,0 +1,11 @@
{
"name": "Незеритовый твинблейд",
"material": "minecraft:netherite_sword",
"model": "astraplus:item/netherite_twinblade",
"components": {
"minecraft:attribute_modifiers": [
{"type": "minecraft:attack_damage", "id": "minecraft:base_attack_damage", "amount": 6, "operation": "add_value", "slot": "mainhand"},
{"type": "minecraft:attack_speed", "id": "minecraft:base_attack_speed", "amount": -2.4, "operation": "add_value", "slot": "mainhand"}
]
}
}
@@ -0,0 +1,12 @@
{
"name": "Боевые перчатки",
"material": "minecraft:iron_sword",
"model": "astraweapons:item/iron_gauntlet_3d",
"components": {
"minecraft:lore": [{"text":"Модель: joshieman — Gallant Gauntlets","color":"dark_gray","italic":false}],
"minecraft:attribute_modifiers": [
{"type":"minecraft:attack_damage","id":"minecraft:base_attack_damage","amount":2,"operation":"add_value","slot":"mainhand"},
{"type":"minecraft:attack_speed","id":"minecraft:base_attack_speed","amount":0,"operation":"add_value","slot":"mainhand"}
]
}
}
@@ -0,0 +1,136 @@
{
"parent": "builtin/generated",
"gui_light": "front",
"display": {
"ground": {
"rotation": [
0,
0,
0
],
"translation": [
0,
2,
0
],
"scale": [
2,
2,
0.5
]
},
"head": {
"rotation": [
0,
180,
0
],
"translation": [
0,
13,
7
],
"scale": [
4,
4,
1
]
},
"thirdperson_righthand": {
"rotation": [
0,
-90,
55
],
"translation": [
0,
4.0,
0.5
],
"scale": [
3.4,
3.4,
0.85
]
},
"thirdperson_lefthand": {
"rotation": [
0,
90,
-55
],
"translation": [
0,
4.0,
0.5
],
"scale": [
3.4,
3.4,
0.85
]
},
"firstperson_righthand": {
"rotation": [
0,
-90,
25
],
"translation": [
1.13,
3.2,
1.13
],
"scale": [
2.72,
2.72,
0.68
]
},
"firstperson_lefthand": {
"rotation": [
0,
90,
-25
],
"translation": [
1.13,
3.2,
1.13
],
"scale": [
2.72,
2.72,
0.68
]
},
"fixed": {
"rotation": [
0,
180,
0
],
"scale": [
4,
4,
1
]
},
"gui": {
"rotation": [
0,
0,
0
],
"scale": [
1.5,
1.5,
1
],
"translation": [1.9, 1.9, 0]
}
},
"textures": {
"layer0": "astraplus:item/netherite_twinblade"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

@@ -0,0 +1,15 @@
# Third-party assets
Gauntlet model and textures: **joshieman**, **Gallant Gauntlets 1.1.2** (Fabric, Minecraft 1.21.1).
Source supplied by the user: `gauntlets-1.1.2-1.21.1`.
Project: https://www.curseforge.com/minecraft/mc-mods/gauntlets/files/5800931
Original geometry and iron textures are retained. Changes: resource namespace, vanilla 26.2 item presentation, and new display-transform animation frames by AstraDev.
The source metadata declares ARR. The bundled `LICENSE_gauntlets` is preserved verbatim; this attribution does not relicense the original assets.
Gauntlet sounds: **Mojang Studios / Double Eleven / Microsoft**, **Minecraft Dungeons**.
Reference and sound filenames: https://minecraft.wiki/w/Dungeons:Gauntlets
Minecraft Wiki refused direct downloads (HTTP 403); the identical named original game wave assets were obtained from the user's local Dungeons installation. OGG data are unmodified.
`gauntlet-audio-provenance.json` lists source names, Wiki file references, and SHA-256 hashes.
Twinblade texture/model: retained from the existing user-provided AstraPlus resource pack. Original credit information was not present in that resource.
Crescent hit texture and pose animation JSON: AstraDev, authored for AstraWeapons.
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/hook_0"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/hook_1"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/hook_2"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/hook_3"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/hook_4"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/hook_5"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/jab_0"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/jab_1"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/jab_2"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/jab_3"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/jab_4"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/jab_5"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/lunge_0"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/lunge_1"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/lunge_2"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/lunge_3"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/lunge_4"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/lunge_5"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraplus:internal/twinblade_gui"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/twinblade_0"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraplus:internal/twinblade_gui"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/twinblade_1"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraplus:internal/twinblade_gui"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/twinblade_2"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraplus:internal/twinblade_gui"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/twinblade_3"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraplus:internal/twinblade_gui"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/twinblade_4"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraplus:internal/twinblade_gui"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/twinblade_5"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/uppercut_0"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/uppercut_1"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/uppercut_2"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/uppercut_3"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/uppercut_4"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:animation/uppercut_5"
}
}
}
@@ -0,0 +1,20 @@
{
"hand_animation_on_swap": false,
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_2d"
}
}
],
"fallback": {
"type": "minecraft:model",
"model": "astraweapons:item/iron_gauntlet_3d"
}
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "astraweapons:effect/slash"
}
}
@@ -0,0 +1,6 @@
{
"model": {
"type": "minecraft:model",
"model": "astraweapons:effect/slash_fire"
}
}
@@ -0,0 +1,10 @@
{
"subtitles.astraweapons.gauntlets.hit_light": "Hit light",
"subtitles.astraweapons.gauntlets.hit_medium": "Hit medium",
"subtitles.astraweapons.gauntlets.hit_kick": "Hit kick",
"subtitles.astraweapons.gauntlets.hit_punch": "Hit punch",
"subtitles.astraweapons.gauntlets.swing_short": "Swing short",
"subtitles.astraweapons.gauntlets.swing_medium": "Swing medium",
"subtitles.astraweapons.gauntlets.swing_kick": "Swing kick",
"subtitles.astraweapons.gauntlets.swing_scream": "Swing scream"
}
@@ -0,0 +1,10 @@
{
"subtitles.astraweapons.gauntlets.hit_light": "Удар перчаткой",
"subtitles.astraweapons.gauntlets.hit_medium": "Апперкот",
"subtitles.astraweapons.gauntlets.hit_kick": "Выпад",
"subtitles.astraweapons.gauntlets.hit_punch": "Хук",
"subtitles.astraweapons.gauntlets.swing_short": "Замах перчаткой",
"subtitles.astraweapons.gauntlets.swing_medium": "Замах апперкота",
"subtitles.astraweapons.gauntlets.swing_kick": "Замах выпада",
"subtitles.astraweapons.gauntlets.swing_scream": "Резкий замах"
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24,
0.0,
-8.0
],
"translation": [
0.5,
6.5,
0.0
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90,
90.0,
0.0
],
"translation": [
0.0,
-3,
-1.25
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24,
0.0,
-8.0
],
"translation": [
-1.5,
6.5,
0.0
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90,
-90.0,
0.0
],
"translation": [
0.0,
-3,
-1.25
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24,
29.389262614623657,
27.267115137548387
],
"translation": [
-4.202282018339785,
6.5,
-2.938926261462366
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90,
119.38926261462366,
35.26711513754839
],
"translation": [
-4.702282018339785,
-3,
-4.188926261462366
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24,
-29.389262614623657,
-43.26711513754839
],
"translation": [
3.202282018339785,
6.5,
-2.938926261462366
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90,
-119.38926261462366,
-35.26711513754839
],
"translation": [
4.702282018339785,
-3,
-4.188926261462366
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24,
47.552825814757675,
49.06339097770921
],
"translation": [
-7.108452130361228,
6.5,
-4.755282581475767
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90,
137.55282581475768,
57.06339097770921
],
"translation": [
-7.608452130361228,
-3,
-6.005282581475767
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24,
-47.552825814757675,
-65.06339097770922
],
"translation": [
6.108452130361228,
6.5,
-4.755282581475767
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90,
-137.55282581475768,
-57.06339097770921
],
"translation": [
7.608452130361228,
-3,
-6.005282581475767
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24,
47.55282581475768,
49.06339097770922
],
"translation": [
-7.108452130361229,
6.5,
-4.755282581475768
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90,
137.55282581475768,
57.06339097770922
],
"translation": [
-7.608452130361229,
-3,
-6.005282581475768
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24,
-47.55282581475768,
-65.06339097770922
],
"translation": [
6.108452130361229,
6.5,
-4.755282581475768
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90,
-137.55282581475768,
-57.06339097770922
],
"translation": [
7.608452130361229,
-3,
-6.005282581475768
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24,
29.38926261462366,
27.267115137548394
],
"translation": [
-4.202282018339786,
6.5,
-2.9389262614623664
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90,
119.38926261462366,
35.267115137548394
],
"translation": [
-4.702282018339786,
-3,
-4.188926261462367
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24,
-29.38926261462366,
-43.267115137548394
],
"translation": [
3.202282018339786,
6.5,
-2.9389262614623664
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90,
-119.38926261462366,
-35.267115137548394
],
"translation": [
4.702282018339786,
-3,
-4.188926261462367
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24,
6.123233995736766e-15,
-7.999999999999993
],
"translation": [
0.499999999999999,
6.5,
-6.123233995736766e-16
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90,
90.0,
7.34788079488412e-15
],
"translation": [
-9.797174393178826e-16,
-3,
-1.2500000000000007
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24,
-6.123233995736766e-15,
-8.000000000000007
],
"translation": [
-1.4999999999999991,
6.5,
-6.123233995736766e-16
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90,
-90.0,
-7.34788079488412e-15
],
"translation": [
9.797174393178826e-16,
-3,
-1.2500000000000007
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24.0,
0,
-8
],
"translation": [
0.5,
6.5,
0.0
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90.0,
90,
0
],
"translation": [
0,
-3,
-1.25
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24.0,
0,
-8
],
"translation": [
-1.5,
6.5,
0.0
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90.0,
-90,
0
],
"translation": [
0,
-3,
-1.25
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-34.58013454126451,
0,
-8
],
"translation": [
0.5,
6.5,
-5.2900672706322585
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-100.58013454126451,
90,
0
],
"translation": [
0,
-3,
-6.5400672706322585
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-34.58013454126451,
0,
-8
],
"translation": [
-1.5,
6.5,
-5.2900672706322585
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-100.58013454126451,
-90,
0
],
"translation": [
0,
-3,
-6.5400672706322585
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-41.119017293312766,
0,
-8
],
"translation": [
0.5,
6.5,
-8.559508646656381
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-107.11901729331277,
90,
0
],
"translation": [
0,
-3,
-9.809508646656381
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-41.119017293312766,
0,
-8
],
"translation": [
-1.5,
6.5,
-8.559508646656381
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-107.11901729331277,
-90,
0
],
"translation": [
0,
-3,
-9.809508646656381
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-41.119017293312766,
0,
-8
],
"translation": [
0.5,
6.5,
-8.559508646656383
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-107.11901729331277,
90,
0
],
"translation": [
0,
-3,
-9.809508646656383
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-41.119017293312766,
0,
-8
],
"translation": [
-1.5,
6.5,
-8.559508646656383
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-107.11901729331277,
-90,
0
],
"translation": [
0,
-3,
-9.809508646656383
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-34.58013454126452,
0,
-8
],
"translation": [
0.5,
6.5,
-5.290067270632259
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-100.58013454126451,
90,
0
],
"translation": [
0,
-3,
-6.540067270632259
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-34.58013454126452,
0,
-8
],
"translation": [
-1.5,
6.5,
-5.290067270632259
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-100.58013454126451,
-90,
0
],
"translation": [
0,
-3,
-6.540067270632259
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24.000000000000004,
0,
-8
],
"translation": [
0.5,
6.5,
-1.102182119232618e-15
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90.0,
90,
0
],
"translation": [
0,
-3,
-1.250000000000001
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24.000000000000004,
0,
-8
],
"translation": [
-1.5,
6.5,
-1.102182119232618e-15
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90.0,
-90,
0
],
"translation": [
0,
-3,
-1.250000000000001
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-24.0,
0,
-8
],
"translation": [
0.5,
6.5,
0.0
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-90.0,
90,
0
],
"translation": [
0,
-3.0,
-1.25
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-24.0,
0,
-8
],
"translation": [
-1.5,
6.5,
0.0
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-90.0,
-90,
0
],
"translation": [
0,
-3.0,
-1.25
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-41.633557568774194,
0,
-8
],
"translation": [
0.5,
5.324429495415053,
-7.641208279802151
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-107.6335575687742,
90,
0
],
"translation": [
0,
-4.175570504584947,
-8.89120827980215
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-41.633557568774194,
0,
-8
],
"translation": [
-1.5,
5.324429495415053,
-7.641208279802151
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-107.6335575687742,
-90,
0
],
"translation": [
0,
-4.175570504584947,
-8.89120827980215
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-52.53169548885461,
0,
-8
],
"translation": [
0.5,
4.597886967409693,
-12.363734711836996
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-118.53169548885461,
90,
0
],
"translation": [
0,
-4.902113032590307,
-13.613734711836996
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-52.53169548885461,
0,
-8
],
"translation": [
-1.5,
4.597886967409693,
-12.363734711836996
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-118.53169548885461,
-90,
0
],
"translation": [
0,
-4.902113032590307,
-13.613734711836996
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}
@@ -0,0 +1,76 @@
{
"parent": "astraweapons:item/iron_gauntlet_3d",
"display": {
"firstperson_righthand": {
"rotation": [
-52.53169548885461,
0,
-8
],
"translation": [
0.5,
4.597886967409693,
-12.363734711836997
],
"scale": [
1,
1,
1
]
},
"thirdperson_righthand": {
"rotation": [
-118.53169548885461,
90,
0
],
"translation": [
0,
-4.902113032590307,
-13.613734711836997
],
"scale": [
1.15,
1.15,
1.15
]
},
"firstperson_lefthand": {
"rotation": [
-52.53169548885461,
0,
-8
],
"translation": [
-1.5,
4.597886967409693,
-12.363734711836997
],
"scale": [
1,
1,
1
]
},
"thirdperson_lefthand": {
"rotation": [
-118.53169548885461,
-90,
0
],
"translation": [
0,
-4.902113032590307,
-13.613734711836997
],
"scale": [
1.15,
1.15,
1.15
]
}
},
"textures": {
"particle": "#0"
}
}

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