PrototypePlayerBuilderToolSettings class

Пакет: com.hypixel.hytale.builtin.buildertools

Файл: com/hypixel/hytale/builtin/buildertools/PrototypePlayerBuilderToolSettings.java

Поля (4)

МодификаторыТипИмя
LongOpenHashSet var1
UUIDComponent var3
long var4
PrototypePlayerBuilderToolSettings var4

Методы (34)

МодификаторыВозвратСигнатура
public record EntityChangerecord EntityChange(double x, double y, double z, Holder<EntityStore> entityHolder)
public record FluidChangerecord FluidChange(int x, int y, int z, int fluidId, byte fluidLevel)
public void clearHistoryUntilFitMaxLengthvoid clearHistoryUntilFitMaxLength()
public void clearLastBrushPositionvoid clearLastBrushPosition()
public void clearLastTransformEntityRefsvoid clearLastTransformEntityRefs()
public boolean containsLocationboolean containsLocation(int var1, int var2, int var3)
for for(LongOpenHashSet var7 : this.ignoredPaintOperations)
public BrushConfig getBrushConfigBrushConfig getBrushConfig()
public BrushConfigCommandExecutor getBrushConfigCommandExecutorBrushConfigCommandExecutor getBrushConfigCommandExecutor()
public String getCurrentlyLoadedBrushConfigNameString getCurrentlyLoadedBrushConfigName()
public int getMaxLengthOfIgnoredPaintOperationsint getMaxLengthOfIgnoredPaintOperations()
public UUID getPlayerUUID getPlayer()
public int getUndoGroupSizeint getUndoGroupSize()
if if(!this.isInSelectionTransformationMode)
public boolean isInSelectionTransformationModeboolean isInSelectionTransformationMode()
public boolean isLoadingBrushboolean isLoadingBrush()
static boolean isOkayToDoCommandsOnSelectionboolean isOkayToDoCommandsOnSelection(Ref<EntityStore> var0, @Nonnull PlayerRef var1, ComponentAccessor<EntityStore> var2)
public void setBlockChangeOffsetOriginvoid setBlockChangeOffsetOrigin(@Nullable Vector3i var1)
public void setBlockChangesForPlaySelectionToolPasteModevoid setBlockChangesForPlaySelectionToolPasteMode(@Nullable BlockChange[] var1)
public void setBlockHoldersForPasteModevoid setBlockHoldersForPasteMode(@Nullable Holder<ChunkStore>[] var1)
public void setBrushConfigvoid setBrushConfig(BrushConfig var1)
public void setCurrentlyLoadedBrushConfigNamevoid setCurrentlyLoadedBrushConfigName(String var1)
public void setEntityChangesForPlaySelectionToolPasteModevoid setEntityChangesForPlaySelectionToolPasteMode(@Nullable PrototypePlayerBuilderToolSettings.EntityChange[] var1)
public void setFluidChangesForPlaySelectionToolPasteModevoid setFluidChangesForPlaySelectionToolPasteMode(@Nullable PrototypePlayerBuilderToolSettings.FluidChange[] var1)
public void setInSelectionTransformationModevoid setInSelectionTransformationMode(boolean var1)
public void setLastBrushPositionvoid setLastBrushPosition(@Nullable Vector3i var1)
public void setLastTransformEntityRefsvoid setLastTransformEntityRefs(@Nullable List<Ref<EntityStore>> var1)
public void setLoadingBrushvoid setLoadingBrush(boolean var1)
public void setMaxLengthOfIgnoredPaintOperationsvoid setMaxLengthOfIgnoredPaintOperations(int var1)
public void setPrototypeItemIdvoid setPrototypeItemId(@Nullable String var1)
public void setShouldShowEditorSettingsvoid setShouldShowEditorSettings(boolean var1)
public void setUndoGroupSizevoid setUndoGroupSize(int var1)
public void setUsePrototypeBrushConfigurationsvoid setUsePrototypeBrushConfigurations(boolean var1)
public boolean usePrototypeBrushConfigurationsboolean usePrototypeBrushConfigurations()

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.buildertools;

class="kw">import com.hypixel.hytale.builtin.buildertools.scriptedbrushes.BrushConfig;
class="kw">import com.hypixel.hytale.builtin.buildertools.scriptedbrushes.BrushConfigCommandExecutor;
class="kw">import com.hypixel.hytale.builtin.buildertools.tooloperations.ToolOperation;
class="kw">import com.hypixel.hytale.component.ComponentAccessor;
class="kw">import com.hypixel.hytale.component.Holder;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.math.block.BlockUtil;
class="kw">import com.hypixel.hytale.protocol.packets.interface_.BlockChange;
class="kw">import com.hypixel.hytale.server.core.Message;
class="kw">import com.hypixel.hytale.server.core.entity.UUIDComponent;
class="kw">import com.hypixel.hytale.server.core.universe.PlayerRef;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import it.unimi.dsi.fastutil.longs.LongOpenHashSet;
class="kw">import java.util.ArrayDeque;
class="kw">import java.util.Deque;
class="kw">import java.util.List;
class="kw">import java.util.UUID;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">import org.joml.Vector3i;

