Improved fire logging and rollback

This commit is contained in:
Brokkonaut
2018-08-21 06:17:24 +02:00
parent 710de5b35a
commit 56404533db
6 changed files with 77 additions and 8 deletions
@@ -101,6 +101,10 @@ public class LoggingUtil {
}
public static void smartLogBlockBreak(Consumer consumer, Actor actor, Block origin) {
smartLogBlockReplace(consumer, actor, origin, null);
}
public static void smartLogBlockReplace(Consumer consumer, Actor actor, Block origin, BlockData replacedWith) {
WorldConfig wcfg = getWorldConfig(origin.getWorld());
if (wcfg == null) {
@@ -187,7 +191,11 @@ public class LoggingUtil {
}
// Do this down here so that the block is added after blocks sitting on it
consumer.queueBlockBreak(actor, origin.getState());
if (replacedWith == null) {
consumer.queueBlockBreak(actor, origin.getState());
} else {
consumer.queueBlockReplace(actor, origin.getState(), replacedWith);
}
}
public static String checkText(String text) {