project: Mixins

This commit is contained in:
Owain van Brakel
2022-02-09 15:22:23 +01:00
parent 4e08e411d4
commit 172c9d94ce
7 changed files with 68 additions and 28 deletions

View File

@@ -86,7 +86,7 @@ public class DynamicObject extends Renderable {
}
if (var8 && this.sequenceDefinition.frameCount != -1) { // L: 38
if (!this.sequenceDefinition.method3600()) { // L: 39
if (!this.sequenceDefinition.isCachedModelIdSet()) { // L: 39
this.frame = (int)(Math.random() * (double)this.sequenceDefinition.frameIds.length); // L: 40
this.cycleStart -= (int)(Math.random() * (double)this.sequenceDefinition.frameLengths[this.frame]); // L: 41
} else {
@@ -111,7 +111,7 @@ public class DynamicObject extends Renderable {
var1 = 100;
}
if (this.sequenceDefinition.method3600()) { // L: 54
if (this.sequenceDefinition.isCachedModelIdSet()) { // L: 54
var2 = this.sequenceDefinition.method3637(); // L: 68
this.frame += var1; // L: 69
var1 = 0; // L: 70

View File

@@ -94,7 +94,7 @@ public class GraphicsObject extends Renderable {
final void advance(int var1) {
if (!this.isFinished) { // L: 36
this.frameCycle += var1; // L: 37
if (!this.sequenceDefinition.method3600()) {
if (!this.sequenceDefinition.isCachedModelIdSet()) {
while (this.frameCycle > this.sequenceDefinition.frameLengths[this.frame]) {
this.frameCycle -= this.sequenceDefinition.frameLengths[this.frame];
++this.frame;

View File

@@ -227,7 +227,7 @@ public final class Projectile extends Renderable {
this.yaw = (int)(Math.atan2(this.speedX, this.speedY) * 325.949D) + 1024 & 2047; // L: 76
this.pitch = (int)(Math.atan2(this.speedZ, this.speed) * 325.949D) & 2047; // L: 77
if (this.sequenceDefinition != null) { // L: 78
if (!this.sequenceDefinition.method3600()) { // L: 79
if (!this.sequenceDefinition.isCachedModelIdSet()) { // L: 79
this.frameCycle += var1; // L: 80
while (true) {

View File

@@ -45,7 +45,8 @@ public class SequenceDefinition extends DualNode {
@ObfuscatedGetter(
intValue = 36227189
)
int field2091;
@Export("SequenceDefinition_cachedModelId")
int SequenceDefinition_cachedModelId;
@ObfuscatedName("v")
public Map field2092;
@ObfuscatedName("a")
@@ -128,7 +129,7 @@ public class SequenceDefinition extends DualNode {
}
SequenceDefinition() {
this.field2091 = -1; // L: 23
this.SequenceDefinition_cachedModelId = -1; // L: 23
this.field2097 = 0; // L: 25
this.field2094 = 0; // L: 26
this.frameCount = -1;
@@ -231,7 +232,7 @@ public class SequenceDefinition extends DualNode {
this.soundEffects[var4] = var1.readMedium();
}
} else if (var2 == 14) { // L: 105
this.field2091 = var1.readInt(); // L: 106
this.SequenceDefinition_cachedModelId = var1.readInt(); // L: 106
} else if (var2 == 15) { // L: 108
var3 = var1.readUnsignedShort(); // L: 109
this.field2092 = new HashMap(); // L: 110
@@ -293,7 +294,7 @@ public class SequenceDefinition extends DualNode {
@Export("transformActorModel")
public Model transformActorModel(Model var1, int var2) {
Model var4;
if (!this.method3600()) { // L: 146
if (!this.isCachedModelIdSet()) { // L: 146
var2 = this.frameIds[var2]; // L: 147
Frames var5 = MouseHandler.getFrames(var2 >> 16); // L: 148
var2 &= 65535; // L: 149
@@ -305,7 +306,7 @@ public class SequenceDefinition extends DualNode {
return var4; // L: 153
}
} else {
class120 var3 = WorldMapSectionType.method4724(this.field2091); // L: 156
class120 var3 = WorldMapSectionType.method4724(this.SequenceDefinition_cachedModelId); // L: 156
if (var3 == null) { // L: 157
return var1.toSharedSequenceModel(true);
} else {
@@ -324,7 +325,7 @@ public class SequenceDefinition extends DualNode {
@Export("transformObjectModel")
Model transformObjectModel(Model var1, int var2, int var3) {
Model var5;
if (!this.method3600()) { // L: 165
if (!this.isCachedModelIdSet()) { // L: 165
var2 = this.frameIds[var2]; // L: 166
Frames var6 = MouseHandler.getFrames(var2 >> 16); // L: 167
var2 &= 65535; // L: 168
@@ -353,7 +354,7 @@ public class SequenceDefinition extends DualNode {
return var5; // L: 179
}
} else {
class120 var4 = WorldMapSectionType.method4724(this.field2091); // L: 182
class120 var4 = WorldMapSectionType.method4724(this.SequenceDefinition_cachedModelId); // L: 182
if (var4 == null) { // L: 183
return var1.toSharedSequenceModel(true);
} else {
@@ -389,7 +390,7 @@ public class SequenceDefinition extends DualNode {
@Export("transformSpotAnimationModel")
Model transformSpotAnimationModel(Model var1, int var2) {
Model var4;
if (!this.method3600()) { // L: 198
if (!this.isCachedModelIdSet()) { // L: 198
var2 = this.frameIds[var2]; // L: 199
Frames var5 = MouseHandler.getFrames(var2 >> 16); // L: 200
var2 &= 65535; // L: 201
@@ -401,7 +402,7 @@ public class SequenceDefinition extends DualNode {
return var4; // L: 205
}
} else {
class120 var3 = WorldMapSectionType.method4724(this.field2091); // L: 208
class120 var3 = WorldMapSectionType.method4724(this.SequenceDefinition_cachedModelId); // L: 208
if (var3 == null) { // L: 209
return var1.toSharedSpotAnimationModel(true);
} else {
@@ -419,16 +420,16 @@ public class SequenceDefinition extends DualNode {
)
@Export("applyTransformations")
public Model applyTransformations(Model var1, int var2, SequenceDefinition var3, int var4) {
if (field2105 && !this.method3600() && !var3.method3600()) { // L: 217
if (field2105 && !this.isCachedModelIdSet() && !var3.isCachedModelIdSet()) { // L: 217
return this.method3598(var1, var2, var3, var4); // L: 218
} else {
Model var5 = var1.toSharedSequenceModel(false); // L: 220
boolean var6 = false; // L: 221
Frames var7 = null; // L: 222
class120 var8;
if (this.method3600()) { // L: 223
if (this.isCachedModelIdSet()) { // L: 223
var8 = this.method3602(); // L: 224
if (var3.method3600() && this.field2101 == null) { // L: 225
if (var3.isCachedModelIdSet() && this.field2101 == null) { // L: 225
var5.method4140(var8, var2); // L: 226
return var5; // L: 227
}
@@ -442,7 +443,7 @@ public class SequenceDefinition extends DualNode {
return var3.transformActorModel(var1, var4);
}
if (!var3.method3600() && (this.field2100 == null || var4 == -1)) { // L: 236
if (!var3.isCachedModelIdSet() && (this.field2100 == null || var4 == -1)) { // L: 236
var5.animate(var7, var2); // L: 237
return var5; // L: 238
}
@@ -452,13 +453,13 @@ public class SequenceDefinition extends DualNode {
return var5; // L: 242
}
var6 = var3.method3600(); // L: 244
var6 = var3.isCachedModelIdSet(); // L: 244
if (!var6) { // L: 245
var5.method4145(var7, var2, this.field2100, false); // L: 246
}
}
if (var3.method3600()) { // L: 249
if (var3.isCachedModelIdSet()) { // L: 249
var8 = var3.method3602(); // L: 250
var5.method4139(var8, var4, this.field2101, true); // L: 251
} else {
@@ -516,7 +517,7 @@ public class SequenceDefinition extends DualNode {
)
@Export("transformWidgetModel")
public Model transformWidgetModel(Model var1, int var2) {
if (!this.method3600()) { // L: 286
if (!this.isCachedModelIdSet()) { // L: 286
int var3 = this.frameIds[var2]; // L: 287
Frames var4 = MouseHandler.getFrames(var3 >> 16); // L: 288
var3 &= 65535; // L: 289
@@ -553,8 +554,9 @@ public class SequenceDefinition extends DualNode {
descriptor = "(I)Z",
garbageValue = "-2140209014"
)
public boolean method3600() {
return this.field2091 >= 0; // L: 314
@Export("isCachedModelIdSet")
public boolean isCachedModelIdSet() {
return this.SequenceDefinition_cachedModelId >= 0; // L: 314
}
@ObfuscatedName("h")
@@ -572,7 +574,7 @@ public class SequenceDefinition extends DualNode {
garbageValue = "-1955299057"
)
public class120 method3602() {
return this.method3600() ? WorldMapSectionType.method4724(this.field2091) : null; // L: 359 360 363
return this.isCachedModelIdSet() ? WorldMapSectionType.method4724(this.SequenceDefinition_cachedModelId) : null; // L: 359 360 363
}
@ObfuscatedName("c")

View File

@@ -81,7 +81,7 @@ public class class293 {
if (var0.movementSequence != -1) { // L: 3999
var1 = class78.SequenceDefinition_get(var0.movementSequence); // L: 4000
if (var1 != null) { // L: 4001
if (!var1.method3600() && var1.frameIds != null) { // L: 4002
if (!var1.isCachedModelIdSet() && var1.frameIds != null) { // L: 4002
++var0.movementFrameCycle; // L: 4003
if (var0.movementFrame < var1.frameIds.length && var0.movementFrameCycle > var1.frameLengths[var0.movementFrame]) { // L: 4004
var0.movementFrameCycle = 1; // L: 4005
@@ -94,7 +94,7 @@ public class class293 {
var0.movementFrame = 0; // L: 4011
Projectile.method1958(var1, var0.movementFrame, var0.x, var0.y); // L: 4012
}
} else if (var1.method3600()) { // L: 4015
} else if (var1.isCachedModelIdSet()) { // L: 4015
++var0.movementFrame; // L: 4016
var2 = var1.method3637(); // L: 4017
if (var0.movementFrame < var2) { // L: 4018
@@ -131,7 +131,7 @@ public class class293 {
if (var0.spotAnimationFrame >= var5.frameIds.length && (var0.spotAnimationFrame < 0 || var0.spotAnimationFrame >= var5.frameIds.length)) { // L: 4043 4044
var0.spotAnimation = -1;
}
} else if (var5.method3600()) { // L: 4047
} else if (var5.isCachedModelIdSet()) { // L: 4047
++var0.spotAnimationFrame; // L: 4048
int var3 = var5.method3637(); // L: 4049
if (var0.spotAnimationFrame < var3) { // L: 4050
@@ -158,7 +158,7 @@ public class class293 {
if (var0.sequence != -1 && var0.sequenceDelay == 0) { // L: 4070
var1 = class78.SequenceDefinition_get(var0.sequence); // L: 4071
if (var1 != null) { // L: 4072
if (!var1.method3600() && var1.frameIds != null) { // L: 4073
if (!var1.isCachedModelIdSet() && var1.frameIds != null) { // L: 4073
++var0.sequenceFrameCycle; // L: 4074
if (var0.sequenceFrame < var1.frameIds.length && var0.sequenceFrameCycle > var1.frameLengths[var0.sequenceFrame]) { // L: 4075
var0.sequenceFrameCycle = 1; // L: 4076
@@ -179,7 +179,7 @@ public class class293 {
}
var0.isWalking = var1.field2102; // L: 4087
} else if (var1.method3600()) { // L: 4089
} else if (var1.isCachedModelIdSet()) { // L: 4089
++var0.sequenceFrame; // L: 4090
var2 = var1.method3602().method2693(); // L: 4091
if (var0.sequenceFrame < var2) { // L: 4092