Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Reach bugs #3826

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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