Skip to content

Commit

Permalink
🔼 Separate config for header
Browse files Browse the repository at this point in the history
  • Loading branch information
KaspianDev committed Aug 27, 2022
1 parent 5487999 commit 69166b2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group = 'com.github.kaspiandev'
version = '4.3'
version = '4.4'

repositories {
mavenCentral()
Expand All @@ -29,7 +29,7 @@ dependencies {
compileOnly 'org.apache.commons:commons-configuration2:2.8.0'
compileOnly "com.viaversion:viaversion:4.4.1"

implementation 'com.github.retrooper.packetevents:spigot:2.0.0-20220807.223642-28'
implementation 'com.github.retrooper.packetevents:spigot:2.0.0-20220826.083630-42'
}

tasks {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/github/kaspiandev/antipopup/AntiPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public void onLoad() {
PacketEvents.setAPI(SpigotPacketEventsBuilder.build(this));
PacketEvents.getAPI().getSettings().debug(false).bStats(false).checkForUpdates(false);
PacketEvents.getAPI().load();
getLogger().info("Loaded PacketEvents");
getLogger().info("Loaded PacketEvents.");
}

@Override
Expand All @@ -47,13 +47,13 @@ public void onEnable() {
.build());
getLogger().info("Config enabled.");
} catch (IOException ex) {
getLogger().warning("Config file could not be initialized");
getLogger().warning("Config file could not be initialized.");
throw new RuntimeException(ex);
}

PacketEvents.getAPI().getEventManager().registerListener(new PacketEventsListener());
PacketEvents.getAPI().init();
getLogger().info("Initiated PacketEvents");
getLogger().info("Initiated PacketEvents.");

Objects.requireNonNull(this.getCommand("antipopup")).setExecutor(new CommandRegister());
getLogger().info("Commands registered.");
Expand Down Expand Up @@ -98,6 +98,6 @@ public void onEnable() {
@Override
public void onDisable() {
PacketEvents.getAPI().terminate();
getLogger().info("Disabled PacketEvents");
getLogger().info("Disabled PacketEvents.");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void onPacketSend(PacketSendEvent event) {
}
}
if (event.getPacketType() == PacketType.Play.Server.PLAYER_CHAT_HEADER
&& AntiPopup.config.getBoolean("strip-signature", true)) {
&& AntiPopup.config.getBoolean("dont-send-header", true)) {
event.setCancelled(true);
}
}
Expand Down
4 changes: 3 additions & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
config-version: 6
config-version: 7

# Should we prevent messages from being reported?
# Leave as true unless you have a different plugin stripping those.
strip-signature: true

dont-send-header: true

# Do not touch this!
first-run: true

0 comments on commit 69166b2

Please sign in to comment.