|
2 | 2 |
|
3 | 3 | import net.minecraft.client.Minecraft; |
4 | 4 | import net.minecraft.client.player.LocalPlayer; |
5 | | -import net.minecraft.core.BlockPos; |
6 | 5 | import net.minecraft.util.Mth; |
7 | 6 | import net.minecraft.world.entity.vehicle.Boat; |
8 | 7 | import net.minecraft.world.phys.Vec3; |
|
13 | 12 | import org.vivecraft.common.utils.MathUtils; |
14 | 13 |
|
15 | 14 | public class RowTracker extends Tracker { |
16 | | - private static final double TRANSMISSION_EFFICIENCY = 0.9D; |
| 15 | + private static final double TRANSMISSION_EFFICIENCY = 1.0D; |
17 | 16 |
|
18 | 17 | public double[] forces = new double[]{0.0D, 0.0D}; |
19 | 18 | private final Vec3[] lastUWPs = new Vec3[2]; |
@@ -74,15 +73,11 @@ public void doProcess(LocalPlayer player) { |
74 | 73 | inWater = true; |
75 | 74 |
|
76 | 75 | Vec3 attach = this.getAttachmentPoint(paddle, boat); |
77 | | - Vec3 underWaterPoint = attach.add(arm2Pad.normalize()).subtract(boat.position()); |
| 76 | + Vec3 underWaterPoint = attach.add(arm2Pad.normalize()); |
78 | 77 |
|
79 | 78 | if (this.lastUWPs[paddle] != null) { |
80 | 79 | Vector3f forceVector = MathUtils.subtractToVector3f(this.lastUWPs[paddle], |
81 | 80 | underWaterPoint); // intentionally reverse |
82 | | - forceVector = forceVector.sub( |
83 | | - (float) boat.getDeltaMovement().x, |
84 | | - (float) boat.getDeltaMovement().y, |
85 | | - (float) boat.getDeltaMovement().z); |
86 | 81 |
|
87 | 82 | Vector3f forward = boatRot.transform(MathUtils.FORWARD, new Vector3f()); |
88 | 83 |
|
@@ -149,7 +144,7 @@ private Vec3 getAbsArmPos(int side) { |
149 | 144 | private boolean isPaddleUnderWater(int paddle, Boat boat) { |
150 | 145 | Vec3 attachAbs = this.getAttachmentPoint(paddle, boat); |
151 | 146 | Vec3 armToPaddle = this.getArmToPaddleVector(paddle, boat).normalize(); |
152 | | - BlockPos blockPos = new BlockPos(attachAbs.add(armToPaddle)); |
153 | | - return boat.level.getBlockState(blockPos).getMaterial().isLiquid(); |
| 147 | + Vec3 blockPos = attachAbs.add(armToPaddle); |
| 148 | + return blockPos.subtract(boat.position()).y < 0.2F; |
154 | 149 | } |
155 | 150 | } |
0 commit comments