BlockExplosive class

Пакет: com.hypixel.hytale.builtin.reactiveblocks.states

Файл: com/hypixel/hytale/builtin/reactiveblocks/states/BlockExplosive.java

implements: Component<ChunkStore>

Поля (1)

МодификаторыТипИмя
ExplosionConfig var6

Методы (5)

МодификаторыВозвратСигнатура
public void doExplosionvoid doExplosion(@Nonnull BlockType var1, @Nonnull Vector3d var2, @Nonnull Rotation3f var3, @Nonnull ComponentAccessor<EntityStore> var4, @Nonnull ComponentAccessor<ChunkStore> var5)
public float getFuseDurationfloat getFuseDuration()
public boolean getPrimedOnPlaceboolean getPrimedOnPlace()
if if(var6 != null)
public void setDetonationInstantvoid setDetonationInstant(Instant var1)

Исходный код

Показать/скрыть
class="kw">package com.hypixel.hytale.builtin.reactiveblocks.states;

class="kw">import com.hypixel.hytale.builtin.reactiveblocks.ReactiveBlocksPlugin;
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.ComponentAccessor;
class="kw">import com.hypixel.hytale.component.ComponentType;
class="kw">import com.hypixel.hytale.math.vector.Rotation3f;
class="kw">import com.hypixel.hytale.server.core.asset.type.blocktype.config.BlockType;
class="kw">import com.hypixel.hytale.server.core.entity.ExplosionConfig;
class="kw">import com.hypixel.hytale.server.core.entity.ExplosionUtils;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.client.ExplodeInteraction;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.ChunkStore;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import java.time.Instant;
class="kw">import javax.annotation.Nonnull;
class="kw">import org.checkerframework.checker.nullness.compatqual.NullableDecl;
class="kw">import org.joml.Vector3d;

class="kw">public class BlockExplosive class="kw">implements Component<ChunkStore> {
   @Nonnull
   class="kw">public class="kw">static class="kw">final BuilderCodec<BlockExplosive> CODEC = BuilderCodec.builder(BlockExplosive.class, BlockExplosive::new)
      .append(new KeyedCodec<>("PrimedOnPlace", Codec.BOOLEAN), (var0, var1) -> var0.primedOnPlace = var1, var0 -> var0.primedOnPlace)
      .documentation("If the fuse will immediately being running down when the block is placed.")
      .add()
      .<Float>append(new KeyedCodec<>("FuseDuration", Codec.FLOAT), (var0, var1) -> var0.fuseDuration = var1, var0 -> var0.fuseDuration)
      .documentation("The duration between being primed and exploding.")
      .add()
      .build();
   class="kw">protected boolean primedOnPlace;
   class="kw">protected float fuseDuration;
   class="kw">protected Instant detonationInstant;

   @Nonnull
   class="kw">public class="kw">static ComponentType<ChunkStore, BlockExplosive> getComponentType() {
      class="kw">return ReactiveBlocksPlugin.get().getExplosiveComponentType();
   }

   class="kw">public boolean getPrimedOnPlace() {
      class="kw">return this.primedOnPlace;
   }

   class="kw">public float getFuseDuration() {
      class="kw">return this.fuseDuration;
   }

   class="kw">public void setDetonationInstant(Instant var1) {
      this.detonationInstant = var1;
   }

   @NullableDecl
   class="kw">public Instant getDetonationInstant() {
      class="kw">return this.detonationInstant;
   }

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

   class="kw">public BlockExplosive(boolean var1, float var2) {
      this.primedOnPlace = var1;
      this.fuseDuration = var2;
   }

   class="kw">public void doExplosion(
      @Nonnull BlockType var1,
      @Nonnull Vector3d var2,
      @Nonnull Rotation3f var3,
      @Nonnull ComponentAccessor<EntityStore> var4,
      @Nonnull ComponentAccessor<ChunkStore> var5
   ) {
      ExplosionConfig var6 = var1.getExplosionConfig();
      if (var6 != null) {
         ExplosionUtils.performExplosion(ExplodeInteraction.DAMAGE_SOURCE_EXPLOSION, var2, var3, var6, null, var4, var5);
      }
   }

   @NullableDecl
   @Override
   class="kw">public Component<ChunkStore> clone() {
      class="kw">return new BlockExplosive(this.primedOnPlace, this.fuseDuration);
   }
}