Skip to content

Commit d456a90

Browse files
committed
fixing the stuff I just broke oops
1 parent fd9dcc6 commit d456a90

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

src/main/java/ace/actually/pirates/blocks/entity/MotionInvokingBlockEntity.java

+15
Original file line numberDiff line numberDiff line change
@@ -202,4 +202,19 @@ private void moveTowards(SeatedControllingPlayer power, LoadedServerShip ship)
202202
private double vdis(double x, double xto) {
203203
return Math.abs(x-xto);
204204
}
205+
206+
private void moveShipForward(LoadedServerShip ship)
207+
{
208+
double mass = ship.getInertiaData().getMass();
209+
Vector3d qdc = ship.getTransform().getShipToWorldRotation().getEulerAnglesZXY(new Vector3d()).mul(mass*100);
210+
qdc = new Vector3d(qdc.x,0,qdc.z);
211+
//qdc = qdc.rotateY(-Math.PI);
212+
GameTickForceApplier gtfa = ship.getAttachment(GameTickForceApplier.class);
213+
if(gtfa!=null)
214+
{
215+
Vector3d loc = new Vector3d(pos.getX()-1,pos.getY()+0.3,pos.getZ()-1).sub(ship.getTransform().getPositionInShip());
216+
gtfa.applyInvariantForceToPos(qdc,loc);
217+
//gtfa.applyInvariantForce(qdc);
218+
}
219+
}
205220
}

src/main/java/ace/actually/pirates/util/PatternProcessor.java

+3-19
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,14 @@ public static void setupBasicPatterns()
6565
}
6666
}
6767

68-
/**
69-
* @deprecated ship patterns are planned for removal, will be replaced with proper ship ai
70-
**/
71-
@Deprecated
72-
private void moveShipForward(LoadedServerShip ship, MotionInvokingBlockEntity be)
73-
{
74-
double mass = ship.getInertiaData().getMass();
75-
Vector3d qdc = ship.getTransform().getShipToWorldRotation().getEulerAnglesZXY(new Vector3d()).mul(mass*100);
76-
qdc = new Vector3d(qdc.x,0,qdc.z);
77-
//qdc = qdc.rotateY(-Math.PI);
78-
GameTickForceApplier gtfa = ship.getAttachment(GameTickForceApplier.class);
79-
if(gtfa!=null)
80-
{
81-
Vector3d loc = new Vector3d(be.getPos().getX()-1,be.getPos().getY()+0.3,be.getPos().getZ()-1).sub(ship.getTransform().getPositionInShip());
82-
gtfa.applyInvariantForceToPos(qdc,loc);
83-
//gtfa.applyInvariantForce(qdc);
84-
}
85-
}
68+
69+
8670

8771
/**
8872
* @deprecated ship patterns are planned for removal, will be replaced with proper ship ai
8973
**/
9074
@Deprecated
91-
private void utiliseInternalPattern(SeatedControllingPlayer seatedControllingPlayer, MotionInvokingBlockEntity be) {
75+
public static void utiliseInternalPattern(SeatedControllingPlayer seatedControllingPlayer, MotionInvokingBlockEntity be) {
9276
String[] instruction = be.getInstructions().getString(0).split(" ");
9377

9478
if (seatedControllingPlayer == null) return;

0 commit comments

Comments
 (0)