ChunkColumn class
Пакет: com.hypixel.hytale.server.core.universe.world.chunk
Файл: com/hypixel/hytale/server/core/universe/world/chunk/ChunkColumn.java
implements: Component<ChunkStore>
Поля (19)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
BuilderCodec<ChunkColumn> |
CODEC |
|
|
break |
|
|
var1 |
|
Holder[] |
var1 |
|
ChunkColumn |
var1 |
|
ChunkColumn |
var1 |
|
Holder[] |
var2 |
|
int |
var2 |
|
|
var2 |
|
int |
var2 |
|
|
var2 |
|
Holder[] |
var3 |
|
Holder[] |
var3 |
|
Ref |
var4 |
|
Store |
var5 |
|
Holder |
var5 |
|
Holder |
var5 |
|
Ref |
var7 |
|
Ref |
var7 |
Методы (18)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
|
|
for for(int var3 = 0; var3 < var0.sections.length; var3++) |
|
|
for for(int var4 = 0; var4 < this.sectionHolders.length; var4++) |
|
|
for for(int var6 = 0; var6 < this.sections.length; var6++) |
|
|
for for(int var4 = 0; var4 < this.sectionHolders.length; var4++) |
|
|
for for(int var6 = 0; var6 < this.sections.length; var6++) |
static |
ComponentType<ChunkStore, ChunkColumn> |
getComponentTypeComponentType<ChunkStore, ChunkColumn> getComponentType() |
|
|
if if(var0.sectionHolders != null) |
|
|
if if(var0.sectionHolders != null) |
|
|
if if(var4 == null) |
|
|
if if(this.sectionHolders != null) |
|
|
if if(this.sectionHolders != null) |
|
|
if if(var5 != null) |
|
|
if if(var7 != null) |
|
|
if if(this.sectionHolders != null) |
|
|
if if(this.sectionHolders != null) |
|
|
if if(var5 != null) |
|
|
if if(var7 != null) |
public |
void |
putSectionHoldersvoid putSectionHolders(Holder<ChunkStore>[] var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.universe.world.chunk;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.codec.codecs.array.ArrayCodec;
class="kw">import com.hypixel.hytale.codec.store.StoredCodec;
class="kw">import com.hypixel.hytale.component.Component;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.component.Holder;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.component.Store;
class="kw">import com.hypixel.hytale.server.core.modules.LegacyModule;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
@Deprecated
class="kw">public class ChunkColumn class="kw">implements Component<ChunkStore> {
class="kw">public class="kw">static class="kw">final BuilderCodec<ChunkColumn> CODEC = BuilderCodec.builder(ChunkColumn.class, ChunkColumn::new)
.append(
new KeyedCodec<>("Sections", new ArrayCodec<>(new StoredCodec<>(ChunkStore.HOLDER_CODEC_KEY), Holder[]::new)),
(var0, var1) -> var0.sectionHolders = var1,
var0 -> {
int var1 = var0.sections.length;
if (var0.sectionHolders != null) {
var1 = Math.max(var0.sectionHolders.length, var0.sections.length);
}
Holder[] var2 = new Holder[var1];
if (var0.sectionHolders != null) {
System.arraycopy(var0.sectionHolders, 0, var2, 0, var0.sectionHolders.length);
}
for (int var3 = 0; var3 < var0.sections.length; var3++) {
Ref var4 = var0.sections[var3];
if (var4 == null) {
break;
}
Store var5 = var4.getStore();
var2[var3] = var5.copySerializableEntity(var4);
}
class="kw">return var2;
}
)
.add()
.build();
class="kw">private class="kw">final Ref<ChunkStore>[] sections = new Ref[10];
@Nullable
class="kw">private Holder<ChunkStore>[] sectionHolders;
class="kw">public class="kw">static ComponentType<ChunkStore, ChunkColumn> getComponentType() {
class="kw">return LegacyModule.get().getChunkColumnComponentType();
}
class="kw">public ChunkColumn() {
}
class="kw">public ChunkColumn(Holder<ChunkStore>[] var1) {
this.sectionHolders = var1;
}
@Nullable
class="kw">public Ref<ChunkStore> getSection(int var1) {
class="kw">return var1 >= 0 && var1 < this.sections.length ? this.sections[var1] : null;
}
@Nonnull
class="kw">public Ref<ChunkStore>[] getSections() {
class="kw">return this.sections;
}
@Nullable
class="kw">public Holder<ChunkStore>[] getSectionHolders() {
class="kw">return this.sectionHolders;
}
@Nullable
class="kw">public Holder<ChunkStore>[] takeSectionHolders() {
Holder[] var1 = this.sectionHolders;
this.sectionHolders = null;
class="kw">return var1;
}
class="kw">public void putSectionHolders(Holder<ChunkStore>[] var1) {
this.sectionHolders = var1;
}
@Nonnull
@Override
class="kw">public Component<ChunkStore> clone() {
ChunkColumn var1 = new ChunkColumn();
int var2 = this.sections.length;
if (this.sectionHolders != null) {
var2 = Math.max(this.sectionHolders.length, this.sections.length);
}
Holder[] var3 = new Holder[var2];
if (this.sectionHolders != null) {
for (int var4 = 0; var4 < this.sectionHolders.length; var4++) {
Holder var5 = this.sectionHolders[var4];
if (var5 != null) {
var3[var4] = var5.clone();
}
}
}
for (int var6 = 0; var6 < this.sections.length; var6++) {
Ref var7 = this.sections[var6];
if (var7 != null) {
var3[var6] = var7.getStore().copyEntity(var7);
}
}
var1.sectionHolders = var3;
class="kw">return var1;
}
@Nonnull
@Override
class="kw">public Component<ChunkStore> cloneSerializable() {
ChunkColumn var1 = new ChunkColumn();
int var2 = this.sections.length;
if (this.sectionHolders != null) {
var2 = Math.max(this.sectionHolders.length, this.sections.length);
}
Holder[] var3 = new Holder[var2];
if (this.sectionHolders != null) {
for (int var4 = 0; var4 < this.sectionHolders.length; var4++) {
Holder var5 = this.sectionHolders[var4];
if (var5 != null) {
var3[var4] = var5.clone();
}
}
}
for (int var6 = 0; var6 < this.sections.length; var6++) {
Ref var7 = this.sections[var6];
if (var7 != null) {
var3[var6] = var7.getStore().copySerializableEntity(var7);
}
}
var1.sectionHolders = var3;
class="kw">return var1;
}
}