mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2025-12-15 08:25:21 +01:00
TSJ and TSV parsing (#1962)
* Deserialization support for tsv files * Benchmarking * Apparently moving the setter out of the lambda fixed the setAccessible issue * Thread it * Use AllArgsConstructor instead of field reflection * Clean up AllArgsConstructor TSV deserialization * Refactor TsvUtils * Remove AllArgsConstructors from Excels * Set field accessible * [WIP] TSJ improvements * [WIP] More TSV stuff * [WIP] More TSV stuff * Working TSV parser (slow) * Load Excels in TSJ > JSON > TSV priority
This commit is contained in:
@@ -1,19 +1,18 @@
|
||||
package emu.grasscutter.game.props.ItemUseAction;
|
||||
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
import lombok.Getter;
|
||||
|
||||
public class ItemUseAddExp extends ItemUseAction {
|
||||
@Getter private int exp = 0;
|
||||
|
||||
public class ItemUseAddExp extends ItemUseInt {
|
||||
@Override
|
||||
public ItemUseOp getItemUseOp() {
|
||||
return ItemUseOp.ITEM_USE_ADD_EXP;
|
||||
}
|
||||
|
||||
public ItemUseAddExp(String[] useParam) {
|
||||
try {
|
||||
this.exp = Integer.parseInt(useParam[0]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
super(useParam);
|
||||
}
|
||||
|
||||
public int getExp() {
|
||||
return this.i;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ItemUseAddItem extends ItemUseInt {
|
||||
super(useParam);
|
||||
try {
|
||||
this.count = Integer.parseInt(useParam[1]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
} catch (NumberFormatException | ArrayIndexOutOfBoundsException ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
package emu.grasscutter.game.props.ItemUseAction;
|
||||
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
import lombok.Getter;
|
||||
|
||||
public class ItemUseAddReliquaryExp extends ItemUseAction {
|
||||
@Getter private int exp = 0;
|
||||
|
||||
public class ItemUseAddReliquaryExp extends ItemUseAddExp {
|
||||
@Override
|
||||
public ItemUseOp getItemUseOp() {
|
||||
return ItemUseOp.ITEM_USE_ADD_RELIQUARY_EXP;
|
||||
}
|
||||
|
||||
public ItemUseAddReliquaryExp(String[] useParam) {
|
||||
try {
|
||||
this.exp = Integer.parseInt(useParam[0]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
super(useParam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ public class ItemUseAddServerBuff extends ItemUseInt {
|
||||
super(useParam);
|
||||
try {
|
||||
this.duration = Integer.parseInt(useParam[1]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
} catch (NumberFormatException | ArrayIndexOutOfBoundsException ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
package emu.grasscutter.game.props.ItemUseAction;
|
||||
|
||||
import emu.grasscutter.game.props.ItemUseOp;
|
||||
import lombok.Getter;
|
||||
|
||||
public class ItemUseAddWeaponExp extends ItemUseAction {
|
||||
@Getter private int exp = 0;
|
||||
|
||||
public class ItemUseAddWeaponExp extends ItemUseAddExp {
|
||||
@Override
|
||||
public ItemUseOp getItemUseOp() {
|
||||
return ItemUseOp.ITEM_USE_ADD_WEAPON_EXP;
|
||||
}
|
||||
|
||||
public ItemUseAddWeaponExp(String[] useParam) {
|
||||
try {
|
||||
this.exp = Integer.parseInt(useParam[0]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
super(useParam);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ public class ItemUseCombineItem extends ItemUseInt {
|
||||
super(useParam);
|
||||
try {
|
||||
this.resultId = Integer.parseInt(useParam[1]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
} catch (NumberFormatException | ArrayIndexOutOfBoundsException ignored) {}
|
||||
try {
|
||||
this.resultCount = Integer.parseInt(useParam[2]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
} catch (NumberFormatException | ArrayIndexOutOfBoundsException ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,10 +19,10 @@ public class ItemUseGainAvatar extends ItemUseInt {
|
||||
super(useParam);
|
||||
try {
|
||||
this.level = Integer.parseInt(useParam[1]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
} catch (NumberFormatException | ArrayIndexOutOfBoundsException ignored) {}
|
||||
try {
|
||||
this.constellation = Integer.parseInt(useParam[2]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
} catch (NumberFormatException | ArrayIndexOutOfBoundsException ignored) {}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,6 @@ public abstract class ItemUseInt extends ItemUseAction {
|
||||
public ItemUseInt(String[] useParam) {
|
||||
try {
|
||||
this.i = Integer.parseInt(useParam[0]);
|
||||
} catch (NumberFormatException ignored) {}
|
||||
} catch (NumberFormatException | ArrayIndexOutOfBoundsException ignored) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user