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.ICodecActionNested 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
FieldsModifier and TypeFieldDescriptionstatic final PatternRegexes 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 intstatic final intThe 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
ConstructorsConstructorDescriptionRequestRecipeDisplaysRegexPacket(net.minecraft.world.item.crafting.RecipeType<?> recipeType, String recipeRegex) -
Method Summary
Modifier and TypeMethodDescriptionvoidactionClient(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player) voidactionServer(net.minecraft.world.level.Level level, net.minecraft.server.level.ServerPlayer player) static booleanisAllowedRegex(String regex) protected booleanisAllowedRequest(net.minecraft.server.level.ServerPlayer player) booleanisAsync()Methods inherited from class org.cyclops.cyclopscore.network.PacketCodec
decode, encodeMethods inherited from class org.cyclops.cyclopscore.network.PacketBase
getCodec, type, writeMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
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_CONNECTIONThe 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:
isAsyncin classorg.cyclops.cyclopscore.network.PacketBase<RequestRecipeDisplaysRegexPacket>
-
actionClient
public void actionClient(net.minecraft.world.level.Level level, net.minecraft.world.entity.player.Player player) - Specified by:
actionClientin classorg.cyclops.cyclopscore.network.PacketBase<RequestRecipeDisplaysRegexPacket>
-
actionServer
public void actionServer(net.minecraft.world.level.Level level, net.minecraft.server.level.ServerPlayer player) - Specified by:
actionServerin classorg.cyclops.cyclopscore.network.PacketBase<RequestRecipeDisplaysRegexPacket>
-
isAllowedRequest
protected boolean isAllowedRequest(net.minecraft.server.level.ServerPlayer player) -
isAllowedRegex
-