Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions 1.19.1/src/main/java/me/doclic/noencryption/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelPromise;
import me.doclic.noencryption.compatibility.Compatibility;
import me.doclic.noencryption.config.ConfigurationHandler;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand Down Expand Up @@ -40,6 +42,14 @@ public void write(ChannelHandlerContext channelHandlerContext, Object packet, Ch

});

if (ConfigurationHandler.getLoginProtectionMessage() != null) {
if (!ConfigurationHandler.getLoginProtectionMessage().trim().equals("")) {
player.sendMessage(
LegacyComponentSerializer.legacy('&').deserialize(ConfigurationHandler.getLoginProtectionMessage())
);
}
}

}

@EventHandler(priority = EventPriority.LOWEST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ public enum ConfigNodes {
"# Note: Doesn't actually do anything, just here",
"# for show, and example",
"# Added in v3.0",
"# Default: false");
"# Default: false"),

LOGIN_PROTECTION_MESSAGE(null, "login_protection_message", "",
" ",
"# Displays a message to users when they log in that their messages are protected",
"# ",
"# Note: Leave blank to disable",
"# ",
"# Added in v3.0",
"# Default: BLANK");


private final String Notice;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,10 @@ private static int getInt(ConfigNodes node) {
}
}

public static String getLoginProtectionMessage() {
return getString(ConfigNodes.LOGIN_PROTECTION_MESSAGE);
}

/* public static String getDBTablePrefix() {
return getString(ConfigNodes.DATABASE_TABLE_PREFIX);
}
Expand Down
10 changes: 10 additions & 0 deletions 1.19.2/src/main/java/me/doclic/noencryption/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelPromise;
import me.doclic.noencryption.compatibility.Compatibility;
import me.doclic.noencryption.config.ConfigurationHandler;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand Down Expand Up @@ -40,6 +42,14 @@ public void write(ChannelHandlerContext channelHandlerContext, Object packet, Ch

});

if (ConfigurationHandler.getLoginProtectionMessage() != null) {
if (!ConfigurationHandler.getLoginProtectionMessage().trim().equals("")) {
player.sendMessage(
LegacyComponentSerializer.legacy('&').deserialize(ConfigurationHandler.getLoginProtectionMessage())
);
}
}

}

@EventHandler(priority = EventPriority.LOWEST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ public enum ConfigNodes {
"# Note: Doesn't actually do anything, just here",
"# for show, and example",
"# Added in v3.0",
"# Default: false");
"# Default: false"),

LOGIN_PROTECTION_MESSAGE(null, "login_protection_message", "",
" ",
"# Displays a message to users when they log in that their messages are protected",
"# ",
"# Note: Leave blank to disable",
"# ",
"# Added in v3.0",
"# Default: BLANK");


private final String Notice;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ private static int getInt(ConfigNodes node) {
}
}

public static String getLoginProtectionMessage() {
return getString(ConfigNodes.LOGIN_PROTECTION_MESSAGE);
}

/* public static String getDBTablePrefix() {
return getString(ConfigNodes.DATABASE_TABLE_PREFIX);
}
Expand Down
10 changes: 10 additions & 0 deletions 1.19/src/main/java/me/doclic/noencryption/PlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import io.netty.channel.ChannelPipeline;
import io.netty.channel.ChannelPromise;
import me.doclic.noencryption.compatibility.Compatibility;
import me.doclic.noencryption.config.ConfigurationHandler;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand Down Expand Up @@ -40,6 +42,14 @@ public void write(ChannelHandlerContext channelHandlerContext, Object packet, Ch

});

if (ConfigurationHandler.getLoginProtectionMessage() != null) {
if (!ConfigurationHandler.getLoginProtectionMessage().trim().equals("")) {
player.sendMessage(
LegacyComponentSerializer.legacy('&').deserialize(ConfigurationHandler.getLoginProtectionMessage())
);
}
}

}

@EventHandler(priority = EventPriority.LOWEST)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ public enum ConfigNodes {
"# Note: Doesn't actually do anything, just here",
"# for show, and example",
"# Added in v3.0",
"# Default: false");
"# Default: false"),

LOGIN_PROTECTION_MESSAGE(null, "login_protection_message", "",
" ",
"# Displays a message to users when they log in that their messages are protected",
"# ",
"# Note: Leave blank to disable",
"# ",
"# Added in v3.0",
"# Default: BLANK");


private final String Notice;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ private static int getInt(ConfigNodes node) {
}
}

public static String getLoginProtectionMessage() {
return getString(ConfigNodes.LOGIN_PROTECTION_MESSAGE);
}

/* public static String getDBTablePrefix() {
return getString(ConfigNodes.DATABASE_TABLE_PREFIX);
}
Expand Down