BlockSet class
Пакет: com.hypixel.hytale.server.core.asset.type.blockset.config
Файл: com/hypixel/hytale/server/core/asset/type/blockset/config/BlockSet.java
implements: JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, BlockSet>>,
NetworkSerializable<com.hypixel.hytale.protocol.BlockSet>
Поля (5)
| Модификаторы | Тип | Имя |
|---|---|---|
|
|
ASSET_STORE |
final |
AssetBuilderCodec<String, BlockSet> |
CODEC |
|
com.hypixel.hytale.protocol.BlockSet |
var1 |
|
int |
var2 |
|
IntSet |
var3 |
Методы (13)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
static |
IndexedLookupTableAssetMap<String, BlockSet> |
getAssetMapIndexedLookupTableAssetMap<String, BlockSet> getAssetMap() |
static |
AssetStore<String, BlockSet, IndexedLookupTableAssetMap<String, BlockSet>> |
getAssetStoreAssetStore<String, BlockSet, IndexedLookupTableAssetMap<String, BlockSet>> getAssetStore() |
public |
String[] |
getExcludeBlockGroupsString[] getExcludeBlockGroups() |
public |
String[] |
getExcludeBlockTypesString[] getExcludeBlockTypes() |
public |
String[][] |
getExcludeCategoriesString[][] getExcludeCategories() |
public |
String[] |
getExcludeHitboxTypesString[] getExcludeHitboxTypes() |
public |
String |
getIdString getId() |
public |
String[] |
getIncludeBlockGroupsString[] getIncludeBlockGroups() |
public |
String[] |
getIncludeBlockTypesString[] getIncludeBlockTypes() |
public |
String[][] |
getIncludeCategoriesString[][] getIncludeCategories() |
public |
String[] |
getIncludeHitboxTypesString[] getIncludeHitboxTypes() |
|
|
if if(ASSET_STORE == null) |
public |
boolean |
isIncludeAllboolean isIncludeAll() |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.asset.type.blockset.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.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.array.ArrayCodec;
class="kw">import com.hypixel.hytale.codec.validation.ValidatorCache;
class="kw">import com.hypixel.hytale.server.core.io.NetworkSerializable;
class="kw">import com.hypixel.hytale.server.core.modules.blockset.BlockSetModule;
class="kw">import it.unimi.dsi.fastutil.ints.IntSet;
class="kw">import java.util.Arrays;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
@Deprecated(forRemoval = true)
class="kw">public class BlockSet
class="kw">implements JsonAssetWithMap<String, IndexedLookupTableAssetMap<String, BlockSet>>,
NetworkSerializable<com.hypixel.hytale.protocol.BlockSet> {
class="kw">public class="kw">static class="kw">final AssetBuilderCodec<String, BlockSet> CODEC = AssetBuilderCodec.builder(
BlockSet.class, BlockSet::new, Codec.STRING, (var0, var1) -> var0.id = var1, var0 -> var0.id, (var0, var1) -> var0.data = var1, var0 -> var0.data
)
.append(new KeyedCodec<>("IncludeAll", Codec.BOOLEAN), (var0, var1) -> var0.includeAll = var1, var0 -> var0.includeAll)
.add()
.append(new KeyedCodec<>("IncludeBlockTypes", Codec.STRING_ARRAY), (var0, var1) -> var0.includeBlockTypes = var1, var0 -> var0.includeBlockTypes)
.add()
.append(new KeyedCodec<>("ExcludeBlockTypes", Codec.STRING_ARRAY), (var0, var1) -> var0.excludeBlockTypes = var1, var0 -> var0.excludeBlockTypes)
.add()
.append(new KeyedCodec<>("IncludeBlockGroups", Codec.STRING_ARRAY), (var0, var1) -> var0.includeBlockGroups = var1, var0 -> var0.includeBlockGroups)
.add()
.append(new KeyedCodec<>("ExcludeBlockGroups", Codec.STRING_ARRAY), (var0, var1) -> var0.excludeBlockGroups = var1, var0 -> var0.excludeBlockGroups)
.add()
.append(new KeyedCodec<>("IncludeHitboxTypes", Codec.STRING_ARRAY), (var0, var1) -> var0.includeHitboxTypes = var1, var0 -> var0.includeHitboxTypes)
.add()
.append(new KeyedCodec<>("ExcludeHitboxTypes", Codec.STRING_ARRAY), (var0, var1) -> var0.excludeHitboxTypes = var1, var0 -> var0.excludeHitboxTypes)
.add()
.append(
new KeyedCodec<>("IncludeCategories", new ArrayCodec<>(Codec.STRING_ARRAY, String[][]::new)),
(var0, var1) -> var0.includeCategories = var1,
var0 -> var0.includeCategories
)
.add()
.append(
new KeyedCodec<>("ExcludeCategories", new ArrayCodec<>(Codec.STRING_ARRAY, String[][]::new)),
(var0, var1) -> var0.excludeCategories = var1,
var0 -> var0.excludeCategories
)
.add()
.build();
class="kw">private class="kw">static class="kw">final int[] EMPTY_SET = new int[0];
class="kw">public class="kw">static class="kw">final ValidatorCache<String> VALIDATOR_CACHE = new ValidatorCache<>(new AssetKeyValidator<>(BlockSet::getAssetStore));
class="kw">private class="kw">static AssetStore<String, BlockSet, IndexedLookupTableAssetMap<String, BlockSet>> ASSET_STORE;
@Nullable
class="kw">protected AssetExtraInfo.Data data;
class="kw">protected String id;
class="kw">protected boolean includeAll;
class="kw">protected String[] includeBlockTypes;
class="kw">protected String[] excludeBlockTypes;
class="kw">protected String[] includeBlockGroups;
class="kw">protected String[] excludeBlockGroups;
class="kw">protected String[] includeHitboxTypes;
class="kw">protected String[] excludeHitboxTypes;
class="kw">protected String[][] includeCategories;
class="kw">protected String[][] excludeCategories;
class="kw">public class="kw">static AssetStore<String, BlockSet, IndexedLookupTableAssetMap<String, BlockSet>> getAssetStore() {
if (ASSET_STORE == null) {
ASSET_STORE = AssetRegistry.getAssetStore(BlockSet.class);
}
class="kw">return ASSET_STORE;
}
class="kw">public class="kw">static IndexedLookupTableAssetMap<String, BlockSet> getAssetMap() {
class="kw">return (IndexedLookupTableAssetMap<String, BlockSet>)getAssetStore().getAssetMap();
}
class="kw">public BlockSet(String var1) {
this.id = var1;
}
class="kw">public BlockSet(
String var1, boolean var2, String[] var3, String[] var4, String[] var5, String[] var6, String[] var7, String[] var8, String[][] var9, String[][] var10
) {
this.id = var1;
this.includeAll = var2;
this.includeBlockTypes = var3;
this.excludeBlockTypes = var4;
this.includeBlockGroups = var5;
this.excludeBlockGroups = var6;
this.includeHitboxTypes = var7;
this.excludeHitboxTypes = var8;
this.includeCategories = var9;
this.excludeCategories = var10;
}
class="kw">protected BlockSet() {
}
class="kw">public String getId() {
class="kw">return this.id;
}
@Nullable
class="kw">public AssetExtraInfo.Data getData() {
class="kw">return this.data;
}
class="kw">public boolean isIncludeAll() {
class="kw">return this.includeAll;
}
class="kw">public String[] getIncludeBlockTypes() {
class="kw">return this.includeBlockTypes;
}
class="kw">public String[] getExcludeBlockTypes() {
class="kw">return this.excludeBlockTypes;
}
class="kw">public String[] getIncludeBlockGroups() {
class="kw">return this.includeBlockGroups;
}
class="kw">public String[] getExcludeBlockGroups() {
class="kw">return this.excludeBlockGroups;
}
class="kw">public String[] getIncludeHitboxTypes() {
class="kw">return this.includeHitboxTypes;
}
class="kw">public String[] getExcludeHitboxTypes() {
class="kw">return this.excludeHitboxTypes;
}
class="kw">public String[][] getIncludeCategories() {
class="kw">return this.includeCategories;
}
class="kw">public String[][] getExcludeCategories() {
class="kw">return this.excludeCategories;
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "BlockSet{id='"
+ this.id
+ "', data='"
+ this.data
+ "', includeAll="
+ this.includeAll
+ ", includeBlockTypes="
+ Arrays.toString(this.includeBlockTypes)
+ ", excludeBlockTypes="
+ Arrays.toString(this.excludeBlockTypes)
+ ", includeBlockGroups="
+ Arrays.toString(this.includeBlockGroups)
+ ", excludeBlockGroups="
+ Arrays.toString(this.excludeBlockGroups)
+ ", includeHitboxTypes="
+ Arrays.toString(this.includeHitboxTypes)
+ ", excludeHitboxTypes="
+ Arrays.toString(this.excludeHitboxTypes)
+ ", includeCategories="
+ Arrays.deepToString(this.includeCategories)
+ ", excludeCategories="
+ Arrays.deepToString(this.excludeCategories)
+ "}";
}
@Nonnull
class="kw">public com.hypixel.hytale.protocol.BlockSet toPacket() {
com.hypixel.hytale.protocol.BlockSet var1 = new com.hypixel.hytale.protocol.BlockSet();
int var2 = getAssetMap().getIndex(this.id);
IntSet var3 = (IntSet)BlockSetModule.getInstance().getBlockSets().get(var2);
var1.name = this.id;
var1.blocks = var3 != null ? var3.toIntArray() : EMPTY_SET;
class="kw">return var1;
}
}