9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-23 08:59:23 +00:00

Add old Blast Protection explosion knockback behavior (#346)

Added configurable old Blast Protection explosion knockback behavior that is from <=1.21.4 version.
This commit is contained in:
Dreeam
2025-06-06 13:10:31 +08:00
committed by GitHub
parent 950be3d8cd
commit b70aaa0450
5 changed files with 89 additions and 5 deletions

View File

@@ -15,6 +15,7 @@ public class Knockback extends ConfigModules {
public static boolean canPlayerKnockbackZombie = true;
@Experimental
public static boolean flushKnockback = false;
public static boolean oldBlastProtectionKnockbackBehavior = false;
@Override
public void onLoaded() {
@@ -34,5 +35,6 @@ public class Knockback extends ConfigModules {
"使玩家可以击退僵尸."
));
flushKnockback = config.getBoolean(getBasePath() + ".flush-location-while-knockback-player", flushKnockback);
oldBlastProtectionKnockbackBehavior = config.getBoolean(getBasePath() + ".old-blast-protection-explosion-knockback", oldBlastProtectionKnockbackBehavior);
}
}

View File

@@ -29,7 +29,7 @@ public final class BlockPosIterator extends AbstractIterator<BlockPos> {
Vec3 movement = vec.scale(toTravel);
AABB fromBB = boundingBox.move(-vec.x, -vec.y, -vec.z);
AABB searchArea = fromBB.expandTowards(movement);
return org.dreeam.leaf.util.map.BlockPosIterator.iterable(searchArea);
return iterable(searchArea);
}
public BlockPosIterator(AABB bb) {