-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extended reach when holding crab claw(hope it works)
- Loading branch information
Showing
3 changed files
with
29 additions
and
1 deletion.
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
27 changes: 27 additions & 0 deletions
27
src/client/java/dev/hybridlabs/aquatic/mixin/client/ClientPlayerInteractionManagerMixin.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,27 @@ | ||
package dev.hybridlabs.aquatic.mixin.client; | ||
|
||
import com.llamalad7.mixinextras.injector.ModifyReturnValue; | ||
import dev.hybridlabs.aquatic.item.HybridAquaticItems; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.network.ClientPlayerInteractionManager; | ||
import net.minecraft.item.ItemStack; | ||
import org.spongepowered.asm.mixin.Final; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.Shadow; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
|
||
@Mixin(ClientPlayerInteractionManager.class) | ||
public class ClientPlayerInteractionManagerMixin { | ||
@Shadow @Final private MinecraftClient client; | ||
|
||
@ModifyReturnValue( | ||
method = "hasExtendedReach", | ||
at = @At("RETURN") | ||
) | ||
private boolean extendedReachWithCrabClaw(boolean original) { | ||
if(client.player == null) return original; | ||
|
||
ItemStack offhandItem = client.player.getOffHandStack(); | ||
return original || (!offhandItem.isEmpty() & offhandItem.getItem().equals(HybridAquaticItems.INSTANCE.getCRAB_CLAW())); | ||
} | ||
} |
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