Skip to content

Commit

Permalink
Actually fix velocity
Browse files Browse the repository at this point in the history
  • Loading branch information
KaspianDev committed Jul 15, 2024
1 parent 8dbfa08 commit b7a08d9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ tasks {

allprojects {
group = "com.github.kaspiandev.antipopup"
version = "9.1"
version = "9.2"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion shared/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ plugins {
dependencies {
compileOnly "org.apache.logging.log4j:log4j-core:2.19.0"
compileOnly "net.kyori:adventure-api:4.14.0"
compileOnly "com.github.retrooper:packetevents-api:${packetEventsVer}"

implementation "dev.dejvokep:boosted-yaml:1.3"
implementation "net.kyori:adventure-text-serializer-gson:4.14.0"
implementation "net.kyori:adventure-platform-bukkit:4.3.1"
implementation "com.github.retrooper:packetevents-api:${packetEventsVer}"
}

java {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.github.kaspiandev.antipopup.listener;

import com.github.kaspiandev.antipopup.platform.Platform;
import com.github.retrooper.packetevents.event.PacketListenerAbstract;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.event.*;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
Expand All @@ -13,12 +10,11 @@
import com.github.retrooper.packetevents.wrapper.status.server.WrapperStatusServerResponse;
import com.google.gson.JsonObject;

public class PacketEventsListener extends PacketListenerAbstract {
public class PacketEventsListener implements PacketListener {

private final Platform platform;

public PacketEventsListener(Platform platform) {
super(PacketListenerPriority.LOW);
this.platform = platform;
}

Expand Down
4 changes: 2 additions & 2 deletions spigot/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ tasks {
}
shadowJar {
minimize()
relocate("io.github.retrooper.packetevents", "com.github.kaspiandev.antipopup.libs.packetevents")
relocate("com.github.retrooper.packetevents", "com.github.kaspiandev.antipopup.libs.packetevents")
relocate("io.github.retrooper.packetevents", "com.github.kaspiandev.antipopup.libs.packetevents.spigot")
relocate("com.github.retrooper.packetevents", "com.github.kaspiandev.antipopup.libs.packetevents.api")
relocate("net.kyori", "com.github.kaspiandev.antipopup.libs.kyori")
relocate("org.bstats", "com.github.kaspiandev.antipopup.libs.bstats")
relocate("com.tcoded.folialib", "com.github.kaspiandev.antipopup.libs.folialib")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.github.kaspiandev.antipopup.spigot.nms.PlayerListener;
import com.github.kaspiandev.antipopup.spigot.platform.SpigotPlatform;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import com.github.retrooper.packetevents.manager.server.ServerManager;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.tcoded.folialib.FoliaLib;
Expand Down Expand Up @@ -104,7 +105,7 @@ public void onEnable() {
getLogger().info("Enabled URL support.");
}

PacketEvents.getAPI().getEventManager().registerListener(new PacketEventsListener(spigotPlatform));
PacketEvents.getAPI().getEventManager().registerListener(new PacketEventsListener(spigotPlatform), PacketListenerPriority.LOW);
PacketEvents.getAPI().init();
getLogger().info("Initiated PacketEvents.");

Expand Down
8 changes: 4 additions & 4 deletions velocity/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ repositories {
}

dependencies {
compileOnly "com.velocitypowered:velocity-api:3.2.0-SNAPSHOT"
annotationProcessor "com.velocitypowered:velocity-api:3.2.0-SNAPSHOT"
compileOnly "com.velocitypowered:velocity-api:3.3.0-SNAPSHOT"
annotationProcessor "com.velocitypowered:velocity-api:3.3.0-SNAPSHOT"

implementation project(path: ":shared")
implementation "com.github.retrooper:packetevents-velocity:${packetEventsVer}"
Expand All @@ -25,8 +25,8 @@ tasks {
}
shadowJar {
minimize()
relocate("io.github.retrooper.packetevents", "com.github.kaspiandev.antipopup.libs.packetevents")
relocate("com.github.retrooper.packetevents", "com.github.kaspiandev.antipopup.libs.packetevents")
relocate("io.github.retrooper.packetevents", "com.github.kaspiandev.antipopup.libs.packetevents.velocity")
relocate("com.github.retrooper.packetevents", "com.github.kaspiandev.antipopup.libs.packetevents.api")
relocate("net.kyori", "com.github.kaspiandev.antipopup.libs.kyori")
relocate("org.bstats", "com.github.kaspiandev.antipopup.libs.bstats")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.github.kaspiandev.antipopup.listener.PacketEventsListener;
import com.github.kaspiandev.antipopup.velocity.platform.VelocityPlatform;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import com.google.inject.Inject;
import com.velocitypowered.api.event.Subscribe;
import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
Expand All @@ -20,6 +21,7 @@
@Plugin(
id = "antipopup",
name = "AntiPopup",
authors = "KaspianDev",
version = BuildConstants.VERSION
)
public class AntiPopup {
Expand All @@ -45,7 +47,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
PacketEvents.setAPI(VelocityPacketEventsBuilder.build(server, pluginContainer, logger, dataDirectory));
PacketEvents.getAPI().getSettings().debug(false).checkForUpdates(false);
PacketEvents.getAPI().load();
PacketEvents.getAPI().getEventManager().registerListener(new PacketEventsListener(platform));
PacketEvents.getAPI().getEventManager().registerListener(new PacketEventsListener(platform), PacketListenerPriority.LOW);
PacketEvents.getAPI().init();
}

Expand Down

0 comments on commit b7a08d9

Please sign in to comment.