ModelAttachment class
Пакет: com.hypixel.hytale.server.core.asset.type.model.config
Файл: com/hypixel/hytale/server/core/asset/type/model/config/ModelAttachment.java
implements: NetworkSerializable<com.hypixel.hytale.protocol.ModelAttachment>
Поля (2)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
BuilderCodec<ModelAttachment> |
CODEC |
|
com.hypixel.hytale.protocol.ModelAttachment |
var1 |
Методы (5)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
String |
getGradientIdString getGradientId() |
public |
String |
getGradientSetString getGradientSet() |
public |
String |
getModelString getModel() |
public |
String |
getTextureString getTexture() |
public |
double |
getWeightdouble getWeight() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.model.config;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.codec.schema.metadata.ui.UIEditor;
class="kw">import com.hypixel.hytale.server.core.asset.common.CommonAssetValidator;
class="kw">import com.hypixel.hytale.server.core.cosmetics.CosmeticAssetValidator;
class="kw">import com.hypixel.hytale.server.core.cosmetics.CosmeticType;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import javax.annotation.Nonnull;
class="kw">public class ModelAttachment class="kw">implements NetworkSerializable<com.hypixel.hytale.protocol.ModelAttachment> {
class="kw">public class="kw">static class="kw">final BuilderCodec<ModelAttachment> CODEC = BuilderCodec.builder(ModelAttachment.class, ModelAttachment::new)
.append(new KeyedCodec<>("Model", Codec.STRING), (var0, var1) -> var0.model = var1, var0 -> var0.model)
.addValidator(CommonAssetValidator.MODEL_CHARACTER_ATTACHMENT)
.add()
.<String>append(new KeyedCodec<>("Texture", Codec.STRING), (var0, var1) -> var0.texture = var1, var0 -> var0.texture)
.addValidator(CommonAssetValidator.TEXTURE_CHARACTER_ATTACHMENT)
.add()
.<String>append(new KeyedCodec<>("GradientSet", Codec.STRING), (var0, var1) -> var0.gradientSet = var1, var0 -> var0.gradientSet)
.metadata(new UIEditor(new UIEditor.Dropdown("GradientSets")))
.addValidator(new CosmeticAssetValidator(CosmeticType.GRADIENT_SETS))
.add()
.<String>append(new KeyedCodec<>("GradientId", Codec.STRING), (var0, var1) -> var0.gradientId = var1, var0 -> var0.gradientId)
.metadata(new UIEditor(new UIEditor.Dropdown("GradientIds")))
.add()
.addField(new KeyedCodec<>("Weight", Codec.DOUBLE), (var0, var1) -> var0.weight = var1, var0 -> var0.weight)
.build();
class="kw">protected String model;
class="kw">protected String texture;
class="kw">protected String gradientSet;
class="kw">protected String gradientId;
class="kw">protected double weight = 1.0;
class="kw">public ModelAttachment(String var1, String var2, String var3, String var4, double var5) {
this.model = var1;
this.texture = var2;
this.gradientSet = var3;
this.gradientId = var4;
this.weight = var5;
}
class="kw">protected ModelAttachment() {
}
class="kw">public String getModel() {
class="kw">return this.model;
}
class="kw">public String getTexture() {
class="kw">return this.texture;
}
class="kw">public String getGradientId() {
class="kw">return this.gradientId;
}
class="kw">public String getGradientSet() {
class="kw">return this.gradientSet;
}
class="kw">public double getWeight() {
class="kw">return this.weight;
}
@Nonnull
class="kw">public com.hypixel.hytale.protocol.ModelAttachment toPacket() {
com.hypixel.hytale.protocol.ModelAttachment var1 = new com.hypixel.hytale.protocol.ModelAttachment();
var1.model = this.model;
var1.texture = this.texture;
var1.gradientSet = this.gradientSet;
var1.gradientId = this.gradientId;
class="kw">return var1;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "ModelAttachment{model='"
+ this.model
+ "', texture='"
+ this.texture
+ "', gradientSet='"
+ this.gradientSet
+ "', gradientId='"
+ this.gradientId
+ "', weight="
+ this.weight
+ "}";
}
}