By default only allow existing blocks to tick.

- Revert back to default FAWE behaviour where placed blocks do not tick by default (until a restart, or another edit is done in the same chunksection without changing the block)
This commit is contained in:
dordsor21 2020-05-08 16:16:08 +01:00
parent 56972ee40b
commit c757b01803
2 changed files with 40 additions and 13 deletions

View File

@ -1,5 +1,6 @@
package com.boydti.fawe.bukkit.adapter;
import com.boydti.fawe.config.Settings;
import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.world.block.BlockID;
@ -68,6 +69,24 @@ public class NMSAdapter {
case BlockID.VOID_AIR:
air++;
break;
default:
if (!Settings.IMP.EXPERIMENTAL.ALLOW_TICK_PLACED) {
boolean ticking;
if (ordinal != lastOrdinal) {
ticking = BlockTypesCache.ticking[ordinal];
lastOrdinal = ordinal;
lastticking = ticking;
} else {
ticking = lastticking;
}
if (ticking) {
BlockState state = BlockState.getFromOrdinal(ordinal);
ticking_blocks
.put(BlockVector3.at(i & 15, (i >> 8) & 15, (i >> 4) & 15),
WorldEditPlugin.getInstance().getBukkitImplAdapter()
.getInternalBlockStateId(state).orElse(0));
}
}
}
set[i] = ordinal;
break;
@ -78,6 +97,7 @@ public class NMSAdapter {
air++;
break;
}
if (Settings.IMP.EXPERIMENTAL.ALLOW_TICK_PLACED) {
boolean ticking;
if (ordinal != lastOrdinal) {
ticking = BlockTypesCache.ticking[ordinal];
@ -92,6 +112,7 @@ public class NMSAdapter {
WorldEditPlugin.getInstance().getBukkitImplAdapter()
.getInternalBlockStateId(state).orElse(0));
}
}
int palette = blockToPalette[ordinal];
if (palette == Integer.MAX_VALUE) {
blockToPalette[ordinal] = palette = num_palette;

View File

@ -369,6 +369,12 @@ public class Settings extends Config {
"Other experimental features"
})
public boolean OTHER = false;
@Comment({
"Allow blocks placed by WorldEdit to tick. This could cause the big lags.",
"This has no effect on existing blocks one way or the other."
})
public boolean ALLOW_TICK_PLACED = false;
}
public static class WEB {