ModelVFX class
Пакет: com.hypixel.hytale.server.core.asset.type.modelvfx.config
Файл: com/hypixel/hytale/server/core/asset/type/modelvfx/config/ModelVFX.java
implements: JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, ModelVFX>>,
NetworkSerializable<com.hypixel.hytale.protocol.ModelVFX>
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
AssetBuilderCodec<String, ModelVFX> |
CODEC |
|
|
STORE |
|
com.hypixel.hytale.protocol.ModelVFX |
var1 |
Методы (21)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
public |
float |
getAnimationDurationfloat getAnimationDuration() |
public |
Vector2f |
getAnimationRangeVector2f getAnimationRange() |
static |
IndexedLookupTableAssetMap<String, ModelVFX> |
getAssetMapIndexedLookupTableAssetMap<String, ModelVFX> getAssetMap() |
static |
AssetStore<String, ModelVFX, IndexedLookupTableAssetMap<String, ModelVFX>> |
getAssetStoreAssetStore<String, ModelVFX, IndexedLookupTableAssetMap<String, ModelVFX>> getAssetStore() |
public |
CurveType |
getCurveTypeCurveType getCurveType() |
public |
EffectDirection |
getEffectDirectionEffectDirection getEffectDirection() |
public |
Color |
getHighlightColorColor getHighlightColor() |
public |
float |
getHighlightThicknessfloat getHighlightThickness() |
public |
String |
getIdString getId() |
public |
LoopOption |
getLoopOptionLoopOption getLoopOption() |
public |
Vector2f |
getNoiseScaleVector2f getNoiseScale() |
public |
Vector2f |
getNoiseScrollSpeedVector2f getNoiseScrollSpeed() |
public |
Color |
getPostColorColor getPostColor() |
public |
float |
getPostColorOpacityfloat getPostColorOpacity() |
public |
SwitchTo |
getSwitchToSwitchTo getSwitchTo() |
|
|
if if(STORE == null) |
|
|
if if(this.animationRange != null) |
|
|
if if(this.noiseScale != null) |
|
|
if if(this.noiseScrollSpeed != null) |
public |
boolean |
useBloomOnHighlightboolean useBloomOnHighlight() |
public |
boolean |
useProgessiveHighlightboolean useProgessiveHighlight() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.modelvfx.config;
class="kw">import com.hypixel.hytale.assetstore.AssetExtraInfo;
class="kw">import com.hypixel.hytale.assetstore.AssetKeyValidator;
class="kw">import com.hypixel.hytale.assetstore.AssetRegistry;
class="kw">import com.hypixel.hytale.assetstore.AssetStore;
class="kw">import com.hypixel.hytale.assetstore.codec.AssetBuilderCodec;
class="kw">import com.hypixel.hytale.assetstore.codec.ContainedAssetCodec;
class="kw">import com.hypixel.hytale.assetstore.map.IndexedLookupTableAssetMap;
class="kw">import com.hypixel.hytale.assetstore.map.JsonAssetWithMap;
class="kw">import com.hypixel.hytale.codec.Codec;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.codecs.EnumCodec;
class="kw">import com.hypixel.hytale.codec.codecs.array.ArrayCodec;
class="kw">import com.hypixel.hytale.codec.validation.ValidatorCache;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import com.hypixel.hytale.math.vector.Vector2fUtil;
class="kw">import com.hypixel.hytale.protocol.Color;
class="kw">import com.hypixel.hytale.protocol.CurveType;
class="kw">import com.hypixel.hytale.protocol.EffectDirection;
class="kw">import com.hypixel.hytale.protocol.LoopOption;
class="kw">import com.hypixel.hytale.protocol.SwitchTo;
class="kw">import com.hypixel.hytale.server.core.codec.ProtocolCodecs;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.joml.Vector2f;
class="kw">public class ModelVFX
class="kw">implements JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, ModelVFX>>,
NetworkSerializable<com.hypixel.hytale.protocol.ModelVFX> {
class="kw">public class="kw">static class="kw">final AssetBuilderCodec<String, ModelVFX> CODEC = AssetBuilderCodec.builder(
ModelVFX.class, ModelVFX::new, Codec.STRING, (var0, var1) -> var0.id = var1, var0 -> var0.id, (var0, var1) -> var0.data = var1, var0 -> var0.data
)
.append(new KeyedCodec<>("SwitchTo", new EnumCodec<>(SwitchTo.class)), (var0, var1) -> var0.switchTo = var1, var0 -> var0.switchTo)
.addValidator(Validators.nonNull())
.add()
.<EffectDirection>append(
new KeyedCodec<>("EffectDirection", new EnumCodec<>(EffectDirection.class)), (var0, var1) -> var0.effectDirection = var1, var0 -> var0.effectDirection
)
.addValidator(Validators.nonNull())
.add()
.append(new KeyedCodec<>("AnimationDuration", Codec.FLOAT), (var0, var1) -> var0.animationDuration = var1, var0 -> var0.animationDuration)
.add()
.append(new KeyedCodec<>("AnimationRange", Vector2fUtil.CODEC), (var0, var1) -> var0.animationRange = var1, var0 -> var0.animationRange)
.add()
.<LoopOption>append(new KeyedCodec<>("LoopOption", new EnumCodec<>(LoopOption.class)), (var0, var1) -> var0.loopOption = var1, var0 -> var0.loopOption)
.addValidator(Validators.nonNull())
.add()
.<CurveType>append(new KeyedCodec<>("CurveType", new EnumCodec<>(CurveType.class)), (var0, var1) -> var0.curveType = var1, var0 -> var0.curveType)
.addValidator(Validators.nonNull())
.add()
.append(new KeyedCodec<>("HighlightColor", ProtocolCodecs.COLOR), (var0, var1) -> var0.highlightColor = var1, var0 -> var0.highlightColor)
.add()
.append(new KeyedCodec<>("HighlightThickness", Codec.FLOAT), (var0, var1) -> var0.highlightThickness = var1, var0 -> var0.highlightThickness)
.add()
.append(new KeyedCodec<>("UseBloomOnHighlight", Codec.BOOLEAN), (var0, var1) -> var0.useBloomOnHighlight = var1, var0 -> var0.useBloomOnHighlight)
.add()
.append(
new KeyedCodec<>("UseProgessiveHighlight", Codec.BOOLEAN), (var0, var1) -> var0.useProgressiveHighlight = var1, var0 -> var0.useProgressiveHighlight
)
.add()
.append(new KeyedCodec<>("NoiseScale", Vector2fUtil.CODEC), (var0, var1) -> var0.noiseScale = var1, var0 -> var0.noiseScale)
.add()
.append(new KeyedCodec<>("NoiseScrollSpeed", Vector2fUtil.CODEC), (var0, var1) -> var0.noiseScrollSpeed = var1, var0 -> var0.noiseScrollSpeed)
.add()
.append(new KeyedCodec<>("PostColor", ProtocolCodecs.COLOR), (var0, var1) -> var0.postColor = var1, var0 -> var0.postColor)
.add()
.<Float>append(new KeyedCodec<>("PostColorOpacity", Codec.FLOAT), (var0, var1) -> var0.postColorOpacity = var1, var0 -> var0.postColorOpacity)
.addValidator(Validators.range(0.0F, 1.0F))
.add()
.build();
class="kw">public class="kw">static class="kw">final Codec<String> CHILD_ASSET_CODEC = new ContainedAssetCodec<>(ModelVFX.class, CODEC);
class="kw">public class="kw">static class="kw">final Codec<String[]> CHILD_ASSET_CODEC_ARRAY = new ArrayCodec<>(CHILD_ASSET_CODEC, String[]::new);
class="kw">private class="kw">static AssetStore<String, ModelVFX, IndexedLookupTableAssetMap<String, ModelVFX>> STORE;
class="kw">public class="kw">static class="kw">final ValidatorCache<String> VALIDATOR_CACHE = new ValidatorCache<>(new AssetKeyValidator<>(ModelVFX::getAssetStore));
class="kw">protected AssetExtraInfo.Data data;
class="kw">protected String id;
@Nonnull
class="kw">private SwitchTo switchTo = SwitchTo.Disappear;
@Nonnull
class="kw">private EffectDirection effectDirection = EffectDirection.None;
class="kw">private float animationDuration;
class="kw">private Vector2f animationRange = new Vector2f(0.0F, 1.0F);
@Nonnull
class="kw">private LoopOption loopOption = LoopOption.PlayOnce;
@Nonnull
class="kw">private CurveType curveType = CurveType.Linear;
class="kw">private Color highlightColor = new Color((byte)-1, (byte)-1, (byte)-1);
class="kw">private float highlightThickness;
class="kw">private boolean useBloomOnHighlight;
class="kw">private boolean useProgressiveHighlight;
class="kw">private Vector2f noiseScale = new Vector2f(50.0F, 50.0F);
class="kw">private Vector2f noiseScrollSpeed;
class="kw">private Color postColor = new Color((byte)-1, (byte)-1, (byte)-1);
class="kw">private float postColorOpacity = 1.0F;
class="kw">public class="kw">static AssetStore<String, ModelVFX, IndexedLookupTableAssetMap<String, ModelVFX>> getAssetStore() {
if (STORE == null) {
STORE = AssetRegistry.getAssetStore(ModelVFX.class);
}
class="kw">return STORE;
}
class="kw">public class="kw">static IndexedLookupTableAssetMap<String, ModelVFX> getAssetMap() {
class="kw">return (IndexedLookupTableAssetMap<String, ModelVFX>)getAssetStore().getAssetMap();
}
class="kw">public ModelVFX(
String var1,
SwitchTo var2,
EffectDirection var3,
float var4,
Vector2f var5,
LoopOption var6,
CurveType var7,
Color var8,
float var9,
boolean var10,
boolean var11,
Vector2f var12,
Vector2f var13,
Color var14,
float var15
) {
this.id = var1;
this.switchTo = var2;
this.effectDirection = var3;
this.animationDuration = var4;
this.animationRange = var5;
this.loopOption = var6;
this.curveType = var7;
this.highlightColor = var8;
this.highlightThickness = var9;
this.useBloomOnHighlight = var10;
this.useProgressiveHighlight = var11;
this.noiseScale = var12;
this.noiseScrollSpeed = var13;
this.postColor = var14;
this.postColorOpacity = var15;
}
class="kw">public ModelVFX(String var1) {
this.id = var1;
}
class="kw">protected ModelVFX() {
}
@Nonnull
class="kw">public com.hypixel.hytale.protocol.ModelVFX toPacket() {
com.hypixel.hytale.protocol.ModelVFX var1 = new com.hypixel.hytale.protocol.ModelVFX();
var1.id = this.id;
var1.switchTo = this.switchTo;
var1.effectDirection = this.effectDirection;
var1.animationDuration = this.animationDuration;
if (this.animationRange != null) {
var1.animationRange = this.animationRange;
}
var1.loopOption = this.loopOption;
var1.curveType = this.curveType;
var1.highlightColor = this.highlightColor;
var1.useBloomOnHighlight = this.useBloomOnHighlight;
var1.useProgessiveHighlight = this.useProgressiveHighlight;
var1.highlightThickness = this.highlightThickness;
if (this.noiseScale != null) {
var1.noiseScale = this.noiseScale;
}
if (this.noiseScrollSpeed != null) {
var1.noiseScrollSpeed = this.noiseScrollSpeed;
}
var1.postColor = this.postColor;
var1.postColorOpacity = this.postColorOpacity;
class="kw">return var1;
}
class="kw">public String getId() {
class="kw">return this.id;
}
class="kw">public SwitchTo getSwitchTo() {
class="kw">return this.switchTo;
}
class="kw">public EffectDirection getEffectDirection() {
class="kw">return this.effectDirection;
}
class="kw">public float getAnimationDuration() {
class="kw">return this.animationDuration;
}
class="kw">public Vector2f getAnimationRange() {
class="kw">return this.animationRange;
}
class="kw">public LoopOption getLoopOption() {
class="kw">return this.loopOption;
}
class="kw">public CurveType getCurveType() {
class="kw">return this.curveType;
}
class="kw">public Color getHighlightColor() {
class="kw">return this.highlightColor;
}
class="kw">public boolean useBloomOnHighlight() {
class="kw">return this.useBloomOnHighlight;
}
class="kw">public boolean useProgessiveHighlight() {
class="kw">return this.useProgressiveHighlight;
}
class="kw">public float getHighlightThickness() {
class="kw">return this.highlightThickness;
}
class="kw">public Vector2f getNoiseScale() {
class="kw">return this.noiseScale;
}
class="kw">public Vector2f getNoiseScrollSpeed() {
class="kw">return this.noiseScrollSpeed;
}
class="kw">public Color getPostColor() {
class="kw">return this.postColor;
}
class="kw">public float getPostColorOpacity() {
class="kw">return this.postColorOpacity;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "ModelVFX{id='"
+ this.id
+ "', SwitchTo="
+ this.switchTo
+ ", effectDirection="
+ this.effectDirection
+ ", animationDuration="
+ this.animationDuration
+ ", animationRange="
+ this.animationRange
+ ", loopOption="
+ this.loopOption
+ ", curveType="
+ this.curveType
+ ", highlightColor='"
+ this.highlightColor
+ "', useBloomOnHighlight="
+ this.useBloomOnHighlight
+ ", useProgressiveHighlight="
+ this.useProgressiveHighlight
+ ", highlightThickness="
+ this.highlightThickness
+ ", noiseScale="
+ this.noiseScale
+ ", noiseScrollSpeed"
+ this.noiseScrollSpeed
+ ", postColor='"
+ this.postColor
+ "', postColorOpacity"
+ this.postColorOpacity
+ "}";
}
}