mirror of
https://github.com/ViaVersion/ViaAprilFools.git
synced 2025-01-08 19:17:40 +01:00
Merge pull request #9 from FlorianMichael/via-update
Updated Via* and implemented new Provider
This commit is contained in:
commit
34b176c3bd
@ -20,8 +20,8 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly "com.viaversion:viaversion:4.6.0-1.19.4-pre3-SNAPSHOT"
|
||||
compileOnly("com.viaversion:viabackwards-common:4.6.0-1.19.4-pre3-SNAPSHOT") {
|
||||
compileOnly "com.viaversion:viaversion:4.7.0-23w17a-SNAPSHOT"
|
||||
compileOnly("com.viaversion:viabackwards-common:4.7.0-23w17a-SNAPSHOT") {
|
||||
exclude group: "com.viaversion", module: "viaversion"
|
||||
}
|
||||
compileOnly "org.yaml:snakeyaml:2.0"
|
||||
|
@ -20,6 +20,7 @@ package net.raphimc.viaaprilfools.protocols.protocol1_16to20w14infinite;
|
||||
import com.viaversion.viabackwards.api.BackwardsProtocol;
|
||||
import com.viaversion.viabackwards.api.data.BackwardsMappings;
|
||||
import com.viaversion.viabackwards.api.rewriters.SoundRewriter;
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryType;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.Entity1_16Types;
|
||||
@ -29,6 +30,7 @@ import com.viaversion.viaversion.data.entity.EntityTrackerBase;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.Protocol1_16To1_15_2;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ServerboundPackets1_16;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
|
||||
import com.viaversion.viaversion.rewriter.RecipeRewriter;
|
||||
import com.viaversion.viaversion.rewriter.StatisticsRewriter;
|
||||
import com.viaversion.viaversion.rewriter.TagRewriter;
|
||||
@ -111,11 +113,11 @@ public class Protocol1_16to20w14infinite extends BackwardsProtocol<ClientboundPa
|
||||
this.registerServerbound(ServerboundPackets1_16.PLAYER_ABILITIES, new PacketHandlers() {
|
||||
@Override
|
||||
public void register() {
|
||||
map(Type.BYTE); // Flags
|
||||
handler(wrapper -> {
|
||||
wrapper.passthrough(Type.BYTE);
|
||||
// Flying and walking speed - not important anyways
|
||||
wrapper.write(Type.FLOAT, 0.05F);
|
||||
wrapper.write(Type.FLOAT, 0.1F);
|
||||
final PlayerAbilitiesProvider playerAbilities = Via.getManager().getProviders().get(PlayerAbilitiesProvider.class);
|
||||
wrapper.write(Type.FLOAT, playerAbilities.getFlyingSpeed());
|
||||
wrapper.write(Type.FLOAT, playerAbilities.getWalkingSpeed());
|
||||
});
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user