<commit_before>package com.ferreusveritas.dynamictrees.blocks;

import com.ferreusveritas.dynamictrees.ModConstants;
import com.ferreusveritas.dynamictrees.api.TreeRegistry;
import com.ferreusveritas.dynamictrees.api.cells.ICellKit;
import com.ferreusveritas.dynamictrees.api.treedata.ILeavesProperties;
import com.ferreusveritas.dynamictrees.cells.CellKits;
import com.ferreusveritas.dynamictrees.trees.DynamicTree;
import com.ferreusveritas.dynamictrees.util.CompatHelper;

import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;

public class LeavesProperties implements ILeavesProperties {

	public static final LeavesProperties NULLPROPERTIES = new LeavesProperties() {
		@Override public ILeavesProperties setTree(DynamicTree tree) { return this; }
		@Override public DynamicTree getTree() { return DynamicTree.NULLTREE; }
		@Override public IBlockState getPrimitiveLeaves() { return Blocks.AIR.getDefaultState(); }
		@Override public ItemStack getPrimitiveLeavesItemStack() { return CompatHelper.emptyStack(); }
		@Override public ILeavesProperties setDynamicLeavesState(IBlockState state) { return this; }
		@Override public IBlockState getDynamicLeavesState() { return Blocks.AIR.getDefaultState(); }
		@Override public IBlockState getDynamicLeavesState(int hydro) { return Blocks.AIR.getDefaultState(); }
		@Override public ICellKit getCellKit() { return CellKits.NULLCELLKIT; }
		@Override public int getFlammability() { return 0; }
		@Override public int getFireSpreadSpeed() { return 0; }
		@Override public int getSmotherLeavesMax() { return 0; }
		@Override public int getLightRequirement() { return 15; }
	};
	
	private IBlockState primitiveLeaves;
	private ItemStack primitiveLeavesItemStack;
	private ICellKit cellKit;
	private DynamicTree tree = DynamicTree.NULLTREE;
	private IBlockState dynamicLeavesBlockHydroStates[] = new IBlockState[5];

	private LeavesProperties() {}
	
	public LeavesProperties(IBlockState primitiveLeaves, ItemStack primitiveLeavesItemStack) {
		this(primitiveLeaves, primitiveLeavesItemStack, TreeRegistry.findCellKit(new ResourceLocation(ModConstants.MODID, "deciduous")));
	}
	
	public LeavesProperties(IBlockState primitiveLeaves, ItemStack primitiveLeavesItemStack, ICellKit cellKit) {
		this.primitiveLeaves = primitiveLeaves;
		this.primitiveLeavesItemStack = primitiveLeavesItemStack;
		this.cellKit = cellKit;
	}
	
	@Override
	public IBlockState getPrimitiveLeaves() {
		return primitiveLeaves;
	}

	@Override
	public ItemStack getPrimitiveLeavesItemStack() {
		return primitiveLeavesItemStack;
	}
	
	@Override
	public ILeavesProperties setDynamicLeavesState(IBlockState state) {

		//Cache all the blockStates to speed up worldgen
		dynamicLeavesBlockHydroStates[0] = Blocks.AIR.getDefaultState();
		for(int i = 1; i <= 4; i++) {
			dynamicLeavesBlockHydroStates[i] = state.withProperty(BlockDynamicLeaves.HYDRO, i); 
		}
		
		return this;
	}
	
	@Override
	public IBlockState getDynamicLeavesState() {
		return dynamicLeavesBlockHydroStates[4];
	}
	
	@Override
	public IBlockState getDynamicLeavesState(int hydro) {
		return dynamicLeavesBlockHydroStates[MathHelper.clamp(hydro, 0, 4)];
	}
	
	@Override
	public ILeavesProperties setTree(DynamicTree tree) {
		this.tree = tree;
		return this;
	}
	
	@Override
	public DynamicTree getTree() {
		return tree;
	}

	@Override
	public int getFlammability() {
		return 60;// Mimic vanilla leaves
	}

	@Override
	public int getFireSpreadSpeed() {
		return 30;// Mimic vanilla leaves
	}
	
	@Override
	public int getSmotherLeavesMax() {
		return 4;
	}

	@Override
	public int getLightRequirement() {
		return 13;
	}

	@Override
	public ICellKit getCellKit() {
		return cellKit;
	}
	
}
<commit_msg>Add various constructors for LeavesProperties<commit_after>package com.ferreusveritas.dynamictrees.blocks;

import com.ferreusveritas.dynamictrees.ModConstants;
import com.ferreusveritas.dynamictrees.api.TreeRegistry;
import com.ferreusveritas.dynamictrees.api.cells.ICellKit;
import com.ferreusveritas.dynamictrees.api.treedata.ILeavesProperties;
import com.ferreusveritas.dynamictrees.cells.CellKits;
import com.ferreusveritas.dynamictrees.trees.DynamicTree;
import com.ferreusveritas.dynamictrees.util.CompatHelper;

