Add missing switch breaks

This commit is contained in:
Nassim Jahnke 2023-10-18 19:48:19 +10:00
parent 6e7f936e83
commit dccb6f234b
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
4 changed files with 9 additions and 7 deletions

View File

@ -165,8 +165,10 @@ public class ComponentRewriter<C extends ClientboundPacketType> {
switch (type) {
case JSON:
processText(wrapper.passthrough(Type.COMPONENT));
break;
case NBT:
processTag(wrapper.passthrough(Type.TAG));
break;
}
}

View File

@ -71,7 +71,7 @@ public final class Protocol1_99To_98 extends AbstractProtocol<ClientboundPackets
new StatisticsRewriter<>(this).register(ClientboundPackets1_20_2.STATISTICS);
// Uncomment if an existing type changed serialization format. Mappings for argument type keys can also be defined in mapping files
/*final CommandRewriter1_z<ClientboundPackets1_20_2> commandRewriter = new CommandRewriter1_z<ClientboundPackets1_20_2>(this) {
/*final CommandRewriter1_19_4<ClientboundPackets1_20_2> commandRewriter = new CommandRewriter1_19_4<ClientboundPackets1_20_2>(this) {
@Override
public void handleArgument(final PacketWrapper wrapper, final String argumentType) throws Exception {
if (argumentType.equals("minecraft:abc")) {
@ -105,9 +105,9 @@ public final class Protocol1_99To_98 extends AbstractProtocol<ClientboundPackets
}
@Override
public void init(final UserConnection user) {
public void init(final UserConnection connection) {
// Register the entity tracker - used for entity id/metadata rewriting AND for tracking world data sent to the client (then used for chunk data rewriting)
addEntityTracker(user, new EntityTrackerBase(user, Entity1_19_4Types.PLAYER));
addEntityTracker(connection, new EntityTrackerBase(connection, Entity1_19_4Types.PLAYER));
}
// Overriding these three methods is important as they are relied on various rewriter classes

View File

@ -18,16 +18,16 @@
package com.viaversion.viaversion.template.protocols.rewriter;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.protocols.protocol1_18to1_17_1.types.Chunk1_18Type;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ClientboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.packet.ServerboundPackets1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.rewriter.RecipeRewriter1_20_2;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.type.ChunkType1_20_2;
import com.viaversion.viaversion.rewriter.BlockRewriter;
import com.viaversion.viaversion.rewriter.ItemRewriter;
import com.viaversion.viaversion.template.protocols.Protocol1_99To_98;
// To replace if needed:
// Chunk1_18Type
// ChunkType1_20_2
// RecipeRewriter1_20_2
public final class BlockItemPacketRewriter1_99 extends ItemRewriter<ClientboundPackets1_20_2, ServerboundPackets1_20_2, Protocol1_99To_98> {
@ -45,7 +45,7 @@ public final class BlockItemPacketRewriter1_99 extends ItemRewriter<ClientboundP
blockRewriter.registerBlockChange(ClientboundPackets1_20_2.BLOCK_CHANGE);
blockRewriter.registerVarLongMultiBlockChange1_20(ClientboundPackets1_20_2.MULTI_BLOCK_CHANGE);
blockRewriter.registerEffect(ClientboundPackets1_20_2.EFFECT, 1010, 2001);
blockRewriter.registerChunkData1_19(ClientboundPackets1_20_2.CHUNK_DATA, Chunk1_18Type::new);
blockRewriter.registerChunkData1_19(ClientboundPackets1_20_2.CHUNK_DATA, ChunkType1_20_2::new);
blockRewriter.registerBlockEntityData(ClientboundPackets1_20_2.BLOCK_ENTITY_DATA);
// Registers item id changes

View File

@ -110,7 +110,7 @@ public final class EntityPacketRewriter1_99 extends EntityRewriter<ClientboundPa
@Override
public void onMappingDataLoaded() {
// IF ENTITY TYPES CHANGED: Automatically map entity id changes AFTER entity ids have been loaded
// mapTypes();
mapTypes();
}
@Override