fix #2860, improve fluid heuristics
This commit is contained in:
parent
f81541c8db
commit
6995b9afb3
2 changed files with 22 additions and 18 deletions
|
@ -150,22 +150,26 @@ public class LibraryDatabase {
|
|||
int sepIndex = fileName.lastIndexOf(LibraryId.BPT_SEP_CHARACTER);
|
||||
int dotIndex = fileName.lastIndexOf('.');
|
||||
|
||||
String extension = fileName.substring(dotIndex + 1);
|
||||
if (dotIndex > 0) {
|
||||
String extension = fileName.substring(dotIndex + 1);
|
||||
|
||||
if (sepIndex > 0) {
|
||||
String prefix = fileName.substring(0, sepIndex);
|
||||
String suffix = fileName.substring(sepIndex + 1);
|
||||
if (sepIndex > 0) {
|
||||
String prefix = fileName.substring(0, sepIndex);
|
||||
String suffix = fileName.substring(sepIndex + 1);
|
||||
|
||||
id.name = prefix;
|
||||
id.uniqueId = LibraryId.toBytes(suffix.substring(0, suffix.length() - (extension.length() + 1)));
|
||||
id.name = prefix;
|
||||
id.uniqueId = LibraryId.toBytes(suffix.substring(0, suffix.length() - (extension.length() + 1)));
|
||||
} else {
|
||||
id.name = fileName.substring(0, dotIndex);
|
||||
id.uniqueId = new byte[0];
|
||||
}
|
||||
id.extension = extension;
|
||||
|
||||
if (!blueprintIds.contains(id)) {
|
||||
blueprintIds.add(id);
|
||||
}
|
||||
} else {
|
||||
id.name = fileName.substring(0, dotIndex);
|
||||
id.uniqueId = new byte[0];
|
||||
}
|
||||
id.extension = extension;
|
||||
|
||||
if (!blueprintIds.contains(id)) {
|
||||
blueprintIds.add(id);
|
||||
BCLog.logger.warn("Found incorrectly named (no extension) blueprint file: '%s'!", fileName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -139,13 +139,13 @@ public final class BlockUtils {
|
|||
return false;
|
||||
}
|
||||
|
||||
// TODO: Make this support all "heavy" liquids, not just oil/lava
|
||||
if (block instanceof IFluidBlock && ((IFluidBlock) block).getFluid() != null && "oil".equals(((IFluidBlock) block).getFluid().getName())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (block == Blocks.lava || block == Blocks.flowing_lava) {
|
||||
return false;
|
||||
} else if (block instanceof IFluidBlock && ((IFluidBlock) block).getFluid() != null) {
|
||||
Fluid f = ((IFluidBlock) block).getFluid();
|
||||
if (f.getDensity(world, x, y, z) >= 3000) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue