mirror of
https://github.com/ViaVersion/ViaAprilFools.git
synced 2025-01-22 21:21:26 +01:00
Add base protocols manually
This commit is contained in:
parent
1b6797675a
commit
a7c50c2ff8
@ -30,7 +30,7 @@ public class AprilFoolsProtocolVersion {
|
||||
public static final List<ProtocolVersion> APRIL_FOOLS_PROTOCOLS = new ArrayList<>();
|
||||
|
||||
public static final ProtocolVersion s3d_shareware = registerAprilFools(1, "3D Shareware", ProtocolVersion.v1_13_2);
|
||||
public static final ProtocolVersion s20w14infinite = registerAprilFools(709, "20w14infinite", ProtocolVersion.v1_16 /* Should be 1.15.2, but 1.16 is used to work around base protocol issues */);
|
||||
public static final ProtocolVersion s20w14infinite = registerAprilFools(709, "20w14infinite", ProtocolVersion.v1_15_2);
|
||||
public static final ProtocolVersion sCombatTest8c = registerSnapshot(803, "Combat Test 8c", ProtocolVersion.v1_16_1);
|
||||
|
||||
private static ProtocolVersion registerSnapshot(final int version, final String name, final ProtocolVersion origin) {
|
||||
|
@ -17,8 +17,11 @@
|
||||
*/
|
||||
package net.raphimc.viaaprilfools.protocols.protocol1_16_2toCombatTest8c;
|
||||
|
||||
import com.viaversion.viaversion.api.Via;
|
||||
import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.protocol.AbstractProtocol;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.ClientboundPackets1_16_2;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16_2to1_16_1.ServerboundPackets1_16_2;
|
||||
@ -45,4 +48,9 @@ public class Protocol1_16_2toCombatTest8c extends AbstractProtocol<ClientboundPa
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(UserConnection userConnection) {
|
||||
userConnection.getProtocolInfo().getPipeline().add(Via.getManager().getProtocolManager().getBaseProtocol(ProtocolVersion.v1_16));
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ import com.viaversion.viaversion.api.connection.UserConnection;
|
||||
import com.viaversion.viaversion.api.minecraft.RegistryType;
|
||||
import com.viaversion.viaversion.api.minecraft.entities.EntityTypes1_16;
|
||||
import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
|
||||
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
|
||||
import com.viaversion.viaversion.api.type.Type;
|
||||
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
|
||||
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.ClientboundPackets1_16;
|
||||
@ -163,6 +164,7 @@ public class Protocol1_16to20w14infinite extends BackwardsProtocol<ClientboundPa
|
||||
@Override
|
||||
public void init(UserConnection userConnection) {
|
||||
userConnection.addEntityTracker(this.getClass(), new EntityTrackerBase(userConnection, EntityTypes1_16.PLAYER));
|
||||
userConnection.getProtocolInfo().getPipeline().add(Via.getManager().getProtocolManager().getBaseProtocol(ProtocolVersion.v1_16));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -108,7 +108,7 @@ public class EntityPackets20w14infinite {
|
||||
@Override
|
||||
public void register() {
|
||||
map(Type.INT); // Entity ID
|
||||
map(Type.BYTE); // Gamemode
|
||||
map(Type.UNSIGNED_BYTE); // Gamemode
|
||||
handler(wrapper -> {
|
||||
wrapper.write(Type.BYTE, (byte) -1); // Previous gamemode, set to none
|
||||
wrapper.write(Type.STRING_ARRAY, WORLD_NAMES); // World list - only used for command completion
|
||||
|
Loading…
Reference in New Issue
Block a user