From bc54d0e280fa5799cc7859cb30ff2b7be1628d66 Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 30 Dec 2022 21:09:33 +0100 Subject: [PATCH] Update fabwork again --- gradle.properties | 2 +- .../minelittlepony/unicopia/network/MsgBlockDestruction.java | 3 --- .../unicopia/network/MsgCancelPlayerAbility.java | 3 --- .../com/minelittlepony/unicopia/network/MsgMarkTraitRead.java | 4 ++-- .../com/minelittlepony/unicopia/network/MsgPlayerAbility.java | 4 ++-- .../unicopia/network/MsgPlayerAnimationChange.java | 4 ++-- .../unicopia/network/MsgPlayerCapabilities.java | 4 ++-- .../com/minelittlepony/unicopia/network/MsgRemoveSpell.java | 4 ++-- .../unicopia/network/MsgRequestSpeciesChange.java | 4 ++-- .../minelittlepony/unicopia/network/MsgServerResources.java | 3 --- .../minelittlepony/unicopia/network/MsgSpawnProjectile.java | 3 --- .../unicopia/network/MsgSpellbookStateChanged.java | 4 ++-- .../com/minelittlepony/unicopia/network/MsgTribeSelect.java | 3 --- .../com/minelittlepony/unicopia/network/MsgUnlockTraits.java | 3 --- 14 files changed, 15 insertions(+), 33 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5342eaa9..e69b5505 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ org.gradle.daemon=false modrinth_project_id= # Dependencies - fabwork_version=1.1.0 + fabwork_version=1.1.1 modmenu_version=5.0.0-alpha.3 minelp_version=4.7.2 kirin_version=1.13.2 diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgBlockDestruction.java b/src/main/java/com/minelittlepony/unicopia/network/MsgBlockDestruction.java index 321b1900..0ea0cf34 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgBlockDestruction.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgBlockDestruction.java @@ -27,7 +27,4 @@ public record MsgBlockDestruction (Long2ObjectMap destructions) implement buffer.writeFloat(i); }); } - - @Override - public void handle(PlayerEntity sender) {} } diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgCancelPlayerAbility.java b/src/main/java/com/minelittlepony/unicopia/network/MsgCancelPlayerAbility.java index c3fc5065..d818736c 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgCancelPlayerAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgCancelPlayerAbility.java @@ -16,7 +16,4 @@ public final class MsgCancelPlayerAbility implements Packet { @Override public void toBuffer(PacketByteBuf buffer) { } - - @Override - public void handle(PlayerEntity sender) { } } diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgMarkTraitRead.java b/src/main/java/com/minelittlepony/unicopia/network/MsgMarkTraitRead.java index 3c87a3c0..9cb559bf 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgMarkTraitRead.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgMarkTraitRead.java @@ -5,12 +5,12 @@ import java.util.Set; import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait; import com.minelittlepony.unicopia.entity.player.Pony; -import com.sollace.fabwork.api.packets.Packet; +import com.sollace.fabwork.api.packets.HandledPacket; import net.minecraft.network.PacketByteBuf; import net.minecraft.server.network.ServerPlayerEntity; -public record MsgMarkTraitRead (Set traits) implements Packet { +public record MsgMarkTraitRead (Set traits) implements HandledPacket { MsgMarkTraitRead(PacketByteBuf buffer) { this(new HashSet<>()); int length = buffer.readInt(); diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAbility.java b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAbility.java index 0553ebe9..dfc963be 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAbility.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAbility.java @@ -7,7 +7,7 @@ import com.minelittlepony.unicopia.ability.Ability; import com.minelittlepony.unicopia.ability.ActivationType; import com.minelittlepony.unicopia.ability.data.Hit; import com.minelittlepony.unicopia.entity.player.Pony; -import com.sollace.fabwork.api.packets.Packet; +import com.sollace.fabwork.api.packets.HandledPacket; import net.minecraft.network.PacketByteBuf; import net.minecraft.server.network.ServerPlayerEntity; @@ -19,7 +19,7 @@ public record MsgPlayerAbility ( Ability power, Optional data, ActivationType type - ) implements Packet { + ) implements HandledPacket { @SuppressWarnings("unchecked") static MsgPlayerAbility read(PacketByteBuf buffer) { diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAnimationChange.java b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAnimationChange.java index bcde2bb1..d2992855 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAnimationChange.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerAnimationChange.java @@ -4,7 +4,7 @@ import java.util.UUID; import com.minelittlepony.unicopia.client.render.PlayerPoser.Animation; import com.minelittlepony.unicopia.entity.player.Pony; -import com.sollace.fabwork.api.packets.Packet; +import com.sollace.fabwork.api.packets.HandledPacket; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.player.PlayerEntity; @@ -17,7 +17,7 @@ public record MsgPlayerAnimationChange ( UUID playerId, Animation animation, int duration - ) implements Packet { + ) implements HandledPacket { MsgPlayerAnimationChange(PacketByteBuf buffer) { this(buffer.readUuid(), buffer.readEnumConstant(Animation.class), buffer.readInt()); diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerCapabilities.java b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerCapabilities.java index 1b446560..a665b194 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerCapabilities.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgPlayerCapabilities.java @@ -7,7 +7,7 @@ import java.util.UUID; import com.minelittlepony.unicopia.Unicopia; import com.minelittlepony.unicopia.entity.player.Pony; -import com.sollace.fabwork.api.packets.Packet; +import com.sollace.fabwork.api.packets.HandledPacket; import io.netty.buffer.ByteBufInputStream; import io.netty.buffer.ByteBufOutputStream; @@ -21,7 +21,7 @@ import net.minecraft.nbt.NbtIo; *

* Also used by the server to notify a race change. */ -public class MsgPlayerCapabilities implements Packet { +public class MsgPlayerCapabilities implements HandledPacket { protected final UUID playerId; diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgRemoveSpell.java b/src/main/java/com/minelittlepony/unicopia/network/MsgRemoveSpell.java index d0221a6d..37b1e0a4 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgRemoveSpell.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgRemoveSpell.java @@ -4,7 +4,7 @@ import java.util.UUID; import com.minelittlepony.unicopia.ability.magic.spell.Spell; import com.minelittlepony.unicopia.entity.player.Pony; -import com.sollace.fabwork.api.packets.Packet; +import com.sollace.fabwork.api.packets.HandledPacket; import net.minecraft.network.PacketByteBuf; import net.minecraft.server.network.ServerPlayerEntity; @@ -12,7 +12,7 @@ import net.minecraft.server.network.ServerPlayerEntity; /** * Sent to the server when a player activates an ability. */ -public record MsgRemoveSpell (UUID id) implements Packet { +public record MsgRemoveSpell (UUID id) implements HandledPacket { MsgRemoveSpell(PacketByteBuf buffer) { this(buffer.readUuid()); } diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgRequestSpeciesChange.java b/src/main/java/com/minelittlepony/unicopia/network/MsgRequestSpeciesChange.java index d13b3bbd..b54a1fd7 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgRequestSpeciesChange.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgRequestSpeciesChange.java @@ -3,7 +3,7 @@ package com.minelittlepony.unicopia.network; import com.minelittlepony.unicopia.Race; import com.minelittlepony.unicopia.WorldTribeManager; import com.minelittlepony.unicopia.entity.player.Pony; -import com.sollace.fabwork.api.packets.Packet; +import com.sollace.fabwork.api.packets.HandledPacket; import net.minecraft.network.PacketByteBuf; import net.minecraft.server.network.ServerPlayerEntity; @@ -17,7 +17,7 @@ import net.minecraft.server.world.ServerWorld; public record MsgRequestSpeciesChange ( boolean force, Race newRace - ) implements Packet { + ) implements HandledPacket { MsgRequestSpeciesChange(PacketByteBuf buffer) { this(buffer.readBoolean(), buffer.readRegistryValue(Race.REGISTRY)); diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgServerResources.java b/src/main/java/com/minelittlepony/unicopia/network/MsgServerResources.java index 0b4cb05e..bd08c145 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgServerResources.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgServerResources.java @@ -39,7 +39,4 @@ public record MsgServerResources ( buffer.writeMap(chapters, PacketByteBuf::writeIdentifier, (r, v) -> ((SpellbookChapterLoader.Chapter)v).write(r)); buffer.writeMap(treeTypes, PacketByteBuf::writeIdentifier, (r, v) -> v.write(r)); } - - @Override - public void handle(PlayerEntity sender) { } } diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgSpawnProjectile.java b/src/main/java/com/minelittlepony/unicopia/network/MsgSpawnProjectile.java index 1d0bff16..ca3c7667 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgSpawnProjectile.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgSpawnProjectile.java @@ -28,7 +28,4 @@ public class MsgSpawnProjectile extends EntitySpawnS2CPacket implements Packet

( int syncId, SpellbookState state - ) implements Packet { + ) implements HandledPacket { public MsgSpellbookStateChanged(PacketByteBuf buffer) { this(buffer.readInt(), new SpellbookState().fromPacket(buffer)); diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgTribeSelect.java b/src/main/java/com/minelittlepony/unicopia/network/MsgTribeSelect.java index f3b0107d..d6ed4545 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgTribeSelect.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgTribeSelect.java @@ -23,7 +23,4 @@ public record MsgTribeSelect (Set availableRaces) implements Packet buffer.writeRegistryValue(Race.REGISTRY, race)); } - - @Override - public void handle(PlayerEntity sender) {} } diff --git a/src/main/java/com/minelittlepony/unicopia/network/MsgUnlockTraits.java b/src/main/java/com/minelittlepony/unicopia/network/MsgUnlockTraits.java index ba9b395c..250f8f7b 100644 --- a/src/main/java/com/minelittlepony/unicopia/network/MsgUnlockTraits.java +++ b/src/main/java/com/minelittlepony/unicopia/network/MsgUnlockTraits.java @@ -27,7 +27,4 @@ public record MsgUnlockTraits (Set traits) implements Packet buffer.writeIdentifier(trait.getId())); } - - @Override - public void handle(PlayerEntity sender) { } }