Update fabwork again

This commit is contained in:
Sollace 2022-12-30 21:09:33 +01:00
parent 83932bfea1
commit bc54d0e280
14 changed files with 15 additions and 33 deletions

View file

@ -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

View file

@ -27,7 +27,4 @@ public record MsgBlockDestruction (Long2ObjectMap<Float> destructions) implement
buffer.writeFloat(i);
});
}
@Override
public void handle(PlayerEntity sender) {}
}

View file

@ -16,7 +16,4 @@ public final class MsgCancelPlayerAbility implements Packet<PlayerEntity> {
@Override
public void toBuffer(PacketByteBuf buffer) { }
@Override
public void handle(PlayerEntity sender) { }
}

View file

@ -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<Trait> traits) implements Packet<ServerPlayerEntity> {
public record MsgMarkTraitRead (Set<Trait> traits) implements HandledPacket<ServerPlayerEntity> {
MsgMarkTraitRead(PacketByteBuf buffer) {
this(new HashSet<>());
int length = buffer.readInt();

View file

@ -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<T extends Hit> (
Ability<T> power,
Optional<T> data,
ActivationType type
) implements Packet<ServerPlayerEntity> {
) implements HandledPacket<ServerPlayerEntity> {
@SuppressWarnings("unchecked")
static <T extends Hit> MsgPlayerAbility<T> read(PacketByteBuf buffer) {

View file

@ -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<PlayerEntity> {
) implements HandledPacket<PlayerEntity> {
MsgPlayerAnimationChange(PacketByteBuf buffer) {
this(buffer.readUuid(), buffer.readEnumConstant(Animation.class), buffer.readInt());

View file

@ -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;
* <p>
* Also used by the server to notify a race change.
*/
public class MsgPlayerCapabilities implements Packet<PlayerEntity> {
public class MsgPlayerCapabilities implements HandledPacket<PlayerEntity> {
protected final UUID playerId;

View file

@ -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<ServerPlayerEntity> {
public record MsgRemoveSpell (UUID id) implements HandledPacket<ServerPlayerEntity> {
MsgRemoveSpell(PacketByteBuf buffer) {
this(buffer.readUuid());
}

View file

@ -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<ServerPlayerEntity> {
) implements HandledPacket<ServerPlayerEntity> {
MsgRequestSpeciesChange(PacketByteBuf buffer) {
this(buffer.readBoolean(), buffer.readRegistryValue(Race.REGISTRY));

View file

@ -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) { }
}

View file

@ -28,7 +28,4 @@ public class MsgSpawnProjectile extends EntitySpawnS2CPacket implements Packet<P
public void toBuffer(PacketByteBuf buffer) {
write(buffer);
}
@Override
public void handle(PlayerEntity sender) {}
}

View file

@ -2,7 +2,7 @@ package com.minelittlepony.unicopia.network;
import com.minelittlepony.unicopia.container.SpellbookScreenHandler;
import com.minelittlepony.unicopia.container.SpellbookState;
import com.sollace.fabwork.api.packets.Packet;
import com.sollace.fabwork.api.packets.HandledPacket;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.PacketByteBuf;
@ -15,7 +15,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
public record MsgSpellbookStateChanged<T extends PlayerEntity> (
int syncId,
SpellbookState state
) implements Packet<T> {
) implements HandledPacket<T> {
public MsgSpellbookStateChanged(PacketByteBuf buffer) {
this(buffer.readInt(), new SpellbookState().fromPacket(buffer));

View file

@ -23,7 +23,4 @@ public record MsgTribeSelect (Set<Race> availableRaces) implements Packet<Player
buffer.writeInt(availableRaces.size());
availableRaces.forEach(race -> buffer.writeRegistryValue(Race.REGISTRY, race));
}
@Override
public void handle(PlayerEntity sender) {}
}

View file

@ -27,7 +27,4 @@ public record MsgUnlockTraits (Set<Trait> traits) implements Packet<PlayerEntity
buffer.writeInt(traits.size());
traits.forEach(trait -> buffer.writeIdentifier(trait.getId()));
}
@Override
public void handle(PlayerEntity sender) { }
}