import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.MathHelper;

public class LeavesProperties implements ILeavesProperties {

	public static final LeavesProperties NULLPROPERTIES = new LeavesProperties() {
		@Override public ILeavesProperties setTree(DynamicTree tree) { return this; }
		@Override public DynamicTree getTree() { return DynamicTree.NULLTREE; }
		@Override public IBlockState getPrimitiveLeaves() { return Blocks.AIR.getDefaultState(); }
		@Override public ItemStack getPrimitiveLeavesItemStack() { return CompatHelper.emptyStack(); }
		@Override public ILeavesProperties setDynamicLeavesState(IBlockState state) { return this; }
		@Override public IBlockState getDynamicLeavesState() { return Blocks.AIR.getDefaultState(); }
		@Override public IBlockState getDynamicLeavesState(int hydro) { return Blocks.AIR.getDefaultState(); }
		@Override public ICellKit getCellKit() { return CellKits.NULLCELLKIT; }
		@Override public int getFlammability() { return 0; }
		@Override public int getFireSpreadSpeed() { return 0; }
		@Override public int getSmotherLeavesMax() { return 0; }
		@Override public int getLightRequirement() { return 15; }
	};
	
	private IBlockState primitiveLeaves;
	private ItemStack primitiveLeavesItemStack;
	private ICellKit cellKit;
	private DynamicTree tree = DynamicTree.NULLTREE;
	private IBlockState dynamicLeavesBlockHydroStates[] = new IBlockState[5];

	private LeavesProperties() {}
	
	public LeavesProperties(IBlockState primitiveLeaves) {
		this(primitiveLeaves, new ItemStack(Item.getItemFromBlock(primitiveLeaves.getBlock()), 1, primitiveLeaves.getBlock().damageDropped(primitiveLeaves)));
	}
	
	public LeavesProperties(IBlockState primitiveLeaves, ICellKit cellKit) {
		this(primitiveLeaves, new ItemStack(Item.getItemFromBlock(primitiveLeaves.getBlock()), 1, primitiveLeaves.getBlock().damageDropped(primitiveLeaves)), cellKit);
	}
	
	public LeavesProperties(IBlockState primitiveLeaves, ItemStack primitiveLeavesItemStack) {
		this(primitiveLeaves, primitiveLeavesItemStack, TreeRegistry.findCellKit(new ResourceLocation(ModConstants.MODID, "deciduous")));
	}
	
	public LeavesProperties(IBlockState primitiveLeaves, ItemStack primitiveLeavesItemStack, ICellKit cellKit) {
		this.primitiveLeaves = primitiveLeaves;
		this.primitiveLeavesItemStack = primitiveLeavesItemStack;
		this.cellKit = cellKit;
	}
	
	@Override
	public IBlockState getPrimitiveLeaves() {
		return primitiveLeaves;
	}

	@Override
	public ItemStack getPrimitiveLeavesItemStack() {
		return primitiveLeavesItemStack;
	}
	
	@Override
	public ILeavesProperties setDynamicLeavesState(IBlockState state) {

		//Cache all the blockStates to speed up worldgen
		dynamicLeavesBlockHydroStates[0] = Blocks.AIR.getDefaultState();
		for(int i = 1; i <= 4; i++) {
			dynamicLeavesBlockHydroStates[i] = state.withProperty(BlockDynamicLeaves.HYDRO, i); 
		}
		
		return this;
	}
	
	@Override
	public IBlockState getDynamicLeavesState() {
		return dynamicLeavesBlockHydroStates[4];
	}
	
	@Override
	public IBlockState getDynamicLeavesState(int hydro) {
		return dynamicLeavesBlockHydroStates[MathHelper.clamp(hydro, 0, 4)];
	}
	
	@Override
	public ILeavesProperties setTree(DynamicTree tree) {
		this.tree = tree;
		return this;
	}
	
	@Override
	public DynamicTree getTree() {
		return tree;
	}

	@Override
	public int getFlammability() {
		return 60;// Mimic vanilla leaves
	}

	@Override
	public int getFireSpreadSpeed() {
		return 30;// Mimic vanilla leaves
	}
	
	@Override
	public int getSmotherLeavesMax() {
		return 4;
	}

	@Override
	public int getLightRequirement() {
		return 13;
	}

	@Override
	public ICellKit getCellKit() {
		return cellKit;
	}
	
}

{'fraction_non_alphanumeric': 0.08712629652226968, 'fraction_numerical': 0.004881025015253203, 'mean_word_length': 5.987212276214834, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6021933', 'n_tokens_mistral': 2701, 'n_tokens_neox': 2525, 'n_words': 545}