commit 356655589311672864e7b228d60987fdf750452c Author: Big Pappa Date: Sun Oct 11 09:03:11 2026 -0500 Initial Development - Add Stop Complete diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..30cf57e --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,10 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Ignored default folder with query files +/queries/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..6c17022 --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..eddf071 --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..0c04b52 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..79fbbba --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..01b5727 --- /dev/null +++ b/pom.xml @@ -0,0 +1,71 @@ + + + + 4.0.0 + + com.rsscripting + rs-taxi + 0.1.0 + jar + + RS-Taxi + Travel and teleportation between server stops. + + + UTF-8 + 25 + ${project.version} + + + + + papermc + https://repo.papermc.io/repository/maven-public/ + + + + + + io.papermc.paper + paper-api + 26.1.2.build.25-alpha + provided + + + + + RS-Taxi-${project.version} + + + + src/main/resources + true + + plugin.yml + + + + src/main/resources + false + + plugin.yml + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.14.1 + + 25 + + + + + + diff --git a/rs-taxi.iml b/rs-taxi.iml new file mode 100644 index 0000000..bbeeb3e --- /dev/null +++ b/rs-taxi.iml @@ -0,0 +1,14 @@ + + + + + + + PAPER + ADVENTURE + + 1 + + + + \ No newline at end of file diff --git a/src/main/java/com/rsscripting/rstaxi/RSTaxi.java b/src/main/java/com/rsscripting/rstaxi/RSTaxi.java new file mode 100644 index 0000000..6314cb6 --- /dev/null +++ b/src/main/java/com/rsscripting/rstaxi/RSTaxi.java @@ -0,0 +1,72 @@ + +package com.rsscripting.rstaxi; + +import com.rsscripting.rstaxi.commands.CabCommand; +import com.rsscripting.rstaxi.language.LanguageManager; +import com.rsscripting.rstaxi.database.DatabaseManager; +import org.bukkit.plugin.java.JavaPlugin; + +public final class RSTaxi extends JavaPlugin { + + private LanguageManager languageManager; + private DatabaseManager databaseManager; + + @Override + public void onEnable() { + + saveDefaultConfig(); + + if (!new java.io.File(getDataFolder(), "language/en_us.yml").exists()) { + saveResource("language/en_us.yml", false); + } + + languageManager = new LanguageManager(this); + languageManager.load(); + + databaseManager = new DatabaseManager(this); + + try { + databaseManager.connect(); + databaseManager.initialize(); + } catch (java.sql.SQLException e) { + getLogger().severe("Failed to initialize SQLite database!"); + getLogger().severe(e.getMessage()); + getServer().getPluginManager().disablePlugin(this); + return; + } + + if (getCommand("cab") == null) { + getLogger().severe("Command 'cab' is missing from plugin.yml!"); + getServer().getPluginManager().disablePlugin(this); + return; + } + + getCommand("cab").setExecutor(new CabCommand(this)); + + getLogger().info("RS-Taxi has been enabled!"); + } + + @Override + public void onDisable() { + + if (databaseManager != null) { + databaseManager.close(); + } + + getLogger().info("RS-Taxi has been disabled!"); + + + } + + public LanguageManager getLanguageManager() { + return languageManager; + } + + + + public DatabaseManager getDatabaseManager() { + return databaseManager; + } + +} + \ No newline at end of file diff --git a/src/main/java/com/rsscripting/rstaxi/commands/CabCommand.java b/src/main/java/com/rsscripting/rstaxi/commands/CabCommand.java new file mode 100644 index 0000000..958b946 --- /dev/null +++ b/src/main/java/com/rsscripting/rstaxi/commands/CabCommand.java @@ -0,0 +1,211 @@ + +package com.rsscripting.rstaxi.commands; + +import com.rsscripting.rstaxi.RSTaxi; +import com.rsscripting.rstaxi.platform.PlatformValidator; +import com.rsscripting.rstaxi.stops.StopManager; +import java.sql.SQLException; +import java.util.Map; +import org.bukkit.command.Command; +import org.bukkit.command.CommandExecutor; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; + +public final class CabCommand implements CommandExecutor { + + private final RSTaxi plugin; + private final PlatformValidator platformValidator; + private final StopManager stopManager; + + public CabCommand(RSTaxi plugin) { + this.plugin = plugin; + this.platformValidator = new PlatformValidator(plugin); + this.stopManager = new StopManager(plugin); + } + + @Override + public boolean onCommand( + CommandSender sender, + Command command, + String label, + String[] args + ) { + if (args.length == 0) { + return handleTravel(sender, args); + } + + switch (args[0].toLowerCase()) { + case "add" -> { + return handleAdd(sender, args); + } + case "update" -> { + return handleUpdate(sender, args); + } + case "edit" -> { + return handleEdit(sender, args); + } + case "remove" -> { + return handleRemove(sender, args); + } + case "list" -> { + return handleList(sender); + } + default -> { + return handleTravel(sender, args); + } + } + } + + private boolean handleTravel( + CommandSender sender, + String[] args + ) { + if (!(sender instanceof Player player)) { + sender.sendMessage( + plugin.getLanguageManager() + .getMessage("general.player-only") + ); + return true; + } + + if (!player.hasPermission("rs-cab.use")) { + player.sendMessage( + plugin.getLanguageManager() + .getMessage("general.no-permission") + ); + return true; + } + + // Travel behavior will be implemented in Phase 2. + return true; + } + + + private boolean handleAdd( + CommandSender sender, + String[] args + ) { + if (!sender.hasPermission("rs-cab.add")) { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("general.no-permission")); + return true; + } + + if (!(sender instanceof Player player)) { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("general.player-only")); + return true; + } + + String arguments = String.join(" ", args) + .substring("add".length()).trim(); + + String name; + String icon; + + if (arguments.startsWith("'")) { + int closingQuote = arguments.indexOf('\'', 1); + + if (closingQuote < 2) { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("general.invalid-usage")); + return true; + } + + name = arguments.substring(1, closingQuote); + icon = arguments.substring(closingQuote + 1).trim(); + } else { + String[] parts = arguments.split("\\s+"); + + if (parts.length != 2) { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("general.invalid-usage")); + return true; + } + + name = parts[0]; + icon = parts[1]; + } + + if (name.isBlank() || icon.isBlank() + || icon.contains(" ")) { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("general.invalid-usage")); + return true; + } + + try { + if (stopManager.exists(name)) { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("stop.already-exists", + Map.of("stop", name))); + return true; + } + + if (!platformValidator.isValid(player)) { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("platform.invalid")); + return true; + } + + if (stopManager.add(name, icon, player.getLocation())) { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("stop.added", + Map.of("stop", name))); + } else { + sender.sendMessage(plugin.getLanguageManager() + .getMessage("stop.already-exists", + Map.of("stop", name))); + } + + } catch (SQLException | IllegalArgumentException e) { + plugin.getLogger().severe( + "Failed to create taxi stop: " + e.getMessage() + ); + sender.sendMessage(plugin.getLanguageManager() + .getMessage("stop.creation-error")); + } + + return true; + } + + + private boolean handleUpdate( + CommandSender sender, + String[] args + ) { + return checkPermission(sender, "rs-cab.edit"); + } + + private boolean handleEdit( + CommandSender sender, + String[] args + ) { + return checkPermission(sender, "rs-cab.edit"); + } + + private boolean handleRemove( + CommandSender sender, + String[] args + ) { + return checkPermission(sender, "rs-cab.delete"); + } + + private boolean handleList(CommandSender sender) { + return checkPermission(sender, "rs-cab.use"); + } + + private boolean checkPermission( + CommandSender sender, + String permission + ) { + if (!sender.hasPermission(permission)) { + sender.sendMessage( + plugin.getLanguageManager() + .getMessage("general.no-permission") + ); + } + + return true; + } +} diff --git a/src/main/java/com/rsscripting/rstaxi/database/DatabaseManager.java b/src/main/java/com/rsscripting/rstaxi/database/DatabaseManager.java new file mode 100644 index 0000000..969748e --- /dev/null +++ b/src/main/java/com/rsscripting/rstaxi/database/DatabaseManager.java @@ -0,0 +1,83 @@ + +package com.rsscripting.rstaxi.database; + +import com.rsscripting.rstaxi.RSTaxi; + +import java.io.File; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.SQLException; +import java.sql.Statement; + +public final class DatabaseManager { + + private final RSTaxi plugin; + private Connection connection; + + public DatabaseManager(RSTaxi plugin) { + this.plugin = plugin; + } + + public void connect() throws SQLException { + File folder = plugin.getDataFolder(); + + if (!folder.exists() && !folder.mkdirs()) { + throw new SQLException( + "Could not create plugin data folder." + ); + } + + File databaseFile = new File(folder, "taxi.db"); + String url = "jdbc:sqlite:" + databaseFile.getAbsolutePath(); + + connection = DriverManager.getConnection(url); + + plugin.getLogger().info("SQLite database connected."); + } + + public void initialize() throws SQLException { + if (connection == null || connection.isClosed()) { + throw new SQLException("Database is not connected."); + } + + String sql = """ + CREATE TABLE IF NOT EXISTS stops ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + name TEXT NOT NULL COLLATE NOCASE UNIQUE, + icon TEXT NOT NULL, + world TEXT NOT NULL, + x REAL NOT NULL, + y REAL NOT NULL, + z REAL NOT NULL, + yaw REAL NOT NULL, + pitch REAL NOT NULL + ); + """; + + try (Statement statement = connection.createStatement()) { + statement.execute(sql); + } + + plugin.getLogger().info("SQLite database initialized."); + } + + public Connection getConnection() { + return connection; + } + + public void close() { + if (connection == null) { + return; + } + + try { + connection.close(); + plugin.getLogger().info("SQLite database connection closed."); + } catch (SQLException e) { + plugin.getLogger().severe( + "Failed to close SQLite database: " + + e.getMessage() + ); + } + } +} diff --git a/src/main/java/com/rsscripting/rstaxi/language/LanguageManager.java b/src/main/java/com/rsscripting/rstaxi/language/LanguageManager.java new file mode 100644 index 0000000..0605e2d --- /dev/null +++ b/src/main/java/com/rsscripting/rstaxi/language/LanguageManager.java @@ -0,0 +1,110 @@ + +package com.rsscripting.rstaxi.language; + +import com.rsscripting.rstaxi.RSTaxi; +import org.bukkit.ChatColor; +import org.bukkit.configuration.file.YamlConfiguration; + +import java.io.File; +import java.util.Map; + +public final class LanguageManager { + + private final RSTaxi plugin; + private YamlConfiguration language; + private YamlConfiguration english; + + public LanguageManager(RSTaxi plugin) { + this.plugin = plugin; + } + + public void load() { + File languageFolder = + new File(plugin.getDataFolder(), "language"); + + if (!languageFolder.exists() && !languageFolder.mkdirs()) { + plugin.getLogger().severe( + "Could not create the language folder." + ); + } + + File englishFile = + new File(languageFolder, "en_us.yml"); + + if (!englishFile.exists()) { + plugin.saveResource("language/en_us.yml", false); + } + + english = YamlConfiguration.loadConfiguration(englishFile); + + String selected = plugin.getConfig() + .getString("language", "en_us") + .trim(); + + if (!selected.matches("[a-zA-Z0-9_-]+")) { + plugin.getLogger().warning( + "Invalid language setting. Using en_us." + ); + selected = "en_us"; + } + + File selectedFile = + new File(languageFolder, selected + ".yml"); + + if (!selectedFile.isFile()) { + plugin.getLogger().warning( + "Language file '" + selected + + ".yml' was not found. Using en_us." + ); + language = english; + return; + } + + language = YamlConfiguration.loadConfiguration(selectedFile); + plugin.getLogger().info( + "Loaded language: " + selected + ); + } + + public String getMessage(String path) { + return getMessage(path, Map.of()); + } + + public String getMessage( + String path, + Map placeholders + ) { + String message = language == null + ? null + : language.getString(path); + + if (message == null && english != null) { + message = english.getString(path); + } + + if (message == null) { + plugin.getLogger().warning( + "Missing language message: " + path + ); + message = "&cMissing message: " + path; + } + + String prefix = language == null + ? "" + : language.getString("prefix", ""); + + if (!path.equals("prefix") && !prefix.isEmpty()) { + message = prefix + message; + } + + for (Map.Entry entry + : placeholders.entrySet()) { + message = message.replace( + "%" + entry.getKey() + "%", + entry.getValue() + ); + } + + return ChatColor.translateAlternateColorCodes('&', message); + } +} diff --git a/src/main/java/com/rsscripting/rstaxi/platform/PlatformValidator.java b/src/main/java/com/rsscripting/rstaxi/platform/PlatformValidator.java new file mode 100644 index 0000000..760ae9a --- /dev/null +++ b/src/main/java/com/rsscripting/rstaxi/platform/PlatformValidator.java @@ -0,0 +1,79 @@ + +package com.rsscripting.rstaxi.platform; + +import com.rsscripting.rstaxi.RSTaxi; +import org.bukkit.Material; +import org.bukkit.block.Block; +import org.bukkit.entity.Player; + +import java.util.Map; + +public final class PlatformValidator { + + private final RSTaxi plugin; + + private static final Map OFFSETS = Map.of( + "north", new int[]{0, -1}, + "northeast", new int[]{1, -1}, + "east", new int[]{1, 0}, + "southeast", new int[]{1, 1}, + "south", new int[]{0, 1}, + "southwest", new int[]{-1, 1}, + "west", new int[]{-1, 0}, + "northwest", new int[]{-1, -1} + ); + + public PlatformValidator(RSTaxi plugin) { + this.plugin = plugin; + } + + public boolean isValid(Player player) { + if (!plugin.getConfig().getBoolean("platform.enabled", true)) { + return true; + } + + Block center = player.getLocation() + .subtract(0, 1, 0) + .getBlock(); + + Material target = getConfiguredMaterial( + "platform.target-block" + ); + + if (center.getType() != target) { + return false; + } + + for (Map.Entry entry : OFFSETS.entrySet()) { + String direction = entry.getKey(); + int[] offset = entry.getValue(); + + Material required = getConfiguredMaterial( + "platform.layout." + direction + ); + + Block surrounding = center.getRelative( + offset[0], 0, offset[1] + ); + + if (surrounding.getType() != required) { + return false; + } + } + + return true; + } + + private Material getConfiguredMaterial(String path) { + String name = plugin.getConfig().getString(path, ""); + Material material = Material.matchMaterial(name); + + if (material == null || !material.isBlock()) { + throw new IllegalArgumentException( + "Invalid platform material at " + path + ": " + name + ); + } + + return material; + } +} diff --git a/src/main/java/com/rsscripting/rstaxi/stops/StopManager.java b/src/main/java/com/rsscripting/rstaxi/stops/StopManager.java new file mode 100644 index 0000000..aff4bff --- /dev/null +++ b/src/main/java/com/rsscripting/rstaxi/stops/StopManager.java @@ -0,0 +1,67 @@ + +package com.rsscripting.rstaxi.stops; + +import com.rsscripting.rstaxi.RSTaxi; +import org.bukkit.Location; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +public final class StopManager { + + private final RSTaxi plugin; + + public StopManager(RSTaxi plugin) { + this.plugin = plugin; + } + + public boolean exists(String name) throws SQLException { + String sql = "SELECT 1 FROM stops WHERE name = ?"; + + try (PreparedStatement statement = connection() + .prepareStatement(sql)) { + + statement.setString(1, name); + + try (ResultSet results = statement.executeQuery()) { + return results.next(); + } + } + } + + public boolean add( + String name, + String icon, + Location location + ) throws SQLException { + + String sql = """ + INSERT OR IGNORE INTO stops + (name, icon, world, x, y, z, yaw, pitch) + VALUES (?, ?, ?, ?, ?, ?, ?, ?) + """; + + try (PreparedStatement statement = connection() + .prepareStatement(sql)) { + + statement.setString(1, name); + statement.setString(2, icon); + statement.setString( + 3, location.getWorld().getName() + ); + statement.setDouble(4, location.getX()); + statement.setDouble(5, location.getY()); + statement.setDouble(6, location.getZ()); + statement.setFloat(7, location.getYaw()); + statement.setFloat(8, location.getPitch()); + + return statement.executeUpdate() == 1; + } + } + + private Connection connection() { + return plugin.getDatabaseManager().getConnection(); + } +} diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml new file mode 100644 index 0000000..4e62121 --- /dev/null +++ b/src/main/resources/config.yml @@ -0,0 +1,35 @@ + +# RS-Taxi Configuration + +# Language file for your server. +# If plugin cannot find needed message in selected file, +# it will default to english for that message. +# Example: en_us, de_de, fr_fr +language: "en_us" + +# Platform Settings. +platform: + # Determines wether platforms are required before adding a destination + # true: A platform is required to be built following the "layout" defined in config. + # false: A platform is not required. + enabled: true + + # The center block of the platform if required. + target-block: "TARGET" + + # Protect the platform blocks from destruction. + # true: platforms cannot be broken. + # false: platforms can be broken. + protect-platforms: true + + #Layout requirement for add a destination if enabled is set to true. + layout: + north: "OAK_PLANKS" + northeast: "OAK_PLANKS" + east: "OAK_PLANKS" + southeast: "OAK_PLANKS" + south: "OAK_PLANKS" + southwest: "OAK_PLANKS" + west: "OAK_PLANKS" + northwest: "OAK_PLANKS" + diff --git a/src/main/resources/language/en_us.yml b/src/main/resources/language/en_us.yml new file mode 100644 index 0000000..bc79911 --- /dev/null +++ b/src/main/resources/language/en_us.yml @@ -0,0 +1,40 @@ + +prefix: "&8[&6RS-Taxi&8] " + +general: + no-permission: "&cYou don't have permission to do that." + player-only: "&cThis command can only be used by a player." + player-not-found: "&cPlayer not found." + invalid-usage: "&cInvalid command usage." + unknown-stop: "&cThe stop &e%stop% &cdoes not exist." + no-stops: "&eNo taxi stops have been created yet." + +database: + connection-success: "&aDatabase connected successfully." + connection-error: "&cCould not connect to the database." + +stop: + added: "&aStop &e%stop% &ahas been created." + updated: "&aStop &e%stop% &ahas been moved to your current location." + edited: "&aStop &e%stop% &ahas been updated." + deleted: "&aStop &e%stop% &ahas been removed." + already-exists: "&cA stop named &e%stop% &calready exists." + invalid-icon: "&cThe icon &e%icon% &cis invalid." + creation-error: "&cUnable to create the taxi stop. Check the server logs." + +teleport: + success: "&aYou have arrived at &e%stop%&a." + +confirmation: + update: "&eAre you sure you want to move stop &6%stop%&e? Confirm the command to proceed." + delete: "&eAre you sure you want to delete stop &6%stop%&e? Confirm the command to proceed." + expired: "&cThat confirmation has expired." + +list: + header: "&6Available Taxi Stops:" + entry: "&e%icon% &f%stop%" + +platform: + invalid: "&cYou must stand on a valid taxi platform to create a stop." + + diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..6080bb8 --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,29 @@ + +name: RS-Taxi +version: '${project.version}' +main: com.rsscripting.rstaxi.RSTaxi +api-version: '26.1.2' +description: Travel between named taxi stops. +author: RSScripting + +commands: + cab: + description: Travel between registered taxi stops. + usage: /cab + +permissions: + rs-cab.use: + description: Allows players to travel to taxi stops. + default: true + + rs-cab.add: + description: Allows players to create taxi stops. + default: op + + rs-cab.edit: + description: Allows players to update and edit taxi stops. + default: op + + rs-cab.delete: + description: Allows players to delete taxi stops. + default: op diff --git a/target/RS-Taxi-0.1.0.jar b/target/RS-Taxi-0.1.0.jar new file mode 100644 index 0000000..ef7aa07 Binary files /dev/null and b/target/RS-Taxi-0.1.0.jar differ diff --git a/target/classes/com/rsscripting/rstaxi/RSTaxi.class b/target/classes/com/rsscripting/rstaxi/RSTaxi.class new file mode 100644 index 0000000..dbe8eff Binary files /dev/null and b/target/classes/com/rsscripting/rstaxi/RSTaxi.class differ diff --git a/target/classes/com/rsscripting/rstaxi/commands/CabCommand.class b/target/classes/com/rsscripting/rstaxi/commands/CabCommand.class new file mode 100644 index 0000000..e0fecb5 Binary files /dev/null and b/target/classes/com/rsscripting/rstaxi/commands/CabCommand.class differ diff --git a/target/classes/com/rsscripting/rstaxi/database/DatabaseManager.class b/target/classes/com/rsscripting/rstaxi/database/DatabaseManager.class new file mode 100644 index 0000000..d1c7235 Binary files /dev/null and b/target/classes/com/rsscripting/rstaxi/database/DatabaseManager.class differ diff --git a/target/classes/com/rsscripting/rstaxi/language/LanguageManager.class b/target/classes/com/rsscripting/rstaxi/language/LanguageManager.class new file mode 100644 index 0000000..af927cf Binary files /dev/null and b/target/classes/com/rsscripting/rstaxi/language/LanguageManager.class differ diff --git a/target/classes/com/rsscripting/rstaxi/platform/PlatformValidator.class b/target/classes/com/rsscripting/rstaxi/platform/PlatformValidator.class new file mode 100644 index 0000000..17c5b56 Binary files /dev/null and b/target/classes/com/rsscripting/rstaxi/platform/PlatformValidator.class differ diff --git a/target/classes/com/rsscripting/rstaxi/stops/StopManager.class b/target/classes/com/rsscripting/rstaxi/stops/StopManager.class new file mode 100644 index 0000000..4f8ca08 Binary files /dev/null and b/target/classes/com/rsscripting/rstaxi/stops/StopManager.class differ diff --git a/target/classes/config.yml b/target/classes/config.yml new file mode 100644 index 0000000..4e62121 --- /dev/null +++ b/target/classes/config.yml @@ -0,0 +1,35 @@ + +# RS-Taxi Configuration + +# Language file for your server. +# If plugin cannot find needed message in selected file, +# it will default to english for that message. +# Example: en_us, de_de, fr_fr +language: "en_us" + +# Platform Settings. +platform: + # Determines wether platforms are required before adding a destination + # true: A platform is required to be built following the "layout" defined in config. + # false: A platform is not required. + enabled: true + + # The center block of the platform if required. + target-block: "TARGET" + + # Protect the platform blocks from destruction. + # true: platforms cannot be broken. + # false: platforms can be broken. + protect-platforms: true + + #Layout requirement for add a destination if enabled is set to true. + layout: + north: "OAK_PLANKS" + northeast: "OAK_PLANKS" + east: "OAK_PLANKS" + southeast: "OAK_PLANKS" + south: "OAK_PLANKS" + southwest: "OAK_PLANKS" + west: "OAK_PLANKS" + northwest: "OAK_PLANKS" + diff --git a/target/classes/language/en_us.yml b/target/classes/language/en_us.yml new file mode 100644 index 0000000..bc79911 --- /dev/null +++ b/target/classes/language/en_us.yml @@ -0,0 +1,40 @@ + +prefix: "&8[&6RS-Taxi&8] " + +general: + no-permission: "&cYou don't have permission to do that." + player-only: "&cThis command can only be used by a player." + player-not-found: "&cPlayer not found." + invalid-usage: "&cInvalid command usage." + unknown-stop: "&cThe stop &e%stop% &cdoes not exist." + no-stops: "&eNo taxi stops have been created yet." + +database: + connection-success: "&aDatabase connected successfully." + connection-error: "&cCould not connect to the database." + +stop: + added: "&aStop &e%stop% &ahas been created." + updated: "&aStop &e%stop% &ahas been moved to your current location." + edited: "&aStop &e%stop% &ahas been updated." + deleted: "&aStop &e%stop% &ahas been removed." + already-exists: "&cA stop named &e%stop% &calready exists." + invalid-icon: "&cThe icon &e%icon% &cis invalid." + creation-error: "&cUnable to create the taxi stop. Check the server logs." + +teleport: + success: "&aYou have arrived at &e%stop%&a." + +confirmation: + update: "&eAre you sure you want to move stop &6%stop%&e? Confirm the command to proceed." + delete: "&eAre you sure you want to delete stop &6%stop%&e? Confirm the command to proceed." + expired: "&cThat confirmation has expired." + +list: + header: "&6Available Taxi Stops:" + entry: "&e%icon% &f%stop%" + +platform: + invalid: "&cYou must stand on a valid taxi platform to create a stop." + + diff --git a/target/classes/plugin.yml b/target/classes/plugin.yml new file mode 100644 index 0000000..fda3015 --- /dev/null +++ b/target/classes/plugin.yml @@ -0,0 +1,29 @@ + +name: RS-Taxi +version: '0.1.0' +main: com.rsscripting.rstaxi.RSTaxi +api-version: '26.1.2' +description: Travel between named taxi stops. +author: RSScripting + +commands: + cab: + description: Travel between registered taxi stops. + usage: /cab + +permissions: + rs-cab.use: + description: Allows players to travel to taxi stops. + default: true + + rs-cab.add: + description: Allows players to create taxi stops. + default: op + + rs-cab.edit: + description: Allows players to update and edit taxi stops. + default: op + + rs-cab.delete: + description: Allows players to delete taxi stops. + default: op diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties new file mode 100644 index 0000000..a36326c --- /dev/null +++ b/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=rs-taxi +groupId=com.rsscripting +version=0.1.0 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..30b5f53 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,6 @@ +com\rsscripting\rstaxi\stops\StopManager.class +com\rsscripting\rstaxi\platform\PlatformValidator.class +com\rsscripting\rstaxi\RSTaxi.class +com\rsscripting\rstaxi\commands\CabCommand.class +com\rsscripting\rstaxi\database\DatabaseManager.class +com\rsscripting\rstaxi\language\LanguageManager.class diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..5d26fe8 --- /dev/null +++ b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,6 @@ +C:\Users\russe\IdeaProjects\RS-Taxi\src\main\java\com\rsscripting\rstaxi\commands\CabCommand.java +C:\Users\russe\IdeaProjects\RS-Taxi\src\main\java\com\rsscripting\rstaxi\database\DatabaseManager.java +C:\Users\russe\IdeaProjects\RS-Taxi\src\main\java\com\rsscripting\rstaxi\language\LanguageManager.java +C:\Users\russe\IdeaProjects\RS-Taxi\src\main\java\com\rsscripting\rstaxi\platform\PlatformValidator.java +C:\Users\russe\IdeaProjects\RS-Taxi\src\main\java\com\rsscripting\rstaxi\RSTaxi.java +C:\Users\russe\IdeaProjects\RS-Taxi\src\main\java\com\rsscripting\rstaxi\stops\StopManager.java