9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-31 04:46:37 +00:00

移除不必要的blockstates.yml

This commit is contained in:
XiaoMoMi
2025-06-29 02:11:54 +08:00
parent 6c4e65eec6
commit 066f0fdb36
4 changed files with 18 additions and 107 deletions

View File

@@ -1,3 +0,0 @@
minecraft:chorus_plant:
down=true,east=true,north=true,south=true,up=true,west=true:
model: "minecraft:block/default_chorus_plant"

View File

@@ -1,90 +0,0 @@
{
"credit": "Made with Blockbench",
"parent": "block/block",
"textures": {
"particle": "block/chorus_plant",
"inside": "block/chorus_plant"
},
"elements": [
{
"from": [3, 14, 3],
"to": [13, 16, 13],
"faces": {
"north": {"uv": [3, 1, 13, 3], "texture": "#inside", "cullface": "up"},
"east": {"uv": [3, 1, 13, 3], "texture": "#inside", "cullface": "up"},
"south": {"uv": [3, 1, 13, 3], "texture": "#inside", "cullface": "up"},
"west": {"uv": [3, 1, 13, 3], "texture": "#inside", "cullface": "up"},
"up": {"uv": [3, 3, 13, 13], "texture": "#inside", "cullface": "up"},
"down": {"uv": [0, 0, 0, 0], "texture": "#inside"}
}
},
{
"from": [0, 3, 3],
"to": [2, 13, 12],
"faces": {
"north": {"uv": [13, 3, 15, 13], "texture": "#inside", "cullface": "west"},
"south": {"uv": [1, 3, 3, 13], "texture": "#inside", "cullface": "west"},
"west": {"uv": [3, 3, 13, 13], "texture": "#inside", "cullface": "west"},
"up": {"uv": [1, 3, 3, 13], "texture": "#inside", "cullface": "west"},
"down": {"uv": [15, 13, 13, 3], "texture": "#inside", "cullface": "west"}
}
},
{
"from": [3, 3, 0],
"to": [13, 13, 2],
"faces": {
"north": {"uv": [3, 3, 13, 13], "texture": "#inside", "cullface": "north"},
"east": {"uv": [13, 3, 15, 13], "texture": "#inside", "cullface": "north"},
"south": {"uv": [0, 0, 0, 0], "texture": "#inside"},
"west": {"uv": [1, 3, 3, 13], "texture": "#inside", "cullface": "north"},
"up": {"uv": [3, 1, 13, 3], "texture": "#inside", "cullface": "north"},
"down": {"uv": [13, 3, 3, 1], "texture": "#inside", "cullface": "north"}
}
},
{
"from": [3, 3, 14],
"to": [13, 13, 16],
"faces": {
"east": {"uv": [1, 3, 3, 13], "texture": "#inside", "cullface": "south"},
"south": {"uv": [3, 3, 13, 13], "texture": "#inside", "cullface": "south"},
"west": {"uv": [13, 3, 15, 13], "texture": "#inside", "cullface": "south"},
"up": {"uv": [3, 13, 13, 15], "texture": "#inside", "cullface": "south"},
"down": {"uv": [13, 15, 3, 13], "texture": "#inside", "cullface": "south"}
}
},
{
"from": [14, 3, 3],
"to": [16, 13, 13],
"faces": {
"north": {"uv": [1, 3, 3, 13], "texture": "#inside", "cullface": "east"},
"east": {"uv": [3, 3, 13, 13], "texture": "#inside", "cullface": "east"},
"south": {"uv": [13, 3, 15, 13], "texture": "#inside", "cullface": "east"},
"up": {"uv": [13, 3, 15, 13], "texture": "#inside", "cullface": "east"},
"down": {"uv": [3, 13, 1, 3], "texture": "#inside", "cullface": "east"}
}
},
{
"from": [3, 0, 3],
"to": [13, 2, 13],
"faces": {
"north": {"uv": [3, 13, 13, 15], "texture": "#inside", "cullface": "down"},
"east": {"uv": [3, 13, 13, 15], "texture": "#inside", "cullface": "down"},
"south": {"uv": [3, 13, 13, 15], "texture": "#inside", "cullface": "down"},
"west": {"uv": [3, 13, 13, 15], "texture": "#inside", "cullface": "down"},
"down": {"uv": [13, 13, 3, 3], "texture": "#inside", "cullface": "down"}
}
},
{
"from": [2, 2, 2],
"to": [14, 14, 14],
"faces": {
"north": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"east": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"south": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"west": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"up": {"uv": [2, 2, 14, 14], "texture": "#inside"},
"down": {"uv": [14, 14, 2, 2], "texture": "#inside"}
}
}
]
}

View File

@@ -336,8 +336,6 @@ public abstract class AbstractPackManager implements PackManager {
plugin.saveResource("resources/remove_shulker_head/resourcepack/1_20_5_remove_shulker_head_overlay/minecraft/shaders/core/rendertype_entity_solid.fsh");
plugin.saveResource("resources/remove_shulker_head/resourcepack/assets/minecraft/textures/entity/shulker/shulker_white.png");
plugin.saveResource("resources/remove_shulker_head/pack.yml");
// internal
plugin.saveResource("resources/internal/resourcepack/assets/minecraft/models/block/default_chorus_plant.json");
plugin.saveResource("resources/internal/pack.yml");
// i18n
plugin.saveResource("resources/internal/configuration/i18n.yml");
@@ -1268,9 +1266,6 @@ public abstract class AbstractPackManager implements PackManager {
}
private void generateBlockOverrides(Path generatedPackPath) {
Path blockStatesFile = this.plugin.dataFolderPath().resolve("blockstates.yml");
if (!Files.exists(blockStatesFile)) this.plugin.saveResource("blockstates.yml");
YamlDocument preset = Config.instance().loadYamlData(blockStatesFile);
for (Map.Entry<Key, Map<String, JsonElement>> entry : plugin.blockManager().blockOverrides().entrySet()) {
Key key = entry.getKey();
Path overridedBlockPath = generatedPackPath
@@ -1278,16 +1273,25 @@ public abstract class AbstractPackManager implements PackManager {
.resolve(key.namespace())
.resolve("blockstates")
.resolve(key.value() + ".json");
JsonObject stateJson = new JsonObject();
JsonObject variants = new JsonObject();
stateJson.add("variants", variants);
Section presetSection = preset.getSection(key.toString());
if (presetSection != null) {
for (Map.Entry<String, Object> presetEntry : presetSection.getStringRouteMappedValues(false).entrySet()) {
if (presetEntry.getValue() instanceof Section section) {
variants.add(presetEntry.getKey(), YamlUtils.sectionToJson(section));
JsonObject stateJson;
if (Files.exists(overridedBlockPath)) {
try {
stateJson = GsonHelper.readJsonFile(overridedBlockPath).getAsJsonObject();
if (!stateJson.has("variants")) {
stateJson = new JsonObject();
}
} catch (IOException e) {
stateJson = new JsonObject();
}
} else {
stateJson = new JsonObject();
}
JsonObject variants;
if (!stateJson.has("variants")) {
variants = new JsonObject();
stateJson.add("variants", variants);
} else {
variants = stateJson.get("variants").getAsJsonObject();
}
for (Map.Entry<String, JsonElement> resourcePathEntry : entry.getValue().entrySet()) {
variants.add(resourcePathEntry.getKey(), resourcePathEntry.getValue());

View File

@@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx1G
# Project settings
# Rule: [major update].[feature update].[bug fix]
project_version=0.0.58.3
project_version=0.0.58.4
config_version=39
lang_version=20
project_group=net.momirealms