Don't load mappings in 1.19.4 protocol

This commit is contained in:
Nassim Jahnke 2023-02-03 12:13:30 +01:00
parent 1b4dbc1388
commit a506b21f56
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
3 changed files with 19 additions and 13 deletions

View File

@ -17,24 +17,22 @@
*/
package com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4;
import com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.data.EntityPackets1_19_4;
import com.viaversion.viabackwards.api.BackwardsProtocol;
import com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.packets.EntityPackets1_19_4;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.data.MappingData;
import com.viaversion.viaversion.api.data.MappingDataBase;
import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_3Types;
import com.viaversion.viaversion.api.protocol.AbstractProtocol;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.data.entity.EntityTrackerBase;
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ClientboundPackets1_19_3;
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.Protocol1_19_3To1_19_1;
import com.viaversion.viaversion.protocols.protocol1_19_3to1_19_1.ServerboundPackets1_19_3;
import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.ClientboundPackets1_19_4;
import com.viaversion.viaversion.protocols.protocol1_19_4to1_19_3.ServerboundPackets1_19_4;
import com.viaversion.viaversion.rewriter.CommandRewriter;
public final class Protocol1_19_3To1_19_4 extends AbstractProtocol<ClientboundPackets1_19_4, ClientboundPackets1_19_3, ServerboundPackets1_19_4, ServerboundPackets1_19_3> {
public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol<ClientboundPackets1_19_4, ClientboundPackets1_19_3, ServerboundPackets1_19_4, ServerboundPackets1_19_3> {
private static final MappingData MAPPINGS = new MappingDataBase("1.19.3", "1.19.3");
private final EntityPackets1_19_4 entityRewriter = new EntityPackets1_19_4(this);
public Protocol1_19_3To1_19_4() {
@ -44,6 +42,9 @@ public final class Protocol1_19_3To1_19_4 extends AbstractProtocol<ClientboundPa
@Override
protected void registerPackets() {
// TODO fallback field in components
executeAsyncAfterLoaded(Protocol1_19_3To1_19_1.class, () -> {
});
entityRewriter.register();
final CommandRewriter commandRewriter = new CommandRewriter(this) {
@ -55,6 +56,16 @@ public final class Protocol1_19_3To1_19_4 extends AbstractProtocol<ClientboundPa
super.handleArgument(wrapper, argumentType);
}
}
@Override
protected String argumentType(final int argumentTypeId) {
return Protocol1_19_3To1_19_1.MAPPINGS.getArgumentTypeMappings().mappedIdentifier(argumentTypeId);
}
@Override
protected int mappedArgumentTypeId(final String mappedArgumentType) {
return Protocol1_19_3To1_19_1.MAPPINGS.getArgumentTypeMappings().mappedId(mappedArgumentType);
}
};
commandRewriter.registerDeclareCommands1_19(ClientboundPackets1_19_4.DECLARE_COMMANDS);
@ -65,9 +76,4 @@ public final class Protocol1_19_3To1_19_4 extends AbstractProtocol<ClientboundPa
public void init(final UserConnection user) {
addEntityTracker(user, new EntityTrackerBase(user, Entity1_19_3Types.PLAYER));
}
@Override
public MappingData getMappingData() {
return MAPPINGS;
}
}

View File

@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.data;
package com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.packets;
import com.viaversion.viabackwards.protocol.protocol1_19_3to1_19_4.Protocol1_19_3To1_19_4;
import com.viaversion.viaversion.api.minecraft.entities.Entity1_19_3Types;

View File

@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions]
# ViaVersion
viaver = "4.6.0-23w03a-SNAPSHOT"
viaver = "4.6.0-23w05a-SNAPSHOT"
# Common provided
netty = "4.0.20.Final"