<commit_before>package ru.beykerykt.lightsource.sources;

import org.bukkit.entity.Entity;

import ru.beykerykt.lightapi.LightAPI;
import ru.beykerykt.lightapi.chunks.ChunkInfo;

public class BurningSource extends OwnedSource {

	public BurningSource(Entity entity, int lightlevel) {
		super(entity, lightlevel);
	}

	@Override
	public boolean shouldExecute() {
		boolean shoud = super.shouldExecute() && getOwner().getFireTicks() > 0;
		if (!shoud) {
			LightAPI.deleteLight(getOldLocation().getWorld(), getOldLocation().getBlockX(), getOldLocation().getBlockY(), getOldLocation().getBlockZ(), false);
			LightAPI.deleteLight(getLocation().getWorld(), getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ(), false);
			for (ChunkInfo info : LightAPI.collectChunks(getLocation().getWorld(), getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ())) {
				LightAPI.updateChunk(info);
			}
		}
		return shoud;
	}

	@Override
	public void onUpdate() {
		super.onUpdate();
		if (getOldLocation().getBlockX() != getLocation().getBlockX() || getOldLocation().getBlockY() != getLocation().getBlockY() || getOldLocation().getBlockZ() != getLocation().getBlockZ()) {
			LightAPI.deleteLight(getOldLocation().getWorld(), getOldLocation().getBlockX(), getOldLocation().getBlockY(), getOldLocation().getBlockZ(), false);
			LightAPI.createLight(getLocation().getWorld(), getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ(), getLightLevel(), false);
			for (ChunkInfo info : LightAPI.collectChunks(getLocation().getWorld(), getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ())) {
				LightAPI.updateChunk(info);
			}
		}
	}
}<commit_msg>sources: changes for async lighting<commit_after>package ru.beykerykt.lightsource.sources;

import org.bukkit.entity.Entity;

import ru.beykerykt.lightapi.LightAPI;
import ru.beykerykt.lightapi.chunks.ChunkInfo;
import ru.beykerykt.lightsource.LightSourceAPI;

public class BurningSource extends OwnedSource {

	public BurningSource(Entity entity, int lightlevel) {
		super(entity, lightlevel);
	}

	@Override
	public boolean shouldExecute() {
		boolean shoud = super.shouldExecute() && getOwner().getFireTicks() > 0;
		if (!shoud) {
			LightAPI.deleteLight(getOldLocation().getWorld(), getOldLocation().getBlockX(), getOldLocation().getBlockY(), getOldLocation().getBlockZ(), LightSourceAPI.isAsyncLightingFlag());
			LightAPI.deleteLight(getLocation().getWorld(), getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ(), LightSourceAPI.isAsyncLightingFlag());
			for (ChunkInfo info : LightAPI.collectChunks(getLocation().getWorld(), getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ())) {
				LightAPI.updateChunk(info);
			}
		}
		return shoud;
	}

	@Override
	public void onUpdate() {
		super.onUpdate();
		if (getOldLocation().getBlockX() != getLocation().getBlockX() || getOldLocation().getBlockY() != getLocation().getBlockY() || getOldLocation().getBlockZ() != getLocation().getBlockZ()) {
			LightAPI.deleteLight(getOldLocation().getWorld(), getOldLocation().getBlockX(), getOldLocation().getBlockY(), getOldLocation().getBlockZ(), LightSourceAPI.isAsyncLightingFlag());
			LightAPI.createLight(getLocation().getWorld(), getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ(), getLightLevel(), LightSourceAPI.isAsyncLightingFlag());
			for (ChunkInfo info : LightAPI.collectChunks(getLocation().getWorld(), getLocation().getBlockX(), getLocation().getBlockY(), getLocation().getBlockZ())) {
				LightAPI.updateChunk(info);
			}
		}
	}
}
{'fraction_non_alphanumeric': 0.16511500547645125, 'fraction_numerical': 0.000547645125958379, 'mean_word_length': 6.941304347826087, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4551677', 'n_tokens_mistral': 1154, 'n_tokens_neox': 1082, 'n_words': 170}