Old class removal and other touchups
Some checks failed
Java CI with Gradle / build (push) Has been cancelled

This commit is contained in:
Camotoy 2024-10-22 23:22:32 -04:00
parent fb2d30254a
commit 3b4afeb410
No known key found for this signature in database
GPG key ID: 7EEFB66FE798081F
15 changed files with 16 additions and 189 deletions

View file

@ -214,9 +214,9 @@ import org.geysermc.mcprotocollib.protocol.packet.status.serverbound.Serverbound
public class MinecraftCodec {
public static final PacketCodec CODEC = PacketCodec.builder()
.protocolVersion((1 << 30) | 215)
.protocolVersion(768)
.helper(MinecraftCodecHelper::new)
.minecraftVersion("1.21.2-pre3")
.minecraftVersion("1.21.2")
.state(ProtocolState.HANDSHAKE, MinecraftPacketRegistry.builder()
.registerServerboundPacket(ClientIntentionPacket.class, ClientIntentionPacket::new)
)

View file

@ -5,6 +5,7 @@ import lombok.NonNull;
import net.kyori.adventure.key.Key;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.Arrays;
import java.util.function.Function;
/**
@ -39,4 +40,13 @@ public final class HolderSet {
return tagResolver.apply(location);
}
@Override
public String toString() {
if (this.holders != null) {
return getClass().getSimpleName() + "[holders=" + Arrays.toString(this.holders) + "]";
} else {
return getClass().getSimpleName() + "[location=" + this.location + "]";
}
}
}

View file

@ -1,15 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import net.kyori.adventure.key.Key;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.data.RecipeData;
@Data
@AllArgsConstructor
public class Recipe {
private final @NonNull RecipeType type;
private final @NonNull Key identifier;
private final RecipeData data;
}

View file

@ -1,32 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe;
public enum RecipeType {
CRAFTING_SHAPED,
CRAFTING_SHAPELESS,
CRAFTING_SPECIAL_ARMORDYE,
CRAFTING_SPECIAL_BOOKCLONING,
CRAFTING_SPECIAL_MAPCLONING,
CRAFTING_SPECIAL_MAPEXTENDING,
CRAFTING_SPECIAL_FIREWORK_ROCKET,
CRAFTING_SPECIAL_FIREWORK_STAR,
CRAFTING_SPECIAL_FIREWORK_STAR_FADE,
CRAFTING_SPECIAL_TIPPEDARROW,
CRAFTING_SPECIAL_BANNERDUPLICATE,
CRAFTING_SPECIAL_SHIELDDECORATION,
CRAFTING_TRANSMUTE,
CRAFTING_SPECIAL_REPAIRITEM,
SMELTING,
BLASTING,
SMOKING,
CAMPFIRE_COOKING,
STONECUTTING,
SMITHING_TRANSFORM,
SMITHING_TRIM,
CRAFTING_DECORATED_POT;
private static final RecipeType[] VALUES = values();
public static RecipeType from(int id) {
return VALUES[id];
}
}

View file

@ -1,20 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.CraftingBookCategory;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
@Data
@AllArgsConstructor
public class CookedRecipeData implements RecipeData {
private final @NonNull String group;
private final @NonNull CraftingBookCategory category;
private final @NonNull Ingredient ingredient;
private final @Nullable ItemStack result;
private final float experience;
private final int cookingTime;
}

View file

@ -1,4 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
public interface RecipeData {
}

View file

@ -1,21 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.CraftingBookCategory;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
@Data
@AllArgsConstructor
public class ShapedRecipeData implements RecipeData {
private final int width;
private final int height;
private final @NonNull String group;
private final @NonNull CraftingBookCategory category;
private final @NonNull Ingredient[] ingredients;
private final @Nullable ItemStack result;
private final boolean showNotification;
}

View file

@ -1,18 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.CraftingBookCategory;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
@Data
@AllArgsConstructor
public class ShapelessRecipeData implements RecipeData {
private final @NonNull String group;
private final @NonNull CraftingBookCategory category;
private final @NonNull Ingredient[] ingredients;
private final @Nullable ItemStack result;
}

View file

@ -1,12 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.CraftingBookCategory;
@Data
@AllArgsConstructor
public class SimpleCraftingRecipeData implements RecipeData {
private final @NonNull CraftingBookCategory category;
}

View file

@ -1,17 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
@Data
@AllArgsConstructor
public class SmithingTransformRecipeData implements RecipeData {
private final @NonNull Ingredient template;
private final @NonNull Ingredient base;
private final @NonNull Ingredient addition;
private final @Nullable ItemStack result;
}

View file

@ -1,14 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
@Data
@AllArgsConstructor
public class SmithingTrimRecipeData implements RecipeData {
private final @NonNull Ingredient template;
private final @NonNull Ingredient base;
private final @NonNull Ingredient addition;
}

View file

@ -1,16 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NonNull;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
@Data
@AllArgsConstructor
public class StoneCuttingRecipeData implements RecipeData {
private final @NonNull String group;
private final @NonNull Ingredient ingredient;
private final @Nullable ItemStack result;
}

View file

@ -1,8 +0,0 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
import org.geysermc.mcprotocollib.protocol.data.game.Holder;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.CraftingBookCategory;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
public record TransmuteRecipeData(String group, CraftingBookCategory category, Ingredient input, Ingredient material, int result) implements RecipeData {
}

View file

@ -1,5 +1,9 @@
package org.geysermc.mcprotocollib.protocol.data.game.recipe.display;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.display.slot.SlotDisplay;
public interface RecipeDisplay {
RecipeDisplayType getType();
SlotDisplay result();
}

View file

@ -1,19 +1,9 @@
package org.geysermc.mcprotocollib.protocol.packet.ingame.clientbound;
import net.kyori.adventure.key.Key;
import org.geysermc.mcprotocollib.protocol.data.game.item.ItemStack;
import org.geysermc.mcprotocollib.protocol.data.game.item.component.HolderSet;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.CraftingBookCategory;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Ingredient;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.Recipe;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.RecipeType;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.data.CookedRecipeData;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.data.ShapedRecipeData;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.data.ShapelessRecipeData;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.data.SmithingTransformRecipeData;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.data.StoneCuttingRecipeData;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.display.slot.ItemStackSlotDisplay;
import org.geysermc.mcprotocollib.protocol.data.game.recipe.display.slot.SlotDisplay;
import org.geysermc.mcprotocollib.protocol.packet.PacketTest;
import org.junit.jupiter.api.BeforeEach;