mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-11-14 11:24:57 -05:00
Old class removal and other touchups
Some checks failed
Java CI with Gradle / build (push) Has been cancelled
Some checks failed
Java CI with Gradle / build (push) Has been cancelled
This commit is contained in:
parent
fb2d30254a
commit
3b4afeb410
15 changed files with 16 additions and 189 deletions
|
@ -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)
|
||||
)
|
||||
|
|
|
@ -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 + "]";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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];
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -1,4 +0,0 @@
|
|||
package org.geysermc.mcprotocollib.protocol.data.game.recipe.data;
|
||||
|
||||
public interface RecipeData {
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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;
|
||||
}
|
|
@ -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 {
|
||||
}
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue