From 36ecc943c7526d89869db04d3d2dee9632b7741b Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 28 Dec 2024 20:38:37 +0000 Subject: [PATCH 1/5] docs: update vehiclesplus-v3/API --- vehiclesplus-v3/API.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vehiclesplus-v3/API.md b/vehiclesplus-v3/API.md index 4eba83f..02aad9e 100644 --- a/vehiclesplus-v3/API.md +++ b/vehiclesplus-v3/API.md @@ -2,7 +2,7 @@ title: API description: Api usage examples published: false -date: 2024-12-28T20:14:44.954Z +date: 2024-12-28T20:38:34.412Z tags: developers editor: markdown dateCreated: 2024-12-28T20:10:42.650Z @@ -29,7 +29,7 @@ Maven (`pom.xml`): tech.sbdevelopment vehiclesplus - LATEST + latest ``` @@ -42,10 +42,10 @@ repositories { } dependencies { - implementation 'tech.sbdevelopment:vehiclesplus:LATEST' + implementation 'tech.sbdevelopment:vehiclesplus:latest' } ``` -> **Note**: Using `LATEST` ensures that your project always fetches the most recent release, but it might cause issues if breaking changes are introduced. For more stability, consider specifying a specific version (e.g., `3.0.2`). +> **Note**: Using `latest` ensures that your project always fetches the most recent release, but it might cause issues if breaking changes are introduced. For more stability, consider specifying a specific version (e.g., `3.0.2`). ## Example: Adding a Car to Someone's Garage @@ -98,3 +98,7 @@ public void giveCar(Player player, String vehicleType) { } } ``` + +## API Documentation + +For additional details, examples, and advanced usage, refer to the official [VehiclesPlus API Docs](https://sbdevelopment.tech/vehiclesplus). From 4958a683ec01d0077a3a49dae99c04bc67d46806 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 28 Dec 2024 20:39:33 +0000 Subject: [PATCH 2/5] docs: update vehiclesplus-v3/API --- vehiclesplus-v3/API.html | 86 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 vehiclesplus-v3/API.html diff --git a/vehiclesplus-v3/API.html b/vehiclesplus-v3/API.html new file mode 100644 index 0000000..50d04ae --- /dev/null +++ b/vehiclesplus-v3/API.html @@ -0,0 +1,86 @@ + + +

API Usage

+

This guide explains how to integrate the new and improved VehiclesPlus API (v3) into your project.

+

Adding VehiclesPlus to Your Project

+

To use the VehiclesPlus API in your plugin, follow these steps:

+

Step 1: Add VehiclesPlus to Your Dependencies

+

Ensure VehiclesPlus is added as a dependency in your project. To always use the latest version, update your dependency configuration as shown below:

+

Maven (pom.xml):

+
<repository>
+    <id>sbdevelopment-repo</id>
+    <url>https://repo.sbdevelopment.tech/releases</url>
+</repository>
+
+<dependency>
+    <groupId>tech.sbdevelopment</groupId>
+    <artifactId>vehiclesplus</artifactId>
+    <version>latest</version>
+</dependency>
+
+

Gradle (build.gradle):

+
repositories {
+    maven {
+        url 'https://repo.sbdevelopment.tech/releases'
+    }
+}
+
+dependencies {
+    implementation 'tech.sbdevelopment:vehiclesplus:latest'
+}
+
+
+

Note: Using latest ensures that your project always fetches the most recent release, but it might cause issues if breaking changes are introduced. For more stability, consider specifying a specific version (e.g., 3.0.2).

+
+

Example: Adding a Car to Someone's Garage

+

This example demonstrates how to add a vehicle to any garage:

+
// Give car to garage
+public void giveCar(Garage garage, String vehicleType) {
+    // Attempt to create a vehicle
+    StorageVehicle vehicle = VehiclesPlusAPI.createVehicle(vehicleType);
+
+    if (vehicle == null) {
+        System.err.println("Failed to create vehicle of type: " + vehicleType);
+        return; // Exit if the vehicle could not be created
+    }
+
+    // Add the vehicle's UUID to the garage
+    garage.addVehicle(vehicle.getUuid());
+    System.out.println("Vehicle created and added to the garage successfully.");
+}
+
+

Example: Adding a Vehicle to the Player's Default Garage

+

This example demonstrates how to add a vehicle to the player's default garage:

+
// Give car to player's default garage
+public void giveCar(Player player, String vehicleType) {
+    // Attempt to create a vehicle
+    StorageVehicle vehicle = VehiclesPlusAPI.createVehicle(vehicleType);
+
+    // Retrieve the player's default garage
+    Optional<Garage> optionalGarage = VehiclesPlusAPI.getGarage(player.getName());
+
+    if (vehicle == null) {
+        System.err.println("Failed to create vehicle of type: " + vehicleType);
+        return; // Exit if the vehicle could not be created
+    }
+
+    if (optionalGarage.isPresent()) {
+        Garage garage = optionalGarage.get();
+        garage.addVehicle(vehicle.getUuid());
+        System.out.println("Vehicle created and added to the garage successfully.");
+    } else {
+        System.err.println("Garage not found for player: " + player.getName());
+        // Optionally, you could create a new garage for the player here if the API allows it.
+    }
+}
+
+

