<commit_before>package com.creativemd.creativecore.core;

import com.creativemd.creativecore.client.rendering.model.CreativeBakedModel;
import com.creativemd.creativecore.client.rendering.model.CreativeBakedQuad;
import com.creativemd.creativecore.client.rendering.model.CreativeCustomModelLoader;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class CreativeCoreClient {
	
	public static Minecraft mc = Minecraft.getMinecraft();
	
	public static float getRenderPartialTicks() {
		return mc.getRenderPartialTicks();
	}
	
	public static void doClientThings() {
		if (!mc.getFramebuffer().isStencilEnabled())
			mc.getFramebuffer().enableStencil();
		
		ModelLoaderRegistry.registerLoader(new CreativeCustomModelLoader());
	}
	
	public static void doClientThingsLate() {
		CreativeBakedModel.lateInit();
	}
	
	public static ItemMeshDefinition mesh = new ItemMeshDefinition() {
		
		@Override
		public ModelResourceLocation getModelLocation(ItemStack stack) {
			return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
		}
	};
	
	public static void registerBlockItem(Block toRegister) {
		Item item = Item.getItemFromBlock(toRegister);
		ModelLoader.setCustomMeshDefinition(item, mesh);
		// Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item,
		// mesh);
	}
	
	public static void registerItemRenderer(Item item) {
		ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
		// Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item,
		// 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
	}
	
	public static IItemColor itemColor = new IItemColor() {
		
		@Override
		public int colorMultiplier(ItemStack stack, int tintIndex) {
			return tintIndex;
		}
	};
	
	public static void registerBlockModels(Block block, String modID, String prefix, Enum<? extends IStringSerializable>[] enumtype) {
		ResourceLocation[] locations = new ResourceLocation[enumtype.length];
		Item item = Item.getItemFromBlock(block);
		for (int i = 0; i < enumtype.length; i++) {
			
			ResourceLocation location = new ResourceLocation(modID + ":" + prefix + ((IStringSerializable) enumtype[i]).getName());
			locations[i] = location;
			ModelLoader.setCustomModelResourceLocation(item, i, new ModelResourceLocation(location, "inventory"));
			// mc.getRenderItem().getItemModelMesher().register(item, i, new
			// ModelResourceLocation(location, "inventory"));
		}
		
		ModelBakery.registerItemVariants(item, locations);
	}
	
	public static IBlockColor blockColor = new IBlockColor() {
		
		@Override
		public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
			if (CreativeBakedQuad.lastRenderedQuad != null && CreativeBakedQuad.lastRenderedQuad.cube != null && CreativeBakedQuad.lastRenderedQuad.cube.block != null && CreativeBakedQuad.lastRenderedQuad.cube.block.getBlockLayer() == BlockRenderLayer.CUTOUT_MIPPED) {
				IBlockState newState = CreativeBakedQuad.lastRenderedQuad.cube.getBlockState(CreativeBakedQuad.lastRenderedQuad.cube.block);
				return mc.getBlockColors().colorMultiplier(newState, worldIn, pos, tintIndex);
				// return ColorUtils.WHITE;
			}
			
			return tintIndex;
		}
	};
	
	public static void registerItemColorHandler(Item item) {
		mc.getItemColors().registerItemColorHandler(itemColor, item);
	}
	
	public static void registerBlockColorHandler(Block block) {
		mc.getItemColors().registerItemColorHandler(itemColor, block);
		// mc.getBlockColors().registerBlockColorHandler(blockColor, block);
	}
}
<commit_msg>Fixed weird entity rendering when game is paused<commit_after>package com.creativemd.creativecore.core;

import com.creativemd.creativecore.client.rendering.model.CreativeBakedModel;
import com.creativemd.creativecore.client.rendering.model.CreativeBakedQuad;
import com.creativemd.creativecore.client.rendering.model.CreativeCustomModelLoader;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemMeshDefinition;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.client.renderer.color.IItemColor;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraftforge.client.model.ModelLoader;
import net.minecraftforge.client.model.ModelLoaderRegistry;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

