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 2022-08-30 10:20:38 -07:00 committed by GitHub
commit fb294fc03c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 28 additions and 24 deletions

View File

@ -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'

View File

@ -68,33 +68,26 @@ public class ObjectResourceLoader extends ResourceLoader<IrisObject> {
if(possibleKeys != null) {
return possibleKeys;
}
Iris.debug("Building " + resourceTypeName + " Possibility Lists");
KSet<String> 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<String> getFiles(File dir, String ext, boolean skipDirName) {
KList<String> 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<String> v = new KList<>(m);
possibleKeys = v.toArray(new String[0]);
return possibleKeys;
return paths;
}
public File findFile(String name) {

View File

@ -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<BlockData> {
// 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<BlockData> {
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);
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) {