Update 1.14.4 yarn

This commit is contained in:
Jonas Herzig
2020-03-30 18:08:01 +02:00
parent ba83aa97b3
commit 527562549b
48 changed files with 214 additions and 225 deletions

View File

@@ -33,9 +33,9 @@ import org.apache.commons.io.FileUtils;
//#if MC>=11400
import net.minecraft.client.options.Option;
import net.minecraft.resource.ResourcePackCreator;
import net.minecraft.resource.ResourcePackContainer;
import net.minecraft.util.NonBlockingThreadExecutor;
import net.minecraft.resource.ResourcePackProvider;
import net.minecraft.resource.ResourcePackProfile;
import net.minecraft.util.thread.ReentrantThreadExecutor;
//#endif
//#if FABRIC>=1
@@ -263,10 +263,10 @@ public class ReplayMod implements
}
};
//#if MC>=11400
mc.getResourcePackContainerManager().addCreator(new ResourcePackCreator() {
mc.getResourcePackManager().registerProvider(new ResourcePackProvider() {
@Override
public <T extends ResourcePackContainer> void registerContainer(Map<String, T> map, ResourcePackContainer.Factory<T> factory) {
map.put("jgui", ResourcePackContainer.of("jgui", true, () -> jGuiResourcePack, factory, ResourcePackContainer.InsertionPosition.BOTTOM));
public <T extends ResourcePackProfile> void register(Map<String, T> map, ResourcePackProfile.Factory<T> factory) {
map.put("jgui", ResourcePackProfile.of("jgui", true, () -> jGuiResourcePack, factory, ResourcePackProfile.InsertionPosition.BOTTOM));
}
});
//#else
@@ -389,7 +389,7 @@ public class ReplayMod implements
if (mc.isOnThread()) {
runnable.run();
} else {
executor.executeFuture(() -> {
executor.submit(() -> {
runnable.run();
return null;
}).get(30, TimeUnit.SECONDS);
@@ -439,7 +439,7 @@ public class ReplayMod implements
// stuff submitted via runLater is actually always run (e.g. recording might not be fully stopped because parts
// of that are run via runLater and stopping the recording happens right around the time MC clears the queue).
// Luckily, that's also the version where MC pulled out the executor implementation, so we can just spin up our own.
public static class ReplayModExecutor extends NonBlockingThreadExecutor<Runnable> {
public static class ReplayModExecutor extends ReentrantThreadExecutor<Runnable> {
private final Thread mcThread = Thread.currentThread();
// Fail-fast in case we ever switch to async loading and forget to change this
// (except for fabric 1.15+ because it loads the mod before the client thread is set)
@@ -452,12 +452,12 @@ public class ReplayMod implements
}
@Override
protected Runnable prepareRunnable(Runnable runnable) {
protected Runnable createTask(Runnable runnable) {
return runnable;
}
@Override
protected boolean canRun(Runnable runnable) {
protected boolean canExecute(Runnable runnable) {
return true;
}
@@ -466,16 +466,9 @@ public class ReplayMod implements
return mcThread;
}
//#if FABRIC>=1 && MC<11500
@Override
public void send(Runnable runnable) {
method_18858(runnable);
}
//#endif
@Override
public void executeTaskQueue() {
super.executeTaskQueue();
public void runTasks() {
super.runTasks();
}
}
public final ReplayModExecutor executor = new ReplayModExecutor("Client/ReplayMod");
@@ -493,7 +486,7 @@ public class ReplayMod implements
}
});
} else {
executor.method_18858(() -> {
executor.send(() -> {
inRunLater = true;
try {
runnable.run();

View File

@@ -20,13 +20,13 @@ import com.replaymod.core.events.PreRenderCallback;
import java.io.IOException;
//#if MC>=11400
import net.minecraft.util.NonBlockingThreadExecutor;
import net.minecraft.util.thread.ReentrantThreadExecutor;
//#endif
@Mixin(MinecraftClient.class)
public abstract class MixinMinecraft
//#if MC>=11400
extends NonBlockingThreadExecutor<Runnable>
extends ReentrantThreadExecutor<Runnable>
//#endif
implements MCVer.MinecraftMethodAccessor {
//#if MC>=11400
@@ -44,7 +44,7 @@ public abstract class MixinMinecraft
//#if MC>=11400
@Override
public void replayModExecuteTaskQueue() {
executeTaskQueue();
runTasks();
}
//#endif

View File

@@ -12,9 +12,9 @@ public interface TimerAccessor {
void setLastSyncSysClock(long value);
//#if MC>=11200
@Accessor("timeScale")
@Accessor("tickTime")
float getTickLength();
@Accessor("timeScale")
@Accessor("tickTime")
void setTickLength(float value);
//#else
//$$ @Accessor

View File

@@ -1,6 +1,6 @@
package com.replaymod.core.utils;
import net.minecraft.client.network.packet.CustomPayloadS2CPacket;
import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket;
import net.minecraft.util.PacketByteBuf;
//#if MC>=10904
import net.minecraft.util.Identifier;

View File

@@ -11,13 +11,13 @@ import net.minecraft.client.world.ClientWorld;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.model.Box;
import net.minecraft.client.model.Cuboid;
import net.minecraft.client.model.ModelPart;
import net.minecraft.util.crash.CrashReportSection;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.PacketByteBuf;
import net.minecraft.util.Identifier;
import net.minecraft.util.SystemUtil;
import net.minecraft.util.Util;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraft.world.chunk.WorldChunk;
@@ -362,7 +362,7 @@ public class MCVer {
}
@SuppressWarnings("unchecked")
public static List<Box> cubeList(Cuboid modelRenderer) {
public static List<Box> cubeList(ModelPart modelRenderer) {
//#if MC>=11500
//$$ return new ArrayList<>(); // FIXME 1.15
//#else
@@ -465,7 +465,7 @@ public class MCVer {
//#if MC>=10800
public static BufferBuilder Tessellator_getBufferBuilder() {
return Tessellator.getInstance().getBufferBuilder();
return Tessellator.getInstance().getBuffer();
}
//#else
//$$ public static Tessellator Tessellator_getBufferBuilder() {
@@ -495,7 +495,7 @@ public class MCVer {
Tessellator_getBufferBuilder().begin(
mode
//#if MC>=10809
, VertexFormats.POSITION_UV
, VertexFormats.POSITION_TEXTURE
//#endif
);
}
@@ -512,7 +512,7 @@ public class MCVer {
Tessellator_getBufferBuilder().begin(
mode
//#if MC>=10809
, VertexFormats.POSITION_UV_COLOR
, VertexFormats.POSITION_TEXTURE_COLOR
//#endif
);
}
@@ -609,7 +609,7 @@ public class MCVer {
public static long milliTime() {
//#if MC>=11400
return SystemUtil.getMeasuringTimeMs();
return Util.getMeasuringTimeMs();
//#else
//$$ return Minecraft.getSystemTime();
//#endif
@@ -648,7 +648,7 @@ public class MCVer {
public static void openFile(File file) {
//#if MC>=11400
SystemUtil.getOperatingSystem().open(file);
Util.getOperatingSystem().open(file);
//#else
//$$ String path = file.getAbsolutePath();
//$$
@@ -679,7 +679,7 @@ public class MCVer {
public static void openURL(URI url) {
//#if MC>=11400
//#if MC>=11400
SystemUtil.getOperatingSystem().open(url);
Util.getOperatingSystem().open(url);
//#else
//$$ Util.getOSType().openURI(url);
//#endif