<commit_before>package me.nallar.tickthreading.minecraft.entitylist;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import me.nallar.tickthreading.minecraft.TickManager;
import net.minecraft.world.World;

/*
* Used to override World.loadedTileEntityList.
* */
public abstract class EntityList<T> extends ArrayList<T> {
	public final TickManager manager;
	public final List innerList;

	EntityList(World world, Field overriddenField, TickManager manager, List innerList) {
		this.manager = manager;
		this.innerList = innerList;
		overriddenField.setAccessible(true);
		try {
			//This should hopefully avoid leaving the world in a bad state if something goes wrong.
			this.addAll((Collection<? extends T>) overriddenField.get(world));
			overriddenField.set(world, this);
		} catch (Exception e) {
			throw new RuntimeException("Failed to override " + overriddenField.getName() + " in world " + world.getWorldInfo().getWorldName(), e);
		}
	}

	@Override
	public abstract boolean add(T t);

	@Override
	public abstract boolean remove(Object o);

	@Override
	public boolean addAll(Collection<? extends T> c) {
		boolean changed = false;
		for (T t : c) {
			changed |= add(t);
		}
		return changed;
	}

	@Override
	public boolean removeAll(Collection c) {
		boolean changed = false;
		for (Object t : c) {
			changed |= remove(t);
		}
		return changed;
	}

	@Override
	public Iterator<T> iterator() {
		return (Iterator<T>) manager.entityList.iterator();
	}

	@Override
	public ListIterator<T> listIterator() {
		return (ListIterator<T>) manager.entityList.listIterator();
	}

	@Override
	public ListIterator<T> listIterator(int index) {
		return (ListIterator<T>) manager.entityList.listIterator(index);
	}

	@Override
	public boolean contains(Object o) {
		return manager.entityList.contains(o);
	}

	@Override
	public int size() {
		return manager.entityList.size();
	}

	@Override
	public T get(int index) {
		return (T) manager.entityList.get(index);
	}

	@Override
	public boolean containsAll(Collection<?> c) {
		return manager.entityList.containsAll(c);
	}

	@Override
	public boolean retainAll(Collection<?> c) {
		return manager.entityList.retainAll(c);
	}

	@Override
	public String toString() {
		return manager.entityList.toString();
	}
}
<commit_msg>Fixed TileEntityList, no longer returns entities.<commit_after>package me.nallar.tickthreading.minecraft.entitylist;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;

import me.nallar.tickthreading.minecraft.TickManager;
import net.minecraft.world.World;

/*
* Used to override World.loadedTileEntityList.
* */
public abstract class EntityList<T> extends ArrayList<T> {
	public final TickManager manager;
	public final List innerList;

	EntityList(World world, Field overriddenField, TickManager manager, List innerList) {
		this.manager = manager;
		this.innerList = innerList;
		overriddenField.setAccessible(true);
		try {
			//This should hopefully avoid leaving the world in a bad state if something goes wrong.
			this.addAll((Collection<? extends T>) overriddenField.get(world));
			overriddenField.set(world, this);
		} catch (Exception e) {
			throw new RuntimeException("Failed to override " + overriddenField.getName() + " in world " + world.getWorldInfo().getWorldName(), e);
		}
	}

	@Override
	public abstract boolean add(T t);

	@Override
	public abstract boolean remove(Object o);

	@Override
	public boolean addAll(Collection<? extends T> c) {
		boolean changed = false;
		for (T t : c) {
			changed |= add(t);
		}
		return changed;
	}

	@Override
	public boolean removeAll(Collection c) {
		boolean changed = false;
		for (Object t : c) {
			changed |= remove(t);
		}
		return changed;
	}

	@Override
	public Iterator<T> iterator() {
		return (Iterator<T>) innerList.iterator();
	}

	@Override
	public ListIterator<T> listIterator() {
		return (ListIterator<T>) innerList.listIterator();
	}

	@Override
	public ListIterator<T> listIterator(int index) {
		return (ListIterator<T>) innerList.listIterator(index);
	}

	@Override
	public boolean contains(Object o) {
		return innerList.contains(o);
	}

	@Override
	public int size() {
		return innerList.size();
	}

	@Override
	public T get(int index) {
		return (T) innerList.get(index);
	}

	@Override
	public boolean containsAll(Collection<?> c) {
		return innerList.containsAll(c);
	}

	@Override
	public boolean retainAll(Collection<?> c) {
		return innerList.retainAll(c);
	}

	@Override
	public String toString() {
		return innerList.toString();
	}
}

{'fraction_non_alphanumeric': 0.11124620060790273, 'fraction_numerical': 0.0, 'mean_word_length': 3.7009523809523808, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, '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': '6817824', 'n_tokens_mistral': 1630, 'n_tokens_neox': 1496, 'n_words': 391}