|
1 | 1 | --- a/jp/ngt/rtm/entity/train/EntityBogie.java
|
2 | 2 | +++ b/jp/ngt/rtm/entity/train/EntityBogie.java
|
3 |
| -@@ -126,11 +126,11 @@ |
| 3 | +@@ -44,10 +44,11 @@ |
| 4 | + private TileEntityLargeRailCore currentRailObj; |
| 5 | + private RailMap currentRailMap; |
| 6 | + private final double[] posBuf = new double[3]; |
| 7 | + private final float[] rotationBuf = new float[4]; |
| 8 | + private int split = -1; |
| 9 | ++ private static final int SPLITS_PER_METER = 360; //(Minimum Speed[km/h] / 3.6 / 20[tick])^-1 e.g. (0.2/3.6/20)^-1 = 360 |
| 10 | + private int prevPosIndex; |
| 11 | + private float jointDelay; |
| 12 | + private boolean reverbSound; |
| 13 | + private int jointIndex; |
| 14 | + private int existCount; |
| 15 | +@@ -126,11 +127,11 @@ |
4 | 16 | return BogieController.MotionState.FLY;
|
5 | 17 | } else {
|
6 | 18 | RailMap railmap = this.currentRailMap;
|
7 | 19 | int i = 0;
|
8 | 20 | if (frontBogie != null && this.prevPosIndex != -1) {
|
9 | 21 | - int j = (int)((speed + 0.25F) * 32.0F);
|
10 |
| -+ int j = (int)((Math.abs(speed) + 0.25F) * 32.0F); |
| 22 | ++ int j = (int)((Math.abs(speed) + 0.25F) * SPLITS_PER_METER); |
11 | 23 | int k = this.prevPosIndex - j;
|
12 | 24 | int l = this.prevPosIndex + j;
|
13 | 25 | int i1 = k < 0 ? 0 : k;
|
14 | 26 | int j1 = l > this.split ? this.split : l;
|
15 | 27 | double[] adouble = frontBogie.getPosBuf();
|
16 |
| -@@ -171,11 +171,11 @@ |
| 28 | +@@ -171,11 +172,11 @@ |
17 | 29 | this.rotationBuf[0] = f2;
|
18 | 30 | this.rotationBuf[1] = f3;
|
19 | 31 | this.rotationBuf[2] = f1;
|
|
26 | 38 | }
|
27 | 39 | }
|
28 | 40 |
|
29 |
| -@@ -196,18 +196,20 @@ |
| 41 | +@@ -196,19 +197,21 @@ |
30 | 42 | TileEntityLargeRailCore tileentitylargerailcore = this.getRail(px, py, pz);
|
31 | 43 | if (tileentitylargerailcore == null) {
|
32 | 44 | return false;
|
|
43 | 55 | + railMap = tileentitylargerailcore.getRailMap(this);
|
44 | 56 | }
|
45 | 57 |
|
| 58 | +- this.split = (int)(this.currentRailMap.getLength() * 32.0D); |
46 | 59 | + this.currentRailObj = tileentitylargerailcore;
|
47 | 60 | + this.currentRailMap = railMap;
|
48 |
| - this.split = (int)(this.currentRailMap.getLength() * 32.0D); |
| 61 | ++ this.split = (int)(this.currentRailMap.getLength() * SPLITS_PER_METER); |
49 | 62 | this.prevPosIndex = -1;
|
50 | 63 | this.onChangeRail(tileentitylargerailcore);
|
51 | 64 | }
|
52 | 65 |
|
53 |
| -@@ -227,14 +229,17 @@ |
| 66 | + return true; |
| 67 | +@@ -227,14 +230,17 @@ |
54 | 68 | return null;
|
55 | 69 | }
|
56 | 70 |
|
|
72 | 86 | }
|
73 | 87 |
|
74 | 88 | protected boolean reverseJointArray() {
|
75 |
| -@@ -245,13 +250,13 @@ |
| 89 | +@@ -245,13 +251,13 @@ |
76 | 90 |
|
77 | 91 | protected void playJointSound() {
|
78 | 92 | EntityTrainBase entitytrainbase = this.getTrain();
|
|
88 | 102 | int j = this.reverseJointArray() ? i - this.jointIndex - 1 : this.jointIndex;
|
89 | 103 | ++this.jointIndex;
|
90 | 104 | int k = this.reverseJointArray() ? i - this.jointIndex - 1 : this.jointIndex;
|
91 |
| -@@ -287,14 +292,23 @@ |
| 105 | +@@ -287,14 +293,23 @@ |
92 | 106 |
|
93 | 107 | public final void onUpdate() {
|
94 | 108 | if (!this.world.isRemote && !this.tracked) {
|
|
112 | 126 | }
|
113 | 127 |
|
114 | 128 | public void onBogieUpdate() {
|
115 |
| -@@ -309,11 +323,11 @@ |
| 129 | +@@ -309,11 +324,11 @@ |
116 | 130 |
|
117 | 131 | }
|
118 | 132 |
|
|
125 | 139 |
|
126 | 140 | }
|
127 | 141 |
|
128 |
| -@@ -491,10 +505,14 @@ |
| 142 | +@@ -349,13 +364,14 @@ |
| 143 | + |
| 144 | + public boolean attackEntityFrom(DamageSource par1, float par2) { |
| 145 | + if (this.getTrain() != null && !this.getTrain().isDead) { |
| 146 | + return this.getTrain().attackEntityFrom(par1, par2); |
| 147 | + } else { |
| 148 | +- if (!this.world.isRemote) { |
| 149 | ++ /*if (!this.world.isRemote) { |
| 150 | + this.setDead(); |
| 151 | +- } |
| 152 | ++ }*/ |
| 153 | ++ this.setDead(); |
| 154 | + |
| 155 | + return true; |
| 156 | + } |
| 157 | + } |
| 158 | + |
| 159 | +@@ -491,10 +507,14 @@ |
129 | 160 | public void addVelocity(double par1, double par3, double par5) {
|
130 | 161 | }
|
131 | 162 |
|
|
140 | 171 | }
|
141 | 172 | } else if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() == RTMItem.paddle) {
|
142 | 173 | return true;
|
143 |
| -@@ -578,6 +596,18 @@ |
| 174 | +@@ -578,6 +598,18 @@ |
144 | 175 | }
|
145 | 176 |
|
146 | 177 | public int getProhibitedAction() {
|
|
0 commit comments