package landmaster.landcore.proxy;

import landmaster.landcore.*;
import landmaster.landcore.entity.*;
import landmaster.landcore.entity.render.*;
import net.minecraft.client.*;
import net.minecraft.client.renderer.block.model.*;
import net.minecraft.client.renderer.texture.*;
import net.minecraft.item.*;
import net.minecraft.util.*;
import net.minecraftforge.client.event.*;
import net.minecraftforge.client.model.*;
import net.minecraftforge.common.*;
import net.minecraftforge.fml.client.registry.*;
import net.minecraftforge.fml.common.eventhandler.*;

public class ClientProxy extends CommonProxy {
	public ClientProxy() {
		MinecraftForge.EVENT_BUS.register(this);
	}
	
	@Override
	public void registerItemRenderer(Item item, int meta, String id) {
	    registerItemRenderer(item, meta, id, "inventory");
	}
	
	@Override
	public void registerItemRenderer(Item item, int meta, String id, String variant) {
		ModelResourceLocation rl = new ModelResourceLocation(LandCore.MODID + ":" + id, variant);
		if (meta >= 0)  {
			ModelLoader.setCustomModelResourceLocation(item, meta, rl);
		} else {
			ModelLoader.setCustomMeshDefinition(item, stack -> rl);
			ModelBakery.registerItemVariants(item, rl);
		}
	}
	
	@Override
	public void preInitEntities() {
		super.preInitEntities();
		
		RenderingRegistry.registerEntityRenderingHandler(EntityLandlord.class, RenderEntityLandlord::new);
		RenderingRegistry.registerEntityRenderingHandler(EntityLandlordMagicFireball.class, RenderEntityLandlordMagicFireball::new);
	}
	
	@SubscribeEvent(priority = EventPriority.LOW)
	public void createCustomTextures(TextureStitchEvent.Pre event) {
		TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();
		texturemap.registerSprite(new ResourceLocation("landcore:blocks/purple_fire_layer_0"));
		texturemap.registerSprite(new ResourceLocation("landcore:blocks/purple_fire_layer_1"));
	}
}

@@ -172,107 +172,28 @@
 ent.
-*;%0Aimport net.minecraft.client.renderer.block.model.*;%0Aimport net.minecraft.client.renderer.texture
+renderer.block.model
 .*;%0A
@@ -1554,92 +1554,22 @@
 %7B%0A%09%09
-TextureMap texturemap = Minecraft.getMinecraft().getTextureMapBlocks();%0A%09%09texturemap
+event.getMap()
 .reg
@@ -1648,18 +1648,22 @@
 ;%0A%09%09
-texturemap
+event.getMap()
 .reg

Use event.getMap()