ShopPageSupplier class

Пакет: com.hypixel.hytale.builtin.adventure.shop

Файл: com/hypixel/hytale/builtin/adventure/shop/ShopPageSupplier.java

implements: OpenCustomUIInteraction.CustomPageSupplier

Методы (1)

МодификаторыВозвратСигнатура
abstract return new ShopPagereturn new ShopPage(var3, this.shopId)

Исходный код

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

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.entity.InteractionContext;
class="kw">import com.hypixel.hytale.server.core.entity.entities.player.pages.CustomUIPage;
class="kw">import com.hypixel.hytale.server.core.modules.interaction.interaction.config.server.OpenCustomUIInteraction;
class="kw">import com.hypixel.hytale.server.core.universe.PlayerRef;
class="kw">import com.hypixel.hytale.server.core.universe.world.storage.EntityStore;
class="kw">import javax.annotation.Nonnull;

class="kw">public class ShopPageSupplier class="kw">implements OpenCustomUIInteraction.CustomPageSupplier {
   @Nonnull
   class="kw">public class="kw">static class="kw">final BuilderCodec<ShopPageSupplier> CODEC = BuilderCodec.builder(ShopPageSupplier.class, ShopPageSupplier::new)
      .appendInherited(
         new KeyedCodec<>("ShopId", Codec.STRING), (var0, var1) -> var0.shopId = var1, var0 -> var0.shopId, (var0, var1) -> var0.shopId = var1.shopId
      )
      .add()
      .build();
   class="kw">protected String shopId;

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

   @Nonnull
   @Override
   class="kw">public CustomUIPage tryCreate(
      @Nonnull Ref<EntityStore> var1, @Nonnull ComponentAccessor<EntityStore> var2, @Nonnull PlayerRef var3, @Nonnull InteractionContext var4
   ) {
      class="kw">return new ShopPage(var3, this.shopId);
   }
}