Merge pull request 'master' (#1) from SBDevelopment/VehiclesPlusConverter:master into master
Reviewed-on: JuliGame/VehiclesPlusConverter#1
This commit is contained in:
commit
861b5b378f
8
pom.xml
8
pom.xml
|
@ -75,16 +75,16 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>nl.sbdeveloper</groupId>
|
<groupId>nl.sbdeveloper</groupId>
|
||||||
<artifactId>VehiclesPlus-v2</artifactId>
|
<artifactId>VehiclesPlus-v2</artifactId>
|
||||||
<version>2.3.5</version>
|
<version>2.4.4.1</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/src/libs/VehiclesPlus-2.3.5.jar</systemPath>
|
<systemPath>${project.basedir}/src/libs/VehiclesPlus-2.4.4.1.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>nl.sbdeveloper</groupId>
|
<groupId>nl.sbdeveloper</groupId>
|
||||||
<artifactId>VehiclesPlus-v3</artifactId>
|
<artifactId>VehiclesPlus-v3</artifactId>
|
||||||
<version>3.0.0-PRE3</version>
|
<version>3.0.0-SNAPSHOT</version>
|
||||||
<scope>system</scope>
|
<scope>system</scope>
|
||||||
<systemPath>${project.basedir}/src/libs/VehiclesPlus-3.0.0-PRE3.jar</systemPath>
|
<systemPath>${project.basedir}/src/libs/VehiclesPlus-3.0.0-SNAPSHOT.jar</systemPath>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
|
||||||
|
}
|
|
@ -176,8 +176,9 @@ public class Converter {
|
||||||
wheel.getXOffset(),
|
wheel.getXOffset(),
|
||||||
wheel.getYOffset(),
|
wheel.getYOffset(),
|
||||||
wheel.getZOffset(),
|
wheel.getZOffset(),
|
||||||
VehiclesPlus.getVehicleManager().getRimDesignHashMap().values().stream().findFirst().orElseThrow(() -> new ConversionException("No RimDesign found while loading Wheel in file", baseVehicle.getName())).getName(),
|
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())),
|
||||||
wheel.getColor(),
|
wheel.getColor(),
|
||||||
|
HolderItemPosition.HEAD,
|
||||||
wheel.getSteering(),
|
wheel.getSteering(),
|
||||||
wheel.getRotationOffset()
|
wheel.getRotationOffset()
|
||||||
));
|
));
|
||||||
|
@ -266,7 +267,7 @@ public class Converter {
|
||||||
UUID ownerUUID = set.getKey();
|
UUID ownerUUID = set.getKey();
|
||||||
String ownerName = Bukkit.getOfflinePlayer(ownerUUID).getName();
|
String ownerName = Bukkit.getOfflinePlayer(ownerUUID).getName();
|
||||||
if (ownerName == null) {
|
if (ownerName == null) {
|
||||||
Bukkit.getLogger().severe("Could not convert vehicle for player with UUID " + ownerUUID + ", the player name is unknown!");
|
Bukkit.getLogger().severe("Could not convert vehicles for player with UUID " + ownerUUID + ", the player name is unknown!");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,16 +279,16 @@ public class Converter {
|
||||||
nl.sbdeveloper.vehiclesplus.api.VehiclesPlusAPI.getVehicleModels().values().stream().filter(v -> v.getId().equalsIgnoreCase(vehicle.getBaseVehicle())).findFirst().orElseThrow(() -> new ConversionException("No VehicleModel found for", vehicle.getUuid()))
|
nl.sbdeveloper.vehiclesplus.api.VehiclesPlusAPI.getVehicleModels().values().stream().filter(v -> v.getId().equalsIgnoreCase(vehicle.getBaseVehicle())).findFirst().orElseThrow(() -> new ConversionException("No VehicleModel found for", vehicle.getUuid()))
|
||||||
);
|
);
|
||||||
|
|
||||||
newVehicle.save();
|
newVehicle.forceSave();
|
||||||
garage.addVehicle(newVehicle.getUuid());
|
garage.addVehicle(newVehicle.getUuid());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Bukkit.getLogger().severe("Could not convert vehicle for player with UUID " + ownerUUID + ", could not save the vehicle!");
|
Bukkit.getLogger().severe("Could not convert vehicles for player with UUID " + ownerUUID + ", could not save the vehicle!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
garage.save();
|
garage.forceSave();
|
||||||
} catch (DataStorageException e) {
|
} catch (DataStorageException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Bukkit.getLogger().severe("Could not convert vehicles for player with UUID " + ownerUUID + ", could not save the garage!");
|
Bukkit.getLogger().severe("Could not convert vehicles for player with UUID " + ownerUUID + ", could not save the garage!");
|
||||||
|
|
|
@ -27,17 +27,17 @@ public class MainUtil {
|
||||||
public static String getTypeIdByClass(String baseVehicle, String type) throws ConversionException {
|
public static String getTypeIdByClass(String baseVehicle, String type) throws ConversionException {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case "BikeType":
|
case "BikeType":
|
||||||
return "bike";
|
return "bikes";
|
||||||
case "BoatType":
|
case "BoatType":
|
||||||
return "boat";
|
return "boats";
|
||||||
case "CarType":
|
case "CarType":
|
||||||
return "car";
|
return "cars";
|
||||||
case "HelicopterType":
|
case "HelicopterType":
|
||||||
return "helicopter";
|
return "helicopters";
|
||||||
case "HovercraftType":
|
case "HovercraftType":
|
||||||
return "hovercraft";
|
return "hovercrafts";
|
||||||
case "PlaneType":
|
case "PlaneType":
|
||||||
return "plane";
|
return "planes";
|
||||||
default:
|
default:
|
||||||
throw new InvalidConversionException("vehicleType", baseVehicle);
|
throw new InvalidConversionException("vehicleType", baseVehicle);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue