mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-24 17:39:30 +00:00
增强generation的功能
This commit is contained in:
@@ -62,4 +62,6 @@ categories:
|
||||
- default:flame_cane
|
||||
- default:gunpowder_block
|
||||
- default:solid_gunpowder_block
|
||||
- default:ender_pearl_flower_seeds
|
||||
- default:ender_pearl_flower_seeds
|
||||
- default:gui_head_size_1
|
||||
- default:gui_head_size_4
|
||||
@@ -1,4 +1,37 @@
|
||||
items:
|
||||
items#gui_head:
|
||||
default:gui_head_size_1:
|
||||
material: player_head
|
||||
custom-model-data: 1000
|
||||
model:
|
||||
type: minecraft:special
|
||||
path: minecraft:item/custom/gui_head_size_1
|
||||
generation:
|
||||
parent: minecraft:item/template_skull
|
||||
gui-light: front
|
||||
display:
|
||||
gui:
|
||||
translation: 0,8,0
|
||||
scale: 2,2,2
|
||||
model:
|
||||
type: minecraft:head
|
||||
kind: player
|
||||
default:gui_head_size_4:
|
||||
material: player_head
|
||||
custom-model-data: 1001
|
||||
model:
|
||||
type: minecraft:special
|
||||
path: minecraft:item/custom/gui_head_size_4
|
||||
generation:
|
||||
parent: minecraft:item/template_skull
|
||||
gui-light: front
|
||||
display:
|
||||
gui:
|
||||
translation: 9,7,0
|
||||
scale: 4,4,4
|
||||
model:
|
||||
type: minecraft:head
|
||||
kind: player
|
||||
items#topaz_gears:
|
||||
default:topaz_rod:
|
||||
material: fishing_rod
|
||||
custom-model-data: 1000
|
||||
|
||||
@@ -227,6 +227,8 @@ warning.config.block.behavior.strippable.missing_stripped: "<yellow>Issue found
|
||||
warning.config.block.event.condition.missing_type: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is missing the required 'type' argument for event condition.</yellow>"
|
||||
warning.config.block.event.condition.invalid_type: "<yellow>Issue found in file <arg:0> - The block '<arg:1>' is using an invalid 'type' argument '<arg:2>' for event condition.</yellow>"
|
||||
warning.config.model.generation.missing_parent: "<yellow>Issue found in file <arg:0> - The config '<arg:1>' is missing the required 'parent' argument in 'generation' section.</yellow>"
|
||||
warning.config.model.generation.invalid_display_position: "<yellow>Issue found in file <arg:0> - The config '<arg:1>' is using an invalid display position '<arg:2>' in 'generation.display' section. Allowed display positions: [<arg:3>]</yellow>"
|
||||
warning.config.model.generation.invalid_gui_light: "<yellow>Issue found in file <arg:0> - The config '<arg:1>' is using an invalid gui-light option '<arg:2>' in 'generation' section. Allowed gui light options: [<arg:3>]</yellow>"
|
||||
warning.config.model.generation.conflict: "<yellow>Issue found in file <arg:0> - Failed to generate model for '<arg:1>' as two or more configurations attempt to generate different json models with the same path: '<arg:2>'.</yellow>"
|
||||
warning.config.model.generation.texture.invalid: "<yellow>Issue found in file <arg:0> - The config '<arg:1>' has a texture '<arg:2>' with path '<arg:3>' that contains illegal characters. Please read https://minecraft.wiki/w/Resource_location#Legal_characters.</yellow>"
|
||||
warning.config.model.generation.parent.invalid: "<yellow>Issue found in file <arg:0> - The config '<arg:1>' has a parent argument '<arg:2>' that contains illegal characters. Please read https://minecraft.wiki/w/Resource_location#Legal_characters.</yellow>"
|
||||
|
||||
@@ -228,6 +228,8 @@ warning.config.block.event.condition.missing_type: "<yellow>在文件 <arg:0> -
|
||||
warning.config.block.event.condition.invalid_type: "<yellow>在文件 <arg:0> - 方块 '<arg:1>' 使用了无效的事件条件类型 '<arg:2>'</yellow>"
|
||||
warning.config.model.generation.missing_parent: "<yellow>在文件 <arg:0> 发现问题 - 配置项 '<arg:1>' 的 'generation' 段落缺少必需的 'parent' 参数</yellow>"
|
||||
warning.config.model.generation.conflict: "<yellow>在文件 <arg:0> 发现问题 - 无法为 '<arg:1>' 生成模型 存在多个配置尝试使用相同路径 '<arg:2>' 生成不同的 JSON 模型</yellow>"
|
||||
warning.config.model.generation.invalid_display_position: "<yellow>在文件 <arg:0> 发现问题 - 配置项 '<arg:1>' 在 'generation.display' 区域使用了无效的 display 位置类型 '<arg:2>'. 可用展示类型: [<arg:3>]</yellow>"
|
||||
warning.config.model.generation.invalid_gui_light: "<yellow>在文件 <arg:0> 发现问题 - 配置项 '<arg:1>' 在 'generation' 区域使用了无效的GUI光照 '<arg:2>'. 可用GUI光照: [<arg:3>]</yellow>"
|
||||
warning.config.model.generation.texture.invalid: "<yellow>在文件 <arg:0> 发现问题 - 配置项 '<arg:1>' 的纹理 '<arg:2>' 路径 '<arg:3>' 包含非法字符 请参考 https://zh.minecraft.wiki/w/%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4ID#%E5%90%88%E6%B3%95%E5%AD%97%E7%AC%A6</yellow>"
|
||||
warning.config.model.generation.parent.invalid: "<yellow>在文件 <arg:0> 发现问题 - 配置项 '<arg:1>' 的父级参数 '<arg:2>' 包含非法字符 请参考 https://zh.minecraft.wiki/w/%E5%91%BD%E5%90%8D%E7%A9%BA%E9%97%B4ID#%E5%90%88%E6%B3%95%E5%AD%97%E7%AC%A6</yellow>"
|
||||
warning.config.emoji.missing_keywords: "<yellow>在文件 <arg:0> 发现问题 - 表情 '<arg:1>' 缺少必需的 'keywords' 参数</yellow>"
|
||||
|
||||
@@ -537,7 +537,7 @@ public class BukkitBlockManager extends AbstractBlockManager {
|
||||
if (singleModelMap.containsKey("weight")) json.addProperty("weight", ResourceConfigUtils.getAsInt(singleModelMap.get("weight"), "weight"));
|
||||
Map<String, Object> generationMap = MiscUtils.castToMap(singleModelMap.get("generation"), true);
|
||||
if (generationMap != null) {
|
||||
prepareModelGeneration(new ModelGeneration(Key.of(modelPath), generationMap));
|
||||
prepareModelGeneration(ModelGeneration.of(Key.of(modelPath), generationMap));
|
||||
}
|
||||
variants.add(json);
|
||||
}
|
||||
|
||||
@@ -463,6 +463,12 @@ public class BukkitItemManager extends AbstractItemManager<ItemStack> {
|
||||
baseModel.path(),
|
||||
customModelData
|
||||
));
|
||||
} else if (currentModel instanceof SpecialItemModel specialModel) {
|
||||
resultList.add(new LegacyOverridesModel(
|
||||
new LinkedHashMap<>(accumulatedPredicates),
|
||||
specialModel.base(),
|
||||
customModelData
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -832,7 +832,7 @@ public abstract class AbstractPackManager implements PackManager {
|
||||
}
|
||||
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(modelPath)) {
|
||||
GsonHelper.get().toJson(generation.getJson(), writer);
|
||||
GsonHelper.get().toJson(generation.get(), writer);
|
||||
} catch (IOException e) {
|
||||
plugin.logger().warn("Failed to generate model: " + modelPath.toAbsolutePath(), e);
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class BaseItemModel implements ItemModel {
|
||||
Map<String, Object> generation = MiscUtils.castToMap(arguments.get("generation"), true);
|
||||
ModelGeneration modelGeneration = null;
|
||||
if (generation != null) {
|
||||
modelGeneration = new ModelGeneration(Key.of(modelPath), generation);
|
||||
modelGeneration = ModelGeneration.of(Key.of(modelPath), generation);
|
||||
}
|
||||
if (arguments.containsKey("tints")) {
|
||||
List<Tint> tints = new ArrayList<>();
|
||||
|
||||
@@ -13,7 +13,6 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class SpecialItemModel implements ItemModel {
|
||||
public static final Factory FACTORY = new Factory();
|
||||
@@ -69,7 +68,7 @@ public class SpecialItemModel implements ItemModel {
|
||||
Map<String, Object> generation = MiscUtils.castToMap(arguments.get("generation"), true);
|
||||
ModelGeneration modelGeneration = null;
|
||||
if (generation != null) {
|
||||
modelGeneration = new ModelGeneration(Key.of(base), generation);
|
||||
modelGeneration = ModelGeneration.of(Key.of(base), generation);
|
||||
}
|
||||
Map<String, Object> model = MiscUtils.castToMap(arguments.get("model"), false);
|
||||
return new SpecialItemModel(SpecialModels.fromMap(model), base, modelGeneration);
|
||||
|
||||
@@ -38,9 +38,12 @@ public abstract class AbstractModelGenerator implements ModelGenerator {
|
||||
if (!ResourceLocation.isValid(model.parentModelPath())) {
|
||||
throw new LocalizedResourceConfigException("warning.config.model.generation.parent.invalid", model.parentModelPath());
|
||||
}
|
||||
for (Map.Entry<String, String> texture : model.texturesOverride().entrySet()) {
|
||||
if (!ResourceLocation.isValid(texture.getValue())) {
|
||||
throw new LocalizedResourceConfigException("warning.config.model.generation.texture.invalid", texture.getKey(), texture.getValue());
|
||||
Map<String, String> textures = model.texturesOverride();
|
||||
if (textures != null) {
|
||||
for (Map.Entry<String, String> texture : textures.entrySet()) {
|
||||
if (!ResourceLocation.isValid(texture.getValue())) {
|
||||
throw new LocalizedResourceConfigException("warning.config.model.generation.texture.invalid", texture.getKey(), texture.getValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
this.modelsToGenerate.put(model.path(), model);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package net.momirealms.craftengine.core.pack.model.generation;
|
||||
|
||||
public enum GuiLight {
|
||||
FRONT, SIDE
|
||||
}
|
||||
@@ -1,44 +1,107 @@
|
||||
package net.momirealms.craftengine.core.pack.model.generation;
|
||||
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import net.momirealms.craftengine.core.pack.model.generation.display.DisplayMeta;
|
||||
import net.momirealms.craftengine.core.pack.model.generation.display.DisplayPosition;
|
||||
import net.momirealms.craftengine.core.plugin.locale.LocalizedResourceConfigException;
|
||||
import net.momirealms.craftengine.core.util.EnumUtils;
|
||||
import net.momirealms.craftengine.core.util.Key;
|
||||
import net.momirealms.craftengine.core.util.MiscUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ModelGeneration {
|
||||
public class ModelGeneration implements Supplier<JsonObject> {
|
||||
private static final Map<String, BiConsumer<Builder, Object>> BUILDER_FUNCTIONS = new HashMap<>();
|
||||
static {
|
||||
BUILDER_FUNCTIONS.put("textures", (b, data) -> {
|
||||
Map<String, Object> texturesMap = MiscUtils.castToMap(data, false);
|
||||
Map<String, String> texturesOverride = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, Object> entry : texturesMap.entrySet()) {
|
||||
if (entry.getValue() instanceof String p) {
|
||||
texturesOverride.put(entry.getKey(), p);
|
||||
}
|
||||
}
|
||||
b.texturesOverride(texturesOverride);
|
||||
});
|
||||
BUILDER_FUNCTIONS.put("display", (b, data) -> {
|
||||
Map<String, Object> displayMap = MiscUtils.castToMap(data, false);
|
||||
Map<DisplayPosition, DisplayMeta> displays = new EnumMap<>(DisplayPosition.class);
|
||||
for (Map.Entry<String, Object> entry : displayMap.entrySet()) {
|
||||
try {
|
||||
DisplayPosition displayPosition = DisplayPosition.valueOf(entry.getKey().toUpperCase(Locale.ENGLISH));
|
||||
if (entry.getValue() instanceof Map<?,?> metaMap) {
|
||||
displays.put(displayPosition, DisplayMeta.fromMap(MiscUtils.castToMap(metaMap, false)));
|
||||
}
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new LocalizedResourceConfigException("warning.config.model.generation.invalid_display_position", e, entry.getKey(), EnumUtils.toString(DisplayPosition.values()));
|
||||
}
|
||||
}
|
||||
b.displays(displays);
|
||||
});
|
||||
BUILDER_FUNCTIONS.put("gui-light", (b, data) -> {
|
||||
String guiLightStr = String.valueOf(data);
|
||||
try {
|
||||
GuiLight guiLight = GuiLight.valueOf(guiLightStr.toUpperCase(Locale.ENGLISH));
|
||||
b.guiLight(guiLight);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new LocalizedResourceConfigException("warning.config.model.generation.invalid_gui_light", e, guiLightStr, EnumUtils.toString(GuiLight.values()));
|
||||
}
|
||||
});
|
||||
BUILDER_FUNCTIONS.put("ambient-occlusion", (b, data) -> {
|
||||
b.ambientOcclusion((boolean) data);
|
||||
});
|
||||
BUILDER_FUNCTIONS.put("parent", (b, data) -> {
|
||||
String parentModelPath = data.toString();
|
||||
b.parentModelPath(parentModelPath);
|
||||
});
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private final Key path;
|
||||
@NotNull
|
||||
private final String parentModelPath;
|
||||
@Nullable
|
||||
private final Map<String, String> texturesOverride;
|
||||
@Nullable
|
||||
private final Map<DisplayPosition, DisplayMeta> displays;
|
||||
@Nullable
|
||||
private final GuiLight guiLight;
|
||||
@Nullable
|
||||
private final Boolean ambientOcclusion;
|
||||
@Nullable
|
||||
private JsonObject cachedModel;
|
||||
|
||||
public ModelGeneration(Key path, String parentModelPath, Map<String, String> texturesOverride) {
|
||||
public ModelGeneration(@NotNull Key path,
|
||||
@NotNull String parentModelPath,
|
||||
@Nullable Map<String, String> texturesOverride,
|
||||
@Nullable Map<DisplayPosition, DisplayMeta> displays,
|
||||
@Nullable GuiLight guiLight,
|
||||
@Nullable Boolean ambientOcclusion) {
|
||||
this.path = path;
|
||||
this.parentModelPath = parentModelPath;
|
||||
this.texturesOverride = texturesOverride;
|
||||
this.displays = displays;
|
||||
this.guiLight = guiLight;
|
||||
this.ambientOcclusion = ambientOcclusion;
|
||||
}
|
||||
|
||||
public ModelGeneration(Key path, Map<String, Object> map) {
|
||||
this.path = path;
|
||||
Object parent = map.get("parent");
|
||||
if (parent == null) {
|
||||
throw new LocalizedResourceConfigException("warning.config.model.generation.missing_parent");
|
||||
}
|
||||
this.parentModelPath = parent.toString();
|
||||
Map<String, Object> texturesMap = MiscUtils.castToMap(map.get("textures"), true);
|
||||
if (texturesMap != null) {
|
||||
this.texturesOverride = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, Object> entry : texturesMap.entrySet()) {
|
||||
if (entry.getValue() instanceof String p) {
|
||||
this.texturesOverride.put(entry.getKey(), p);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.texturesOverride = Collections.emptyMap();
|
||||
public static ModelGeneration of(Key path, Map<String, Object> map) {
|
||||
Builder builder = builder().path(path);
|
||||
for (Map.Entry<String, Object> entry : map.entrySet()) {
|
||||
Optional.ofNullable(BUILDER_FUNCTIONS.get(entry.getKey())).ifPresent(it -> it.accept(builder, entry.getValue()));
|
||||
}
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Map<String, String> texturesOverride() {
|
||||
return texturesOverride;
|
||||
}
|
||||
|
||||
public Key path() {
|
||||
@@ -49,36 +112,137 @@ public class ModelGeneration {
|
||||
return parentModelPath;
|
||||
}
|
||||
|
||||
public Map<String, String> texturesOverride() {
|
||||
return texturesOverride;
|
||||
@Nullable
|
||||
public Map<DisplayPosition, DisplayMeta> displays() {
|
||||
return displays;
|
||||
}
|
||||
|
||||
public JsonObject getJson() {
|
||||
@Nullable
|
||||
public GuiLight guiLight() {
|
||||
return guiLight;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public Boolean ambientOcclusion() {
|
||||
return ambientOcclusion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObject get() {
|
||||
if (this.cachedModel == null) {
|
||||
this.cachedModel = this.getCachedModel();
|
||||
}
|
||||
return this.cachedModel;
|
||||
}
|
||||
|
||||
private JsonObject getCachedModel() {
|
||||
JsonObject model = new JsonObject();
|
||||
model.addProperty("parent", parentModelPath);
|
||||
if (this.texturesOverride != null && !this.texturesOverride.isEmpty()) {
|
||||
model.addProperty("parent", this.parentModelPath);
|
||||
if (this.texturesOverride != null) {
|
||||
JsonObject textures = new JsonObject();
|
||||
for (Map.Entry<String, String> entry : this.texturesOverride.entrySet()) {
|
||||
textures.addProperty(entry.getKey(), entry.getValue());
|
||||
}
|
||||
model.add("textures", textures);
|
||||
}
|
||||
if (this.displays != null) {
|
||||
JsonObject displays = new JsonObject();
|
||||
for (Map.Entry<DisplayPosition, DisplayMeta> entry : this.displays.entrySet()) {
|
||||
JsonObject displayMetadata = new JsonObject();
|
||||
DisplayMeta meta = entry.getValue();
|
||||
if (meta.rotation() != null)
|
||||
displayMetadata.add("rotation", vectorToJsonArray(meta.rotation()));
|
||||
if (meta.translation() != null)
|
||||
displayMetadata.add("translation", vectorToJsonArray(meta.translation()));
|
||||
if (meta.scale() != null)
|
||||
displayMetadata.add("scale", vectorToJsonArray(meta.scale()));
|
||||
displays.add(entry.getKey().name().toLowerCase(Locale.ENGLISH), displayMetadata);
|
||||
}
|
||||
model.add("display", displays);
|
||||
}
|
||||
if (this.guiLight != null) {
|
||||
model.addProperty("gui_light", this.guiLight.name().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
private JsonArray vectorToJsonArray(Vector3f vector) {
|
||||
JsonArray array = new JsonArray();
|
||||
array.add(vector.x());
|
||||
array.add(vector.y());
|
||||
array.add(vector.z());
|
||||
return array;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
ModelGeneration that = (ModelGeneration) o;
|
||||
return this.path.equals(that.path) && parentModelPath.equals(that.parentModelPath) && Objects.equals(texturesOverride, that.texturesOverride);
|
||||
return this.path.equals(that.path) && parentModelPath.equals(that.parentModelPath) && Objects.equals(texturesOverride, that.texturesOverride)
|
||||
&& Objects.equals(displays, that.displays) && Objects.equals(ambientOcclusion, that.ambientOcclusion) && Objects.equals(guiLight, that.guiLight);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = path.hashCode();
|
||||
result = 31 * result + parentModelPath.hashCode();
|
||||
result = 31 * result + texturesOverride.hashCode();
|
||||
int result = this.path.hashCode();
|
||||
result = 31 * result + this.parentModelPath.hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
public static Builder builder() {
|
||||
return new Builder();
|
||||
}
|
||||
|
||||
public static class Builder {
|
||||
private Key path;
|
||||
private String parentModelPath;
|
||||
@Nullable
|
||||
private Map<String, String> texturesOverride;
|
||||
@Nullable
|
||||
private Map<DisplayPosition, DisplayMeta> displays;
|
||||
@Nullable
|
||||
private GuiLight guiLight;
|
||||
@Nullable
|
||||
private Boolean ambientOcclusion;
|
||||
|
||||
public Builder() {}
|
||||
|
||||
public Builder path(Key key) {
|
||||
this.path = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder parentModelPath(String parentModelPath) {
|
||||
this.parentModelPath = parentModelPath;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder texturesOverride(Map<String, String> texturesOverride) {
|
||||
this.texturesOverride = texturesOverride;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder displays(Map<DisplayPosition, DisplayMeta> displays) {
|
||||
this.displays = displays;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder guiLight(GuiLight guiLight) {
|
||||
this.guiLight = guiLight;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder ambientOcclusion(Boolean ambientOcclusion) {
|
||||
this.ambientOcclusion = ambientOcclusion;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ModelGeneration build() {
|
||||
if (this.parentModelPath == null) {
|
||||
throw new LocalizedResourceConfigException("warning.config.model.generation.missing_parent");
|
||||
}
|
||||
return new ModelGeneration(Objects.requireNonNull(this.path, "path should be nonnull"), this.parentModelPath, this.texturesOverride, this.displays, this.guiLight, this.ambientOcclusion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package net.momirealms.craftengine.core.pack.model.generation.display;
|
||||
|
||||
import net.momirealms.craftengine.core.util.MiscUtils;
|
||||
import org.joml.Vector3f;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public record DisplayMeta(Vector3f rotation, Vector3f translation, Vector3f scale) {
|
||||
|
||||
public static DisplayMeta fromMap(Map<String, Object> map) {
|
||||
Vector3f rotation = null;
|
||||
if (map.containsKey("rotation")) {
|
||||
rotation = MiscUtils.getAsVector3f(map.get("rotation"), "rotation");
|
||||
}
|
||||
Vector3f translation = null;
|
||||
if (map.containsKey("translation")) {
|
||||
translation = MiscUtils.getAsVector3f(map.get("translation"), "translation");
|
||||
}
|
||||
Vector3f scale = null;
|
||||
if (map.containsKey("scale")) {
|
||||
scale = MiscUtils.getAsVector3f(map.get("scale"), "scale");
|
||||
}
|
||||
return new DisplayMeta(rotation, translation, scale);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package net.momirealms.craftengine.core.pack.model.generation.display;
|
||||
|
||||
public enum DisplayPosition {
|
||||
THIRDPERSON_RIGHTHAND,
|
||||
THIRDPERSON_LEFTHAND,
|
||||
FIRSTPERSON_RIGHTHAND,
|
||||
FIRSTPERSON_LEFTHAND,
|
||||
GUI,
|
||||
HEAD,
|
||||
GROUND,
|
||||
FIXED
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import net.momirealms.craftengine.core.util.Key;
|
||||
import net.momirealms.craftengine.core.util.ResourceConfigUtils;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.awt.desktop.OpenFilesEvent;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
@@ -6,7 +6,6 @@ import net.kyori.adventure.text.minimessage.tag.resolver.ArgumentQueue;
|
||||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver;
|
||||
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
||||
import net.momirealms.craftengine.core.plugin.context.Context;
|
||||
import net.momirealms.craftengine.core.plugin.locale.TranslationManager;
|
||||
import net.momirealms.craftengine.core.util.AdventureHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
Reference in New Issue
Block a user