@SideOnly(Side.CLIENT)
public class CreativeCoreClient {
	
	public static Minecraft mc = Minecraft.getMinecraft();
	
	public static float getRenderPartialTicks() {
		if (mc.isGamePaused())
			return 1.0F;
		return mc.getRenderPartialTicks();
	}
	
	public static void doClientThings() {
		if (!mc.getFramebuffer().isStencilEnabled())
			mc.getFramebuffer().enableStencil();
		
		ModelLoaderRegistry.registerLoader(new CreativeCustomModelLoader());
	}
	
	public static void doClientThingsLate() {
		CreativeBakedModel.lateInit();
	}
	
	public static ItemMeshDefinition mesh = new ItemMeshDefinition() {
		
		@Override
		public ModelResourceLocation getModelLocation(ItemStack stack) {
			return new ModelResourceLocation(stack.getItem().getRegistryName(), "inventory");
		}
	};
	
	public static void registerBlockItem(Block toRegister) {
		Item item = Item.getItemFromBlock(toRegister);
		ModelLoader.setCustomMeshDefinition(item, mesh);
		// Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item,
		// mesh);
	}
	
	public static void registerItemRenderer(Item item) {
		ModelLoader.setCustomModelResourceLocation(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
		// Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item,
		// 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
	}
	
	public static IItemColor itemColor = new IItemColor() {
		
		@Override
		public int colorMultiplier(ItemStack stack, int tintIndex) {
			return tintIndex;
		}
	};
	
	public static void registerBlockModels(Block block, String modID, String prefix, Enum<? extends IStringSerializable>[] enumtype) {
		ResourceLocation[] locations = new ResourceLocation[enumtype.length];
		Item item = Item.getItemFromBlock(block);
		for (int i = 0; i < enumtype.length; i++) {
			
			ResourceLocation location = new ResourceLocation(modID + ":" + prefix + ((IStringSerializable) enumtype[i]).getName());
			locations[i] = location;
			ModelLoader.setCustomModelResourceLocation(item, i, new ModelResourceLocation(location, "inventory"));
			// mc.getRenderItem().getItemModelMesher().register(item, i, new
			// ModelResourceLocation(location, "inventory"));
		}
		
		ModelBakery.registerItemVariants(item, locations);
	}
	
	public static IBlockColor blockColor = new IBlockColor() {
		
		@Override
		public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
			if (CreativeBakedQuad.lastRenderedQuad != null && CreativeBakedQuad.lastRenderedQuad.cube != null && CreativeBakedQuad.lastRenderedQuad.cube.block != null && CreativeBakedQuad.lastRenderedQuad.cube.block.getBlockLayer() == BlockRenderLayer.CUTOUT_MIPPED) {
				IBlockState newState = CreativeBakedQuad.lastRenderedQuad.cube.getBlockState(CreativeBakedQuad.lastRenderedQuad.cube.block);
				return mc.getBlockColors().colorMultiplier(newState, worldIn, pos, tintIndex);
				// return ColorUtils.WHITE;
			}
			
			return tintIndex;
		}
	};
	
	public static void registerItemColorHandler(Item item) {
		mc.getItemColors().registerItemColorHandler(itemColor, item);
	}
	
	public static void registerBlockColorHandler(Block block) {
		mc.getItemColors().registerItemColorHandler(itemColor, block);
		// mc.getBlockColors().registerBlockColorHandler(blockColor, block);
	}
}

{'fraction_non_alphanumeric': 0.10758241758241759, 'fraction_numerical': 0.0008791208791208791, 'mean_word_length': 5.973946360153256, 'pattern_counts': {'":': 2, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1220195', 'n_tokens_mistral': 2894, 'n_tokens_neox': 2732, 'n_words': 479}