34 lines
913 B
Java
34 lines
913 B
Java
package carpet.mixins;
|
|
|
|
import carpet.utils.RandomTools;
|
|
import net.minecraft.entity.projectile.ProjectileEntity;
|
|
import org.spongepowered.asm.mixin.Mixin;
|
|
import org.spongepowered.asm.mixin.injection.At;
|
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
|
|
|
import java.util.Random;
|
|
|
|
@Mixin(ProjectileEntity.class)
|
|
public class ProjectileEntity_extremeMixin
|
|
{
|
|
@Redirect(method = "setVelocity", expect = 3, at = @At(
|
|
value = "INVOKE",
|
|
target = "Ljava/util/Random;nextGaussian()D"
|
|
))
|
|
private double nextGauBian(Random random)
|
|
{
|
|
return RandomTools.nextGauBian(random);
|
|
}
|
|
|
|
// calculates damage
|
|
@Redirect(method = "method_7435", expect = 1, at = @At(
|
|
value = "INVOKE",
|
|
target = "Ljava/util/Random;nextGaussian()D"
|
|
))
|
|
private double nextGauBian2(Random random)
|
|
{
|
|
return RandomTools.nextGauBian(random);
|
|
}
|
|
|
|
}
|