WorldChunk class

Пакет: com.hypixel.hytale.server.core.universe.world.chunk

Файл: com/hypixel/hytale/server/core/universe/world/chunk/WorldChunk.java

implements: Component<ChunkStore>

Поля (74)

МодификаторыТипИмя
final int KEEP_ALIVE_DEFAULT
return
Store var1
Store var1
boolean var1
var1
int var10
BlockSection var10
int var10
int var11
int var12
int var13
boolean var14
ChunkSection var15
int var16
int var17
short var18
var18
Holder var19
long var2
var2
ChunkFlag var2
ChunkColumn var2
Holder var20
boolean var21
boolean var22
Ref var23
BlockComponentSection var24
Store var25
TickProcedure var26
FillerBlockUtil.ChangeReason var27
var27
BlockType var28
boolean var3
var3
boolean var4
long var4
BlockComponentSection var4
BlockComponentSection var4
Ref var4
Ref var4
Ref var4
Store var5
int var5
int var5
Store var5
Store var5
Store var5
int var6
String var6
int var6
ChunkColumn var6
Ref var6
ChunkColumn var6
ChunkColumn var6
ChunkColumn var6
int var7
int var7
String var7
Ref var7
Holder var7
Ref var7
Ref var7
Ref var7
Ref var7
int var8
BlockType var8
FluidSection var8
FluidSection var8
BlockPhysics var8
BlockComponentSection var8
int var9
short var9
int var9

Методы (59)

МодификаторыВозвратСигнатура
abstract throw new IllegalArgumentExceptionthrow new IllegalArgumentException("Chunk already has a valid EntityReference: " + this.reference + " new reference " + var1)
abstract throw new IllegalArgumentExceptionthrow new IllegalArgumentException("START_INIT hasn't been set!")
abstract throw new IllegalArgumentExceptionthrow new IllegalArgumentException("INIT is already set!")
abstract throw new IllegalArgumentExceptionthrow new IllegalArgumentException("Unknown key! " + var4)
abstract throw new IllegalArgumentExceptionthrow new IllegalArgumentException("Unknown key! " + var6)
public void addKeepLoadedvoid addKeepLoaded()
public boolean consumeNeedsSavingboolean consumeNeedsSaving()
for for(int var1 = 0; var1 < ChunkFlag.VALUES.length; var1++)
static ComponentType<ChunkStore, WorldChunk> getComponentTypeComponentType<ChunkStore, WorldChunk> getComponentType()
public short getHeightshort getHeight(int var1, int var2)
public short getHeightshort getHeight(int var1)
public long getIndexlong getIndex()
public boolean getNeedsSavingboolean getNeedsSaving()
public Ref<ChunkStore> getReferenceRef<ChunkStore> getReference()
public World getWorldWorld getWorld()
public int getXint getX()
public int getZint getZ()
if if(var3)
if if(var1 == ChunkFlag.TICKING)
if if(var2)
if if(var6 == Integer.MIN_VALUE)
if if(var7 == Integer.MIN_VALUE)
if if(var8 != null)
if if(var2 >= 0 && var2 < 320)
if if(var15 != null)
if if(var19 != null && var7 == 0)
if if(this.lightingUpdatesEnabled)
if if(var21 || var22)
if if(var24 != null)
if if(var21)
if if(var22)
if if(var7 != null)
if if(var2 < 0 || var2 >= 320)
if if(var4 == null)
if if(var2 < 0 || var2 >= 320)
if if(var4 == null)
if if(var6 != null)
if if(var7 == null)
if if(var7 == null)
if if(var7 == null)
if if(var2 >= 0 && var2 < 320 && var4 != null)
if if(var8 != null)
public void initFlagsvoid initFlags()
public boolean isboolean is(@Nonnull ChunkFlag var1)
public boolean isSavingboolean isSaving()
public void markNeedsSavingvoid markNeedsSaving()
public int pollActiveTimerint pollActiveTimer(int var1)
public int pollKeepAliveint pollKeepAlive(int var1)
public void removeKeepLoadedvoid removeKeepLoaded()
public void resetActiveTimervoid resetActiveTimer()
public void resetKeepAlivevoid resetKeepAlive()
private void setBlockPhysicsvoid setBlockPhysics(int var1, int var2, int var3, @Nonnull BlockType var4)
public void setFlagvoid setFlag(@Nonnull ChunkFlag var1, boolean var2)
public void setSavingvoid setSaving(boolean var1)
public boolean shouldKeepLoadedboolean shouldKeepLoaded()
private void startsTickingvoid startsTicking()
private void stopsTickingvoid stopsTicking()
abstract this this(var1, var2)
private void updateFlagvoid updateFlag(ChunkFlag var1, boolean var2)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.server.core.universe.world.chunk;

class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.common.collection.Flags;
class="kw">import com.hypixel.hytale.common.util.CompletableFutureUtil;
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.logger.HytaleLogger;
class="kw">import com.hypixel.hytale.math.util.ChunkUtil;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktick.BlockTickManager;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktick.config.TickProcedure;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.BlockType;
class="kw">import com.hypixel.hytale.server.core.blocktype.component.BlockPhysics;
class="kw">import com.hypixel.hytale.server.core.modules.LegacyModule;
class="kw">import com.hypixel.hytale.server.core.modules.block.BlockEntity;
class="kw">import com.hypixel.hytale.server.core.universe.world.World;
class="kw">import com.hypixel.hytale.server.core.universe.world.chunk.environment.EnvironmentChunk;
class="kw">import com.hypixel.hytale.server.core.universe.world.chunk.section.BlockComponentSection;
class="kw">import com.hypixel.hytale.server.core.universe.world.chunk.section.BlockSection;
class="kw">import com.hypixel.hytale.server.core.universe.world.chunk.section.ChunkSection;
class="kw">import com.hypixel.hytale.server.core.universe.world.chunk.section.FluidSection;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
class="kw">import com.hypixel.hytale.server.core.util.FillerBlockUtil;
class="kw">import java.util.concurrent.CompletableFuture;
class="kw">import java.util.concurrent.atomic.AtomicInteger;
class="kw">import java.util.concurrent.atomic.AtomicLong;
class="kw">import java.util.concurrent.locks.StampedLock;
class="kw">import java.util.logging.Level;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.joml.Vector3i;
class="kw">import org.joml.Vector3ic;

class="kw">public class WorldChunk class="kw">implements Component<ChunkStore> {
   class="kw">public class="kw">static class="kw">final int KEEP_ALIVE_DEFAULT = 15;
   class="kw">public class="kw">static class="kw">final BuilderCodec<WorldChunk> CODEC = BuilderCodec.builder(WorldChunk.class, WorldChunk::new).build();
   class="kw">private class="kw">static class="kw">final HytaleLogger LOGGER = HytaleLogger.forEnclosingClass();
   class="kw">private World world;
   class="kw">private class="kw">final StampedLock flagsLock = new StampedLock();
   class="kw">private class="kw">final Flags<ChunkFlag> flags;
   class="kw">private Ref<ChunkStore> reference;
   @Nullable
   class="kw">private BlockChunk blockChunk;
   class="kw">private int keepAlive = 15;
   class="kw">private int activeTimer = 15;
   class="kw">private boolean needsSaving;
   class="kw">private boolean isSaving;
   class="kw">private class="kw">final AtomicInteger keepLoaded = new AtomicInteger();
   class="kw">private boolean lightingUpdatesEnabled = true;
   @Deprecated
   class="kw">public class="kw">final AtomicLong chunkLightTiming = new AtomicLong();

   class="kw">public class="kw">static ComponentType<ChunkStore, WorldChunk> getComponentType() {
      class="kw">return LegacyModule.get().getWorldChunkComponentType();
   }

   class="kw">private WorldChunk() {
      this.flags = new Flags<>();
   }

   class="kw">private WorldChunk(World var1, Flags<ChunkFlag> var2) {
      this.world = var1;
      this.flags = var2;
   }

   class="kw">public WorldChunk(World var1, Flags<ChunkFlag> var2, BlockChunk var3) {
      this(var1, var2);
      this.blockChunk = var3;
   }

   @Deprecated
   class="kw">public void setReference(Ref<ChunkStore> var1) {
      if (this.reference != null && this.reference.isValid()) {
         throw new IllegalArgumentException("Chunk already has a valid EntityReference: " + this.reference + " new reference " + var1);
      }

      this.reference = var1;
   }

   class="kw">public Ref<ChunkStore> getReference() {
      class="kw">return this.reference;
   }

   @Nonnull
   @Override
   class="kw">public Component<ChunkStore> clone() {
      class="kw">return new WorldChunk();
   }

   class="kw">public boolean is(@Nonnull ChunkFlag var1) {
      long var2 = this.flagsLock.tryOptimisticRead();
      boolean var4 = this.flags.is(var1);
      if (this.flagsLock.validate(var2)) {
         class="kw">return var4;
      }

      var2 = this.flagsLock.readLock();

      try {
         class="kw">return this.flags.is(var1);
      } class="kw">finally {
         this.flagsLock.unlockRead(var2);
      }
   }

   class="kw">public void setFlag(@Nonnull ChunkFlag var1, boolean var2) {
      long var4 = this.flagsLock.writeLock();

      boolean var3;
      try {
         if (!this.flags.set(var1, var2)) {
            class="kw">return;
         }

         var3 = this.flags.is(ChunkFlag.INIT);
      } class="kw">finally {
         this.flagsLock.unlockWrite(var4);
      }

      if (var3) {
         this.updateFlag(var1, var2);
      }

      LOGGER.at(Level.FINER).log("[%d, %d] updated chunk flag (init: %s): %s, %s ", this.getX(), this.getZ(), var3, var1, var2);
   }

   @Deprecated
   class="kw">public void loadFromHolder(World var1, int var2, int var3, @Nonnull Holder<ChunkStore> var4) {
      this.world = var1;
      this.blockChunk = var4.getComponent(BlockChunk.getComponentType());
      this.blockChunk.setEnvironmentChunk(var4.getComponent(EnvironmentChunk.getComponentType()));
      this.blockChunk.load(var2, var3);
   }

   class="kw">public void initFlags() {
      this.world.debugAssertInTickingThread();
      if (!this.is(ChunkFlag.START_INIT)) {
         throw new IllegalArgumentException("START_INIT hasn't been set!");
      }

      if (this.is(ChunkFlag.INIT)) {
         throw new IllegalArgumentException("INIT is already set!");
      }

      for (int var1 = 0; var1 < ChunkFlag.VALUES.length; var1++) {
         ChunkFlag var2 = ChunkFlag.VALUES[var1];
         this.updateFlag(var2, this.is(var2));
      }

      this.setFlag(ChunkFlag.INIT, true);
   }

   class="kw">private void updateFlag(ChunkFlag var1, boolean var2) {
      if (var1 == ChunkFlag.TICKING) {
         this.world.debugAssertInTickingThread();
         this.resetKeepAlive();
         if (var2) {
            this.startsTicking();
         } else {
            this.stopsTicking();
         }
      }
   }

   class="kw">private void startsTicking() {
      this.world.debugAssertInTickingThread();
      LOGGER.at(Level.FINER).log("Chunk started ticking %s", this);
      Store var1 = this.world.getChunkStore().getStore();
      var1.tryRemoveComponent(this.reference, ChunkStore.REGISTRY.getNonTickingComponentType());
   }

   class="kw">private void stopsTicking() {
      this.world.debugAssertInTickingThread();
      LOGGER.at(Level.FINER).log("Chunk stopped ticking %s", this);
      Store var1 = this.world.getChunkStore().getStore();
      var1.ensureComponent(this.reference, ChunkStore.REGISTRY.getNonTickingComponentType());
   }

   @Nullable
   @Deprecated
   class="kw">public BlockChunk getBlockChunk() {
      class="kw">return this.blockChunk;
   }

   class="kw">public boolean shouldKeepLoaded() {
      class="kw">return this.keepLoaded.get() > 0;
   }

   class="kw">public void addKeepLoaded() {
      this.keepLoaded.incrementAndGet();
   }

   class="kw">public void removeKeepLoaded() {
      this.keepLoaded.decrementAndGet();
   }

   class="kw">public int pollKeepAlive(int var1) {
      class="kw">return this.keepAlive = Math.max(this.keepAlive - var1, 0);
   }

   class="kw">public void resetKeepAlive() {
      this.keepAlive = 15;
   }

