-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RocketMan - Added riptide charge time bypass.
- Loading branch information
Showing
3 changed files
with
39 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package dev.stardust.mixin; | ||
|
||
import net.minecraft.item.Item; | ||
import net.minecraft.world.World; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.TridentItem; | ||
import dev.stardust.modules.RocketMan; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import net.minecraft.entity.LivingEntity; | ||
import com.llamalad7.mixinextras.sugar.Local; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import com.llamalad7.mixinextras.sugar.ref.LocalIntRef; | ||
import meteordevelopment.meteorclient.systems.modules.Modules; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
|
||
/** | ||
* @author Tas [0xTas] <[email protected]> | ||
**/ | ||
@Mixin(TridentItem.class) | ||
public abstract class TridentItemMixin extends Item { | ||
public TridentItemMixin(Settings settings) { | ||
super(settings); | ||
} | ||
|
||
// See RocketMan.java | ||
@Inject(method = "onStoppedUsing", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/TridentItem;getMaxUseTime(Lnet/minecraft/item/ItemStack;)I", shift = At.Shift.AFTER)) | ||
private void bypassTridentChargeTime(ItemStack stack, World world, LivingEntity user, int remainingUseTicks, CallbackInfo ci, @Local(ordinal = 0)LocalIntRef i) { | ||
RocketMan rm = Modules.get().get(RocketMan.class); | ||
if (!rm.isActive() || !rm.tridentBoost.get()) return; | ||
i.set(69420); | ||
} | ||
} |
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