<commit_before>package shedar.mods.ic2.nuclearcontrol.utils;

import ic2.api.reactor.IReactor;
import ic2.api.reactor.IReactorChamber;
import ic2.api.reactor.ISteamReactor;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import shedar.mods.ic2.nuclearcontrol.IC2NuclearControl;

public class NuclearHelper {

	private static final double STEAM_PER_EU = 3.2D;

	public static IReactor getReactorAt(World world, int x, int y, int z) {
		if (world == null)
			return null;
		TileEntity entity = world.getTileEntity(x, y, z);
		if (entity instanceof IReactor)
			return (IReactor) entity;
		return null;
	}
	
	
	public static boolean isSteam(IReactor reactor) {
		// no more steam reactors. Liquid container will be used for coolant
		// liquids.
		if(reactor instanceof ISteamReactor)
		{
			return true;
		}
		return false;
	}

	public static int euToSteam(int eu) {
		return (int) Math.floor((eu) * STEAM_PER_EU);
	}

	public static IReactorChamber getReactorChamberAt(World world, int x, int y, int z) {
		if (world == null)
			return null;
		TileEntity entity = world.getTileEntity(x, y, z);
		if (entity instanceof IReactorChamber) {
			return (IReactorChamber) entity;
		}
		return null;
	}

	public static IReactor getReactorAroundCoord(World world, int x, int y, int z) {
		if (world == null)
			return null;
		ChunkPosition[] around = { new ChunkPosition(-1, 0, 0),
				new ChunkPosition(1, 0, 0), new ChunkPosition(0, -1, 0),
				new ChunkPosition(0, 1, 0), new ChunkPosition(0, 0, -1),
				new ChunkPosition(0, 0, 1) };
		IReactor ent = null;
		for (int i = 0; i < 6 && ent == null; i++) {
			ChunkPosition delta = around[i];<commit_msg>This *probably* works. Didn't test though cause gradle screwup.<commit_after>package shedar.mods.ic2.nuclearcontrol.utils;

import ic2.api.reactor.IReactor;
import ic2.api.reactor.IReactorChamber;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.ChunkPosition;
import net.minecraft.world.World;
import shedar.mods.ic2.nuclearcontrol.IC2NuclearControl;

public class NuclearHelper {

	private static final double STEAM_PER_EU = 3.2D;
	private static final String ISTEAMREACTOR = "ic2.api.reactor.ISteamReactor";

	public static IReactor getReactorAt(World world, int x, int y, int z) {
		if (world == null)
			return null;
		TileEntity entity = world.getTileEntity(x, y, z);
		if (entity instanceof IReactor)
			return (IReactor) entity;
		return null;
	}
	
	
	public static boolean isSteam(IReactor reactor) {
		try{
			if(IC2NuclearControl.instance.crossClassic.isClassicSpeiger && reactor.getClass().isInstance(Class.forName(ISTEAMREACTOR)))
				return true;
		}catch(ClassNotFoundException e){} // No biggie
		
		return false;
	}

	public static int euToSteam(int eu) {
		return (int) Math.floor((eu) * STEAM_PER_EU);
	}

	public static IReactorChamber getReactorChamberAt(World world, int x, int y, int z) {
		if (world == null)
			return null;
		TileEntity entity = world.getTileEntity(x, y, z);
		if (entity instanceof IReactorChamber) {
			return (IReactorChamber) entity;
		}
		return null;
	}

	public static IReactor getReactorAroundCoord(World world, int x, int y, int z) {
		if (world == null)
			return null;
		ChunkPosition[] around = { new ChunkPosition(-1, 0, 0),
				new ChunkPosition(1, 0, 0), new ChunkPosition(0, -1, 0),
				new ChunkPosition(0, 1, 0), new ChunkPosition(0, 0, -1),
				new ChunkPosition(0, 0, 1) };
		IReactor ent = null;
		for (int i = 0; i < 6 && ent == null; i++) {
			ChunkPosition delta = around[i];
{'fraction_non_alphanumeric': 0.11170497060395511, 'fraction_numerical': 0.015232495991448424, 'mean_word_length': 4.271830985915493, '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': '3141358', 'n_tokens_mistral': 1442, 'n_tokens_neox': 1290, 'n_words': 361}