API Documentation

+

For additional details, examples, and advanced usage, refer to the official VehiclesPlus API Docs.

From 3cc7d84c54804556580a3eaa407c13403ffa8fb9 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 28 Dec 2024 20:40:27 +0000 Subject: [PATCH 3/5] docs: update vehiclesplus-v3/API --- vehiclesplus-v3/API.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/vehiclesplus-v3/API.md b/vehiclesplus-v3/API.md index 02aad9e..ba7110b 100644 --- a/vehiclesplus-v3/API.md +++ b/vehiclesplus-v3/API.md @@ -2,7 +2,7 @@ title: API description: Api usage examples published: false -date: 2024-12-28T20:38:34.412Z +date: 2024-12-28T20:40:27.836Z tags: developers editor: markdown dateCreated: 2024-12-28T20:10:42.650Z @@ -17,9 +17,11 @@ This guide explains how to integrate the new and improved VehiclesPlus API (v3) To use the VehiclesPlus API in your plugin, follow these steps: ### Step 1: Add VehiclesPlus to Your Dependencies + Ensure VehiclesPlus is added as a dependency in your project. To always use the latest version, update your dependency configuration as shown below: Maven (`pom.xml`): + ```xml sbdevelopment-repo @@ -34,6 +36,7 @@ Maven (`pom.xml`): ``` Gradle (`build.gradle`): + ```gradle repositories { maven { @@ -45,14 +48,13 @@ dependencies { implementation 'tech.sbdevelopment:vehiclesplus:latest' } ``` -> **Note**: Using `latest` ensures that your project always fetches the most recent release, but it might cause issues if breaking changes are introduced. For more stability, consider specifying a specific version (e.g., `3.0.2`). +> **Note**: Using `latest` ensures that your project always fetches the most recent release, but it might cause issues if breaking changes are introduced. For more stability, consider specifying a specific version (e.g., `3.0.2`). ## Example: Adding a Car to Someone's Garage This example demonstrates how to add a vehicle to any garage: - ```java // Give car to garage public void giveCar(Garage garage, String vehicleType) { @@ -101,4 +103,4 @@ public void giveCar(Player player, String vehicleType) { ## API Documentation -For additional details, examples, and advanced usage, refer to the official [VehiclesPlus API Docs](https://sbdevelopment.tech/vehiclesplus). +For additional details, examples, and advanced usage, refer to the official [VehiclesPlus API Docs](https://sbdevelopment.tech/vehiclesplus). \ No newline at end of file From 20407a2332dac8c939c4973bc888642c287dba49 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 28 Dec 2024 20:41:37 +0000 Subject: [PATCH 4/5] docs: update vehiclesplus-v3/API --- vehiclesplus-v3/API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vehiclesplus-v3/API.md b/vehiclesplus-v3/API.md index ba7110b..1b895f1 100644 --- a/vehiclesplus-v3/API.md +++ b/vehiclesplus-v3/API.md @@ -2,7 +2,7 @@ title: API description: Api usage examples published: false -date: 2024-12-28T20:40:27.836Z +date: 2024-12-28T20:41:34.480Z tags: developers editor: markdown dateCreated: 2024-12-28T20:10:42.650Z @@ -103,4 +103,4 @@ public void giveCar(Player player, String vehicleType) { ## API Documentation -For additional details, examples, and advanced usage, refer to the official [VehiclesPlus API Docs](https://sbdevelopment.tech/vehiclesplus). \ No newline at end of file +For additional details and advanced usage refer to the official [VehiclesPlus javadocs](https://sbdevelopment.tech/javadoc/vehiclesplus-v3/index.html). \ No newline at end of file From c518e5cee26fb839e8d489aeb8c3429fb70d6139 Mon Sep 17 00:00:00 2001 From: Cedric Date: Sat, 28 Dec 2024 20:41:59 +0000 Subject: [PATCH 5/5] docs: update vehiclesplus-v3/API --- vehiclesplus-v3/API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vehiclesplus-v3/API.md b/vehiclesplus-v3/API.md index 1b895f1..532194b 100644 --- a/vehiclesplus-v3/API.md +++ b/vehiclesplus-v3/API.md @@ -2,7 +2,7 @@ title: API description: Api usage examples published: false -date: 2024-12-28T20:41:34.480Z +date: 2024-12-28T20:41:56.904Z tags: developers editor: markdown dateCreated: 2024-12-28T20:10:42.650Z @@ -103,4 +103,4 @@ public void giveCar(Player player, String vehicleType) { ## API Documentation -For additional details and advanced usage refer to the official [VehiclesPlus javadocs](https://sbdevelopment.tech/javadoc/vehiclesplus-v3/index.html). \ No newline at end of file +For additional details and advanced usage refer to the official [VehiclesPlus Javadoc](https://sbdevelopment.tech/javadoc/vehiclesplus-v3/index.html). \ No newline at end of file