1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Merge pull request #384 from Poslovitch/161-fix

Fixes a NumberFormatException when trying to read nonexistent frequency of a CargoManager
This commit is contained in:
TheBusyBiscuit 2017-08-11 18:30:40 +02:00 committed by GitHub
commit fa90b7105d

View File

@ -37,7 +37,6 @@ import me.mrCookieSlime.Slimefun.holograms.CargoHologram;
public class CargoNet {
public enum Axis {
X_POSITIVE,
X_NEGATIVE,
Y_POSITIVE,
@ -462,7 +461,7 @@ public class CargoNet {
}
private static int getFrequency(Location l) {
return Integer.parseInt(BlockStorage.getBlockInfo(l).getString("frequency"));
return BlockStorage.getBlockInfo(l).getInt("frequency"); // If no frequency is found, will automatically return 0.
}
public static Set<Location> scan(Location source, Set<Location> blocks, List<Location> l1, List<Location> l2, Axis exclude, Map<Location, Integer> input, Map<Integer, List<Location>> output, Set<Location> terminals, Set<Location> providers, Set<Location> destinations, Set<Location> imports, Set<Location> exports) {