[ci skip] Add more identifying patch comments, merge related patches

This commit is contained in:
Nassim Jahnke
2024-01-19 12:30:04 +01:00
parent 864f4072c1
commit b5b92e90d8
38 changed files with 181 additions and 229 deletions

View File

@@ -14,11 +14,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
protected BlockPos findLightningTargetAround(BlockPos pos) {
+ // Paper start
+ // Paper start - Add methods to find targets for lightning strikes
+ return this.findLightningTargetAround(pos, false);
+ }
+ public BlockPos findLightningTargetAround(BlockPos pos, boolean returnNullWhenNoTarget) {
+ // Paper end
+ // Paper end - Add methods to find targets for lightning strikes
BlockPos blockposition1 = this.getHeightmapPos(Heightmap.Types.MOTION_BLOCKING, pos);
Optional<BlockPos> optional = this.findLightningRod(blockposition1);
@@ -26,7 +26,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
if (!list.isEmpty()) {
return ((LivingEntity) list.get(this.random.nextInt(list.size()))).blockPosition();
} else {
+ if (returnNullWhenNoTarget) return null; // Paper
+ if (returnNullWhenNoTarget) return null; // Paper - Add methods to find targets for lightning strikes
if (blockposition1.getY() == this.getMinBuildHeight() - 1) {
blockposition1 = blockposition1.above(2);
}
@@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
return (LightningStrike) lightning.getBukkitEntity();
}
+ // Paper start
+ // Paper start - Add methods to find targets for lightning strikes
+ @Override
+ public Location findLightningRod(Location location) {
+ return this.world.findLightningRod(io.papermc.paper.util.MCUtil.toBlockPosition(location))
@@ -53,7 +53,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ final BlockPos pos = this.world.findLightningTargetAround(io.papermc.paper.util.MCUtil.toBlockPosition(location), true);
+ return pos == null ? null : io.papermc.paper.util.MCUtil.toLocation(this.world, pos);
+ }
+ // Paper end
+ // Paper end - Add methods to find targets for lightning strikes
+
@Override
public boolean generateTree(Location loc, TreeType type) {