-
-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Labels
Description
when enchanting a regular bow with multishot (not possible in vanilla, only possible with commands) all additional arrows are bundled with the main arrow
this is caused, because we override the yRot in Projectile#shootFromRotation here
VivecraftMod/common/src/main/java/org/vivecraft/mixin/world/entity/projectile/ProjectileMixin.java
Lines 64 to 71 in 88125b0
| @ModifyVariable(method = "shootFromRotation", at = @At("HEAD"), ordinal = 1, argsOnly = true) | |
| private float vivecraft$modifyYRot(float yRot, @Share("dir") LocalRef<Vec3> direction) { | |
| if (direction.get() != null) { | |
| return (float) Math.toDegrees(Math.atan2(-direction.get().x, direction.get().z)); | |
| } else { | |
| return yRot; | |
| } | |
| } |
vanilla adds the offset to the yRot before calling this method, which causes it to break
in BowItem#shootProjectile
projectile.shootFromRotation(shooter, shooter.getXRot(), shooter.getYRot() + angle, ...
so we would need to change the direction in another way for this to work.
AllFiRE0