class="kw">public class PrototypePlayerBuilderToolSettings {
   @Nonnull
   class="kw">private class="kw">static class="kw">final Message MESSAGE_BUILDER_TOOLS_CANNOT_PERFORM_COMMAND_IN_TRANSFORMATION_MODE = Message.translation(
      "server.builderTools.cannotPerformCommandInTransformationMode"
   );
   class="kw">private class="kw">final UUID player;
   class="kw">private class="kw">final Deque<LongOpenHashSet> ignoredPaintOperations = new ArrayDeque<>();
   class="kw">private int maxLengthOfIgnoredPaintOperations;
   class="kw">private boolean shouldShowEditorSettings;
   class="kw">private boolean isLoadingBrush;
   class="kw">private boolean usePrototypeBrushConfigurations;
   class="kw">private String currentlyLoadedBrushConfigName = "";
   class="kw">private BrushConfig brushConfig = new BrushConfig();
   class="kw">private BrushConfigCommandExecutor brushConfigCommandExecutor;
   class="kw">private boolean isInSelectionTransformationMode = false;
   @Nullable
   class="kw">private BlockChange[] blockChangesForPlaySelectionToolPasteMode = null;
   @Nullable
   class="kw">private PrototypePlayerBuilderToolSettings.FluidChange[] fluidChangesForPlaySelectionToolPasteMode = null;
   @Nullable
   class="kw">private PrototypePlayerBuilderToolSettings.EntityChange[] entityChangesForPlaySelectionToolPasteMode = null;
   @Nullable
   class="kw">private Holder<ChunkStore>[] blockHoldersForPasteMode = null;
   @Nullable
   class="kw">private String prototypeItemId;
   @Nullable
   class="kw">private Vector3i lastBrushPosition = null;
   class="kw">private int undoGroupSize = 10;
   @Nullable
   class="kw">private Vector3i blockChangeOffsetOrigin = null;
   @Nullable
   class="kw">private List<Ref<EntityStore>> lastTransformEntityRefs = null;

   class="kw">public PrototypePlayerBuilderToolSettings(UUID var1) {
      this.player = var1;
      this.brushConfigCommandExecutor = new BrushConfigCommandExecutor(this.brushConfig);
   }

   class="kw">public UUID getPlayer() {
      class="kw">return this.player;
   }

   @Nullable
   class="kw">public String getPrototypeItemId() {
      class="kw">return this.prototypeItemId;
   }

   class="kw">public void setPrototypeItemId(@Nullable String var1) {
      this.prototypeItemId = var1;
   }

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

   class="kw">public void setInSelectionTransformationMode(boolean var1) {
      this.isInSelectionTransformationMode = var1;
      if (!this.isInSelectionTransformationMode) {
         this.blockChangesForPlaySelectionToolPasteMode = null;
         this.fluidChangesForPlaySelectionToolPasteMode = null;
         this.entityChangesForPlaySelectionToolPasteMode = null;
         this.blockHoldersForPasteMode = null;
         this.blockChangeOffsetOrigin = null;
      }
   }

   class="kw">public void setBlockChangesForPlaySelectionToolPasteMode(@Nullable BlockChange[] var1) {
      this.blockChangesForPlaySelectionToolPasteMode = var1;
   }

   class="kw">public String getCurrentlyLoadedBrushConfigName() {
      class="kw">return this.currentlyLoadedBrushConfigName;
   }

   class="kw">public void setCurrentlyLoadedBrushConfigName(String var1) {
      this.currentlyLoadedBrushConfigName = var1;
   }

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

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

   @Nullable
   class="kw">public BlockChange[] getBlockChangesForPlaySelectionToolPasteMode() {
      class="kw">return this.blockChangesForPlaySelectionToolPasteMode;
   }

   class="kw">public void setFluidChangesForPlaySelectionToolPasteMode(@Nullable PrototypePlayerBuilderToolSettings.FluidChange[] var1) {
      this.fluidChangesForPlaySelectionToolPasteMode = var1;
   }

   @Nullable
   class="kw">public PrototypePlayerBuilderToolSettings.FluidChange[] getFluidChangesForPlaySelectionToolPasteMode() {
      class="kw">return this.fluidChangesForPlaySelectionToolPasteMode;
   }

   class="kw">public void setEntityChangesForPlaySelectionToolPasteMode(@Nullable PrototypePlayerBuilderToolSettings.EntityChange[] var1) {
      this.entityChangesForPlaySelectionToolPasteMode = var1;
   }

