FarmingBlock class
Пакет: com.hypixel.hytale.builtin.adventure.farming.states
Файл: com/hypixel/hytale/builtin/adventure/farming/states/FarmingBlock.java
implements: Component<ChunkStore>
Методы (14)
| Модификаторы | Возврат | Сигнатура |
|---|---|---|
static |
ComponentType<ChunkStore, FarmingBlock> |
getComponentTypeComponentType<ChunkStore, FarmingBlock> getComponentType() |
public |
int |
getExecutionsint getExecutions() |
public |
int |
getGenerationint getGeneration() |
public |
float |
getGrowthProgressfloat getGrowthProgress() |
public |
Instant |
getLastTickGameTimeInstant getLastTickGameTime() |
public |
String |
getPreviousBlockTypeString getPreviousBlockType() |
public |
float |
getSpreadRatefloat getSpreadRate() |
public |
void |
setCurrentStageSetvoid setCurrentStageSet(@Nullable String var1) |
public |
void |
setExecutionsvoid setExecutions(int var1) |
public |
void |
setGenerationvoid setGeneration(int var1) |
public |
void |
setGrowthProgressvoid setGrowthProgress(float var1) |
public |
void |
setLastTickGameTimevoid setLastTickGameTime(Instant var1) |
public |
void |
setPreviousBlockTypevoid setPreviousBlockType(String var1) |
public |
void |
setSpreadRatevoid setSpreadRate(float var1) |
Исходный код
Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.adventure.farming.states;
class="kw">import com.hypixel.hytale.builtin.adventure.farming.FarmingPlugin;
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.Component;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
class="kw">import java.time.Instant;
class="kw">import javax.annotation.Nonnull;
class="kw">import javax.annotation.Nullable;
class="kw">public class FarmingBlock class="kw">implements Component<ChunkStore> {
@Nonnull
class="kw">public class="kw">static class="kw">final String DEFAULT_STAGE_SET = "Default";
@Nonnull
class="kw">public class="kw">static class="kw">final BuilderCodec<FarmingBlock> CODEC = BuilderCodec.builder(FarmingBlock.class, FarmingBlock::new)
.append(
new KeyedCodec<>("CurrentStageSet", Codec.STRING),
(var0, var1) -> var0.currentStageSet = var1,
var0 -> "Default".equals(var0.currentStageSet) ? null : var0.currentStageSet
)
.add()
.append(
new KeyedCodec<>("GrowthProgress", Codec.FLOAT),
(var0, var1) -> var0.growthProgress = var1,
var0 -> var0.growthProgress == 0.0F ? null : var0.growthProgress
)
.add()
.append(new KeyedCodec<>("LastTickGameTime", Codec.INSTANT), (var0, var1) -> var0.lastTickGameTime = var1, var0 -> var0.lastTickGameTime)
.add()
.append(new KeyedCodec<>("Generation", Codec.INTEGER), (var0, var1) -> var0.generation = var1, var0 -> var0.generation == 0 ? null : var0.generation)
.add()
.append(new KeyedCodec<>("PreviousBlockType", Codec.STRING), (var0, var1) -> var0.previousBlockType = var1, var0 -> var0.previousBlockType)
.add()
.append(new KeyedCodec<>("SpreadRate", Codec.FLOAT), (var0, var1) -> var0.spreadRate = var1, var0 -> var0.spreadRate == 1.0F ? null : var0.spreadRate)
.add()
.append(new KeyedCodec<>("Executions", Codec.INTEGER), (var0, var1) -> var0.executions = var1, var0 -> var0.executions == 0 ? null : var0.executions)
.add()
.build();
@Nonnull
class="kw">private String currentStageSet = "Default";
class="kw">private float growthProgress;
class="kw">private Instant lastTickGameTime;
class="kw">private int generation;
class="kw">private String previousBlockType;
class="kw">private float spreadRate = 1.0F;
class="kw">private int executions;
class="kw">public class="kw">static ComponentType<ChunkStore, FarmingBlock> getComponentType() {
class="kw">return FarmingPlugin.get().getFarmingBlockComponentType();
}
class="kw">public FarmingBlock() {
}
class="kw">public FarmingBlock(@Nonnull String var1, float var2, Instant var3, int var4, String var5, float var6, int var7) {
this.currentStageSet = var1;
this.growthProgress = var2;
this.lastTickGameTime = var3;
this.generation = var4;
this.previousBlockType = var5;
this.spreadRate = var6;
this.executions = var7;
}
@Nonnull
class="kw">public String getCurrentStageSet() {
class="kw">return this.currentStageSet;
}
class="kw">public void setCurrentStageSet(@Nullable String var1) {
this.currentStageSet = var1 != null ? var1 : "Default";
}
class="kw">public float getGrowthProgress() {
class="kw">return this.growthProgress;
}
class="kw">public void setGrowthProgress(float var1) {
this.growthProgress = var1;
}
class="kw">public Instant getLastTickGameTime() {
class="kw">return this.lastTickGameTime;
}
class="kw">public void setLastTickGameTime(Instant var1) {
this.lastTickGameTime = var1;
}
class="kw">public int getGeneration() {
class="kw">return this.generation;
}
class="kw">public void setGeneration(int var1) {
this.generation = var1;
}
class="kw">public String getPreviousBlockType() {
class="kw">return this.previousBlockType;
}
class="kw">public void setPreviousBlockType(String var1) {
this.previousBlockType = var1;
}
class="kw">public float getSpreadRate() {
class="kw">return this.spreadRate;
}
class="kw">public void setSpreadRate(float var1) {
this.spreadRate = var1;
}
class="kw">public int getExecutions() {
class="kw">return this.executions;
}
class="kw">public void setExecutions(int var1) {
this.executions = var1;
}
@Nullable
@Override
class="kw">public Component<ChunkStore> clone() {
class="kw">return new FarmingBlock(
this.currentStageSet, this.growthProgress, this.lastTickGameTime, this.generation, this.previousBlockType, this.spreadRate, this.executions
);
}
@Nonnull
@Override
class="kw">public String toString() {
class="kw">return "FarmingBlock{currentStageSet='"
+ this.currentStageSet
+ "', growthProgress="
+ this.growthProgress
+ ", lastTickGameTime="
+ this.lastTickGameTime
+ ", generation="
+ this.generation
+ ", previousBlockType='"
+ this.previousBlockType
+ "', spreadRate="
+ this.spreadRate
+ ", executions="
+ this.executions
+ "}";
}
}