Created
July 25, 2019 02:34
-
-
Save Jess4Tech/c003eafa8d659f82f08eabf60c64f681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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