Closed ScribbleTAS closed 1 year ago
In the end, it was a bit different than what I proposed here.
The solution was to add an empty TickContainer to the inputs, when the recording is starting and if it's empty
case RECORDING:
if (Minecraft.getMinecraft().player != null && startLocation.isEmpty()) {
startLocation = getStartLocation(Minecraft.getMinecraft().player);
}
+ if(this.inputs.isEmpty()) {
+ inputs.add(new TickInputContainer(index));
+ desyncMonitor.recordNull(index);
+ }
state = TASstate.RECORDING;
return verbose ? TextFormatting.GREEN + "Starting a recording" : "";
This will retime the index to be equal the size of the inputs rather than ahead of the size of the inputs.
The same also needs to happen for the desyncMonitor.
This also changes the stop condition of the playback:
/*Stop condition*/
- if (index >= inputs.size()) {
+ if (index == inputs.size()) {
unpressContainer();
TASstateClient.setOrSend(TASstate.NONE);
}
When recording, the index of the recording is 2 ticks ahead at all times, which creates some headaches regarding new features.
To solve this, the index increase needs to be moved to the end of the block.
As you may expect, this creates even more headaches with timing, however I feel that this is a good change for the future