Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-12-24 15:20:19 +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
Dieser Commit ist enthalten in:
Ursprung
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.storage.ConfigurationPacketStorage;
|
||||
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.EntityTypes1_19_4;
|
||||
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
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.cancel();
|
||||
|
||||
final PacketWrapper featuresPacket = wrapper.create(ClientboundPackets1_19_4.UPDATE_ENABLED_FEATURES);
|
||||
featuresPacket.write(Type.STRING_ARRAY, configurationPacketStorage.enabledFeatures());
|
||||
featuresPacket.send(Protocol1_20To1_20_2.class);
|
||||
if (configurationPacketStorage.enabledFeatures() != null) {
|
||||
final PacketWrapper featuresPacket = wrapper.create(ClientboundPackets1_19_4.UPDATE_ENABLED_FEATURES);
|
||||
featuresPacket.write(Type.STRING_ARRAY, configurationPacketStorage.enabledFeatures());
|
||||
featuresPacket.send(Protocol1_20To1_20_2.class);
|
||||
}
|
||||
|
||||
configurationPacketStorage.sendQueuedPackets(wrapper.user());
|
||||
});
|
||||
|
@ -29,6 +29,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
||||
|
||||
public final class ConfigurationPacketStorage implements StorableObject {
|
||||
|
||||
@ -51,8 +52,7 @@ public final class ConfigurationPacketStorage implements StorableObject {
|
||||
this.registry = registry;
|
||||
}
|
||||
|
||||
public String[] enabledFeatures() {
|
||||
Preconditions.checkNotNull(enabledFeatures);
|
||||
public String @Nullable [] enabledFeatures() {
|
||||
return enabledFeatures;
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren