forked from Sk1erLLC/Patcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
closes Sk1erLLC#149
- Loading branch information
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
src/main/java/club/sk1er/patcher/mixins/features/cropheight/BlockCactusMixin_CropHitbox.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package club.sk1er.patcher.mixins.features.cropheight; | ||
|
||
import club.sk1er.patcher.config.PatcherConfig; | ||
import club.sk1er.patcher.hooks.CropUtilities; | ||
import net.minecraft.block.BlockCactus; | ||
import net.minecraft.util.AxisAlignedBB; | ||
import net.minecraft.util.BlockPos; | ||
import net.minecraft.util.MovingObjectPosition; | ||
import net.minecraft.util.Vec3; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(BlockCactus.class) | ||
public class BlockCactusMixin_CropHitbox extends BlockMixin_CropHitbox { | ||
//#if MC==10809 | ||
@Inject(method = "getSelectedBoundingBox", at = @At("HEAD")) | ||
public void patcher$getSelectedBoundingBox(World worldIn, BlockPos pos, CallbackInfoReturnable<AxisAlignedBB> cir) { | ||
if (PatcherConfig.futureHitBoxes) { | ||
CropUtilities.updateCactusBox(worldIn.getBlockState(pos).getBlock()); | ||
} | ||
} | ||
|
||
@Override | ||
public void collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end, CallbackInfoReturnable<MovingObjectPosition> cir) { | ||
if (PatcherConfig.futureHitBoxes) { | ||
CropUtilities.updateCactusBox(worldIn.getBlockState(pos).getBlock()); | ||
} | ||
} | ||
//#endif | ||
} |
19 changes: 19 additions & 0 deletions
19
src/main/java/club/sk1er/patcher/mixins/features/cropheight/BlockMixin_CropHitbox.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package club.sk1er.patcher.mixins.features.cropheight; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.util.BlockPos; | ||
import net.minecraft.util.MovingObjectPosition; | ||
import net.minecraft.util.Vec3; | ||
import net.minecraft.world.World; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
@Mixin(Block.class) | ||
public class BlockMixin_CropHitbox { | ||
@Inject(method = "collisionRayTrace", at = @At("HEAD")) | ||
public void collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end, CallbackInfoReturnable<MovingObjectPosition> cir) { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters