Port to MC 1.18-pre1
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
// 1.18+
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user