BlockBreakingDecal class
Пакет: com.hypixel.hytale.server.core.asset.type.blockbreakingdecal.config
Файл: com/hypixel/hytale/server/core/asset/type/blockbreakingdecal/config/BlockBreakingDecal.java
implements: JsonAssetWithMap<String, DefaultAssetMap<String, BlockBreakingDecal>>,
NetworkSerializable<com.hypixel.hytale.protocol.BlockBreakingDecal>
Поля (3)
| Модификаторы | Тип | Имя |
|---|---|---|
|
|
ASSET_STORE |
final |
String[] |
DEFAULT_STAGE_TEXTURE_LIST |
|
com.hypixel.hytale.protocol.BlockBreakingDecal |
var1 |
Методы (3)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
static |
AssetStore<String, BlockBreakingDecal, DefaultAssetMap<String, BlockBreakingDecal>> |
getAssetStoreAssetStore<String, BlockBreakingDecal, DefaultAssetMap<String, BlockBreakingDecal>> getAssetStore() |
public |
String |
getIdString getId() |
|
|
if if(ASSET_STORE == null) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.blockbreakingdecal.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.AssetCodec;
class="kw">import com.hypixel.hytale.assetstore.map.DefaultAssetMap;
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.validation.ValidatorCache;
class="kw">import com.hypixel.hytale.codec.validation.Validators;
class="kw">import com.hypixel.hytale.codec.validation.validator.ArrayValidator;
class="kw">import com.hypixel.hytale.server.core.asset.common.CommonAssetValidator;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import java.util.Arrays;
class="kw">import javax.annotation.Nonnull;
class="kw">public class BlockBreakingDecal
class="kw">implements JsonAssetWithMap<String, DefaultAssetMap<String, BlockBreakingDecal>>,
NetworkSerializable<com.hypixel.hytale.protocol.BlockBreakingDecal> {
class="kw">private class="kw">static class="kw">final String[] DEFAULT_STAGE_TEXTURE_LIST = new String[0];
class="kw">public class="kw">static class="kw">final AssetCodec<String, BlockBreakingDecal> CODEC = AssetBuilderCodec.builder(
BlockBreakingDecal.class,
BlockBreakingDecal::new,
Codec.STRING,
(var0, var1) -> var0.id = var1,
var0 -> var0.id,
(var0, var1) -> var0.data = var1,
var0 -> var0.data
)
.append(new KeyedCodec<>("StageTextures", Codec.STRING_ARRAY), (var0, var1) -> var0.stageTextures = var1, var0 -> var0.stageTextures)
.addValidator(Validators.nonNull())
.addValidator(new ArrayValidator<>(CommonAssetValidator.TEXTURE_ITEM))
.add()
.build();
class="kw">private class="kw">static AssetStore<String, BlockBreakingDecal, DefaultAssetMap<String, BlockBreakingDecal>> ASSET_STORE;
class="kw">public class="kw">static class="kw">final ValidatorCache<String> VALIDATOR_CACHE = new ValidatorCache<>(new AssetKeyValidator<>(BlockBreakingDecal::getAssetStore));
class="kw">private String id;
class="kw">private AssetExtraInfo.Data data;
@Nonnull
class="kw">private String[] stageTextures = DEFAULT_STAGE_TEXTURE_LIST;
class="kw">public class="kw">static AssetStore<String, BlockBreakingDecal, DefaultAssetMap<String, BlockBreakingDecal>> getAssetStore() {
if (ASSET_STORE == null) {
ASSET_STORE = AssetRegistry.getAssetStore(BlockBreakingDecal.class);
}
class="kw">return ASSET_STORE;
}
class="kw">protected BlockBreakingDecal() {
}
@Nonnull
class="kw">public com.hypixel.hytale.protocol.BlockBreakingDecal toPacket() {
com.hypixel.hytale.protocol.BlockBreakingDecal var1 = new com.hypixel.hytale.protocol.BlockBreakingDecal();
var1.stageTextures = this.stageTextures;
class="kw">return var1;
}
class="kw">public String getId() {
class="kw">return this.id;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "BlockBreakingDecal{id='" + this.id + "', data=" + this.data + ", stageTextures=" + Arrays.toString(this.stageTextures) + "}";
}
}