mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-03 22:26:16 +00:00
改进液体碰撞放置行为
This commit is contained in:
@@ -42,6 +42,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.yaml.snakeyaml.LoaderOptions;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
import org.yaml.snakeyaml.scanner.ScannerException;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
@@ -543,6 +544,19 @@ public abstract class AbstractPackManager implements PackManager {
|
||||
} catch (IOException e) {
|
||||
AbstractPackManager.this.plugin.logger().severe("Error while reading config file: " + path, e);
|
||||
return FileVisitResult.CONTINUE;
|
||||
} catch (ScannerException e) {
|
||||
if (e.getMessage() != null && e.getMessage().contains("TAB") && e.getMessage().contains("indentation")) {
|
||||
try {
|
||||
String content = Files.readString(path);
|
||||
content = content.replace("\t", " ");
|
||||
Files.writeString(path, content);
|
||||
} catch (Exception ex) {
|
||||
AbstractPackManager.this.plugin.logger().severe("Failed to fix tab indentation in config file: " + path, ex);
|
||||
}
|
||||
} else {
|
||||
AbstractPackManager.this.plugin.logger().severe("Error found while reading config file: " + path, e);
|
||||
}
|
||||
return FileVisitResult.CONTINUE;
|
||||
} catch (LocalizedException e) {
|
||||
e.setArgument(0, path.toString());
|
||||
TranslationManager.instance().log(e.node(), e.arguments());
|
||||
|
||||
Reference in New Issue
Block a user