GatheringEffectsConfig class

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

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

Методы (5)

МодификаторыВозвратСигнатура
public String getParticleSystemIdString getParticleSystemId()
public String getSoundEventIdString getSoundEventId()
public int getSoundEventIndexint getSoundEventIndex()
if if(this.soundEventId != null)
protected void processConfigvoid processConfig()

Исходный код

Показать/скрыть
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.server.core.asset.type.particle.config.ParticleSystem;
class="kw">import com.hypixel.hytale.server.core.asset.type.soundevent.config.SoundEvent;
class="kw">import javax.annotation.Nonnull;

class="kw">public class GatheringEffectsConfig {
   @Nonnull
   class="kw">public class="kw">static class="kw">final BuilderCodec<GatheringEffectsConfig> CODEC = BuilderCodec.builder(GatheringEffectsConfig.class, GatheringEffectsConfig::new)
      .append(new KeyedCodec<>("ParticleSystemId", Codec.STRING), (var0, var1) -> var0.particleSystemId = var1, var0 -> var0.particleSystemId)
      .addValidator(ParticleSystem.VALIDATOR_CACHE.getValidator())
      .add()
      .<String>append(new KeyedCodec<>("SoundEventId", Codec.STRING), (var0, var1) -> var0.soundEventId = var1, var0 -> var0.soundEventId)
      .addValidator(SoundEvent.VALIDATOR_CACHE.getValidator())
      .add()
      .afterDecode(GatheringEffectsConfig::processConfig)
      .build();
   class="kw">protected String particleSystemId;
   class="kw">protected String soundEventId;
   class="kw">protected class="kw">transient int soundEventIndex;

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

   class="kw">public String getParticleSystemId() {
      class="kw">return this.particleSystemId;
   }

   class="kw">public String getSoundEventId() {
      class="kw">return this.soundEventId;
   }

   class="kw">public int getSoundEventIndex() {
      class="kw">return this.soundEventIndex;
   }

   class="kw">protected void processConfig() {
      if (this.soundEventId != null) {
         this.soundEventIndex = SoundEvent.getAssetMap().getIndex(this.soundEventId);
      }
   }
}