This repository has been archived by the owner on Sep 24, 2024. It is now read-only.
generated from MeteorDevelopment/meteor-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try fix Criticals work on Shulker Bullet
- Loading branch information
Showing
4 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/main/java/nekiplay/meteorplus/mixin/meteorclient/modules/CriticalsMixin.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,35 @@ | ||
package nekiplay.meteorplus.mixin.meteorclient.modules; | ||
|
||
import meteordevelopment.meteorclient.events.packets.PacketEvent; | ||
import meteordevelopment.meteorclient.mixininterface.IPlayerInteractEntityC2SPacket; | ||
import meteordevelopment.meteorclient.systems.modules.Category; | ||
import meteordevelopment.meteorclient.systems.modules.Module; | ||
import meteordevelopment.meteorclient.systems.modules.combat.Criticals; | ||
import net.minecraft.entity.Entity; | ||
import net.minecraft.entity.EntityType; | ||
import net.minecraft.network.packet.c2s.play.PlayerInteractEntityC2SPacket; | ||
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.CallbackInfo; | ||
|
||
import static nekiplay.meteorplus.features.modules.combat.criticals.CriticalsPlus.skipCrit; | ||
|
||
@Mixin(value = Criticals.class, remap = false, priority = 1001) | ||
public class CriticalsMixin extends Module { | ||
public CriticalsMixin(Category category, String name, String description) { | ||
super(category, name, description); | ||
} | ||
|
||
@Inject(method = "onSendPacket", at = @At("HEAD"), cancellable = true) | ||
private void onSendPacket(PacketEvent.Send event, CallbackInfo ci) { | ||
if (event.packet instanceof IPlayerInteractEntityC2SPacket packet && packet.getType() == PlayerInteractEntityC2SPacket.InteractType.ATTACK) { | ||
if (skipCrit()) return; | ||
|
||
Entity entity = packet.getEntity(); | ||
if (entity.getType() == EntityType.SHULKER_BULLET || entity.getType() == EntityType.FIREBALL) { | ||
ci.cancel(); | ||
} | ||
} | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
accessWidener v1 named | ||
|
||
accessible method net/minecraft/entity/passive/AbstractHorseEntity canBreed ()Z | ||
accessible class net/minecraft/network/packet/c2s/play/PlayerInteractEntityC2SPacket$InteractType |
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