Fixed rim design issue

This commit is contained in:
Stijn Bannink 2024-12-30 21:20:06 +01:00
parent 07d27adce1
commit 7ffb83c805
Signed by: SBDeveloper
GPG key ID: B730712F2C3A9D7A
2 changed files with 12 additions and 3 deletions

View file

@ -6,7 +6,7 @@
<groupId>tech.sbdevelopment</groupId>
<artifactId>VehiclesPlusConverter</artifactId>
<version>0.2.2</version>
<version>0.2.3</version>
<packaging>jar</packaging>
<name>VehiclesPlusConverter</name>

View file

@ -85,7 +85,7 @@ public class Converter {
private static void convertRims() {
for (Map.Entry<String, RimDesign> entry : VehiclesPlus.getVehicleManager().getRimDesignHashMap().entrySet()) {
nl.sbdeveloper.vehiclesplus.api.vehicles.rims.RimDesign rd = new nl.sbdeveloper.vehiclesplus.api.vehicles.rims.RimDesign(
entry.getValue().getName(),
entry.getValue().getName().toLowerCase(),
entry.getValue().getSkin(),
HolderItemPosition.HEAD,
entry.getValue().getPrice()
@ -191,7 +191,7 @@ public class Converter {
wheel.getXOffset(),
wheel.getYOffset(),
wheel.getZOffset(),
nl.sbdeveloper.vehiclesplus.api.VehiclesPlusAPI.getRimDesign(VehiclesPlus.getVehicleManager().getRimDesignHashMap().values().stream().findFirst().orElseThrow(() -> new ConversionException("No RimDesign found while loading Wheel in file", baseVehicle.getName())).getName()).orElseThrow(() -> new ConversionException("No matching RimDesign found while loading Wheel in file", baseVehicle.getName())),
nl.sbdeveloper.vehiclesplus.api.VehiclesPlusAPI.getRimDesign(VehiclesPlus.getVehicleManager().getRimDesignHashMap().values().stream().map(str -> str.getName().toLowerCase()).findFirst().orElseThrow(() -> new ConversionException("No RimDesign found while loading Wheel in file", baseVehicle.getName()))).orElseThrow(() -> new ConversionException("No matching RimDesign found while loading Wheel in file", baseVehicle.getName())),
wheel.getColor(),
wheel.getSteering(),
wheel.getRotationOffset()
@ -301,6 +301,15 @@ public class Converter {
false
);
// Set the vehicle's stats
newVehicle.getStatics().forceSetMaxSpeed(vehicle.getVehicleStats().getSpeed());
newVehicle.getStatics().forceSetTurningRadius(vehicle.getVehicleStats().getSteering());
newVehicle.getStatics().forceSetFuelTank(vehicle.getVehicleStats().getFuelTank());
newVehicle.getStatics().setCurrentFuel(vehicle.getVehicleStats().getCurrentFuel());
newVehicle.getStatics().forceSetAcceleration(vehicle.getVehicleStats().getAcceleration());
newVehicle.getStatics().setBroken(vehicle.getVehicleStats().getBroken());
newVehicle.getStatics().setCurrentHealth(vehicle.getVehicleStats().getHealth());
newVehicle.forceSave();
garage.addVehicle(newVehicle.getUuid());
} catch (Exception e) {