Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package io.github.jess4tech.interdimensionalportals.commandLogic;
import org.spongepowered.api.command.CommandResult;
import org.spongepowered.api.command.CommandSource;
import org.spongepowered.api.command.args.CommandContext;
import org.spongepowered.api.command.spec.CommandExecutor;
import io.github.jess4tech.interdimensionalportals.databaseManagement.getCoors;
import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColors;
import java.sql.SQLException;
public class RemovePortal implements CommandExecutor {
@Override
public CommandResult execute(CommandSource src, CommandContext args) {
int ID = (int) args.getOne("ID").get();
try {
getCoors.DeleteDbEntry(ID);
} catch (SQLException e) {
src.sendMessage(Text.of(TextColors.RED, "An SQlException has occurred!"));
}
return CommandResult.success();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.