DimensionsOperation class

Пакет: com.hypixel.hytale.builtin.buildertools.scriptedbrushes.operations.sequential.dimensions

Файл: com/hypixel/hytale/builtin/buildertools/scriptedbrushes/operations/sequential/dimensions/DimensionsOperation.java

extends: SequenceBrushOperation

Поля (3)

МодификаторыТипИмя
final BuilderCodec<DimensionsOperation> CODEC
int var5
int var6

Методы (1)

МодификаторыВозвратСигнатура
abstract super super("Modify Dimensions", "Set, add, or subtract from the dimensions of the brush area", false)

Исходный код

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

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.scriptedbrushes.operations.system.SequenceBrushOperation;
class="kw">import com.hypixel.hytale.codec.KeyedCodec;
class="kw">import com.hypixel.hytale.codec.builder.BuilderCodec;
class="kw">import com.hypixel.hytale.component.ComponentAccessor;
class="kw">import com.hypixel.hytale.component.Ref;
class="kw">import com.hypixel.hytale.math.util.MathUtil;
class="kw">import com.hypixel.hytale.server.core.command.system.arguments.types.RelativeInteger;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;

class="kw">public class DimensionsOperation class="kw">extends SequenceBrushOperation {
   class="kw">public class="kw">static class="kw">final BuilderCodec<DimensionsOperation> CODEC = BuilderCodec.builder(DimensionsOperation.class, DimensionsOperation::new)
      .append(new KeyedCodec<>("Width", RelativeInteger.CODEC), (var0, var1) -> var0.widthArg = var1, var0 -> var0.widthArg)
      .documentation("Sets the width of the brush to the specified amount, optionally relative to the existing amount when using prefixing with tilde")
      .add()
      .<RelativeInteger>append(new KeyedCodec<>("Height", RelativeInteger.CODEC), (var0, var1) -> var0.heightArg = var1, var0 -> var0.heightArg)
      .documentation("Sets the height of the brush to the specified amount, optionally relative to the existing amount when using prefixing with tilde")
      .add()
      .documentation("Set, add, or subtract from the dimensions of the brush area")
      .build();
   @Nonnull
   class="kw">public RelativeInteger widthArg = new RelativeInteger(3, false);
   @Nonnull
   class="kw">public RelativeInteger heightArg = new RelativeInteger(3, false);

   class="kw">public DimensionsOperation() {
      super("Modify Dimensions", "Set, add, or subtract from the dimensions of the brush area", false);
   }

   @Override
   class="kw">public void modifyBrushConfig(
      @Nonnull Ref<EntityStore> var1, @Nonnull BrushConfig var2, @Nonnull BrushConfigCommandExecutor var3, @Nonnull ComponentAccessor<EntityStore> var4
   ) {
      int var5 = this.widthArg.resolve(var2.getShapeWidth());
      int var6 = this.heightArg.resolve(var2.getShapeHeight());
      var2.setShapeWidth(MathUtil.clamp(var5, 1, 75));
      var2.setShapeHeight(MathUtil.clamp(var6, 1, 75));
   }
}