mirror of
https://github.com/ViaVersion/ViaBackwards.git
synced 2024-11-16 11:15:49 +01:00
Don't expect enables features to always be sent
The client defaults to the vanilla registry, so it doesn't need to be sent
This commit is contained in:
parent
71f08b9e4e
commit
bce716caa4
@ -21,8 +21,8 @@ import com.viaversion.viabackwards.api.rewriters.EntityRewriter;
|
|||||||
import com.viaversion.viabackwards.protocol.protocol1_20to1_20_2.Protocol1_20To1_20_2;
|
import com.viaversion.viabackwards.protocol.protocol1_20to1_20_2.Protocol1_20To1_20_2;
|
||||||
import com.viaversion.viabackwards.protocol.protocol1_20to1_20_2.storage.ConfigurationPacketStorage;
|
import com.viaversion.viabackwards.protocol.protocol1_20to1_20_2.storage.ConfigurationPacketStorage;
|
||||||
import com.viaversion.viaversion.api.minecraft.GlobalPosition;
|
import com.viaversion.viaversion.api.minecraft.GlobalPosition;
|
||||||
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4;
|
|
||||||
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
import com.viaversion.viaversion.api.minecraft.entities.EntityType;
|
||||||
|
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_19_4;
|
||||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||||
import com.viaversion.viaversion.api.type.Type;
|
import com.viaversion.viaversion.api.type.Type;
|
||||||
@ -143,9 +143,11 @@ public final class EntityPacketRewriter1_20_2 extends EntityRewriter<Clientbound
|
|||||||
wrapper.send(Protocol1_20To1_20_2.class);
|
wrapper.send(Protocol1_20To1_20_2.class);
|
||||||
wrapper.cancel();
|
wrapper.cancel();
|
||||||
|
|
||||||
|
if (configurationPacketStorage.enabledFeatures() != null) {
|
||||||
final PacketWrapper featuresPacket = wrapper.create(ClientboundPackets1_19_4.UPDATE_ENABLED_FEATURES);
|
final PacketWrapper featuresPacket = wrapper.create(ClientboundPackets1_19_4.UPDATE_ENABLED_FEATURES);
|
||||||
featuresPacket.write(Type.STRING_ARRAY, configurationPacketStorage.enabledFeatures());
|
featuresPacket.write(Type.STRING_ARRAY, configurationPacketStorage.enabledFeatures());
|
||||||
featuresPacket.send(Protocol1_20To1_20_2.class);
|
featuresPacket.send(Protocol1_20To1_20_2.class);
|
||||||
|
}
|
||||||
|
|
||||||
configurationPacketStorage.sendQueuedPackets(wrapper.user());
|
configurationPacketStorage.sendQueuedPackets(wrapper.user());
|
||||||
});
|
});
|
||||||
|
@ -29,6 +29,7 @@ import io.netty.buffer.ByteBuf;
|
|||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||||
|
|
||||||
public final class ConfigurationPacketStorage implements StorableObject {
|
public final class ConfigurationPacketStorage implements StorableObject {
|
||||||
|
|
||||||
@ -51,8 +52,7 @@ public final class ConfigurationPacketStorage implements StorableObject {
|
|||||||
this.registry = registry;
|
this.registry = registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] enabledFeatures() {
|
public String @Nullable [] enabledFeatures() {
|
||||||
Preconditions.checkNotNull(enabledFeatures);
|
|
||||||
return enabledFeatures;
|
return enabledFeatures;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user