Interface CommonServices


public interface CommonServices
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addConfigurationPayloads(Supplier<List<net.minecraft.network.protocol.common.custom.CustomPacketPayload>> payloads)
    Payloads to send to every client as its configuration starts; asked for once per connection.
    boolean
    canPlayerReceive(net.minecraft.server.level.ServerPlayer player, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?> type)
     
    <T extends net.minecraft.world.level.block.entity.BlockEntity>
    net.minecraft.world.level.block.entity.BlockEntityType<T>
    createBlockEntityType(BlockEntityTypes.Factory<? extends T> factory, net.minecraft.world.level.block.Block... blocks)
     
    createDeferredRegister(String modId, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey)
     
    <T extends net.minecraft.world.inventory.AbstractContainerMenu>
    net.minecraft.world.inventory.MenuType<T>
     
    net.minecraft.world.item.CreativeModeTab.Builder
     
    get()
     
    void
    invalidateBlockHandlers(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
    Invalidates the loader's own handler caches at a position (NeoForge's capabilities); a no-op elsewhere.
    void
    openExtendedMenu(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.MenuProvider provider, Consumer<net.minecraft.network.RegistryFriendlyByteBuf> data)
     
    <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
    void
    registerClientbound(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, PayloadReceiver<T> receiver)
     
    <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
    void
    registerConfigurationClientbound(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.FriendlyByteBuf,T> codec, CommonServices.ConfigurationReceiver<T> receiver)
    A payload the server sends while a client is still configuring (before it joins the world), received on the client's main thread.
    <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload>
    void
    registerServerbound(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, PayloadReceiver<T> receiver)
     
    void
    registerServerReloadListener(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.resources.PreparableReloadListener listener)
     
    void
    sendToPlayer(net.minecraft.server.level.ServerPlayer player, net.minecraft.network.protocol.common.custom.CustomPacketPayload payload)
     
  • Method Details

    • get

      static CommonServices get()
    • createDeferredRegister

      <T> DeferredRegister<T> createDeferredRegister(String modId, net.minecraft.resources.ResourceKey<? extends net.minecraft.core.Registry<T>> registryKey)
    • creativeTabBuilder

      net.minecraft.world.item.CreativeModeTab.Builder creativeTabBuilder()
    • createBlockEntityType

      <T extends net.minecraft.world.level.block.entity.BlockEntity> net.minecraft.world.level.block.entity.BlockEntityType<T> createBlockEntityType(BlockEntityTypes.Factory<? extends T> factory, net.minecraft.world.level.block.Block... blocks)
    • createExtendedMenuType

      <T extends net.minecraft.world.inventory.AbstractContainerMenu> net.minecraft.world.inventory.MenuType<T> createExtendedMenuType(ExtendedMenus.Factory<T> factory)
    • openExtendedMenu

      void openExtendedMenu(net.minecraft.server.level.ServerPlayer player, net.minecraft.world.MenuProvider provider, Consumer<net.minecraft.network.RegistryFriendlyByteBuf> data)
    • registerServerReloadListener

      void registerServerReloadListener(net.minecraft.resources.ResourceLocation id, net.minecraft.server.packs.resources.PreparableReloadListener listener)
    • registerServerbound

      <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> void registerServerbound(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, PayloadReceiver<T> receiver)
    • registerClientbound

      <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> void registerClientbound(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.RegistryFriendlyByteBuf,T> codec, PayloadReceiver<T> receiver)
    • sendToPlayer

      void sendToPlayer(net.minecraft.server.level.ServerPlayer player, net.minecraft.network.protocol.common.custom.CustomPacketPayload payload)
    • canPlayerReceive

      boolean canPlayerReceive(net.minecraft.server.level.ServerPlayer player, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<?> type)
    • registerConfigurationClientbound

      <T extends net.minecraft.network.protocol.common.custom.CustomPacketPayload> void registerConfigurationClientbound(net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T> type, net.minecraft.network.codec.StreamCodec<? super net.minecraft.network.FriendlyByteBuf,T> codec, CommonServices.ConfigurationReceiver<T> receiver)
      A payload the server sends while a client is still configuring (before it joins the world), received on the client's main thread. The receiver only runs on clients.
    • addConfigurationPayloads

      void addConfigurationPayloads(Supplier<List<net.minecraft.network.protocol.common.custom.CustomPacketPayload>> payloads)
      Payloads to send to every client as its configuration starts; asked for once per connection.
    • invalidateBlockHandlers

      void invalidateBlockHandlers(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos)
      Invalidates the loader's own handler caches at a position (NeoForge's capabilities); a no-op elsewhere.