   @Nullable
   class="kw">public PrototypePlayerBuilderToolSettings.EntityChange[] getEntityChangesForPlaySelectionToolPasteMode() {
      class="kw">return this.entityChangesForPlaySelectionToolPasteMode;
   }

   class="kw">public void setBlockHoldersForPasteMode(@Nullable Holder<ChunkStore>[] var1) {
      this.blockHoldersForPasteMode = var1;
   }

   @Nullable
   class="kw">public Holder<ChunkStore>[] getBlockHoldersForPasteMode() {
      class="kw">return this.blockHoldersForPasteMode;
   }

   class="kw">public void setBlockChangeOffsetOrigin(@Nullable Vector3i var1) {
      this.blockChangeOffsetOrigin = var1;
   }

   @Nullable
   class="kw">public Vector3i getBlockChangeOffsetOrigin() {
      class="kw">return this.blockChangeOffsetOrigin;
   }

   class="kw">public void setLastTransformEntityRefs(@Nullable List<Ref<EntityStore>> var1) {
      this.lastTransformEntityRefs = var1;
   }

   @Nullable
   class="kw">public List<Ref<EntityStore>> getLastTransformEntityRefs() {
      class="kw">return this.lastTransformEntityRefs;
   }

   class="kw">public void clearLastTransformEntityRefs() {
      this.lastTransformEntityRefs = null;
   }

   @Nonnull
   class="kw">public LongOpenHashSet addIgnoredPaintOperation() {
      LongOpenHashSet var1 = new LongOpenHashSet();
      this.ignoredPaintOperations.add(var1);
      this.clearHistoryUntilFitMaxLength();
      class="kw">return var1;
   }

   class="kw">public void clearHistoryUntilFitMaxLength() {
      while (this.ignoredPaintOperations.size() > this.maxLengthOfIgnoredPaintOperations) {
         this.ignoredPaintOperations.removeFirst();
      }
   }

   class="kw">public boolean containsLocation(int var1, int var2, int var3) {
      long var4 = BlockUtil.pack(var1, var2, var3);

      for (LongOpenHashSet var7 : this.ignoredPaintOperations) {
         if (var7.contains(var4)) {
            class="kw">return true;
         }
      }

      class="kw">return false;
   }

   @Nonnull
   class="kw">public Deque<LongOpenHashSet> getIgnoredPaintOperations() {
      class="kw">return this.ignoredPaintOperations;
   }

   class="kw">public int getMaxLengthOfIgnoredPaintOperations() {
      class="kw">return this.maxLengthOfIgnoredPaintOperations;
   }

   class="kw">public void setMaxLengthOfIgnoredPaintOperations(int var1) {
      this.maxLengthOfIgnoredPaintOperations = var1;
      this.clearHistoryUntilFitMaxLength();
   }

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

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

   class="kw">public BrushConfig getBrushConfig() {
      class="kw">return this.brushConfig;
   }

   class="kw">public BrushConfigCommandExecutor getBrushConfigCommandExecutor() {
      class="kw">return this.brushConfigCommandExecutor;
   }

   class="kw">public void setBrushConfig(BrushConfig var1) {
      this.brushConfig = var1;
   }

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

   @Nullable
   class="kw">public Vector3i getLastBrushPosition() {
      class="kw">return this.lastBrushPosition;
   }

   class="kw">public void setLastBrushPosition(@Nullable Vector3i var1) {
      this.lastBrushPosition = var1;
   }

   class="kw">public void clearLastBrushPosition() {
      this.lastBrushPosition = null;
   }

   class="kw">public int getUndoGroupSize() {
      class="kw">return this.undoGroupSize;
   }

   class="kw">public void setUndoGroupSize(int var1) {
      this.undoGroupSize = var1 > 0 ? var1 : 10;
   }

   class="kw">public class="kw">static boolean isOkayToDoCommandsOnSelection(Ref<EntityStore> var0, @Nonnull PlayerRef var1, ComponentAccessor<EntityStore> var2) {
      UUIDComponent var3 = var2.getComponent(var0, UUIDComponent.getComponentType());
      assert var3 != null;
      PrototypePlayerBuilderToolSettings var4 = ToolOperation.getOrCreatePrototypeSettings(var3.getUuid());
      if (var4.isInSelectionTransformationMode()) {
         var1.sendMessage(MESSAGE_BUILDER_TOOLS_CANNOT_PERFORM_COMMAND_IN_TRANSFORMATION_MODE);
         class="kw">return false;
      } else {
         class="kw">return true;
      }
   }

   class="kw">public record EntityChange(double x, double y, double z, Holder<EntityStore> entityHolder) {
      class="kw">public EntityChange {
      }
   }

   class="kw">public record FluidChange(int x, int y, int z, int fluidId, byte fluidLevel) {
      class="kw">public FluidChange {
      }
   }
}