I guess no pojavlauncher type shi
This commit is contained in:
@@ -20,17 +20,18 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
@Mixin(AbstractBlock.AbstractBlockState.class)
|
||||
public class NoClipMixin {
|
||||
|
||||
@Inject(method = "getCollisionShape", at = @At("HEAD"), cancellable = true)
|
||||
@Inject(method = "getCollisionShape*", at = @At("HEAD"), cancellable = true)
|
||||
private void szar_noClipBelowTracker(BlockView world, BlockPos pos,
|
||||
CallbackInfoReturnable<VoxelShape> cir) {
|
||||
// Only applies to players — need to check differently without ShapeContext
|
||||
// Use the world to find nearby players at this pos
|
||||
if (!(world instanceof WorldView worldView)) return;
|
||||
ShapeContext ctx, CallbackInfoReturnable<VoxelShape> cir) {
|
||||
// Only applies to players
|
||||
if (!(ctx instanceof EntityShapeContext esc)) return;
|
||||
Entity entity = esc.getEntity();
|
||||
if (!(entity instanceof PlayerEntity)) return;
|
||||
|
||||
// Check 1–5 blocks above for a TrackerBlock
|
||||
// Check 1–5 blocks above this position for a TrackerBlock
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
BlockPos above = pos.up(i);
|
||||
if (worldView.getBlockState(above).getBlock() instanceof TrackerBlock) {
|
||||
if (world.getBlockState(above).getBlock() instanceof TrackerBlock) {
|
||||
cir.setReturnValue(VoxelShapes.empty());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user