mirror of
https://github.com/revanced/ARSCLib.git
synced 2025-04-30 22:34:24 +02:00
fix -ve type ids
This commit is contained in:
parent
54576ea91f
commit
33817b36d8
@ -171,7 +171,7 @@ public class SpecTypePairArray extends BlockArray<SpecTypePair>
|
||||
}
|
||||
return results;
|
||||
}
|
||||
public byte getSmallestTypeId(){
|
||||
public int getSmallestTypeId(){
|
||||
SpecTypePair[] childes=getChildes();
|
||||
if(childes==null){
|
||||
return 0;
|
||||
@ -183,7 +183,7 @@ public class SpecTypePairArray extends BlockArray<SpecTypePair>
|
||||
if(pair==null){
|
||||
continue;
|
||||
}
|
||||
int id=pair.getTypeId();
|
||||
int id=pair.getTypeIdInt();
|
||||
if(!firstFound){
|
||||
result=id;
|
||||
}
|
||||
@ -192,30 +192,25 @@ public class SpecTypePairArray extends BlockArray<SpecTypePair>
|
||||
result=id;
|
||||
}
|
||||
}
|
||||
return (byte) result;
|
||||
return result;
|
||||
}
|
||||
public byte getHighestTypeId(){
|
||||
public int getHighestTypeId(){
|
||||
SpecTypePair[] childes=getChildes();
|
||||
if(childes==null){
|
||||
return 0;
|
||||
}
|
||||
int result=0;
|
||||
boolean firstFound=false;
|
||||
for (int i=0;i<childes.length;i++){
|
||||
SpecTypePair pair=childes[i];
|
||||
if(pair==null){
|
||||
continue;
|
||||
}
|
||||
int id=pair.getTypeId();
|
||||
if(!firstFound){
|
||||
result=id;
|
||||
}
|
||||
firstFound=true;
|
||||
if(id<result){
|
||||
int id=pair.getTypeIdInt();
|
||||
if(id>result){
|
||||
result=id;
|
||||
}
|
||||
}
|
||||
return (byte) result;
|
||||
return result;
|
||||
}
|
||||
@Override
|
||||
public JSONArray toJson() {
|
||||
|
@ -84,6 +84,9 @@ public class SpecTypePair extends BlockContainer<Block>
|
||||
public byte getTypeId(){
|
||||
return mSpecBlock.getTypeId();
|
||||
}
|
||||
public int getTypeIdInt(){
|
||||
return mSpecBlock.getTypeIdInt();
|
||||
}
|
||||
public void setTypeId(byte id){
|
||||
mSpecBlock.setTypeId(id);
|
||||
mTypeBlockArray.setTypeId(id);
|
||||
@ -201,7 +204,7 @@ public class SpecTypePair extends BlockContainer<Block>
|
||||
}
|
||||
@Override
|
||||
public int compareTo(SpecTypePair specTypePair) {
|
||||
return Integer.compare(getTypeId(), specTypePair.getTypeId());
|
||||
return Integer.compare(getTypeIdInt(), specTypePair.getTypeIdInt());
|
||||
}
|
||||
@Override
|
||||
public String toString(){
|
||||
|
Loading…
x
Reference in New Issue
Block a user