SetDensity class
Пакет: com.hypixel.hytale.builtin.buildertools.scriptedbrushes.operations.sequential
Файл: com/hypixel/hytale/builtin/buildertools/scriptedbrushes/operations/sequential/SetDensity.java
extends: SequenceBrushOperation
Поля (1)
| Модификаторы | Тип | Имя |
|---|---|---|
final |
BuilderCodec<SetDensity> |
CODEC |
Методы (1)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
abstract |
|
super super("Density",
"Sets the random chance that any given block being set will actually get set, otherwise getting cancelled. Ex: a value of 30 is a 30% chance blocks will appear with a set operation.",
false) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.buildertools.scriptedbrushes.operations.sequential;
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.Codec;
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.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;
class="kw">public class SetDensity class="kw">extends SequenceBrushOperation {
class="kw">public class="kw">static class="kw">final BuilderCodec<SetDensity> CODEC = BuilderCodec.builder(SetDensity.class, SetDensity::new)
.append(new KeyedCodec<>("Density", Codec.INTEGER), (var0, var1) -> var0.density = var1, var0 -> var0.density)
.documentation("Changes the likelyhood that a given block will be processed")
.add()
.documentation(
"Sets the random chance that any given block being set will actually get set, otherwise getting cancelled. Ex: a value of 30 is a 30% chance blocks will appear with a set operation."
)
.build();
class="kw">public Integer density = 100;
class="kw">public SetDensity() {
super(
"Density",
"Sets the random chance that any given block being set will actually get set, otherwise getting cancelled. Ex: a value of 30 is a 30% chance blocks will appear with a set operation.",
false
);
}
@Override
class="kw">public void modifyBrushConfig(
@Nonnull Ref<EntityStore> var1, @Nonnull BrushConfig var2, @Nonnull BrushConfigCommandExecutor var3, @Nonnull ComponentAccessor<EntityStore> var4
) {
var2.setDensity(this.density);
}
}