3
0
Fork 0
VehiclesPlus-v3-API-example/src/main/java/tech/sbdevelopment/vp3apitest/models/DefaultSubmarine.java
2024-08-05 20:29:21 +02:00

73 lines
2.9 KiB
Java

package tech.sbdevelopment.vp3apitest.models;
import nl.sbdeveloper.vehiclesplus.api.vehicles.HolderItemPosition;
import nl.sbdeveloper.vehiclesplus.api.vehicles.VehicleModel;
import nl.sbdeveloper.vehiclesplus.api.vehicles.defaults.DefaultVehicleModel;
import nl.sbdeveloper.vehiclesplus.api.vehicles.parts.impl.seat.Seat;
import nl.sbdeveloper.vehiclesplus.api.vehicles.parts.impl.skin.Skin;
import nl.sbdeveloper.vehiclesplus.api.vehicles.settings.UpgradableSetting;
import nl.sbdeveloper.vehiclesplus.api.vehicles.settings.impl.*;
import nl.sbdeveloper.vehiclesplus.utils.ItemBuilder;
import nl.sbdeveloper.vehiclesplus.utils.jackson.ColorList;
import org.bukkit.Color;
import org.bukkit.Material;
import org.bukkit.Sound;
import tech.sbdevelopment.vp3apitest.parts.Vent;
public class DefaultSubmarine extends DefaultVehicleModel {
@Override
public VehicleModel build() {
return VehicleModel.builder()
.id("ExampleSubmarine")
.displayName("&cExample &aSubmarine")
.typeId("submarines")
.part(new Skin(
0, 0.3, 0,
new ItemBuilder(Material.LEATHER_BOOTS)
.customModelData(4, (ib) -> ib
.durability((short) 4)
.unbreakable())
.armorColor(Color.WHITE)
.getItemStack(),
HolderItemPosition.HEAD
))
.part(new Seat(
-0.5, -0.5, 0.5, true
))
.part(new Vent())
.permissions(new Permissions("ExampleSubmarine"))
.sounds(defaultSounds)
.availableColors(ColorList.of(
Color.GRAY,
Color.BLACK
))
.maxSpeed(new UpgradableSetting(
10, 200, 5, 1000, "km/h"
))
.fuelTank(new UpgradableSetting(
100, 200, 5, 1000, "L"
))
.turningRadius(new UpgradableSetting(
5, 10, 1, 1000, ""
))
.acceleration(new UpgradableSetting(
50, 100, 1, 1000, ""
))
.horn(new Horn(
true, new Sounds.Sound(Sound.WEATHER_RAIN_ABOVE.getKey().toString(), 3)
))
.drift(false)
.exitWhileMoving(false)
.price(100000)
.fuel(new Fuel(
"gasoline", 6
))
.health(100)
.trunkSize(0)
.hitbox(new Hitbox(
4, 2, 1.2
))
.gearbox(new Gearbox(false))
.build();
}
}