Skip to content

Commit

Permalink
Fixed start seed in fullrecord not matching fullplay
Browse files Browse the repository at this point in the history
  • Loading branch information
ScribbleTAS committed Apr 23, 2023
1 parent ecb1ed8 commit fd14cdc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;

import com.google.common.collect.ImmutableList;
import com.minecrafttas.tasmod.CommonProxy;
import com.minecrafttas.tasmod.TASmod;

import net.minecraft.command.CommandBase;
Expand Down Expand Up @@ -43,6 +44,9 @@ public void execute(MinecraftServer server, ICommandSender sender, String[] args
}
if (args.length < 1) {
TASmod.containerStateServer.toggleRecording();
CommonProxy.tickSchedulerServer.add(() ->{
TASmod.ktrngHandler.broadcastStartSeed();
});
} else if (args.length > 1) {
sender.sendMessage(new TextComponentString(TextFormatting.RED + "Too many arguments. " + getUsage(sender)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.minecrafttas.tasmod.ClientProxy;
import com.minecrafttas.tasmod.TASmod;
import com.minecrafttas.tasmod.inputcontainer.InputContainer;
import com.minecrafttas.tasmod.inputcontainer.TASstate;
import com.minecrafttas.tasmod.inputcontainer.server.ContainerStateClient;
import com.minecrafttas.tasmod.tickratechanger.TickrateChangerClient;
Expand All @@ -23,7 +24,12 @@ public class OpenGuiEvents {
*/
public static void openGuiMainMenu(GuiMainMenu guiMainMenu) {
if (stateWhenOpened != null) {
ClientProxy.virtual.getContainer().setTASState(stateWhenOpened);
InputContainer container = ClientProxy.virtual.getContainer();
if(stateWhenOpened == TASstate.RECORDING) {
long seed = TASmod.ktrngHandler.getGlobalSeedClient();
container.setStartSeed(seed);
}
container.setTASState(stateWhenOpened);
stateWhenOpened = null;
}
LoadWorldEvents.doneShuttingDown();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,6 @@ public void leaveServer(EntityPlayerMP player) {
public void setState(TASstate stateIn) {
setServerState(stateIn);
TASmod.packetServer.sendToAll(new SyncStatePacket(state, true));

if(state == TASstate.RECORDING) { // Set the start seed of the recording
CommonProxy.tickSchedulerServer.add(() ->{
TASmod.ktrngHandler.broadcastStartSeed();
});
}
}

public void setServerState(TASstate stateIn) {
Expand Down

0 comments on commit fd14cdc

Please sign in to comment.