mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-30 17:06:56 +01:00
Allow block breakers to work at center of bearing
This commit is contained in:
parent
0aaa09260b
commit
55abcde5d5
1 changed files with 4 additions and 2 deletions
|
@ -34,6 +34,7 @@ public class ControlledContraptionEntity extends AbstractContraptionEntity {
|
||||||
protected Axis rotationAxis;
|
protected Axis rotationAxis;
|
||||||
protected float prevAngle;
|
protected float prevAngle;
|
||||||
protected float angle;
|
protected float angle;
|
||||||
|
protected float angleDelta;
|
||||||
|
|
||||||
public ControlledContraptionEntity(EntityType<?> type, World world) {
|
public ControlledContraptionEntity(EntityType<?> type, World world) {
|
||||||
super(type, world);
|
super(type, world);
|
||||||
|
@ -130,6 +131,7 @@ public class ControlledContraptionEntity extends AbstractContraptionEntity {
|
||||||
public void setPositionAndRotationDirect(double x, double y, double z, float yw, float pt, int inc, boolean t) {}
|
public void setPositionAndRotationDirect(double x, double y, double z, float yw, float pt, int inc, boolean t) {}
|
||||||
|
|
||||||
protected void tickContraption() {
|
protected void tickContraption() {
|
||||||
|
angleDelta = angle - prevAngle;
|
||||||
prevAngle = angle;
|
prevAngle = angle;
|
||||||
tickActors();
|
tickActors();
|
||||||
|
|
||||||
|
@ -171,7 +173,7 @@ public class ControlledContraptionEntity extends AbstractContraptionEntity {
|
||||||
return false;
|
return false;
|
||||||
if (!VecHelper.onSameAxis(blockInfo.pos, BlockPos.ZERO, facing.getAxis()))
|
if (!VecHelper.onSameAxis(blockInfo.pos, BlockPos.ZERO, facing.getAxis()))
|
||||||
return false;
|
return false;
|
||||||
context.motion = Vector3d.of(facing.getDirectionVec()).scale(angle - prevAngle);
|
context.motion = Vector3d.of(facing.getDirectionVec()).scale(angleDelta / 360.0);
|
||||||
context.relativeMotion = context.motion;
|
context.relativeMotion = context.motion;
|
||||||
int timer = context.data.getInt("StationaryTimer");
|
int timer = context.data.getInt("StationaryTimer");
|
||||||
if (timer > 0) {
|
if (timer > 0) {
|
||||||
|
|
Loading…
Reference in a new issue