RespawnConfig class

Пакет: com.hypixel.hytale.server.core.asset.type.gameplay

Файл: com/hypixel/hytale/server/core/asset/type/gameplay/RespawnConfig.java

Методы (2)

МодификаторыВозвратСигнатура
public int getMaxRespawnPointsPerPlayerint getMaxRespawnPointsPerPlayer()
public int getRadiusLimitRespawnPointint getRadiusLimitRespawnPoint()

Исходный код

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

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.codec.validation.Validators;
class="kw">import javax.annotation.Nonnull;

class="kw">public class RespawnConfig {
   @Nonnull
   class="kw">public class="kw">static class="kw">final BuilderCodec<RespawnConfig> CODEC = BuilderCodec.builder(RespawnConfig.class, RespawnConfig::new)
      .append(
         new KeyedCodec<>("RadiusLimitRespawnPoint", Codec.INTEGER), (var0, var1) -> var0.radiusLimitRespawnPoint = var1, var0 -> var0.radiusLimitRespawnPoint
      )
      .addValidator(Validators.greaterThan(0))
      .add()
      .<Integer>append(
         new KeyedCodec<>("MaxRespawnPointsPerPlayer", Codec.INTEGER),
         (var0, var1) -> var0.maxRespawnPointsPerPlayer = var1,
         var0 -> var0.maxRespawnPointsPerPlayer
      )
      .addValidator(Validators.greaterThan(0))
      .add()
      .build();
   class="kw">protected int radiusLimitRespawnPoint = 500;
   class="kw">protected int maxRespawnPointsPerPlayer = 3;

   class="kw">public RespawnConfig() {
   }

   class="kw">public int getRadiusLimitRespawnPoint() {
      class="kw">return this.radiusLimitRespawnPoint;
   }

   class="kw">public int getMaxRespawnPointsPerPlayer() {
      class="kw">return this.maxRespawnPointsPerPlayer;
   }
}