/*
 * Copyright 2016 FabricMC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package net.fabricmc.base;

import net.fabricmc.api.Side;
import net.minecraft.client.Minecraft;
import net.minecraft.sortme.EntityPlayerAbstract;

public class ClientSidedHandler implements ISidedHandler {

	@Override
	public Side getSide() {
		return Side.CLIENT;
	}

	@Override
	public EntityPlayerAbstract getClientPlayer() {
		return Minecraft.getInstance().player;
	}

	@Override
	public void runOnMainThread(Runnable runnable) {
		Minecraft.getInstance().scheduleOnMainThread(runnable);
	}

}

@@ -1022,16 +1022,95 @@
 able) %7B%0A
+%09%09if (Minecraft.getInstance().isMainThread()) %7B%0A%09%09%09runnable.run();%0A%09%09%7D else %7B%0A%09
 %09%09Minecr
@@ -1159,14 +1159,18 @@
 nable);%0A
+%09%09%7D%0A
 %09%7D%0A%0A%7D%0A

Check main thread before scheduling