From c3b8a31ff3226dd1c3ad8a5394730c7e0eb89976 Mon Sep 17 00:00:00 2001 From: Abbie Date: Mon, 11 Nov 2024 20:57:10 +0000 Subject: [PATCH] remove redundant type parameters from BotaniaPacket --- Xplat/src/main/java/vazkii/botania/network/BotaniaPacket.java | 3 +-- .../botania/network/clientbound/AvatarSkiesRodPacket.java | 2 +- .../botania/network/clientbound/BotaniaEffectPacket.java | 2 +- .../vazkii/botania/network/clientbound/GogWorldPacket.java | 2 +- .../java/vazkii/botania/network/clientbound/ItemAgePacket.java | 2 +- .../botania/network/clientbound/SpawnGaiaGuardianPacket.java | 2 +- .../network/clientbound/UpdateItemsRemainingPacket.java | 2 +- .../java/vazkii/botania/network/serverbound/DodgePacket.java | 2 +- .../botania/network/serverbound/IndexKeybindRequestPacket.java | 2 +- .../botania/network/serverbound/IndexStringRequestPacket.java | 2 +- .../java/vazkii/botania/network/serverbound/JumpPacket.java | 2 +- .../vazkii/botania/network/serverbound/LeftClickPacket.java | 2 +- 12 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Xplat/src/main/java/vazkii/botania/network/BotaniaPacket.java b/Xplat/src/main/java/vazkii/botania/network/BotaniaPacket.java index db53e9c994..65ac251e36 100644 --- a/Xplat/src/main/java/vazkii/botania/network/BotaniaPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/BotaniaPacket.java @@ -2,10 +2,9 @@ import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import io.netty.buffer.ByteBuf; import vazkii.botania.api.BotaniaAPI; -public interface BotaniaPacket> extends CustomPacketPayload { +public interface BotaniaPacket extends CustomPacketPayload { static Type createType(String path) { return new Type<>(BotaniaAPI.botaniaRL(path)); } diff --git a/Xplat/src/main/java/vazkii/botania/network/clientbound/AvatarSkiesRodPacket.java b/Xplat/src/main/java/vazkii/botania/network/clientbound/AvatarSkiesRodPacket.java index 64dc2fe210..d45d0c53ca 100644 --- a/Xplat/src/main/java/vazkii/botania/network/clientbound/AvatarSkiesRodPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/clientbound/AvatarSkiesRodPacket.java @@ -16,7 +16,7 @@ import vazkii.botania.common.item.rod.SkiesRodItem; import vazkii.botania.network.BotaniaPacket; -public record AvatarSkiesRodPacket(boolean elytra) implements BotaniaPacket { +public record AvatarSkiesRodPacket(boolean elytra) implements BotaniaPacket { public static final Type ID = BotaniaPacket.createType("atr"); public static final StreamCodec STREAM_CODEC = ByteBufCodecs.BOOL .map(AvatarSkiesRodPacket::new, AvatarSkiesRodPacket::elytra); diff --git a/Xplat/src/main/java/vazkii/botania/network/clientbound/BotaniaEffectPacket.java b/Xplat/src/main/java/vazkii/botania/network/clientbound/BotaniaEffectPacket.java index 1aeb9f67f4..30f8bc8110 100644 --- a/Xplat/src/main/java/vazkii/botania/network/clientbound/BotaniaEffectPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/clientbound/BotaniaEffectPacket.java @@ -40,7 +40,7 @@ // Prefer using World.addBlockEvent/Block.eventReceived/TileEntity.receiveClientEvent where possible // as those use less network bandwidth (~14 bytes), vs 26+ bytes here -public record BotaniaEffectPacket(EffectType effectType, double x, double y, double z, int... args) implements BotaniaPacket { +public record BotaniaEffectPacket(EffectType effectType, double x, double y, double z, int... args) implements BotaniaPacket { public static final Type ID = BotaniaPacket.createType("eff"); private static final int MAX_VARIABLE_ARGS = 128; diff --git a/Xplat/src/main/java/vazkii/botania/network/clientbound/GogWorldPacket.java b/Xplat/src/main/java/vazkii/botania/network/clientbound/GogWorldPacket.java index c5bd961662..1025b9569a 100644 --- a/Xplat/src/main/java/vazkii/botania/network/clientbound/GogWorldPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/clientbound/GogWorldPacket.java @@ -15,7 +15,7 @@ import vazkii.botania.client.core.SkyblockWorldInfo; import vazkii.botania.network.BotaniaPacket; -public class GogWorldPacket implements BotaniaPacket { +public class GogWorldPacket implements BotaniaPacket { public static final GogWorldPacket INSTANCE = new GogWorldPacket(); public static final Type ID = BotaniaPacket.createType("gog"); public static final StreamCodec STREAM_CODEC = StreamCodec.unit(INSTANCE); diff --git a/Xplat/src/main/java/vazkii/botania/network/clientbound/ItemAgePacket.java b/Xplat/src/main/java/vazkii/botania/network/clientbound/ItemAgePacket.java index 5096dc838c..51a7983abb 100644 --- a/Xplat/src/main/java/vazkii/botania/network/clientbound/ItemAgePacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/clientbound/ItemAgePacket.java @@ -18,7 +18,7 @@ import vazkii.botania.network.BotaniaPacket; import vazkii.botania.xplat.XplatAbstractions; -public record ItemAgePacket(int entityId, int timeCounter) implements BotaniaPacket { +public record ItemAgePacket(int entityId, int timeCounter) implements BotaniaPacket { public static final Type ID = BotaniaPacket.createType("ia"); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( diff --git a/Xplat/src/main/java/vazkii/botania/network/clientbound/SpawnGaiaGuardianPacket.java b/Xplat/src/main/java/vazkii/botania/network/clientbound/SpawnGaiaGuardianPacket.java index 0045f8b0fd..8a46ea981f 100644 --- a/Xplat/src/main/java/vazkii/botania/network/clientbound/SpawnGaiaGuardianPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/clientbound/SpawnGaiaGuardianPacket.java @@ -23,7 +23,7 @@ import java.util.UUID; public record SpawnGaiaGuardianPacket(ClientboundAddEntityPacket inner, int playerCount, boolean hardMode, - BlockPos source, UUID bossInfoId) implements BotaniaPacket { + BlockPos source, UUID bossInfoId) implements BotaniaPacket { public static final Type ID = BotaniaPacket.createType("spg"); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( diff --git a/Xplat/src/main/java/vazkii/botania/network/clientbound/UpdateItemsRemainingPacket.java b/Xplat/src/main/java/vazkii/botania/network/clientbound/UpdateItemsRemainingPacket.java index d74432c428..707c01308f 100644 --- a/Xplat/src/main/java/vazkii/botania/network/clientbound/UpdateItemsRemainingPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/clientbound/UpdateItemsRemainingPacket.java @@ -23,7 +23,7 @@ import java.util.Optional; -public record UpdateItemsRemainingPacket(ItemStack stack, int count, @Nullable Component tooltip) implements BotaniaPacket { +public record UpdateItemsRemainingPacket(ItemStack stack, int count, @Nullable Component tooltip) implements BotaniaPacket { public static final Type ID = BotaniaPacket.createType("rem"); public static final StreamCodec STREAM_CODEC = StreamCodec.composite( diff --git a/Xplat/src/main/java/vazkii/botania/network/serverbound/DodgePacket.java b/Xplat/src/main/java/vazkii/botania/network/serverbound/DodgePacket.java index 08f493eb42..6f33c9668c 100644 --- a/Xplat/src/main/java/vazkii/botania/network/serverbound/DodgePacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/serverbound/DodgePacket.java @@ -23,7 +23,7 @@ import vazkii.botania.common.item.equipment.bauble.RingOfDexterousMotionItem; import vazkii.botania.network.BotaniaPacket; -public class DodgePacket implements BotaniaPacket { +public class DodgePacket implements BotaniaPacket { public static final DodgePacket INSTANCE = new DodgePacket(); public static final Type ID = BotaniaPacket.createType("do"); public static final StreamCodec STREAM_CODEC = StreamCodec.unit(INSTANCE); diff --git a/Xplat/src/main/java/vazkii/botania/network/serverbound/IndexKeybindRequestPacket.java b/Xplat/src/main/java/vazkii/botania/network/serverbound/IndexKeybindRequestPacket.java index f90f4ce9f0..7d3cee7bac 100644 --- a/Xplat/src/main/java/vazkii/botania/network/serverbound/IndexKeybindRequestPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/serverbound/IndexKeybindRequestPacket.java @@ -18,7 +18,7 @@ import vazkii.botania.common.block.block_entity.corporea.CorporeaIndexBlockEntity; import vazkii.botania.network.BotaniaPacket; -public record IndexKeybindRequestPacket(ItemStack stack) implements BotaniaPacket { +public record IndexKeybindRequestPacket(ItemStack stack) implements BotaniaPacket { public static final Type ID = BotaniaPacket.createType("idx"); public static final StreamCodec STREAM_CODEC = ItemStack.STREAM_CODEC .map(IndexKeybindRequestPacket::new, IndexKeybindRequestPacket::stack); diff --git a/Xplat/src/main/java/vazkii/botania/network/serverbound/IndexStringRequestPacket.java b/Xplat/src/main/java/vazkii/botania/network/serverbound/IndexStringRequestPacket.java index 265123288c..acb4b356ce 100644 --- a/Xplat/src/main/java/vazkii/botania/network/serverbound/IndexStringRequestPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/serverbound/IndexStringRequestPacket.java @@ -9,7 +9,7 @@ import vazkii.botania.common.block.block_entity.corporea.CorporeaIndexBlockEntity; import vazkii.botania.network.BotaniaPacket; -public record IndexStringRequestPacket(String message) implements BotaniaPacket { +public record IndexStringRequestPacket(String message) implements BotaniaPacket { public static final Type ID = BotaniaPacket.createType("idxs"); public static final StreamCodec STREAM_CODEC = ByteBufCodecs.STRING_UTF8 .map(IndexStringRequestPacket::new, IndexStringRequestPacket::message); diff --git a/Xplat/src/main/java/vazkii/botania/network/serverbound/JumpPacket.java b/Xplat/src/main/java/vazkii/botania/network/serverbound/JumpPacket.java index 06de5b330c..8aefb0a445 100644 --- a/Xplat/src/main/java/vazkii/botania/network/serverbound/JumpPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/serverbound/JumpPacket.java @@ -18,7 +18,7 @@ import vazkii.botania.common.item.equipment.bauble.CirrusAmuletItem; import vazkii.botania.network.BotaniaPacket; -public class JumpPacket implements BotaniaPacket { +public class JumpPacket implements BotaniaPacket { public static final JumpPacket INSTANCE = new JumpPacket(); public static final Type ID = BotaniaPacket.createType("jmp"); public static final StreamCodec STREAM_CODEC = StreamCodec.unit(INSTANCE); diff --git a/Xplat/src/main/java/vazkii/botania/network/serverbound/LeftClickPacket.java b/Xplat/src/main/java/vazkii/botania/network/serverbound/LeftClickPacket.java index f6e91ea1c6..a95280e517 100644 --- a/Xplat/src/main/java/vazkii/botania/network/serverbound/LeftClickPacket.java +++ b/Xplat/src/main/java/vazkii/botania/network/serverbound/LeftClickPacket.java @@ -16,7 +16,7 @@ import vazkii.botania.common.item.equipment.tool.terrasteel.TerraBladeItem; import vazkii.botania.network.BotaniaPacket; -public class LeftClickPacket implements BotaniaPacket { +public class LeftClickPacket implements BotaniaPacket { public static final LeftClickPacket INSTANCE = new LeftClickPacket(); public static final Type ID = BotaniaPacket.createType("lc"); public static final StreamCodec STREAM_CODEC = StreamCodec.unit(INSTANCE);