Trees on Bukkit

This commit is contained in:
dfsek
2020-12-14 23:53:01 -07:00
parent 4d59c27a13
commit ee35c371ec
6 changed files with 45 additions and 6 deletions

View File

@@ -15,6 +15,7 @@ public class Cactus extends FractalTree {
main.getWorldHandle().createMaterialData("minecraft:red_sand"));
}
/**
* Instantiates a TreeGrower at an origin location.
*

View File

@@ -23,16 +23,16 @@ public class Transformer<F, T> {
* @return Result
*/
public T translate(F from) {
List<TransformException> exceptions = new ArrayList<>();
List<Exception> exceptions = new ArrayList<>();
for(Transform<F, T> transform : transformer) {
try {
return transform.transform(from);
} catch(TransformException exception) {
} catch(Exception exception) {
exceptions.add(exception);
}
}
StringBuilder exBuilder = new StringBuilder("Could not transform input; all attempts failed: ").append(from.toString()).append("\n");
for(TransformException exception : exceptions) exBuilder.append(exception.getMessage()).append("\n");
for(Exception exception : exceptions) exBuilder.append(exception.getMessage()).append("\n");
throw new AttemptsFailedException(exBuilder.toString());
}