Skip to content

Instantly share code, notes, and snippets.

Minecraft on Apple Silicon

In this gist, you can find the steps to run Minecraft 1.16.4 natively on Apple Silicon (AS), without needing Rosetta 2 translation of the dependencies (mainly LWJGL and related libraries).

While it's possible to use a launcher like MultiMC to have a prettier way to run the game on AS, it requires installing even more dependencies (like QT) which take time and are difficult to distribute. Therefore, I've put together a command line-based launcher tool using a couple shell & Python scripts.

To get up and running quickly, follow the steps below. Otherwise, for more detail, watch my YouTube video.

Download my package

import sys
import requests
def download_file_from_google_drive(id, destination):
URL = "https://docs.google.com/uc?export=download"
session = requests.Session()
response = session.get(URL, params = { 'id' : id }, stream = True)
token = get_confirm_token(response)
class ImageFolderEX(datasets.ImageFolder):
def __getitem__(self, index):
while True:
path, label = self.imgs[index]
try:
img = self.loader(os.path.join(self.root, path))
if self.transform is not None:
img = self.transform(img)
except:
index = np.random.randint(self.__len__())
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
ls imagenet_subset | while read line; do file "./imagenet_subset/$line" | grep -P "^.*: .*image data, " 1>/dev/null ; if [[ $? -ne 0 ]] ; then rm -f "./imagenet_subset/$line" ; fi ; done
@peter0749
peter0749 / Face_Fitting.ipynb
Last active May 15, 2019 15:46
3DMM Fitting
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peter0749
peter0749 / pi.scala
Last active March 26, 2019 10:28
Pi
val n_pt = 1000000
val rd_g = scala.util.Random
(for ( i <- 0 until n_pt ) yield (rd_g.nextFloat, rd_g.nextFloat)).map( x => (x._1-0.5,x._2-0.5) ).map( x => if (x._1*x._1+x._2*x._2<0.25) 1 else 0 ).reduce(_ + _).toFloat / n_pt.toFloat * 4.0
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.autograd import Variable
from torch.nn import Parameter
from torchvision import datasets, transforms
@peter0749
peter0749 / bored.cpp
Created February 26, 2019 06:22
bored.cpp
#include <iostream>
#include <iomanip>
#include <algorithm>
int main(void) {
int a[9];
for (int i=0; i<9; ++i) a[i]=i+1;
do {
if (
a[0]-a[1]==a[2] &&
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.