<commit_before>package protocolsupportpocketstuff.api.util;

import org.bukkit.entity.Entity;
import protocolsupport.api.Connection;
import protocolsupport.protocol.utils.datawatcher.DataWatcherObject;
import protocolsupport.protocol.utils.datawatcher.objects.DataWatcherObjectFloatLe;
import protocolsupport.utils.CollectionsUtils;
import protocolsupportpocketstuff.packet.play.EntityDataPacket;

import java.util.concurrent.ConcurrentHashMap;

public class PocketUtils {
	private static final ConcurrentHashMap<Integer, Float> entityScales = new ConcurrentHashMap<>();

	public static void setScale(Entity entity, float scale) {
		setScale(entity.getEntityId(), scale);
	}

	public static void setScale(int entityId, float scale) {
		if (scale == 1) {
			entityScales.remove(entityId);
		} else {
			entityScales.put(entityId, scale);
		}
		// Update to all players
		CollectionsUtils.ArrayMap<DataWatcherObject<?>> metadata = new CollectionsUtils.ArrayMap<>(76);
		metadata.put(39, new DataWatcherObjectFloatLe(scale));
		EntityDataPacket packet = new EntityDataPacket(entityId, metadata);
		for (Connection connection : PocketCon.getPocketConnections()) {
			PocketCon.sendPocketPacket(connection, packet);
		}
	}

	public static boolean hasCustomScale(int entityId) {
		return entityScales.containsKey(entityId);
	}

	public static float getCustomScale(int entityId) {
		return entityScales.get(entityId);
	}
}<commit_msg>Add javadocs to the entity scale API<commit_after>package protocolsupportpocketstuff.api.util;

import org.bukkit.entity.Entity;
import protocolsupport.api.Connection;
import protocolsupport.protocol.utils.datawatcher.DataWatcherObject;
import protocolsupport.protocol.utils.datawatcher.objects.DataWatcherObjectFloatLe;
import protocolsupport.utils.CollectionsUtils;
import protocolsupportpocketstuff.packet.play.EntityDataPacket;

import java.util.concurrent.ConcurrentHashMap;

public class PocketUtils {
	private static final ConcurrentHashMap<Integer, Float> entityScales = new ConcurrentHashMap<>();

	/***
	 * Sets the scale of an entity
	 * @param entity
	 * @param scale
	 */
	public static void setScale(Entity entity, float scale) {
		setScale(entity.getEntityId(), scale);
	}

	/***
	 * Sets the scale of an entity ID
	 * @param entityId
	 * @param scale
	 */
	public static void setScale(int entityId, float scale) {
		if (scale == 1) {
			entityScales.remove(entityId);
		} else {
			entityScales.put(entityId, scale);
		}
		// Update to all players
		CollectionsUtils.ArrayMap<DataWatcherObject<?>> metadata = new CollectionsUtils.ArrayMap<>(76);
		metadata.put(39, new DataWatcherObjectFloatLe(scale));
		EntityDataPacket packet = new EntityDataPacket(entityId, metadata);
		for (Connection connection : PocketCon.getPocketConnections()) {
			PocketCon.sendPocketPacket(connection, packet);
		}
	}

	/***
	 * Returns if an entityId has an custom scale set
	 * @param entityId
	 * @return if the entityId has an custom scale set
	 */
	public static boolean hasCustomScale(int entityId) {
		return entityScales.containsKey(entityId);
	}

	/***
	 * Gets the entityId custom scale
	 * @param entityId
	 * @return the entityId custom scale
	 */
	public static float getCustomScale(int entityId) {
		return entityScales.get(entityId);
	}
}
{'fraction_non_alphanumeric': 0.09645909645909646, 'fraction_numerical': 0.0030525030525030525, 'mean_word_length': 5.450787401574803, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3952568', 'n_tokens_mistral': 1007, 'n_tokens_neox': 947, 'n_words': 231}