Skip to content

Instantly share code, notes, and snippets.

@Jess4Tech
Created July 25, 2019 02:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jess4Tech/c003eafa8d659f82f08eabf60c64f681 to your computer and use it in GitHub Desktop.
Save Jess4Tech/c003eafa8d659f82f08eabf60c64f681 to your computer and use it in GitHub Desktop.
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