Add subtle pixel shading to combined soup bowls
This commit is contained in:
@@ -124,7 +124,11 @@
|
|||||||
|
|
||||||
Цвет супа — среднее RGB ингредиентов в равных долях, цвет зелья — из его компонентов,
|
Цвет супа — среднее RGB ингредиентов в равных долях, цвет зелья — из его компонентов,
|
||||||
цвет окрашенной воды — результат смешивания красителей. Миска супа имеет собственную
|
цвет окрашенной воды — результат смешивания красителей. Миска супа имеет собственную
|
||||||
составную иконку: деревянная часть не окрашивается.
|
составную иконку: деревянная часть не окрашивается. С версии 0.2.4 жидкость в миске
|
||||||
|
имеет мягкий пиксельный градиент из трёх оттенков (100%, 92% и 85% яркости исходного
|
||||||
|
цвета): небольшой светлый участок сверху слева, более тёмный край снизу справа.
|
||||||
|
Модель использует нейтральные пиксели ванильных текстур; оттенок ингредиентов сохраняется.
|
||||||
|
Новый вид применяется и к уже выданным супам после обновления ресурспака.
|
||||||
|
|
||||||
## Сохранение и установка
|
## Сохранение и установка
|
||||||
|
|
||||||
@@ -150,9 +154,10 @@ Minecraft и мода не является общей транзакцией с
|
|||||||
API/sources/verification JAR на рабочий сервер не устанавливать. Старый JAR перед заменой
|
API/sources/verification JAR на рабочий сервер не устанавливать. Старый JAR перед заменой
|
||||||
сохранить в `old-mods`, затем проверить SHA-256 установленного файла.
|
сохранить в `old-mods`, затем проверить SHA-256 установленного файла.
|
||||||
|
|
||||||
При запуске модель миски экспортируется без перезаписи пользовательских файлов в
|
При запуске модель миски экспортируется в
|
||||||
`astraplus/resources/assets/astradev_soups`; AstraPlus добавляет свою модель жидкости и
|
`astraplus/resources/assets/astradev_soups`; AstraPlus добавляет свою модель жидкости и
|
||||||
собирает ZIP. При наличии AstraPacks используется его экспорт/доставка. Для ручной
|
собирает ZIP. Неизменённая однотонная модель из версий 0.2.0–0.2.3 обновляется автоматически;
|
||||||
|
пользовательские модели сохраняются. При наличии AstraPacks используется его экспорт/доставка. Для ручной
|
||||||
пересборки: `/astraplus build`.
|
пересборки: `/astraplus build`.
|
||||||
|
|
||||||
Bukkit-YAML, UUID миров Paper и данные ItemsAdder автоматически не импортируются:
|
Bukkit-YAML, UUID миров Paper и данные ItemsAdder автоматически не импортируются:
|
||||||
|
|||||||
+19
-1
@@ -1,4 +1,22 @@
|
|||||||
# Проверка AstraCauldron 0.2.0 и AstraPlus 0.5.1
|
# Проверки AstraCauldron
|
||||||
|
|
||||||
|
## Градиент миски супа — 11 сентября 2026, версия 0.2.4
|
||||||
|
|
||||||
|
- `gradlew.bat --offline test assemble` — успешно, 19 тестов без ошибок.
|
||||||
|
- Проверены экспорт модели, повторный запуск без перезаписи, обновление исходной
|
||||||
|
однотонной модели с LF/CRLF и сохранение пользовательской модификации.
|
||||||
|
- Декодеры `ClientItem.CODEC` и `CuboidModel` Minecraft 26.2 приняли модели из
|
||||||
|
проверочного ZIP, содержащего ресурсы нового JAR.
|
||||||
|
- Используются три нейтральных оттенка ванильных текстур: `#FFFFFF`, `#EAEAEA`,
|
||||||
|
`#D8D8D8`, умножаемые на прежний RGB супа. Проверка в игровом клиенте не проводилась.
|
||||||
|
- AstraCauldron-0.2.4.jar установлен непосредственно в `mods` рабочего NeoForge-сервера.
|
||||||
|
SHA-256 сборки и установленного файла:
|
||||||
|
`ED66C33A153DFA6089D99C62F8A864F279C3ABC9CF8D88EEF6AD4F8D6CF6D48E`.
|
||||||
|
- Прежний JAR сохранён в
|
||||||
|
`C:/Users/ScarPC/Documents/NeoForge Server 26.2/old-mods/20260911-181130/AstraCauldron-0.2.3.jar`.
|
||||||
|
Для загрузки нужен перезапуск сервера; штатная модель обновится до сборки ресурспака.
|
||||||
|
|
||||||
|
## AstraCauldron 0.2.0 и AstraPlus 0.5.1
|
||||||
|
|
||||||
8 сентября 2026 года, Java 26.0.2 (target Java 25), Minecraft 26.2,
|
8 сентября 2026 года, Java 26.0.2 (target Java 25), Minecraft 26.2,
|
||||||
NeoForge 26.2.0.79. Отдельный новый мир в `build/verification-*`, 127.0.0.1:25639.
|
NeoForge 26.2.0.79. Отдельный новый мир в `build/verification-*`, 127.0.0.1:25639.
|
||||||
|
|||||||
+1
-1
@@ -3,7 +3,7 @@ plugins {
|
|||||||
id("net.neoforged.moddev") version "2.0.146"
|
id("net.neoforged.moddev") version "2.0.146"
|
||||||
}
|
}
|
||||||
group = "online.astradev"
|
group = "online.astradev"
|
||||||
version = "0.2.3"
|
version = "0.2.4"
|
||||||
repositories { mavenCentral() }
|
repositories { mavenCentral() }
|
||||||
val astraPlusApi = providers.gradleProperty("astraPlusApi")
|
val astraPlusApi = providers.gradleProperty("astraPlusApi")
|
||||||
.orElse("../AstraPlus/build/libs/AstraPlus-0.5.9-api.jar")
|
.orElse("../AstraPlus/build/libs/AstraPlus-0.5.9-api.jar")
|
||||||
|
|||||||
@@ -2,10 +2,17 @@ package online.astradev.cauldron;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.*;
|
import java.nio.file.*;
|
||||||
|
import java.security.MessageDigest;
|
||||||
|
import java.security.NoSuchAlgorithmException;
|
||||||
|
import java.util.HexFormat;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
|
||||||
/** Export before AstraPlus's startup pack build; never overwrite administrator resources. */
|
/** Export before AstraPlus's startup pack build; upgrade only known, unmodified defaults. */
|
||||||
final class SoupResources {
|
final class SoupResources {
|
||||||
|
// Bundled flat-colour model in 0.2.0–0.2.3, with normalized newlines and outer whitespace.
|
||||||
|
private static final String FLAT_MODEL_SHA256 =
|
||||||
|
"51b5c2b0561ec815e5ddaff5654ce04fffa0995fc3e5972323f385d58842cd2c";
|
||||||
private SoupResources() {}
|
private SoupResources() {}
|
||||||
static void install(Path root) throws IOException {
|
static void install(Path root) throws IOException {
|
||||||
for (String name : List.of("items/combined_soup.json",
|
for (String name : List.of("items/combined_soup.json",
|
||||||
@@ -13,11 +20,27 @@ final class SoupResources {
|
|||||||
String relative = "assets/astradev_soups/" + name;
|
String relative = "assets/astradev_soups/" + name;
|
||||||
Path target = root.resolve("astraplus/resources").resolve(relative);
|
Path target = root.resolve("astraplus/resources").resolve(relative);
|
||||||
Files.createDirectories(target.getParent());
|
Files.createDirectories(target.getParent());
|
||||||
if (Files.exists(target)) continue;
|
boolean exists = Files.exists(target, LinkOption.NOFOLLOW_LINKS);
|
||||||
|
if (exists && !(name.equals("models/item/soup_liquid.json") && isFlatDefault(target))) continue;
|
||||||
try (var input = SoupResources.class.getResourceAsStream("/astra-resources/" + relative)) {
|
try (var input = SoupResources.class.getResourceAsStream("/astra-resources/" + relative)) {
|
||||||
if (input == null) throw new IOException("Missing resource " + relative);
|
if (input == null) throw new IOException("Missing resource " + relative);
|
||||||
Files.copy(input, target);
|
if (!exists) Files.copy(input, target);
|
||||||
|
else {
|
||||||
|
Path temp = Files.createTempFile(target.getParent(), "soup-model-", ".tmp");
|
||||||
|
try {
|
||||||
|
Files.copy(input, temp, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
Files.move(temp, target, StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING);
|
||||||
|
} finally { Files.deleteIfExists(temp); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
private static boolean isFlatDefault(Path path) throws IOException {
|
||||||
|
if (!Files.isRegularFile(path, LinkOption.NOFOLLOW_LINKS) || Files.size(path) > 8192) return false;
|
||||||
|
String model = Files.readString(path, UTF_8).replace("\r\n", "\n").trim();
|
||||||
|
try {
|
||||||
|
return HexFormat.of().formatHex(MessageDigest.getInstance("SHA-256")
|
||||||
|
.digest(model.getBytes(UTF_8))).equals(FLAT_MODEL_SHA256);
|
||||||
|
} catch (NoSuchAlgorithmException impossible) { throw new AssertionError(impossible); }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+55
-5
@@ -2,6 +2,7 @@
|
|||||||
"gui_light": "front",
|
"gui_light": "front",
|
||||||
"textures": {
|
"textures": {
|
||||||
"white": "minecraft:item/bone_meal",
|
"white": "minecraft:item/bone_meal",
|
||||||
|
"grey": "minecraft:item/iron_ingot",
|
||||||
"particle": "minecraft:item/bowl"
|
"particle": "minecraft:item/bowl"
|
||||||
},
|
},
|
||||||
"display": {
|
"display": {
|
||||||
@@ -13,24 +14,73 @@
|
|||||||
},
|
},
|
||||||
"elements": [
|
"elements": [
|
||||||
{
|
{
|
||||||
"from": [5, 9, 7.49], "to": [11, 10, 8.51], "shade": false,
|
"from": [5, 9, 7.49], "to": [6, 10, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [4.4, 2.4, 4.6, 2.6], "texture": "#white", "tintindex": 0 },
|
||||||
|
"south": { "uv": [4.4, 2.4, 4.6, 2.6], "texture": "#white", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [6, 9, 7.49], "to": [9, 10, 8.51], "shade": false,
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 },
|
"north": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 },
|
||||||
"south": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 }
|
"south": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [3, 8, 7.49], "to": [13, 9, 8.51], "shade": false,
|
"from": [9, 9, 7.49], "to": [11, 10, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [4.4, 2.4, 4.6, 2.6], "texture": "#white", "tintindex": 0 },
|
||||||
|
"south": { "uv": [4.4, 2.4, 4.6, 2.6], "texture": "#white", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [3, 8, 7.49], "to": [4, 9, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [8.4, 4.4, 8.6, 4.6], "texture": "#grey", "tintindex": 0 },
|
||||||
|
"south": { "uv": [8.4, 4.4, 8.6, 4.6], "texture": "#grey", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [4, 8, 7.49], "to": [7, 9, 8.51], "shade": false,
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 },
|
"north": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 },
|
||||||
"south": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 }
|
"south": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 }
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"from": [4, 7, 7.49], "to": [12, 8, 8.51], "shade": false,
|
"from": [7, 8, 7.49], "to": [10, 9, 8.51], "shade": false,
|
||||||
"faces": {
|
"faces": {
|
||||||
"north": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 },
|
"north": { "uv": [4.4, 2.4, 4.6, 2.6], "texture": "#white", "tintindex": 0 },
|
||||||
"south": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 }
|
"south": { "uv": [4.4, 2.4, 4.6, 2.6], "texture": "#white", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [10, 8, 7.49], "to": [13, 9, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [8.4, 4.4, 8.6, 4.6], "texture": "#grey", "tintindex": 0 },
|
||||||
|
"south": { "uv": [8.4, 4.4, 8.6, 4.6], "texture": "#grey", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [4, 7, 7.49], "to": [6, 8, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [8.4, 4.4, 8.6, 4.6], "texture": "#grey", "tintindex": 0 },
|
||||||
|
"south": { "uv": [8.4, 4.4, 8.6, 4.6], "texture": "#grey", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [6, 7, 7.49], "to": [9, 8, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [4.4, 2.4, 4.6, 2.6], "texture": "#white", "tintindex": 0 },
|
||||||
|
"south": { "uv": [4.4, 2.4, 4.6, 2.6], "texture": "#white", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [9, 7, 7.49], "to": [12, 8, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [8.4, 4.4, 8.6, 4.6], "texture": "#grey", "tintindex": 0 },
|
||||||
|
"south": { "uv": [8.4, 4.4, 8.6, 4.6], "texture": "#grey", "tintindex": 0 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package online.astradev.cauldron;
|
||||||
|
|
||||||
|
import java.nio.file.*;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.junit.jupiter.api.io.TempDir;
|
||||||
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
class SoupResourcesTest {
|
||||||
|
@TempDir Path root;
|
||||||
|
private static final String MODEL = "assets/astradev_soups/models/item/soup_liquid.json";
|
||||||
|
|
||||||
|
@Test void exportsBundledResourcesAndCanRunAgain() throws Exception {
|
||||||
|
SoupResources.install(root);
|
||||||
|
assertArrayEquals(bundled(), Files.readAllBytes(target()));
|
||||||
|
var modified = Files.getLastModifiedTime(target());
|
||||||
|
SoupResources.install(root);
|
||||||
|
assertEquals(modified, Files.getLastModifiedTime(target()));
|
||||||
|
assertTrue(Files.exists(root.resolve("astraplus/resources/assets/astradev_soups/items/combined_soup.json")));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test void upgradesFlatDefaultWithEitherLineEnding() throws Exception {
|
||||||
|
try (var input = getClass().getResourceAsStream("/legacy/soup_liquid.json")) {
|
||||||
|
String legacy = new String(input.readAllBytes(), UTF_8).replace("\r\n", "\n");
|
||||||
|
Files.createDirectories(target().getParent());
|
||||||
|
for (String ending : new String[]{"\n", "\r\n"}) {
|
||||||
|
Files.writeString(target(), legacy.replace("\n", ending));
|
||||||
|
SoupResources.install(root);
|
||||||
|
assertArrayEquals(bundled(), Files.readAllBytes(target()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test void preservesAdministratorCustomizationOfOldModel() throws Exception {
|
||||||
|
try (var input = getClass().getResourceAsStream("/legacy/soup_liquid.json")) {
|
||||||
|
String custom = new String(input.readAllBytes(), UTF_8).replace("minecraft:item/bone_meal", "custom:item/soup");
|
||||||
|
Files.createDirectories(target().getParent());
|
||||||
|
Files.writeString(target(), custom);
|
||||||
|
SoupResources.install(root);
|
||||||
|
assertEquals(custom, Files.readString(target()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Path target() { return root.resolve("astraplus/resources").resolve(MODEL); }
|
||||||
|
private byte[] bundled() throws Exception {
|
||||||
|
try (var input = getClass().getResourceAsStream("/astra-resources/" + MODEL)) { return input.readAllBytes(); }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"gui_light": "front",
|
||||||
|
"textures": {
|
||||||
|
"white": "minecraft:item/bone_meal",
|
||||||
|
"particle": "minecraft:item/bowl"
|
||||||
|
},
|
||||||
|
"display": {
|
||||||
|
"ground": { "translation": [0, 2, 0], "scale": [0.5, 0.5, 0.5] },
|
||||||
|
"head": { "rotation": [0, 180, 0], "translation": [0, 13, 7] },
|
||||||
|
"thirdperson_righthand": { "translation": [0, 3, 1], "scale": [0.55, 0.55, 0.55] },
|
||||||
|
"firstperson_righthand": { "rotation": [0, -90, 25], "translation": [1.13, 3.2, 1.13], "scale": [0.68, 0.68, 0.68] },
|
||||||
|
"fixed": { "rotation": [0, 180, 0] }
|
||||||
|
},
|
||||||
|
"elements": [
|
||||||
|
{
|
||||||
|
"from": [5, 9, 7.49], "to": [11, 10, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 },
|
||||||
|
"south": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [3, 8, 7.49], "to": [13, 9, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 },
|
||||||
|
"south": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"from": [4, 7, 7.49], "to": [12, 8, 8.51], "shade": false,
|
||||||
|
"faces": {
|
||||||
|
"north": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 },
|
||||||
|
"south": { "uv": [4.4, 3.4, 4.6, 3.6], "texture": "#white", "tintindex": 0 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user