Class RequestRecipeDisplaysRegexPacket

java.lang.Object
org.cyclops.cyclopscore.network.PacketBase<RequestRecipeDisplaysRegexPacket>
org.cyclops.cyclopscore.network.PacketCodec<RequestRecipeDisplaysRegexPacket>
org.cyclops.cyclopscore.network.packet.RequestRecipeDisplaysRegexPacket
All Implemented Interfaces:
net.minecraft.network.protocol.common.custom.CustomPacketPayload

public class RequestRecipeDisplaysRegexPacket extends org.cyclops.cyclopscore.network.PacketCodec<RequestRecipeDisplaysRegexPacket>
Packet from client to server to request a recipe display.
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.cyclops.cyclopscore.network.PacketCodec

    org.cyclops.cyclopscore.network.PacketCodec.ICodecAction

    Nested classes/interfaces inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload

    net.minecraft.network.protocol.common.custom.CustomPacketPayload.FallbackProvider<B>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<T>, net.minecraft.network.protocol.common.custom.CustomPacketPayload.TypeAndCodec<B,T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Pattern
    Regexes must be a recipe id, or a recipe id prefix followed by '.*'.
    static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, RequestRecipeDisplaysRegexPacket>
     
    static final int
     
    static final int
    The maximum number of distinct requests per connection.
    static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<RequestRecipeDisplaysRegexPacket>
     

    Fields inherited from class org.cyclops.cyclopscore.network.PacketCodec

    fieldCache
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    RequestRecipeDisplaysRegexPacket(net.minecraft.world.item.crafting.RecipeType<?> recipeType, String recipeRegex)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    actionClient(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player)
     
    void
    actionServer(net.minecraft.world.level.Level level, net.minecraft.server.level.ServerPlayer player)
     
    static boolean
     
    protected boolean
    isAllowedRequest(net.minecraft.server.level.ServerPlayer player)
     
    boolean
     

    Methods inherited from class org.cyclops.cyclopscore.network.PacketCodec

    decode, encode

    Methods inherited from class org.cyclops.cyclopscore.network.PacketBase

    getCodec, type, write

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.network.protocol.common.custom.CustomPacketPayload

    toVanillaClientbound, toVanillaServerbound
  • Field Details

    • TYPE

      public static final net.minecraft.network.protocol.common.custom.CustomPacketPayload.Type<RequestRecipeDisplaysRegexPacket> TYPE
    • CODEC

      public static final net.minecraft.network.codec.StreamCodec<net.minecraft.network.RegistryFriendlyByteBuf, RequestRecipeDisplaysRegexPacket> CODEC
    • MAX_REGEX_LENGTH

      public static final int MAX_REGEX_LENGTH
      See Also:
    • ALLOWED_REGEX

      public static final Pattern ALLOWED_REGEX
      Regexes must be a recipe id, or a recipe id prefix followed by '.*'. Such regexes can be matched in linear time.
    • MAX_REQUESTS_PER_CONNECTION

      public static final int MAX_REQUESTS_PER_CONNECTION
      The maximum number of distinct requests per connection. Clients send each request once per login.
      See Also:
  • Constructor Details

    • RequestRecipeDisplaysRegexPacket

      public RequestRecipeDisplaysRegexPacket()
    • RequestRecipeDisplaysRegexPacket

      public RequestRecipeDisplaysRegexPacket(net.minecraft.world.item.crafting.RecipeType<?> recipeType, String recipeRegex)
  • Method Details

    • isAsync

      public boolean isAsync()
      Specified by:
      isAsync in class org.cyclops.cyclopscore.network.PacketBase<RequestRecipeDisplaysRegexPacket>
    • actionClient

      public void actionClient(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player)
      Specified by:
      actionClient in class org.cyclops.cyclopscore.network.PacketBase<RequestRecipeDisplaysRegexPacket>
    • actionServer

      public void actionServer(net.minecraft.world.level.Level level, net.minecraft.server.level.ServerPlayer player)
      Specified by:
      actionServer in class org.cyclops.cyclopscore.network.PacketBase<RequestRecipeDisplaysRegexPacket>
    • isAllowedRequest

      protected boolean isAllowedRequest(net.minecraft.server.level.ServerPlayer player)
    • isAllowedRegex

      public static boolean isAllowedRegex(String regex)