Skip to content

Commit

Permalink
Partial fix for #45, #48
Browse files Browse the repository at this point in the history
  • Loading branch information
Thelnfamous1 committed Feb 10, 2024
1 parent 7d119ae commit aa8cde4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,10 @@ dependencies {
runtimeOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}")
compileOnly fg.deobf("top.theillusivec4.curios:curios-forge:${curios_version}:api")


compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}"))
implementation(jarJar("io.github.llamalad7:mixinextras-forge:${mixinextras_version}")) {
jarJar.ranged(it, "[${mixinextras_version},)")
}

// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
// http://www.gradle.org/docs/current/userguide/dependency_management.html
Expand Down
3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ geckolib_version=3.1.39
curios_version=1.19.2-5.1.1.0
mappings_channel=official
mappings_version=1.19.2
modid=dungeons_libraries
modid=dungeons_libraries
mixinextras_version=0.3.5
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.infamous.dungeons_libraries.mixin;

import com.infamous.dungeons_libraries.utils.RangedAttackHelper;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.projectile.AbstractArrow;
Expand All @@ -13,16 +15,15 @@
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.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;

@Mixin(BowItem.class)
public abstract class BowItemMixin {

@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/BowItem;getPowerForTime(I)F"),
@WrapOperation(at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/BowItem;getPowerForTime(I)F"),
method = "releaseUsing")
private float libraries_releaseUsing_getPowerForTime(int useTime, ItemStack itemStack, Level level, LivingEntity livingEntity, int useTimeRemaining) {
private float libraries_releaseUsing_getPowerForTime(int useTime, Operation<Float> original, ItemStack itemStack, Level level, LivingEntity livingEntity, int useTimeRemaining) {
return RangedAttackHelper.getBowArrowVelocity(livingEntity, itemStack, useTime);
}

Expand Down

0 comments on commit aa8cde4

Please sign in to comment.