<commit_before>package protocolsupport.protocol.v_1_5.clientboundtransformer;

import java.util.Iterator;

import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.hash.TIntObjectHashMap;
import io.netty.buffer.Unpooled;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.ItemStack;
import net.minecraft.server.v1_8_R1.Vector3f;
import protocolsupport.protocol.DataStorage.ProtocolVersion;
import protocolsupport.protocol.PacketDataSerializer;
import protocolsupport.protocol.watchedentites.WatchedEntity;

public class DataWatcherFilter {

	public static byte[] filterEntityData(ProtocolVersion version, WatchedEntity entity, byte[] data) {
		if (entity == null) {
			return data;
		}
		TIntObjectMap<DataWatcherObject> objects = decodeData(version, data);
		if (entity.isLiving()) {
			DataWatcherObject damageobject = objects.get(6);
			if (damageobject != null) {
				damageobject.value = ((byte) ((float) damageobject.value));
				damageobject.type = 0;
			}
			DataWatcherObject object = objects.get(8);
			if (object != null) {
				object.value = ((int) ((byte) object.value));
				object.type = 2;
			}
		}
		if (entity.isWolf()) {
			DataWatcherObject damageobject = objects.get(18);
			if (damageobject != null) {
				damageobject.value = ((int) ((float) damageobject.value));
				damageobject.type = 2;
			}
		}
		if (entity.isAgeable()) {
			DataWatcherObject object = objects.get(12);
			if (object != null) {
				object.value = ((int) ((byte) object.value));
				object.type = 2;
			}
		} else if (entity.isEnderman()) {
			DataWatcherObject object = objects.get(16);
			if (object != null) {
				object.value = ((byte) ((short) object.value));
				object.type = 0;
			}
		} else if (entity.isMinecart()) {
			DataWatcherObject damageobject = objects.get(19);
			if (damageobject != null) {
				damageobject.value = ((int) ((float) damageobject.value));
				damageobject.type = 2;
			}
			DataWatcherObject object = objects.get(20);
			if (object != null) {<commit_msg>Remap potion and arrows effect data for 1.5.2 properly<commit_after>package protocolsupport.protocol.v_1_5.clientboundtransformer;

import java.util.Iterator;

import gnu.trove.iterator.TIntObjectIterator;
import gnu.trove.map.TIntObjectMap;
import gnu.trove.map.hash.TIntObjectHashMap;
import io.netty.buffer.Unpooled;
import net.minecraft.server.v1_8_R1.BlockPosition;
import net.minecraft.server.v1_8_R1.ItemStack;
import net.minecraft.server.v1_8_R1.Vector3f;
import protocolsupport.protocol.DataStorage.ProtocolVersion;
import protocolsupport.protocol.PacketDataSerializer;
import protocolsupport.protocol.watchedentites.WatchedEntity;

public class DataWatcherFilter {

	public static byte[] filterEntityData(ProtocolVersion version, WatchedEntity entity, byte[] data) {
		if (entity == null) {
			return data;
		}
		TIntObjectMap<DataWatcherObject> objects = decodeData(version, data);
		if (entity.isLiving()) {
			DataWatcherObject damageobject = objects.get(6);
			if (damageobject != null) {
				damageobject.value = ((byte) ((float) damageobject.value));
				damageobject.type = 0;
			}
			DataWatcherObject arrows = objects.get(9);
			if (arrows != null) {
				objects.remove(9);
				objects.put(10, arrows);
			}
			DataWatcherObject pambient = objects.get(8);
			if (arrows != null) {
				objects.remove(8);
				objects.put(9, pambient);
			}
			DataWatcherObject pcolor = objects.get(7);
			if (arrows != null) {
				objects.remove(7);
				objects.put(8, pcolor);
			}
		}
		if (entity.isWolf()) {
			DataWatcherObject damageobject = objects.get(18);
			if (damageobject != null) {
				damageobject.value = ((int) ((float) damageobject.value));
				damageobject.type = 2;
			}
		}
		if (entity.isAgeable()) {
			DataWatcherObject object = objects.get(12);
			if (object != null) {
				object.value = ((int) ((byte) object.value));
				object.type = 2;
			}
		} else if (entity.isEnderman()) {
			DataWatcherObject object = objects.get(16);
			if (object != null) {
				object.value = ((byte) ((short) object.value));
				object.type = 0;
			}
		} else if (entity.isMinecart()) {
			DataWatcherObject damageobject = objects.get(19);
			if (damageobject != null) {
				damageobject.value = ((int) ((float) damageobject.value));
				damageobject.type = 2;
			}
			DataWatcherObject object = objects.get(20);
			if (object != null) {
{'fraction_non_alphanumeric': 0.13378684807256236, 'fraction_numerical': 0.016099773242630386, 'mean_word_length': 4.15906432748538, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3024050', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1470, 'n_words': 293}