MCPcopy Create free account
hub / github.com/boxbeam/RedLib / fromString

Method fromString

src/redempt/redlib/region/CuboidRegion.java:357–367  ·  view source on GitHub ↗

Converts a String generated by CuboidRegion#toString() back to a Region @param input The String representation of a Region @return The Region

(String input)

Source from the content-addressed store, hash-verified

355 * @return The Region
356 */
357 public static CuboidRegion fromString(String input) {
358 String[] split = input.split(" ");
359 World world = Bukkit.getWorld(split[0]);
360 double minX = Double.parseDouble(split[1]);
361 double minY = Double.parseDouble(split[2]);
362 double minZ = Double.parseDouble(split[3]);
363 double maxX = Double.parseDouble(split[4]);
364 double maxY = Double.parseDouble(split[5]);
365 double maxZ = Double.parseDouble(split[6]);
366 return new CuboidRegion(new Location(world, minX, minY, minZ), new Location(world, maxX, maxY, maxZ));
367 }
368
369 /**
370 * Represents a state of a Region, not necessarily at the current point in time

Callers 1

fromStringMethod · 0.95

Calls 2

splitMethod · 0.80
getWorldMethod · 0.45

Tested by

no test coverage detected