mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-27 07:17:58 +01:00
Update fabwork again
This commit is contained in:
parent
83932bfea1
commit
bc54d0e280
14 changed files with 15 additions and 33 deletions
|
@ -20,7 +20,7 @@ org.gradle.daemon=false
|
||||||
modrinth_project_id=
|
modrinth_project_id=
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
fabwork_version=1.1.0
|
fabwork_version=1.1.1
|
||||||
modmenu_version=5.0.0-alpha.3
|
modmenu_version=5.0.0-alpha.3
|
||||||
minelp_version=4.7.2
|
minelp_version=4.7.2
|
||||||
kirin_version=1.13.2
|
kirin_version=1.13.2
|
||||||
|
|
|
@ -27,7 +27,4 @@ public record MsgBlockDestruction (Long2ObjectMap<Float> destructions) implement
|
||||||
buffer.writeFloat(i);
|
buffer.writeFloat(i);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(PlayerEntity sender) {}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,4 @@ public final class MsgCancelPlayerAbility implements Packet<PlayerEntity> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void toBuffer(PacketByteBuf buffer) { }
|
public void toBuffer(PacketByteBuf buffer) { }
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(PlayerEntity sender) { }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,12 +5,12 @@ import java.util.Set;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait;
|
import com.minelittlepony.unicopia.ability.magic.spell.trait.Trait;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
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.network.PacketByteBuf;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
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) {
|
MsgMarkTraitRead(PacketByteBuf buffer) {
|
||||||
this(new HashSet<>());
|
this(new HashSet<>());
|
||||||
int length = buffer.readInt();
|
int length = buffer.readInt();
|
||||||
|
|
|
@ -7,7 +7,7 @@ import com.minelittlepony.unicopia.ability.Ability;
|
||||||
import com.minelittlepony.unicopia.ability.ActivationType;
|
import com.minelittlepony.unicopia.ability.ActivationType;
|
||||||
import com.minelittlepony.unicopia.ability.data.Hit;
|
import com.minelittlepony.unicopia.ability.data.Hit;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
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.network.PacketByteBuf;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
@ -19,7 +19,7 @@ public record MsgPlayerAbility<T extends Hit> (
|
||||||
Ability<T> power,
|
Ability<T> power,
|
||||||
Optional<T> data,
|
Optional<T> data,
|
||||||
ActivationType type
|
ActivationType type
|
||||||
) implements Packet<ServerPlayerEntity> {
|
) implements HandledPacket<ServerPlayerEntity> {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
static <T extends Hit> MsgPlayerAbility<T> read(PacketByteBuf buffer) {
|
static <T extends Hit> MsgPlayerAbility<T> read(PacketByteBuf buffer) {
|
||||||
|
|
|
@ -4,7 +4,7 @@ import java.util.UUID;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.client.render.PlayerPoser.Animation;
|
import com.minelittlepony.unicopia.client.render.PlayerPoser.Animation;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
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.client.MinecraftClient;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
@ -17,7 +17,7 @@ public record MsgPlayerAnimationChange (
|
||||||
UUID playerId,
|
UUID playerId,
|
||||||
Animation animation,
|
Animation animation,
|
||||||
int duration
|
int duration
|
||||||
) implements Packet<PlayerEntity> {
|
) implements HandledPacket<PlayerEntity> {
|
||||||
|
|
||||||
MsgPlayerAnimationChange(PacketByteBuf buffer) {
|
MsgPlayerAnimationChange(PacketByteBuf buffer) {
|
||||||
this(buffer.readUuid(), buffer.readEnumConstant(Animation.class), buffer.readInt());
|
this(buffer.readUuid(), buffer.readEnumConstant(Animation.class), buffer.readInt());
|
||||||
|
|
|
@ -7,7 +7,7 @@ import java.util.UUID;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.Unicopia;
|
import com.minelittlepony.unicopia.Unicopia;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
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.ByteBufInputStream;
|
||||||
import io.netty.buffer.ByteBufOutputStream;
|
import io.netty.buffer.ByteBufOutputStream;
|
||||||
|
@ -21,7 +21,7 @@ import net.minecraft.nbt.NbtIo;
|
||||||
* <p>
|
* <p>
|
||||||
* Also used by the server to notify a race change.
|
* 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;
|
protected final UUID playerId;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@ import java.util.UUID;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.ability.magic.spell.Spell;
|
import com.minelittlepony.unicopia.ability.magic.spell.Spell;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
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.network.PacketByteBuf;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
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.
|
* 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) {
|
MsgRemoveSpell(PacketByteBuf buffer) {
|
||||||
this(buffer.readUuid());
|
this(buffer.readUuid());
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,7 @@ package com.minelittlepony.unicopia.network;
|
||||||
import com.minelittlepony.unicopia.Race;
|
import com.minelittlepony.unicopia.Race;
|
||||||
import com.minelittlepony.unicopia.WorldTribeManager;
|
import com.minelittlepony.unicopia.WorldTribeManager;
|
||||||
import com.minelittlepony.unicopia.entity.player.Pony;
|
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.network.PacketByteBuf;
|
||||||
import net.minecraft.server.network.ServerPlayerEntity;
|
import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
|
@ -17,7 +17,7 @@ import net.minecraft.server.world.ServerWorld;
|
||||||
public record MsgRequestSpeciesChange (
|
public record MsgRequestSpeciesChange (
|
||||||
boolean force,
|
boolean force,
|
||||||
Race newRace
|
Race newRace
|
||||||
) implements Packet<ServerPlayerEntity> {
|
) implements HandledPacket<ServerPlayerEntity> {
|
||||||
|
|
||||||
MsgRequestSpeciesChange(PacketByteBuf buffer) {
|
MsgRequestSpeciesChange(PacketByteBuf buffer) {
|
||||||
this(buffer.readBoolean(), buffer.readRegistryValue(Race.REGISTRY));
|
this(buffer.readBoolean(), buffer.readRegistryValue(Race.REGISTRY));
|
||||||
|
|
|
@ -39,7 +39,4 @@ public record MsgServerResources (
|
||||||
buffer.writeMap(chapters, PacketByteBuf::writeIdentifier, (r, v) -> ((SpellbookChapterLoader.Chapter)v).write(r));
|
buffer.writeMap(chapters, PacketByteBuf::writeIdentifier, (r, v) -> ((SpellbookChapterLoader.Chapter)v).write(r));
|
||||||
buffer.writeMap(treeTypes, PacketByteBuf::writeIdentifier, (r, v) -> v.write(r));
|
buffer.writeMap(treeTypes, PacketByteBuf::writeIdentifier, (r, v) -> v.write(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(PlayerEntity sender) { }
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,4 @@ public class MsgSpawnProjectile extends EntitySpawnS2CPacket implements Packet<P
|
||||||
public void toBuffer(PacketByteBuf buffer) {
|
public void toBuffer(PacketByteBuf buffer) {
|
||||||
write(buffer);
|
write(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(PlayerEntity sender) {}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.minelittlepony.unicopia.network;
|
||||||
|
|
||||||
import com.minelittlepony.unicopia.container.SpellbookScreenHandler;
|
import com.minelittlepony.unicopia.container.SpellbookScreenHandler;
|
||||||
import com.minelittlepony.unicopia.container.SpellbookState;
|
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.entity.player.PlayerEntity;
|
||||||
import net.minecraft.network.PacketByteBuf;
|
import net.minecraft.network.PacketByteBuf;
|
||||||
|
@ -15,7 +15,7 @@ import net.minecraft.server.network.ServerPlayerEntity;
|
||||||
public record MsgSpellbookStateChanged<T extends PlayerEntity> (
|
public record MsgSpellbookStateChanged<T extends PlayerEntity> (
|
||||||
int syncId,
|
int syncId,
|
||||||
SpellbookState state
|
SpellbookState state
|
||||||
) implements Packet<T> {
|
) implements HandledPacket<T> {
|
||||||
|
|
||||||
public MsgSpellbookStateChanged(PacketByteBuf buffer) {
|
public MsgSpellbookStateChanged(PacketByteBuf buffer) {
|
||||||
this(buffer.readInt(), new SpellbookState().fromPacket(buffer));
|
this(buffer.readInt(), new SpellbookState().fromPacket(buffer));
|
||||||
|
|
|
@ -23,7 +23,4 @@ public record MsgTribeSelect (Set<Race> availableRaces) implements Packet<Player
|
||||||
buffer.writeInt(availableRaces.size());
|
buffer.writeInt(availableRaces.size());
|
||||||
availableRaces.forEach(race -> buffer.writeRegistryValue(Race.REGISTRY, race));
|
availableRaces.forEach(race -> buffer.writeRegistryValue(Race.REGISTRY, race));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(PlayerEntity sender) {}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,4 @@ public record MsgUnlockTraits (Set<Trait> traits) implements Packet<PlayerEntity
|
||||||
buffer.writeInt(traits.size());
|
buffer.writeInt(traits.size());
|
||||||
traits.forEach(trait -> buffer.writeIdentifier(trait.getId()));
|
traits.forEach(trait -> buffer.writeIdentifier(trait.getId()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void handle(PlayerEntity sender) { }
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue