FINNALY WORKS (no clipping under tracker block in pojav launcher too)
This commit is contained in:
@@ -6,7 +6,7 @@ minecraft_version=1.20.1
|
|||||||
yarn_mappings=1.20.1+build.10
|
yarn_mappings=1.20.1+build.10
|
||||||
loader_version=0.18.3
|
loader_version=0.18.3
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version=26.3.17.3
|
mod_version=26.3.17.4
|
||||||
maven_group=dev.tggamesyt
|
maven_group=dev.tggamesyt
|
||||||
archives_base_name=szar
|
archives_base_name=szar
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|||||||
@@ -20,15 +20,16 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||||||
@Mixin(AbstractBlock.AbstractBlockState.class)
|
@Mixin(AbstractBlock.AbstractBlockState.class)
|
||||||
public class NoClipMixin {
|
public class NoClipMixin {
|
||||||
|
|
||||||
@Inject(method = "getCollisionShape*", at = @At("HEAD"), cancellable = true)
|
@Inject(
|
||||||
|
method = "getCollisionShape(Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/ShapeContext;)Lnet/minecraft/util/shape/VoxelShape;",
|
||||||
|
at = @At("HEAD"), cancellable = true
|
||||||
|
)
|
||||||
private void szar_noClipBelowTracker(BlockView world, BlockPos pos,
|
private void szar_noClipBelowTracker(BlockView world, BlockPos pos,
|
||||||
ShapeContext ctx, CallbackInfoReturnable<VoxelShape> cir) {
|
ShapeContext ctx,
|
||||||
// Only applies to players
|
CallbackInfoReturnable<VoxelShape> cir) {
|
||||||
if (!(ctx instanceof EntityShapeContext esc)) return;
|
if (!(ctx instanceof EntityShapeContext esc)) return;
|
||||||
Entity entity = esc.getEntity();
|
if (!(esc.getEntity() instanceof PlayerEntity)) return;
|
||||||
if (!(entity instanceof PlayerEntity)) return;
|
|
||||||
|
|
||||||
// Check 1–5 blocks above this position for a TrackerBlock
|
|
||||||
for (int i = 1; i <= 5; i++) {
|
for (int i = 1; i <= 5; i++) {
|
||||||
BlockPos above = pos.up(i);
|
BlockPos above = pos.up(i);
|
||||||
if (world.getBlockState(above).getBlock() instanceof TrackerBlock) {
|
if (world.getBlockState(above).getBlock() instanceof TrackerBlock) {
|
||||||
|
|||||||
Reference in New Issue
Block a user