Skip to content

Commit

Permalink
Fix protocol class names
Browse files Browse the repository at this point in the history
Protocol classes should be named the same as the package:
server version To client version
  • Loading branch information
FlorianMichael committed Jul 3, 2024
1 parent be56317 commit 994e011
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
import net.raphimc.viaaprilfools.ViaAprilFools;
import net.raphimc.viaaprilfools.ViaAprilFoolsConfig;
import net.raphimc.viaaprilfools.api.AprilFoolsProtocolVersion;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol1_14to3D_Shareware;
import net.raphimc.viaaprilfools.protocol.scombattest8ctov1_16_2.Protocol1_16_2toCombatTest8c;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol3D_SharewareTo1_14;
import net.raphimc.viaaprilfools.protocol.scombattest8ctov1_16_2.ProtocolCombatTest8cTo1_16_2;
import net.raphimc.viaaprilfools.protocol.s20w14infinitetov1_16.Protocol20w14infiniteTo1_16;
import net.raphimc.viaaprilfools.protocol.v1_14tos3d_shareware.Protocol3D_Sharewareto1_14;
import net.raphimc.viaaprilfools.protocol.v1_14tos3d_shareware.Protocol1_14To3D_Shareware;

import java.io.File;
import java.util.logging.Logger;
Expand All @@ -41,10 +41,10 @@ default void init(final File configFile) {
Via.getManager().getSubPlatforms().add(ViaAprilFools.IMPL_VERSION);

final ProtocolManager protocolManager = Via.getManager().getProtocolManager();
protocolManager.registerProtocol(new Protocol1_14to3D_Shareware(), ProtocolVersion.v1_14, AprilFoolsProtocolVersion.s3d_shareware);
protocolManager.registerProtocol(new Protocol3D_Sharewareto1_14(), AprilFoolsProtocolVersion.s3d_shareware, ProtocolVersion.v1_14);
protocolManager.registerProtocol(new Protocol3D_SharewareTo1_14(), ProtocolVersion.v1_14, AprilFoolsProtocolVersion.s3d_shareware);
protocolManager.registerProtocol(new Protocol1_14To3D_Shareware(), AprilFoolsProtocolVersion.s3d_shareware, ProtocolVersion.v1_14);
protocolManager.registerProtocol(new Protocol20w14infiniteTo1_16(), ProtocolVersion.v1_16, AprilFoolsProtocolVersion.s20w14infinite);
protocolManager.registerProtocol(new Protocol1_16_2toCombatTest8c(), ProtocolVersion.v1_16_2, AprilFoolsProtocolVersion.sCombatTest8c);
protocolManager.registerProtocol(new ProtocolCombatTest8cTo1_16_2(), ProtocolVersion.v1_16_2, AprilFoolsProtocolVersion.sCombatTest8c);
}

Logger getLogger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.rewriter.EntityPacketRewriter3D_Shareware;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.storage.ChunkCenterTracker3D_Shareware;

public class Protocol1_14to3D_Shareware extends BackwardsProtocol<ClientboundPackets3D_Shareware, ClientboundPackets1_14, ServerboundPackets3D_Shareware, ServerboundPackets1_14> {
public class Protocol3D_SharewareTo1_14 extends BackwardsProtocol<ClientboundPackets3D_Shareware, ClientboundPackets1_14, ServerboundPackets3D_Shareware, ServerboundPackets1_14> {

public static final BackwardsMappingData MAPPINGS = new AprilFoolsMappingData("3D_Shareware", "1.14", Protocol1_13_2To1_14.class);
private static final int SERVERSIDE_VIEW_DISTANCE = 64;

private final BlockItemPacketRewriter3D_Shareware blockItemPackets = new BlockItemPacketRewriter3D_Shareware(this);

public Protocol1_14to3D_Shareware() {
public Protocol3D_SharewareTo1_14() {
super(ClientboundPackets3D_Shareware.class, ClientboundPackets1_14.class, ServerboundPackets3D_Shareware.class, ServerboundPackets1_14.class);
}

Expand All @@ -68,7 +68,7 @@ protected void registerPackets() {
final PacketWrapper fakePosLook = wrapper.create(ClientboundPackets1_14.SET_CHUNK_CACHE_CENTER); // Set center chunk
fakePosLook.write(Types.VAR_INT, chunk.getX());
fakePosLook.write(Types.VAR_INT, chunk.getZ());
fakePosLook.send(Protocol1_14to3D_Shareware.class);
fakePosLook.send(Protocol3D_SharewareTo1_14.class);
entityTracker.setChunkCenterX(chunk.getX());
entityTracker.setChunkCenterZ(chunk.getZ());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
import com.viaversion.viaversion.protocols.v1_13_2to1_14.packet.ServerboundPackets1_14;
import com.viaversion.viaversion.rewriter.ItemRewriter;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ClientboundPackets3D_Shareware;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol1_14to3D_Shareware;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol3D_SharewareTo1_14;

public class BlockItemPacketRewriter3D_Shareware extends ItemRewriter<ClientboundPackets3D_Shareware, ServerboundPackets1_14, Protocol1_14to3D_Shareware> {
public class BlockItemPacketRewriter3D_Shareware extends ItemRewriter<ClientboundPackets3D_Shareware, ServerboundPackets1_14, Protocol3D_SharewareTo1_14> {

public BlockItemPacketRewriter3D_Shareware(Protocol1_14to3D_Shareware protocol) {
public BlockItemPacketRewriter3D_Shareware(Protocol3D_SharewareTo1_14 protocol) {
super(protocol, Types.ITEM1_13_2, Types.ITEM1_13_2_SHORT_ARRAY);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.api.type.types.version.Types1_14;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ClientboundPackets3D_Shareware;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol1_14to3D_Shareware;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.Protocol3D_SharewareTo1_14;

import java.util.List;

public class EntityPacketRewriter3D_Shareware extends RewriterBase<Protocol1_14to3D_Shareware> {
public class EntityPacketRewriter3D_Shareware extends RewriterBase<Protocol3D_SharewareTo1_14> {

public EntityPacketRewriter3D_Shareware(Protocol1_14to3D_Shareware protocol) {
public EntityPacketRewriter3D_Shareware(Protocol3D_SharewareTo1_14 protocol) {
super(protocol);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ClientboundPackets1_16_2;
import com.viaversion.viaversion.protocols.v1_16_1to1_16_2.packet.ServerboundPackets1_16_2;

public class Protocol1_16_2toCombatTest8c extends AbstractProtocol<ClientboundPackets1_16_2, ClientboundPackets1_16_2, ServerboundPackets1_16_2, ServerboundPackets1_16_2> {
public class ProtocolCombatTest8cTo1_16_2 extends AbstractProtocol<ClientboundPackets1_16_2, ClientboundPackets1_16_2, ServerboundPackets1_16_2, ServerboundPackets1_16_2> {

public Protocol1_16_2toCombatTest8c() {
public ProtocolCombatTest8cTo1_16_2() {
super(ClientboundPackets1_16_2.class, ClientboundPackets1_16_2.class, ServerboundPackets1_16_2.class, ServerboundPackets1_16_2.class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ClientboundPackets3D_Shareware;
import net.raphimc.viaaprilfools.protocol.s3d_sharewaretov1_14.packet.ServerboundPackets3D_Shareware;

public class Protocol3D_Sharewareto1_14 extends BackwardsProtocol<ClientboundPackets1_14, ClientboundPackets3D_Shareware, ServerboundPackets1_14, ServerboundPackets3D_Shareware> {
public class Protocol1_14To3D_Shareware extends BackwardsProtocol<ClientboundPackets1_14, ClientboundPackets3D_Shareware, ServerboundPackets1_14, ServerboundPackets3D_Shareware> {

public Protocol3D_Sharewareto1_14() {
public Protocol1_14To3D_Shareware() {
super(ClientboundPackets1_14.class, ClientboundPackets3D_Shareware.class, ServerboundPackets1_14.class, ServerboundPackets3D_Shareware.class);
}

Expand Down

0 comments on commit 994e011

Please sign in to comment.