Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,7 @@ public void onServerPacket(PacketID id, ByteBuffer buf, String username) throws
* Once the player is done renaming the savestate, the screens are cleared for all players.
*/
try {
// TODO Currently desyncs the savestates... Bigger investigation necessary
// TASmod.server.sendTo(player, new TASmodBufferBuilder(TASmodPackets.SAVESTATE_RENAME_SCREEN).writeInt(paths.getSavestate().index));
TASmod.server.sendTo(player, new TASmodBufferBuilder(TASmodPackets.SAVESTATE_RENAME_SCREEN).writeInt(paths.getSavestate().index));
} catch (Exception e) {
LOGGER.catching(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ else if (state == SavestateState.LOADING)
break;
case SAVESTATE_RENAME_SCREEN:
int index = TASmodBufferBuilder.readInt(buf);
mc.displayGuiScreen(null);
TASmodClient.tickSchedulerClient.add(() -> {
displayGuiRename(index);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,10 @@ public class VirtualInterpolationHandler implements EventVirtualInput.EventVirtu
* Is updated in {@link #onVirtualCameraTick()}
*/
private final List<VirtualCameraAngle> cameraAngleStates = new ArrayList<>();
// private int debugFinalIndex = 0;

@Override
public VirtualMouse onVirtualMouseTick(VirtualMouse vmouse) {
this.nextMouse = vmouse;
// if (TASmodClient.controller.isPlayingback()) {
// System.out.println(debugFinalIndex == mousePointerInterpolationStates.size() - 1);
// }
mousePointerStates.clear();
TASmodClient.controller.getNextMouse().getStates(mousePointerStates);
return null;
Expand Down Expand Up @@ -69,7 +65,6 @@ public MouseInterpolation getInterpolatedMouseCursor(float partialTick, boolean
if (enable && !mousePointerStates.isEmpty()) {
partialTick = dynamicallyRound(partialTick, TASmodClient.tickratechanger.ticksPerSecond);
int index = (int) MathHelper.clampedLerp(0, mousePointerStates.size() - 1, partialTick); // Get interpolate index
// debugFinalIndex = index;
VirtualMouse interpolatedCamera = mousePointerStates.get(index);

interpolatedPointerX = interpolatedCamera.getCursorX();
Expand All @@ -79,7 +74,7 @@ public MouseInterpolation getInterpolatedMouseCursor(float partialTick, boolean
Minecraft mc = Minecraft.getMinecraft();
GuiScreenDuck gui = (GuiScreenDuck) mc.currentScreen;

if (gui != null) {
if (gui != null && !(mc.currentScreen instanceof SubtickGuiScreen)) {
interpolatedPointerX = gui.rescaleX(PointerNormalizer.reapplyScalingX(interpolatedPointerX));
interpolatedPointerY = gui.rescaleY(PointerNormalizer.reapplyScalingY(interpolatedPointerY));
}
Expand Down