<commit_before>package com.calumgilchrist.ld23.tinyworld.core;

import org.jbox2d.callbacks.ContactImpulse;
import org.jbox2d.collision.Manifold;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.Body;
import org.jbox2d.dynamics.contacts.Contact;

public class ContactListener implements org.jbox2d.callbacks.ContactListener {

	private Player player;
	int createCount;
	
	public ContactListener(Player player) {
		this.player = player;
		createCount = 0;
	}
	
	@Override
	public void beginContact(Contact contact) {
		
	}

	@Override
	public void endContact(Contact contact) {
		// TODO Auto-generated method stub
	}

	@Override
	public void preSolve(Contact contact, Manifold oldManifold) {
		
	}

	@Override
	public void postSolve(Contact contact, ContactImpulse impulse) {
		Body hitter;
		
		//Fixture A is never the contact, I think
		if (player.getBody().equals(contact.getFixtureB().m_body)) {
			
			hitter = contact.getFixtureA().m_body;
			Planetoid planet = DynamicFactory.getFromBody(hitter);
			
			if (planet != null) {
			
				player.addMass(hitter.m_mass);
	
				DynamicFactory.removeByBody(hitter);
				createCount++;
			}
		}
	}
		
	public int getCreateCount() {
		return createCount;
	}
	
	public void clearCreateCount() {
		createCount = 0;
	}
}<commit_msg>Fixed Issue Where Contact Listener Wasn't Working<commit_after>package com.calumgilchrist.ld23.tinyworld.core;

import org.jbox2d.callbacks.ContactImpulse;
import org.jbox2d.collision.Manifold;
import org.jbox2d.common.Vec2;
import org.jbox2d.dynamics.Body;
import org.jbox2d.dynamics.contacts.Contact;

public class ContactListener implements org.jbox2d.callbacks.ContactListener {

	private Player player;
	int createCount;
	
	public ContactListener(Player player) {
		this.player = player;
		createCount = 0;
	}
	
	@Override
	public void beginContact(Contact contact) {
		
	}

	@Override
	public void endContact(Contact contact) {
		// TODO Auto-generated method stub
	}

	@Override
	public void preSolve(Contact contact, Manifold oldManifold) {
		
	}

	@Override
	public void postSolve(Contact contact, ContactImpulse impulse) {
		Body hitter;
		
		//Fixture A is never the contact, I think
		
		if (player.getBody().equals(contact.getFixtureA().m_body)) {
			
			hitter = contact.getFixtureB().m_body;
			Planetoid planet = DynamicFactory.getFromBody(hitter);
			
			if (planet != null) {
			
				player.addMass(hitter.m_mass);
	
				DynamicFactory.removeByBody(hitter);
				createCount++;
				System.out.println("Knock B");
			}
		} if (player.getBody().equals(contact.getFixtureB().m_body)) {
			
			hitter = contact.getFixtureA().m_body;
			Planetoid planet = DynamicFactory.getFromBody(hitter);
			
			if (planet != null) {
			
				player.addMass(hitter.m_mass);
	
				DynamicFactory.removeByBody(hitter);
				createCount++;
				System.out.println("Knock A");
			}
		}
		
	}
		
	public int getCreateCount() {
		return createCount;
	}
	
	public void clearCreateCount() {
		createCount = 0;
	}
}
{'fraction_non_alphanumeric': 0.10508701472556894, 'fraction_numerical': 0.007362784471218206, 'mean_word_length': 3.9080459770114944, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1796033', 'n_tokens_mistral': 1159, 'n_tokens_neox': 976, 'n_words': 203}