Merge remote-tracking branch 'origin/develop' into snapshot
This commit is contained in:
@@ -70,11 +70,14 @@ import net.minecraft.network.packet.s2c.play.EntitySpawnGlobalS2CPacket;
|
||||
//#endif
|
||||
|
||||
//#if MC>=11400
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import net.minecraft.network.packet.s2c.play.ChunkDataS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.PlayerActionResponseS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.OpenContainerS2CPacket;
|
||||
import net.minecraft.network.packet.s2c.play.OpenWrittenBookS2CPacket;
|
||||
import net.minecraft.entity.EntityType;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.world.chunk.light.LightingProvider;
|
||||
//#else
|
||||
//$$ import net.minecraft.client.resources.I18n;
|
||||
//$$ import net.minecraft.entity.Entity;
|
||||
@@ -459,6 +462,24 @@ public class FullReplaySender extends ChannelDuplexHandler implements ReplaySend
|
||||
//#endif
|
||||
}
|
||||
}
|
||||
|
||||
//#if MC>=11400
|
||||
if (p instanceof ChunkDataS2CPacket) {
|
||||
Runnable doLightUpdates = () -> {
|
||||
if (mc.world != null) {
|
||||
LightingProvider provider = mc.world.getChunkManager().getLightingProvider();
|
||||
while (provider.hasUpdates()) {
|
||||
provider.doLightUpdates(Integer.MAX_VALUE, true, true);
|
||||
}
|
||||
}
|
||||
};
|
||||
if (MCVer.isOnMainThread()) {
|
||||
doLightUpdates.run();
|
||||
} else {
|
||||
MCVer.scheduleOnMainThread(doLightUpdates);
|
||||
}
|
||||
}
|
||||
//#endif
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// We'd rather not have a failure parsing one packet screw up the whole replay process
|
||||
|
||||
@@ -284,7 +284,7 @@ public class QuickReplaySender extends ChannelHandlerAdapter implements ReplaySe
|
||||
//$$ public void onTick(TickEvent.ClientTickEvent event) {
|
||||
//$$ if (event.phase != TickEvent.Phase.START) return;
|
||||
//#endif
|
||||
if (!asyncMode) return;
|
||||
if (!asyncMode || paused()) return;
|
||||
|
||||
long now = System.currentTimeMillis();
|
||||
long realTimePassed = now - lastAsyncUpdateTime;
|
||||
|
||||
@@ -578,7 +578,7 @@ public class CameraEntity
|
||||
|
||||
private void handleInputEvents() {
|
||||
if (this.client.options.keyAttack.wasPressed() || this.client.options.keyUse.wasPressed()) {
|
||||
if (canSpectate(this.client.targetedEntity)) {
|
||||
if (this.client.currentScreen == null && canSpectate(this.client.targetedEntity)) {
|
||||
ReplayModReplay.instance.getReplayHandler().spectateEntity(
|
||||
//#if MC<=10710
|
||||
//$$ (EntityLivingBase)
|
||||
|
||||
Reference in New Issue
Block a user