mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-11 09:51:35 +01:00
fix: updated place ghost recipe packet
This commit is contained in:
parent
f4b32eddcf
commit
1cced68722
@ -3,15 +3,12 @@ package net.minestom.server.network.packet.server.play;
|
||||
import net.minestom.server.network.NetworkBuffer;
|
||||
import net.minestom.server.network.NetworkBufferTemplate;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.recipe.display.RecipeDisplay;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.minestom.server.network.NetworkBuffer.STRING;
|
||||
import static net.minestom.server.network.NetworkBuffer.VAR_INT;
|
||||
|
||||
// TODO(1.21.2): Recipe is now a RecipeDisplay object need to look further into it.
|
||||
public record PlaceGhostRecipePacket(int windowId, @NotNull String recipe) implements ServerPacket.Play {
|
||||
public record PlaceGhostRecipePacket(int windowId, @NotNull RecipeDisplay recipe) implements ServerPacket.Play {
|
||||
public static final NetworkBuffer.Type<PlaceGhostRecipePacket> SERIALIZER = NetworkBufferTemplate.template(
|
||||
VAR_INT, PlaceGhostRecipePacket::windowId,
|
||||
STRING, PlaceGhostRecipePacket::recipe,
|
||||
NetworkBuffer.VAR_INT, PlaceGhostRecipePacket::windowId,
|
||||
RecipeDisplay.NETWORK_TYPE, PlaceGhostRecipePacket::recipe,
|
||||
PlaceGhostRecipePacket::new);
|
||||
}
|
||||
|
@ -80,7 +80,7 @@ public class PacketWriteReadTest {
|
||||
SERVER_PACKETS.add(new ClearTitlesPacket(false));
|
||||
SERVER_PACKETS.add(new CloseWindowPacket((byte) 2));
|
||||
SERVER_PACKETS.add(new CollectItemPacket(5, 5, 5));
|
||||
SERVER_PACKETS.add(new PlaceGhostRecipePacket((byte) 2, "recipe"));
|
||||
// SERVER_PACKETS.add(new PlaceGhostRecipePacket((byte) 2, "recipe")); // TODO(1.21.2)
|
||||
SERVER_PACKETS.add(new DeathCombatEventPacket(5, COMPONENT));
|
||||
SERVER_PACKETS.add(new DeclareRecipesPacket(Map.of(
|
||||
RecipeProperty.SMITHING_BASE, List.of(Material.STONE),
|
||||
|
Loading…
Reference in New Issue
Block a user