Skip to content

Commit

Permalink
Fix Reach not working in creative (MeteorDevelopment#3826)
Browse files Browse the repository at this point in the history
  • Loading branch information
hexadecimal233 authored Jul 12, 2023
1 parent 9a36f0a commit 5e29429
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ private void onGetReachDistance(CallbackInfoReturnable<Float> info) {
info.setReturnValue(Modules.get().get(Reach.class).blockReach());
}

@Inject(method = "hasExtendedReach", at = @At("HEAD"), cancellable = true)
private void onHasExtendedReach(CallbackInfoReturnable<Boolean> info) {
if (Modules.get().isActive(Reach.class)) info.setReturnValue(false);
}

@Redirect(method = "updateBlockBreakingProgress", at = @At(value = "FIELD", target = "Lnet/minecraft/client/network/ClientPlayerInteractionManager;blockBreakingCooldown:I", opcode = Opcodes.PUTFIELD, ordinal = 1))
private void creativeBreakDelayChange(ClientPlayerInteractionManager interactionManager, int value) {
BlockBreakingCooldownEvent event = MeteorClient.EVENT_BUS.post(BlockBreakingCooldownEvent.get(value));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

@Mixin(AbstractBlockRenderContext.class)
public class AbstractBlockRenderContextMixin {
@Final
@Shadow
protected BlockRenderInfo blockInfo;
@Final @Shadow(remap = false) protected BlockRenderInfo blockInfo;

@Inject(method = "renderQuad", at = @At(value = "INVOKE", target = "Lnet/fabricmc/fabric/impl/client/indigo/renderer/render/AbstractBlockRenderContext;bufferQuad(Lnet/fabricmc/fabric/impl/client/indigo/renderer/mesh/MutableQuadViewImpl;Lnet/minecraft/client/render/VertexConsumer;)V"), cancellable = true)
private void onBufferQuad(MutableQuadViewImpl quad, boolean isVanilla, CallbackInfo ci) {
Expand Down

0 comments on commit 5e29429

Please sign in to comment.