Port to MC 1.18-pre1

This commit is contained in:
Jonas Herzig
2021-11-14 16:15:35 +01:00
parent d2f27e3918
commit 6e1febdab8
17 changed files with 219 additions and 7 deletions

View File

@@ -183,12 +183,16 @@ public class Util {
}
public static String getTileEntityId(BlockEntity tileEntity) {
//#if MC>=11800
//$$ NbtCompound nbt = tileEntity.createNbt();
//#else
CompoundTag nbt = new CompoundTag();
//#if MC>=11400
tileEntity.toTag(nbt);
//#else
//$$ tileEntity.writeToNBT(nbt);
//#endif
//#endif
return nbt.getString("id");
}

View File

@@ -0,0 +1 @@
// 1.18+

View File

@@ -24,7 +24,20 @@ import java.util.concurrent.locks.ReentrantLock;
public abstract class Mixin_BlockOnChunkRebuilds implements ForceChunkLoadingHook.IBlockOnChunkRebuilds {
@Shadow @Final private Queue<BlockBufferBuilderStorage> threadBuffers;
//#if MC>=11800
//$$ @org.spongepowered.asm.mixin.Unique
//$$ private boolean upload() {
//$$ boolean anything = false;
//$$ Runnable runnable;
//$$ while ((runnable = this.uploadQueue.poll()) != null) {
//$$ runnable.run();
//$$ anything = true;
//$$ }
//$$ return anything;
//$$ }
//#else
@Shadow public abstract boolean upload();
//#endif
@Shadow @Final private TaskExecutor<Runnable> mailbox;

View File

@@ -20,7 +20,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
public abstract class Mixin_ChromaKeyColorSky {
@Shadow @Final private MinecraftClient client;
//#if MC>=11400 || 10710>=MC
//#if MC>=11800
//$$ @Inject(method = "renderSky(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Matrix4f;FLjava/lang/Runnable;)V",
//$$ at = @At(value = "INVOKE", target = "Ljava/lang/Runnable;run()V", remap = false, shift = At.Shift.AFTER),
//$$ cancellable = true)
//#elseif MC>=11400 || 10710>=MC
@Inject(method = "renderSky", at = @At("HEAD"), cancellable = true)
//#else
//$$ @Inject(method = "renderSky(FI)V", at = @At("HEAD"), cancellable = true)