Skip to content

Commit b48c9be

Browse files
committed
chore(git): merge upstream changes
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
2 parents f98e097 + 1265b3d commit b48c9be

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

src/main/java/org/spongepowered/common/event/SpongeCommonEventFactory.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -587,16 +587,13 @@ public static boolean handleCollideImpactEvent(final net.minecraft.world.entity.
587587
if (movingObjectType == HitResult.Type.BLOCK) {
588588
final BlockHitResult blockMovingObjectPosition = (BlockHitResult) movingObjectPosition;
589589
final BlockPos blockPos = blockMovingObjectPosition.getBlockPos();
590-
if (blockPos.getY() < projectile.level().getMinY()) {
591-
return false;
592-
}
593-
594590
final BlockSnapshot targetBlock = ((ServerWorld) projectile.level()).createSnapshot(blockPos.getX(), blockPos.getY(), blockPos.getZ());
591+
final ServerLocation targetLocation = ServerLocation.of((ServerWorld) projectile.level(), VecHelper.toVector3d(blockMovingObjectPosition.getBlockPos()));
595592
final Direction side = DirectionFacingProvider.INSTANCE.getKey(blockMovingObjectPosition.getDirection()).get();
596593

597594
final CollideBlockEvent.Impact event = SpongeEventFactory.createCollideBlockEventImpact(frame.currentCause(),
598595
impactPoint, targetBlock.state(),
599-
targetBlock.location().get(), side);
596+
targetLocation, side);
600597
cancelled = SpongeCommon.post(event);
601598
// Track impact block if event is not cancelled
602599
if (!cancelled && creator.isPresent()) {

src/mixins/java/org/spongepowered/common/mixin/core/server/level/ServerLevelMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ public abstract class ServerLevelMixin extends LevelMixin implements ServerLevel
331331
public BlockSnapshot bridge$createSnapshot(final int x, final int y, final int z) {
332332
final BlockPos pos = new BlockPos(x, y, z);
333333

334-
if (!((ServerLevel) (Object) this).isInWorldBounds(pos)) {
334+
if (((ServerLevel) (Object) this).isOutsideBuildHeight(pos)) {
335335
return BlockSnapshot.empty();
336336
}
337337

0 commit comments

Comments
 (0)