From 1a29ea302e14d97934ba30e1845596fe9b4f7ff9 Mon Sep 17 00:00:00 2001 From: Vatuu <21113232+Vatuu@users.noreply.github.com> Date: Tue, 30 Aug 2022 18:06:17 +0200 Subject: [PATCH 1/3] Fixed vines not properly generating using decorators. --- .../iris/engine/modifier/IrisPostModifier.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java b/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java index 3b2a50b04..580f258fe 100644 --- a/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java +++ b/src/main/java/com/volmit/iris/engine/modifier/IrisPostModifier.java @@ -28,6 +28,7 @@ import com.volmit.iris.util.scheduling.PrecisionStopwatch; import org.bukkit.Material; import org.bukkit.block.data.BlockData; import org.bukkit.block.data.Levelled; +import org.bukkit.block.data.MultipleFacing; import org.bukkit.block.data.Waterlogged; import org.bukkit.block.data.type.Slab; @@ -221,6 +222,16 @@ public class IrisPostModifier extends EngineAssignedModifier { // Foliage b = getPostBlock(x, h + 1, z, currentPostX, currentPostZ, currentData); + if(B.isVineBlock(b) && b instanceof MultipleFacing f) { + int finalH = h + 1; + + f.getAllowedFaces().forEach(face -> { + BlockData d = getPostBlock(x + face.getModX(), finalH + face.getModY(), z + face.getModZ(), currentPostX, currentPostZ, currentData); + f.setFace(face, !B.isAir(d) && !B.isVineBlock(d)); + }); + setPostBlock(x, h + 1, z, b, currentPostX, currentPostZ, currentData); + } + if(B.isFoliage(b) || b.getMaterial().equals(Material.DEAD_BUSH)) { Material onto = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData).getMaterial(); @@ -242,7 +253,7 @@ public class IrisPostModifier extends EngineAssignedModifier { public boolean isSolid(int x, int y, int z, int currentPostX, int currentPostZ, Hunk currentData) { BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, currentData); - return d.getMaterial().isSolid(); + return d.getMaterial().isSolid() && !B.isVineBlock(d); } public boolean isSolidNonSlab(int x, int y, int z, int currentPostX, int currentPostZ, Hunk currentData) { From 7c4c2d63824e2a3ba6adb337c83ff1d8363d0585 Mon Sep 17 00:00:00 2001 From: Vatuu <21113232+Vatuu@users.noreply.github.com> Date: Tue, 30 Aug 2022 19:14:28 +0200 Subject: [PATCH 2/3] Fixed autocomplete only going two dirs deep. --- .../core/loader/ObjectResourceLoader.java | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/main/java/com/volmit/iris/core/loader/ObjectResourceLoader.java b/src/main/java/com/volmit/iris/core/loader/ObjectResourceLoader.java index 5f1be6ee0..bc1f1e9b5 100644 --- a/src/main/java/com/volmit/iris/core/loader/ObjectResourceLoader.java +++ b/src/main/java/com/volmit/iris/core/loader/ObjectResourceLoader.java @@ -68,33 +68,26 @@ public class ObjectResourceLoader extends ResourceLoader { if(possibleKeys != null) { return possibleKeys; } - Iris.debug("Building " + resourceTypeName + " Possibility Lists"); KSet m = new KSet<>(); - for(File i : getFolders()) { - for(File j : i.listFiles()) { - if(j.isFile() && j.getName().endsWith(".iob")) { - m.add(j.getName().replaceAll("\\Q.iob\\E", "")); - } else if(j.isDirectory()) { - for(File k : j.listFiles()) { - if(k.isFile() && k.getName().endsWith(".iob")) { - m.add(j.getName() + "/" + k.getName().replaceAll("\\Q.iob\\E", "")); - } else if(k.isDirectory()) { - for(File l : k.listFiles()) { - if(l.isFile() && l.getName().endsWith(".iob")) { - m.add(j.getName() + "/" + k.getName() + "/" + l.getName().replaceAll("\\Q.iob\\E", "")); - } - } - } - } - } + m.addAll(getFiles(i, ".iob", true)); + } + possibleKeys = m.toArray(new String[0]); + return possibleKeys; + } + + private KList getFiles(File dir, String ext, boolean skipDirName) { + KList paths = new KList<>(); + String name = skipDirName ? "" : dir.getName() + "/"; + for(File f : dir.listFiles()) { + if(f.isFile() && f.getName().endsWith(ext)) { + paths.add(name + f.getName().replaceAll("\\Q" + ext + "\\E", "")); + } else if(f.isDirectory()) { + getFiles(f, ext, false).forEach(e -> paths.add(name + e)); } } - - KList v = new KList<>(m); - possibleKeys = v.toArray(new String[0]); - return possibleKeys; + return paths; } public File findFile(String name) { From 98b628065202d5f0f8eea402a4a8d23bb4e64760 Mon Sep 17 00:00:00 2001 From: Vatuu <21113232+Vatuu@users.noreply.github.com> Date: Tue, 30 Aug 2022 19:15:05 +0200 Subject: [PATCH 3/3] V+ --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 06b1b8b40..760387bf9 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ plugins { id "de.undercouch.download" version "5.0.1" } -version '2.2.13-1.19.2' // Needs to be version specific +version '2.2.14-1.19.2' // Needs to be version specific def nmsVersion = "1.19.2" def apiVersion = '1.19' def spigotJarVersion = '1.19.1-R0.1-SNAPSHOT'