   class="kw">public int pollActiveTimer(int var1) {
      class="kw">return this.activeTimer = Math.max(this.activeTimer - var1, 0);
   }

   class="kw">public void resetActiveTimer() {
      this.activeTimer = 15;
   }

   @Deprecated
   class="kw">public int getBlock(int var1, int var2, int var3) {
      class="kw">return var2 >= 0 && var2 < 320 ? this.blockChunk.getBlock(var1, var2, var3) : 0;
   }

   @Nullable
   @Deprecated
   class="kw">public BlockType getBlockType(int var1, int var2, int var3) {
      class="kw">return BlockType.getAssetMap().getAsset(this.getBlock(var1, var2, var3));
   }

   @Nullable
   @Deprecated
   class="kw">public BlockType getBlockType(@Nonnull Vector3ic var1) {
      class="kw">return this.getBlockType(var1.x(), var1.y(), var1.z());
   }

   @Deprecated
   class="kw">public boolean setBlock(int var1, int var2, int var3, String var4) {
      class="kw">return this.setBlock(var1, var2, var3, var4, 0);
   }

   @Deprecated
   class="kw">public boolean setBlock(int var1, int var2, int var3, String var4, int var5) {
      int var6 = BlockType.getAssetMap().getIndex(var4);
      if (var6 == Integer.MIN_VALUE) {
         throw new IllegalArgumentException("Unknown key! " + var4);
      } else {
         class="kw">return this.setBlock(var1, var2, var3, var6, var5);
      }
   }

   @Deprecated
   class="kw">public boolean setBlock(int var1, int var2, int var3, int var4) {
      class="kw">return this.setBlock(var1, var2, var3, var4, 0);
   }

   @Deprecated
   class="kw">public boolean setBlock(int var1, int var2, int var3, int var4, int var5) {
      class="kw">return this.setBlock(var1, var2, var3, var4, BlockType.getAssetMap().getAsset(var4), 0, 0, var5);
   }

   @Deprecated
   class="kw">public boolean setBlock(int var1, int var2, int var3, @Nonnull BlockType var4) {
      class="kw">return this.setBlock(var1, var2, var3, var4, 0);
   }

   @Deprecated
   class="kw">public boolean setBlock(int var1, int var2, int var3, @Nonnull BlockType var4, int var5) {
      String var6 = var4.getId();
      int var7 = BlockType.getAssetMap().getIndex(var6);
      if (var7 == Integer.MIN_VALUE) {
         throw new IllegalArgumentException("Unknown key! " + var6);
      } else {
         class="kw">return this.setBlock(var1, var2, var3, var7, var4, 0, 0, var5);
      }
   }

   @Deprecated
   class="kw">public boolean breakBlock(int var1, int var2, int var3, int var4, int var5) {
      if ((var5 & 16) == 0) {
         int var6 = var1;
         int var7 = var2;
         int var8 = var3;
         var1 -= FillerBlockUtil.unpackX(var4);
         var2 -= FillerBlockUtil.unpackY(var4);
         var3 -= FillerBlockUtil.unpackZ(var4);
         if (this.getBlock(var1, var2, var3) == 0) {
            class="kw">return this.setBlock(var6, var7, var8, 0, BlockType.EMPTY, 0, 0, var5);
         }
      }

      class="kw">return this.setBlock(var1, var2, var3, 0, BlockType.EMPTY, 0, 0, var5);
   }

   @Deprecated
   class="kw">public boolean breakBlock(int var1, int var2, int var3, int var4) {
      class="kw">return this.breakBlock(var1, var2, var3, 0, var4);
   }

   @Deprecated
   class="kw">public void setBlockInteractionState(@Nonnull Vector3i var1, @Nonnull BlockType var2, @Nonnull String var3) {
      this.setBlockInteractionState(var1.x, var1.y, var1.z, var2, var3, false);
   }

   @Deprecated
   class="kw">public void setBlockInteractionState(int var1, int var2, int var3, @Nonnull BlockType var4, @Nonnull String var5, boolean var6) {
      if (var4.getData() != null) {
         String var7 = var4.getCurrentInteractionState();
         if (var6 || var7 == null || !var7.equals(var5)) {
            BlockType var8 = var4.getBlockForState(var5);
            if (var8 != null) {
               int var9 = 198;
               int var10 = this.getRotationIndex(var1, var2, var3);
               this.setBlock(var1, var2, var3, BlockType.getAssetMap().getIndex(var8.getId()), var8, var10, 0, 198);
            }
         }
      }
   }

   @Deprecated
   class="kw">public boolean setBlock(int var1, int var2, int var3, int var4, @Nonnull BlockType var5, int var6, int var7, int var8) {
      if (var2 >= 0 && var2 < 320) {
         short var9 = this.blockChunk.getHeight(var1, var3);
         BlockSection var10 = this.blockChunk.getSectionAtBlockY(var2);
         int var11 = var10.getRotationIndex(var1, var2, var3);
         int var12 = var10.getFiller(var1, var2, var3);
         int var13 = var10.get(var1, var2, var3);
         boolean var14 = (var13 != var4 || var6 != var11) && var10.set(var1, var2, var3, var4, var6, var7);
         if (var14 || (var8 & 64) != 0) {
            ChunkSection var15 = this.blockChunk.getSectionRefAtIndex(ChunkUtil.chunkCoordinate(var2));
            if (var15 != null) {
               var15.markNeedsSaving();
            }

            int var16 = (this.getX() << 5) + (var1 & 31);
            int var17 = (this.getZ() << 5) + (var3 & 31);
            if ((var8 & 64) != 0) {
               var10.invalidateBlock(var1, var2, var3);
            }

            short var18 = var9;
            if ((var8 & 512) == 0) {
               var18 = BlockOperations.updateBlockHeight(this.blockChunk, var4, var5, var1, var2, var3, var18);
            }

            if ((var8 & 4) == 0) {
               BlockOperations.spawnBlockParticles(this.world.getChunkStore(), var13, var4, var16, var2, var17, (var8 & 32) != 0);
            }

            if ((var8 & 2) == 0) {
               Holder var19 = var5.getBlockEntity();
               if (var19 != null && var7 == 0) {
                  Holder var20 = var19.clone();
                  this.setState(var1, var2, var3, var5, var6, var20);
               } else {
                  this.setState(var1, var2, var3, var5, var6, null);
               }
            }

            if (this.lightingUpdatesEnabled) {
               this.world.getChunkLighting().invalidateLightAtBlock(this.world.getChunkStore(), var1, var2, var3, var5, var9, var18);
            }

            TickProcedure var26 = BlockTickManager.getBlockTickProvider().getTickProcedure(var4);
            this.blockChunk.setTicking(var1, var2, var3, var26 != null);
            FillerBlockUtil.ChangeReason var27 = FillerBlockUtil.ChangeReason.NONE;
            if ((var8 & 4) == 0) {
               var27 = (var8 & 32) != 0 ? FillerBlockUtil.ChangeReason.BY_PHYSICS : FillerBlockUtil.ChangeReason.NORMAL;
            }

            boolean var21 = (var8 & 16) == 0;
            boolean var22 = (var8 & 8) == 0 && var7 == 0;
            if (var21 || var22) {
               Ref var23 = this.getSectionReference(var2);
               BlockComponentSection var24 = this.getBlockComponentSection(var23);
               if (var24 != null) {
                  Store var25 = this.reference.getStore();
                  if (var21) {
                     FillerBlockUtil.removeFillerBlocksAt(var25, var10, var24, var16, var2, var17, var13, var12, var11, var27);
                  }

                  if (var22) {
                     FillerBlockUtil.setFillerBlocksAt(var25, var23, var10, var24, var16, var2, var17, var4, var7, var6, var27);
                  }
               }
            }

            if ((var8 & 256) != 0) {
               BlockOperations.updateBlockArea(this.world.getChunkStore(), var10, var5, var6, var1, var2, var3);
            }

            if (this.reference != null && this.reference.isValid()) {
               if (this.world.isInThread()) {
                  this.setBlockPhysics(var1, var2, var3, var5);
               } else {
                  BlockType var28 = var5;
                  CompletableFutureUtil._catch(CompletableFuture.runAsync(() -> this.setBlockPhysics(var1, var2, var3, var28), this.world));
               }
            }
         }

         class="kw">return var14;
      } else {
         class="kw">return false;
      }
   }

