Skip to content

Commit

Permalink
Minor tweaks to velocity (update api)
Browse files Browse the repository at this point in the history
  • Loading branch information
retrooper committed Sep 22, 2023
1 parent cdc7ed3 commit 0ca2f5c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public ProtocolPacketEvent(PacketSide packetSide, Object channel,
this.packetType = PacketType.getById(packetSide, user.getConnectionState(),
version, packetID);
if (this.packetType == null) {
// mojang fucked up and keeps sending disconnect packets in the wrong protocol state
// mojang messed up and keeps sending disconnect packets in the wrong protocol state
if (PacketType.getById(packetSide, ConnectionState.PLAY, version, packetID) == PacketType.Play.Server.DISCONNECT) {
throw new InvalidDisconnectPacketSend();
}
Expand Down
7 changes: 5 additions & 2 deletions velocity/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ repositories {
maven {
url 'https://papermc.io/repo/repository/maven-public/'
}
maven {
url 'https://repo.papermc.io/repository/maven-public/'
}
}

shadowJar {
Expand All @@ -13,8 +16,8 @@ shadowJar {

dependencies {
compileOnly 'io.netty:netty-all:4.1.75.Final'
compileOnly 'com.velocitypowered:velocity-api:1.0.0-SNAPSHOT'
annotationProcessor 'com.velocitypowered:velocity-api:1.0.0-SNAPSHOT'
compileOnly 'com.velocitypowered:velocity-api:3.1.0'
annotationProcessor 'com.velocitypowered:velocity-api:3.1.0'
api project(':api')
implementation project(':netty-common')
//Velocity ships with adventure & gson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
import com.github.retrooper.packetevents.event.PacketListenerAbstract;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.netty.channel.ChannelHelper;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientInteractEntity;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerExplosion;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSystemChatMessage;
import com.google.inject.Inject;
import com.velocitypowered.api.event.PostOrder;
import com.velocitypowered.api.event.Subscribe;
Expand All @@ -38,7 +41,7 @@

import java.util.logging.Logger;

@Plugin(id = "packetevents", name = "PacketEvents", version = "2.0.0")
@Plugin(id = "packetevents", name = "PacketEvents", version = "2.0.2")
public class PacketEventsPlugin {
private final ProxyServer server;
private final Logger logger;
Expand Down Expand Up @@ -75,6 +78,11 @@ public void onPacketReceive(PacketReceiveEvent event) {
@Override
public void onPacketSend(PacketSendEvent event) {
//System.out.println("Outgoing: " + event.getPacketType().getName());
/*if (event.getPacketType() == PacketType.Play.Server.SYSTEM_CHAT_MESSAGE) {
System.out.println("Before processing, pipe: " + ChannelHelper.pipelineHandlerNamesAsString(event.getChannel()));
WrapperPlayServerSystemChatMessage msg = new WrapperPlayServerSystemChatMessage(event);
System.out.println("After processing: " + msg.getMessage());
}*/
}
});
PacketEvents.getAPI().init();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ public void init() {
}

if (settings.isbStatsEnabled()) {
// TODO Cross-platform metrics?
}

PacketType.Play.Client.load();
Expand Down

0 comments on commit 0ca2f5c

Please sign in to comment.