Merge pull request #879 from VolmitSoftware/Development

Changelog:

- Fixed Vines, Again! for Floors
- Merged stability changes
- Made the folder checking system recursive
This commit is contained in:
Brian Fopiano authored and GitHub committed 2022-08-30 10:20:38 -07:00
commit fb294fc03c
3 files changed
+27 -23

No files matched your search

+1 -1
View File
@@ -24,7 +24,7 @@ plugins {
id "de.undercouch.download" version "5.0.1" 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 nmsVersion = "1.19.2"
def apiVersion = '1.19' def apiVersion = '1.19'
def spigotJarVersion = '1.19.1-R0.1-SNAPSHOT' def spigotJarVersion = '1.19.1-R0.1-SNAPSHOT'
@@ -68,33 +68,26 @@ public class ObjectResourceLoader extends ResourceLoader<IrisObject> {
if(possibleKeys != null) { if(possibleKeys != null) {
return possibleKeys; return possibleKeys;
} }
Iris.debug("Building " + resourceTypeName + " Possibility Lists"); Iris.debug("Building " + resourceTypeName + " Possibility Lists");
KSet<String> m = new KSet<>(); KSet<String> m = new KSet<>();
for(File i : getFolders()) { for(File i : getFolders()) {
for(File j : i.listFiles()) { m.addAll(getFiles(i, ".iob", true));
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", ""));
}
}
}
}
}
} }
possibleKeys = m.toArray(new String[0]);
return possibleKeys;
} }
KList<String> v = new KList<>(m); private KList<String> getFiles(File dir, String ext, boolean skipDirName) {
possibleKeys = v.toArray(new String[0]); KList<String> paths = new KList<>();
return possibleKeys; 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));
}
}
return paths;
} }
public File findFile(String name) { public File findFile(String name) {
@@ -28,6 +28,7 @@ import com.volmit.iris.util.scheduling.PrecisionStopwatch;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.data.BlockData; import org.bukkit.block.data.BlockData;
import org.bukkit.block.data.Levelled; import org.bukkit.block.data.Levelled;
import org.bukkit.block.data.MultipleFacing;
import org.bukkit.block.data.Waterlogged; import org.bukkit.block.data.Waterlogged;
import org.bukkit.block.data.type.Slab; import org.bukkit.block.data.type.Slab;
@@ -221,6 +222,16 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
// Foliage // Foliage
b = getPostBlock(x, h + 1, z, currentPostX, currentPostZ, currentData); 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)) { if(B.isFoliage(b) || b.getMaterial().equals(Material.DEAD_BUSH)) {
Material onto = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData).getMaterial(); Material onto = getPostBlock(x, h, z, currentPostX, currentPostZ, currentData).getMaterial();
@@ -242,7 +253,7 @@ public class IrisPostModifier extends EngineAssignedModifier<BlockData> {
public boolean isSolid(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData) { public boolean isSolid(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData) {
BlockData d = getPostBlock(x, y, z, currentPostX, currentPostZ, 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<BlockData> currentData) { public boolean isSolidNonSlab(int x, int y, int z, int currentPostX, int currentPostZ, Hunk<BlockData> currentData) {