   class="kw">private void setBlockPhysics(int var1, int var2, int var3, @Nonnull BlockType var4) {
      Store var5 = this.reference.getStore();
      ChunkColumn var6 = var5.getComponent(this.reference, ChunkColumn.getComponentType());
      Ref var7 = var6.getSection(ChunkUtil.chunkCoordinate(var2));
      if (var7 != null) {
         if (!var4.hasSupport()) {
            BlockPhysics.clear(var5, var7, var1, var2, var3);
         } else {
            BlockPhysics.reset(var5, var7, var1, var2, var3);
         }
      }
   }

   @Deprecated(forRemoval = true)
   class="kw">public int getFiller(int var1, int var2, int var3) {
      class="kw">return var2 >= 0 && var2 < 320 ? this.blockChunk.getSectionAtBlockY(var2).getFiller(var1, var2, var3) : 0;
   }

   @Deprecated(forRemoval = true)
   class="kw">public int getRotationIndex(int var1, int var2, int var3) {
      class="kw">return var2 >= 0 && var2 < 320 ? this.blockChunk.getSectionAtBlockY(var2).getRotationIndex(var1, var2, var3) : 0;
   }

   @Deprecated
   class="kw">public boolean setTicking(int var1, int var2, int var3, boolean var4) {
      class="kw">return this.blockChunk.setTicking(var1, var2, var3, var4);
   }

   @Deprecated
   class="kw">public boolean isTicking(int var1, int var2, int var3) {
      class="kw">return this.blockChunk.isTicking(var1, var2, var3);
   }

   class="kw">public short getHeight(int var1, int var2) {
      class="kw">return this.blockChunk.getHeight(var1, var2);
   }

   class="kw">public short getHeight(int var1) {
      class="kw">return this.blockChunk.getHeight(var1);
   }

   @Nullable
   @Deprecated
   class="kw">public Ref<ChunkStore> getBlockComponentEntity(int var1, int var2, int var3) {
      if (var2 < 0 || var2 >= 320) {
         class="kw">return null;
      }

      if (!this.world.isInThread()) {
         class="kw">return CompletableFuture.<Ref<ChunkStore>>supplyAsync(() -> this.getBlockComponentEntity(var1, var2, var3), this.world).join();
      }

      BlockComponentSection var4 = this.getBlockComponentSection(this.getSectionReference(var2));
      if (var4 == null) {
         class="kw">return null;
      }

      int var5 = ChunkUtil.indexBlock(var1, var2, var3);
      class="kw">return var4.getBlockReference(var5);
   }

   @Nullable
   @Deprecated
   class="kw">public Holder<ChunkStore> getBlockComponentHolder(int var1, int var2, int var3) {
      if (var2 < 0 || var2 >= 320) {
         class="kw">return null;
      }

      if (!this.world.isInThread()) {
         class="kw">return CompletableFuture.<Holder<ChunkStore>>supplyAsync(() -> this.getBlockComponentHolder(var1, var2, var3), this.world).join();
      }

      BlockComponentSection var4 = this.getBlockComponentSection(this.getSectionReference(var2));
      if (var4 == null) {
         class="kw">return null;
      }

      int var5 = ChunkUtil.indexBlock(var1, var2, var3);
      Ref var6 = var4.getBlockReference(var5);
      if (var6 != null) {
         class="kw">return var6.getStore().copyEntity(var6);
      }

      Holder var7 = var4.getBlockHolder(var5);
      class="kw">return var7 != null ? var7.clone() : null;
   }

   @Deprecated(forRemoval = true)
   class="kw">public int getFluidId(int var1, int var2, int var3) {
      Ref var4 = this.getReference();
      Store var5 = var4.getStore();
      ChunkColumn var6 = var5.getComponent(var4, ChunkColumn.getComponentType());
      Ref var7 = var6.getSection(ChunkUtil.chunkCoordinate(var2));
      if (var7 == null) {
         class="kw">return 0;
      }

      FluidSection var8 = var5.getComponent(var7, FluidSection.getComponentType());
      class="kw">return var8.getFluidId(var1, var2, var3);
   }

