From 05bd84b504006e43dfc67b2d11d95551d00e082d Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Wed, 16 Feb 2022 17:47:43 +0000 Subject: [PATCH] Don't crazily initialise HeightMapFilter...?? --- .../core/math/heightmap/HeightMap.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/heightmap/HeightMap.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/heightmap/HeightMap.java index 8fb91d91c..bf9f8f17d 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/heightmap/HeightMap.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/math/heightmap/HeightMap.java @@ -56,14 +56,9 @@ public interface HeightMap { layers ); if (smooth) { - try { - HeightMapFilter filter = (HeightMapFilter) HeightMapFilter.class.getConstructors()[0].newInstance(GaussianKernel.class - .getConstructors()[0].newInstance(5, 1)); - int diameter = 2 * size + 1; - data[1] = filter.filter(data[1], diameter, diameter); - } catch (IllegalAccessException | InvocationTargetException | InstantiationException e) { - e.printStackTrace(); - } + HeightMapFilter filter = new HeightMapFilter(new GaussianKernel(5, 1)); + int diameter = 2 * size + 1; + data[1] = filter.filter(data[1], diameter, diameter); } if (layers) { heightMap.applyLayers(data[1]);