Skip to content

Commit

Permalink
Rename to Necrify
Browse files Browse the repository at this point in the history
  • Loading branch information
JvstvsHD committed May 19, 2024
1 parent 5a53010 commit 24d5c5c
Show file tree
Hide file tree
Showing 48 changed files with 216 additions and 216 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package de.jvstvshd.velocitypunishment.api;
package de.jvstvshd.necrify.api;

public class PunishmentException extends Exception {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api;
package de.jvstvshd.necrify.api;

import com.velocitypowered.api.proxy.ProxyServer;
import de.jvstvshd.velocitypunishment.api.message.MessageProvider;
import de.jvstvshd.velocitypunishment.api.punishment.PunishmentManager;
import de.jvstvshd.velocitypunishment.api.punishment.util.PlayerResolver;
import de.jvstvshd.necrify.api.message.MessageProvider;
import de.jvstvshd.necrify.api.punishment.PunishmentManager;
import de.jvstvshd.necrify.api.punishment.util.PlayerResolver;

import java.util.concurrent.ExecutorService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.duration;
package de.jvstvshd.necrify.api.duration;

import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.duration;
package de.jvstvshd.necrify.api.duration;

import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.duration;
package de.jvstvshd.necrify.api.duration;

import java.sql.Timestamp;
import java.time.Duration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.duration;
package de.jvstvshd.necrify.api.duration;

import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.message;
package de.jvstvshd.necrify.api.message;

import com.velocitypowered.api.command.CommandSource;
import net.kyori.adventure.text.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment;
package de.jvstvshd.necrify.api.punishment;

public interface Ban extends TemporalPunishment {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment;
package de.jvstvshd.necrify.api.punishment;

import de.jvstvshd.velocitypunishment.api.PunishmentException;
import de.jvstvshd.velocitypunishment.api.duration.PunishmentDuration;
import de.jvstvshd.necrify.api.PunishmentException;
import de.jvstvshd.necrify.api.duration.PunishmentDuration;
import net.kyori.adventure.text.Component;

import java.util.concurrent.CompletableFuture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment;
package de.jvstvshd.necrify.api.punishment;

public interface Mute extends TemporalPunishment {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment;
package de.jvstvshd.necrify.api.punishment;

import de.jvstvshd.velocitypunishment.api.PunishmentException;
import de.jvstvshd.velocitypunishment.api.duration.PunishmentDuration;
import de.jvstvshd.velocitypunishment.api.punishment.util.ReasonHolder;
import de.jvstvshd.necrify.api.PunishmentException;
import de.jvstvshd.necrify.api.duration.PunishmentDuration;
import de.jvstvshd.necrify.api.punishment.util.ReasonHolder;
import net.kyori.adventure.text.Component;

import java.time.LocalDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment;
package de.jvstvshd.necrify.api.punishment;

import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer;
import de.jvstvshd.velocitypunishment.api.duration.PunishmentDuration;
import de.jvstvshd.velocitypunishment.api.punishment.util.PlayerResolver;
import de.jvstvshd.necrify.api.duration.PunishmentDuration;
import de.jvstvshd.necrify.api.punishment.util.PlayerResolver;
import net.kyori.adventure.text.Component;

import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment;
package de.jvstvshd.necrify.api.punishment;

public interface PunishmentType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment;
package de.jvstvshd.necrify.api.punishment;

public enum StandardPunishmentType implements PunishmentType {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment;
package de.jvstvshd.necrify.api.punishment;

import de.jvstvshd.velocitypunishment.api.duration.PunishmentDuration;
import de.jvstvshd.necrify.api.duration.PunishmentDuration;

/**
* An interface containing some methods to only punish a player for a defined duration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment.util;
package de.jvstvshd.necrify.api.punishment.util;

import org.jetbrains.annotations.NotNull;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.api.punishment.util;
package de.jvstvshd.necrify.api.punishment.util;

import com.velocitypowered.api.command.CommandSource;
import net.kyori.adventure.text.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.paper;
package de.jvstvshd.necrify.paper;

import de.jvstvshd.velocitypunishment.common.plugin.MuteData;
import de.jvstvshd.velocitypunishment.paper.listeners.ChatListener;
import de.jvstvshd.velocitypunishment.paper.listeners.MessagingChannelListener;
import de.jvstvshd.velocitypunishment.paper.listeners.MuteInformation;
import de.jvstvshd.necrify.common.plugin.MuteData;
import de.jvstvshd.necrify.paper.listeners.ChatListener;
import de.jvstvshd.necrify.paper.listeners.MessagingChannelListener;
import de.jvstvshd.necrify.paper.listeners.MuteInformation;
import org.bukkit.plugin.java.JavaPlugin;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.paper.listeners;
package de.jvstvshd.necrify.paper.listeners;

import de.jvstvshd.velocitypunishment.paper.VelocityPunishmentPaperPlugin;
import de.jvstvshd.necrify.paper.VelocityPunishmentPaperPlugin;
import io.papermc.paper.event.player.AsyncChatEvent;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.paper.listeners;
package de.jvstvshd.necrify.paper.listeners;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.io.ByteStreams;
import de.jvstvshd.velocitypunishment.common.plugin.MuteData;
import de.jvstvshd.velocitypunishment.paper.VelocityPunishmentPaperPlugin;
import de.jvstvshd.necrify.common.plugin.MuteData;
import de.jvstvshd.necrify.paper.VelocityPunishmentPaperPlugin;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
import org.jetbrains.annotations.NotNull;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.paper.listeners;
package de.jvstvshd.necrify.paper.listeners;

import de.jvstvshd.velocitypunishment.api.duration.PunishmentDuration;
import de.jvstvshd.velocitypunishment.common.plugin.MuteData;
import de.jvstvshd.necrify.api.duration.PunishmentDuration;
import de.jvstvshd.necrify.common.plugin.MuteData;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.Bukkit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.common.plugin;
package de.jvstvshd.necrify.common.plugin;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.common.plugin;
package de.jvstvshd.necrify.common.plugin;

import java.util.UUID;
import java.util.concurrent.Callable;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment;
package de.jvstvshd.necrify;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.google.common.io.ByteStreams;
Expand All @@ -31,9 +31,9 @@
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.ProxyServer;
import com.velocitypowered.api.proxy.server.RegisteredServer;
import de.jvstvshd.velocitypunishment.api.punishment.Mute;
import de.jvstvshd.velocitypunishment.api.punishment.util.ReasonHolder;
import de.jvstvshd.velocitypunishment.common.plugin.MuteData;
import de.jvstvshd.necrify.api.punishment.Mute;
import de.jvstvshd.necrify.api.punishment.util.ReasonHolder;
import de.jvstvshd.necrify.common.plugin.MuteData;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.slf4j.Logger;
Expand Down Expand Up @@ -121,7 +121,7 @@ public void onChooseInitialServer(ServerPostConnectEvent event) {
}

private boolean sendMessage(RegisteredServer server, MuteData muteData) throws JsonProcessingException {
return server.sendPluginMessage(VelocityPunishmentPlugin.MUTE_DATA_CHANNEL_IDENTIFIER, serializeMuteData(muteData));
return server.sendPluginMessage(NecrifyPlugin.MUTE_DATA_CHANNEL_IDENTIFIER, serializeMuteData(muteData));


}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment;
package de.jvstvshd.necrify;

import com.google.inject.Inject;
import com.velocitypowered.api.command.CommandManager;
Expand All @@ -43,17 +43,17 @@
import de.chojo.sadu.jdbc.RemoteJdbcConfig;
import de.chojo.sadu.updater.SqlUpdater;
import de.chojo.sadu.wrapper.QueryBuilderConfig;
import de.jvstvshd.velocitypunishment.api.VelocityPunishment;
import de.jvstvshd.velocitypunishment.api.message.MessageProvider;
import de.jvstvshd.velocitypunishment.api.punishment.PunishmentManager;
import de.jvstvshd.velocitypunishment.api.punishment.util.PlayerResolver;
import de.jvstvshd.velocitypunishment.commands.*;
import de.jvstvshd.velocitypunishment.common.plugin.MuteData;
import de.jvstvshd.velocitypunishment.config.ConfigurationManager;
import de.jvstvshd.velocitypunishment.impl.DefaultPlayerResolver;
import de.jvstvshd.velocitypunishment.impl.DefaultPunishmentManager;
import de.jvstvshd.velocitypunishment.listener.ConnectListener;
import de.jvstvshd.velocitypunishment.message.ResourceBundleMessageProvider;
import de.jvstvshd.necrify.api.VelocityPunishment;
import de.jvstvshd.necrify.api.message.MessageProvider;
import de.jvstvshd.necrify.api.punishment.PunishmentManager;
import de.jvstvshd.necrify.api.punishment.util.PlayerResolver;
import de.jvstvshd.necrify.commands.*;
import de.jvstvshd.necrify.common.plugin.MuteData;
import de.jvstvshd.necrify.config.ConfigurationManager;
import de.jvstvshd.necrify.impl.DefaultPlayerResolver;
import de.jvstvshd.necrify.impl.DefaultPunishmentManager;
import de.jvstvshd.necrify.listener.ConnectListener;
import de.jvstvshd.necrify.message.ResourceBundleMessageProvider;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
Expand All @@ -67,7 +67,7 @@
import java.util.concurrent.Executors;

@Plugin(id = "velocity-punishment", name = "Velocity Punishment Plugin", version = "1.0.0-SNAPSHOT", description = "A simple punishment plugin for Velocity", authors = {"JvstvsHD"})
public class VelocityPunishmentPlugin implements VelocityPunishment {
public class NecrifyPlugin implements VelocityPunishment {

private final ProxyServer server;
private final Logger logger;
Expand Down Expand Up @@ -96,7 +96,7 @@ public class VelocityPunishmentPlugin implements VelocityPunishment {
public static final Component MUTES_DISABLED = Component.text(MUTES_DISABLED_STRING);

@Inject
public VelocityPunishmentPlugin(ProxyServer server, Logger logger, @DataDirectory Path dataDirectory) {
public NecrifyPlugin(ProxyServer server, Logger logger, @DataDirectory Path dataDirectory) {
this.server = server;
this.logger = logger;
this.configurationManager = new ConfigurationManager(dataDirectory.resolve("config.yml"));
Expand Down Expand Up @@ -127,7 +127,7 @@ public void onProxyInitialization(ProxyInitializeEvent event) {
logger.error("Could not create table velocity_punishment in database {}", dataSource.getDataSourceProperties().get("dataSource.databaseName"), e);
}
setup(server.getCommandManager(), server.getEventManager());
logger.info("Velocity Punishment Plugin v1.0.0 has been loaded");
logger.info("Velocity Punishment Plugin v1.2.0-SNAPSHOT has been loaded");
}

private void setup(CommandManager commandManager, EventManager eventManager) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,31 +22,31 @@
* SOFTWARE.
*/

package de.jvstvshd.velocitypunishment.commands;
package de.jvstvshd.necrify.commands;

import com.mojang.brigadier.Command;
import com.mojang.brigadier.context.CommandContext;
import com.velocitypowered.api.command.BrigadierCommand;
import com.velocitypowered.api.command.CommandSource;
import de.jvstvshd.velocitypunishment.VelocityPunishmentPlugin;
import de.jvstvshd.velocitypunishment.api.PunishmentException;
import de.jvstvshd.velocitypunishment.internal.PunishmentHelper;
import de.jvstvshd.velocitypunishment.internal.Util;
import de.jvstvshd.necrify.NecrifyPlugin;
import de.jvstvshd.necrify.api.PunishmentException;
import de.jvstvshd.necrify.internal.PunishmentHelper;
import de.jvstvshd.necrify.internal.Util;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.format.TextDecoration;

import static de.jvstvshd.velocitypunishment.internal.Util.copyComponent;
import static de.jvstvshd.necrify.internal.Util.copyComponent;

public class BanCommand {

public static BrigadierCommand banCommand(VelocityPunishmentPlugin plugin) {
public static BrigadierCommand banCommand(NecrifyPlugin plugin) {
var node = Util.permissibleCommand("ban", "velocitypunishment.command.ban")
.then(Util.playerArgument(plugin.getServer()).executes(context -> execute(context, plugin))
.then(Util.reasonArgument.executes(context -> execute(context, plugin))));
return new BrigadierCommand(node);
}

private static int execute(CommandContext<CommandSource> context, VelocityPunishmentPlugin plugin) {
private static int execute(CommandContext<CommandSource> context, NecrifyPlugin plugin) {
var source = context.getSource();
var player = context.getArgument("player", String.class);
var reason = PunishmentHelper.parseReason(context);
Expand Down
Loading

0 comments on commit 24d5c5c

Please sign in to comment.