<commit_before>package Hexel.blocks;

import Hexel.blocks.types.*;
import Hexel.chunk.Chunk;
import Hexel.chunk.Chunks;
import Hexel.math.Vector3i;
import Hexel.util.Pair;

import java.util.ArrayList;
import java.util.Random;

public class BlockRules {

	private Chunks chunks;

	ArrayList<BlockRule> everywhereRules = new ArrayList<BlockRule>();
	ArrayList<BlockRule> seedRules = new ArrayList<BlockRule>();
	ArrayList<BlockRule> woodRules = new ArrayList<BlockRule>();
	ArrayList<BlockRule> waterRules = new ArrayList<BlockRule>();

	public BlockRules(Chunks chunks) {
		this.chunks = chunks;

		everywhereRules.add(new BlockRule() {
			@Override
			public int stepsUntilConsider(int x, int y, int z, Block b,
					Chunk c, Chunks chunks, int steps, Vector3i tmp) {
				return (5 - (steps % 5)) % 5;
			}

			@Override
			public boolean isMatch(int x, int y, int z, Block b, Chunk c,
					Chunks chunks, int steps, Vector3i tmp) {
				return b.health < b.getMaxHealth();
			}

			@Override
			public ArrayList<BlockDelta> apply(int x, int y, int z, Block b,
					Chunk c, Chunks chunks, int steps, Vector3i tmp) {
				ArrayList<BlockDelta> deltas = new ArrayList<BlockDelta>();
				b.health += .01;
				deltas.add(new BlockDelta(x, y, z, b));<commit_msg>minor block health logic improvement<commit_after>package Hexel.blocks;

import Hexel.blocks.types.*;
import Hexel.chunk.Chunk;
import Hexel.chunk.Chunks;
import Hexel.math.Vector3i;
import Hexel.util.Pair;

import java.util.ArrayList;
import java.util.Random;

public class BlockRules {

	private Chunks chunks;

	ArrayList<BlockRule> everywhereRules = new ArrayList<BlockRule>();
	ArrayList<BlockRule> seedRules = new ArrayList<BlockRule>();
	ArrayList<BlockRule> woodRules = new ArrayList<BlockRule>();
	ArrayList<BlockRule> waterRules = new ArrayList<BlockRule>();

	public BlockRules(Chunks chunks) {
		this.chunks = chunks;

		everywhereRules.add(new BlockRule() {
			@Override
			public int stepsUntilConsider(int x, int y, int z, Block b,
					Chunk c, Chunks chunks, int steps, Vector3i tmp) {
				return (5 - (steps % 5)) % 5;
			}

			@Override
			public boolean isMatch(int x, int y, int z, Block b, Chunk c,
					Chunks chunks, int steps, Vector3i tmp) {
				return b.health < b.getMaxHealth();
			}

			@Override
			public ArrayList<BlockDelta> apply(int x, int y, int z, Block b,
					Chunk c, Chunks chunks, int steps, Vector3i tmp) {
				ArrayList<BlockDelta> deltas = new ArrayList<BlockDelta>();
				b.health = Math.min(b.health + .01, b.getMaxHealth());
				deltas.add(new BlockDelta(x, y, z, b));
{'fraction_non_alphanumeric': 0.11659541391371939, 'fraction_numerical': 0.006995724834823164, 'mean_word_length': 4.221095334685598, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 25, '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': '3737114', 'n_tokens_mistral': 944, 'n_tokens_neox': 814, 'n_words': 247}