Fixed rim design issue
This commit is contained in:
parent
07d27adce1
commit
7ffb83c805
2 changed files with 12 additions and 3 deletions
2
pom.xml
2
pom.xml
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
<groupId>tech.sbdevelopment</groupId>
|
<groupId>tech.sbdevelopment</groupId>
|
||||||
<artifactId>VehiclesPlusConverter</artifactId>
|
<artifactId>VehiclesPlusConverter</artifactId>
|
||||||
<version>0.2.2</version>
|
<version>0.2.3</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>VehiclesPlusConverter</name>
|
<name>VehiclesPlusConverter</name>
|
||||||
|
|
|
@ -85,7 +85,7 @@ public class Converter {
|
||||||
private static void convertRims() {
|
private static void convertRims() {
|
||||||
for (Map.Entry<String, RimDesign> entry : VehiclesPlus.getVehicleManager().getRimDesignHashMap().entrySet()) {
|
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(
|
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(),
|
entry.getValue().getSkin(),
|
||||||
HolderItemPosition.HEAD,
|
HolderItemPosition.HEAD,
|
||||||
entry.getValue().getPrice()
|
entry.getValue().getPrice()
|
||||||
|
@ -191,7 +191,7 @@ public class Converter {
|
||||||
wheel.getXOffset(),
|
wheel.getXOffset(),
|
||||||
wheel.getYOffset(),
|
wheel.getYOffset(),
|
||||||
wheel.getZOffset(),
|
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.getColor(),
|
||||||
wheel.getSteering(),
|
wheel.getSteering(),
|
||||||
wheel.getRotationOffset()
|
wheel.getRotationOffset()
|
||||||
|
@ -301,6 +301,15 @@ public class Converter {
|
||||||
false
|
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();
|
newVehicle.forceSave();
|
||||||
garage.addVehicle(newVehicle.getUuid());
|
garage.addVehicle(newVehicle.getUuid());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in a new issue