   @Deprecated(forRemoval = true)
   class="kw">public byte getFluidLevel(int var1, int var2, int var3) {
      Ref var4 = this.getReference();
      Store var5 = var4.getStore();
      ChunkColumn var6 = var5.getComponent(var4, ChunkColumn.getComponentType());
      Ref var7 = var6.getSection(ChunkUtil.chunkCoordinate(var2));
      if (var7 == null) {
         class="kw">return 0;
      }

      FluidSection var8 = var5.getComponent(var7, FluidSection.getComponentType());
      class="kw">return var8.getFluidLevel(var1, var2, var3);
   }

   @Deprecated(forRemoval = true)
   class="kw">public int getSupportValue(int var1, int var2, int var3) {
      Ref var4 = this.getReference();
      Store var5 = var4.getStore();
      ChunkColumn var6 = var5.getComponent(var4, ChunkColumn.getComponentType());
      Ref var7 = var6.getSection(ChunkUtil.chunkCoordinate(var2));
      if (var7 == null) {
         class="kw">return 0;
      }

      BlockPhysics var8 = var5.getComponent(var7, BlockPhysics.getComponentType());
      class="kw">return var8 != null ? var8.get(var1, var2, var3) : 0;
   }

   @Deprecated
   class="kw">public void setState(int var1, int var2, int var3, BlockType var4, int var5, @Nullable Holder<ChunkStore> var6) {
      if (var2 >= 0 && var2 < 320 && var4 != null) {
         if (!this.world.isInThread()) {
            CompletableFutureUtil._catch(CompletableFuture.runAsync(() -> this.setState(var1, var2, var3, var4, var5, var6), this.world));
         } else {
            Ref var7 = this.getSectionReference(var2);
            BlockComponentSection var8 = this.getBlockComponentSection(var7);
            if (var8 != null) {
               int var9 = ChunkUtil.worldCoordFromLocalCoord(this.getX(), ChunkUtil.localCoordinate(var1));
               int var10 = ChunkUtil.worldCoordFromLocalCoord(this.getZ(), ChunkUtil.localCoordinate(var3));
               BlockEntity.setBlockEntity(this.world.getChunkStore().getStore(), var7, var8, var9, var2, var10, var4, var5, var6);
            }
         }
      }
   }

   @Nullable
   class="kw">private Ref<ChunkStore> getSectionReference(int var1) {
      if (this.reference != null && this.reference.isValid()) {
         ChunkColumn var2 = this.reference.getStore().getComponent(this.reference, ChunkColumn.getComponentType());
         class="kw">return var2 != null ? var2.getSection(ChunkUtil.chunkCoordinate(var1)) : null;
      } else {
         class="kw">return null;
      }
   }

   @Nullable
   class="kw">private BlockComponentSection getBlockComponentSection(@Nullable Ref<ChunkStore> var1) {
      class="kw">return var1 != null ? this.reference.getStore().getComponent(var1, BlockComponentSection.getComponentType()) : null;
   }

   class="kw">public void markNeedsSaving() {
      this.needsSaving = true;
   }

   class="kw">public boolean getNeedsSaving() {
      class="kw">return this.needsSaving || this.blockChunk.getNeedsSaving();
   }

   class="kw">public boolean consumeNeedsSaving() {
      boolean var1 = this.needsSaving;
      if (this.blockChunk.consumeNeedsSaving()) {
         var1 = true;
      }

      this.needsSaving = false;
      class="kw">return var1;
   }

   class="kw">public boolean isSaving() {
      class="kw">return this.isSaving;
   }

   class="kw">public void setSaving(boolean var1) {
      this.isSaving = var1;
   }

   class="kw">public long getIndex() {
      class="kw">return this.blockChunk.getIndex();
   }

   class="kw">public int getX() {
      class="kw">return this.blockChunk.getX();
   }

   class="kw">public int getZ() {
      class="kw">return this.blockChunk.getZ();
   }

   @Deprecated
   class="kw">public void setLightingUpdatesEnabled(boolean var1) {
      this.lightingUpdatesEnabled = var1;
   }

   class="kw">public World getWorld() {
      class="kw">return this.world;
   }

   @Nonnull
   @Override
   class="kw">public String toString() {
      class="kw">return "WorldChunk{x=" + this.blockChunk.getX() + ", z=" + this.blockChunk.getZ() + ", flags=" + this.flags + "}";
   }
}