Skip to content
This repository was archived by the owner on Feb 19, 2019. It is now read-only.

Commit 5bd3388

Browse files
committed
Remove BoundingBoxEvent cancellability
Was causing problems, and there's an alternative method to achieve the same results.
1 parent 4640674 commit 5bd3388

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

src/main/java/clientapi/event/defaults/game/world/BoundingBoxEvent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package clientapi.event.defaults.game.world;
1818

19-
import me.zero.alpine.type.Cancellable;
2019
import net.minecraft.block.Block;
2120
import net.minecraft.entity.Entity;
2221
import net.minecraft.util.math.AxisAlignedBB;
@@ -32,7 +31,7 @@
3231
* @author Brady
3332
* @since 4/10/2017 12:00 PM
3433
*/
35-
public final class BoundingBoxEvent extends Cancellable {
34+
public final class BoundingBoxEvent {
3635

3736
/**
3837
* The block itself
@@ -68,7 +67,8 @@ public BoundingBoxEvent(Block block, BlockPos pos, AxisAlignedBB aabb, List<Axis
6867
}
6968

7069
/**
71-
* Sets the block's bounding box
70+
* Sets the block's bounding box. Setting it to
71+
* {@code null} will effectively cancel the call.
7272
*
7373
* @param aabb New bounding box
7474
* @return This event

src/main/java/clientapi/load/mixin/MixinBlock.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import net.minecraft.world.IBlockAccess;
2828
import net.minecraft.world.World;
2929
import org.spongepowered.asm.mixin.Mixin;
30-
import org.spongepowered.asm.mixin.Shadow;
3130
import org.spongepowered.asm.mixin.injection.At;
3231
import org.spongepowered.asm.mixin.injection.Inject;
3332
import org.spongepowered.asm.mixin.injection.Redirect;
@@ -55,12 +54,11 @@ private void canCollideCheck(IBlockState state, boolean hitIfLiquid, CallbackInf
5554
}
5655

5756
@Inject(method = "addCollisionBoxToList(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/AxisAlignedBB;Ljava/util/List;Lnet/minecraft/entity/Entity;Z)V",
58-
at = @At("HEAD"), cancellable = true)
57+
at = @At("HEAD"))
5958
private void in(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entity, boolean isActualState, CallbackInfo ci) {
6059
Block block = (Block) (Object) (this);
6160
bbEvent = new BoundingBoxEvent(block, pos, block.getCollisionBoundingBox(state, world, pos), collidingBoxes, entity);
6261
ClientAPI.EVENT_BUS.post(bbEvent);
63-
if (bbEvent.isCancelled()) ci.cancel();
6462
}
6563

6664
@Redirect(method = "addCollisionBoxToList(Lnet/minecraft/block/state/IBlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/AxisAlignedBB;Ljava/util/List;Lnet/minecraft/entity/Entity;Z)V",

0 commit comments

Comments
 (0)