<commit_before>package com.kylantraynor.mangostructures.structures;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

import com.kylantraynor.mangostructures.MangoStructures;

public class Bell extends Structure{

	private static ArrayList<Bell> bells = new ArrayList<Bell>();
	
	enum BlockType{
		BRASS,
		IRON,
		CLAPPER,
		UNDEFINED
	}
	
	static String[] validShapes = {
		"[..x..-..x..][..c..-..c..]",
		"[..x..-..x..][..x..-..x..][..c..-..c..]",
		"[..x..-..x..][.xcx.-.xcx.][..c..-..c..]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][..c..-..c..]",
		"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][x0c0x-x0c0x][.0c0.-.0c0.]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][x0c0x-x0c0x][.0c0.-.0c0.]"
	};
	
	private String shape = "";
	private BlockType[][][] blockShape;
	private List<BlockState> blocks;
	private boolean inRefractoryPeriod = false;

	private String name;
	
	public Bell(Location l) {
		super(l);
		loadShape();
		if(isValidShape()){
			bells.add(this);
		}
	}

	private void loadShape() {
		String clapper = "c";
		String bell = "x";
		String air = "0";
		String other = ".";
		int maxHeight = 0;
		for(String s : validShapes){
			maxHeight = Math.max(maxHeight, s.split("-").length - 1);
		}
		StringBuilder sb = new StringBuilder();
		for(int y = 1; y <= maxHeight; y++){
			StringBuilder sb1 = new StringBuilder();
			sb1.append("[");
			for(int x = -2; x <= 2; x++){
				switch(getLocation().clone().add(x, -y, 0).getBlock().getType()){
				case IRON_BLOCK: case GOLD_BLOCK:
					sb1.append(bell);
				case FENCE: case ACACIA_FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
					sb1.append(clapper);
				//case AIR:
				//	sb1.append(air);
				default:
					sb1.append(other);
				}
			}
			sb1.append("-");
			for(int z = -2; z <= 2; z++){
				switch(getLocation().clone().add(0, -y, z).getBlock().getType()){
				case IRON_BLOCK: case GOLD_BLOCK:
					sb1.append(bell);
				case FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
					sb1.append(clapper);
				default:
					sb1.append(air);
				}
			}
			sb1.append("]");
			if(!sb1.toString().equalsIgnoreCase("[00000-00000]")){
				sb.append(sb1.toString());
			}
		}
		shape = sb.toString();
		if(isValidShape()){
			Location l = getLocation().clone().add(0, -1, 0);
			blocks = new ArrayList<BlockState>();
			blocks.add(l.getBlock().getState());
			addBlocksAround(l);
		}
	}
<commit_msg>Fixed shapes.<commit_after>package com.kylantraynor.mangostructures.structures;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;

import org.bukkit.Bukkit;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockState;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;

import com.kylantraynor.mangostructures.MangoStructures;

public class Bell extends Structure{

	private static ArrayList<Bell> bells = new ArrayList<Bell>();
	
	enum BlockType{
		BRASS,
		IRON,
		CLAPPER,
		UNDEFINED
	}
	
	static String[] validShapes = {
		"[..x..-..x..][..c..-..c..]",
		"[..x..-..x..][..x..-..x..][..c..-..c..]",
		"[..x..-..x..][.xcx.-.xcx.][..c..-..c..]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][..c..-..c..]",
		"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][0xcx0-0xcx0][.0c0.-.0c0.]",
		"[..x..-..x..][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][x0c0x-x0c0x][.0c0.-.0c0.]",
		"[.xxx.-.xxx.][.xcx.-.xcx.][0xcx0-0xcx0][0xcx0-0xcx0][x0c0x-x0c0x][.0c0.-.0c0.]"
	};
	
	private String shape = "";
	private BlockType[][][] blockShape;
	private List<BlockState> blocks;
	private boolean inRefractoryPeriod = false;

	private String name;
	
	public Bell(Location l) {
		super(l);
		loadShape();
		if(isValidShape()){
			bells.add(this);
		}
	}

	private void loadShape() {
		String clapper = "c";
		String bell = "x";
		String air = "0";
		String other = ".";
		int maxHeight = 0;
		for(String s : validShapes){
			maxHeight = Math.max(maxHeight, s.split("-").length - 1);
		}
		StringBuilder sb = new StringBuilder();
		for(int y = 1; y <= maxHeight; y++){
			StringBuilder sb1 = new StringBuilder();
			sb1.append("[");
			for(int x = -2; x <= 2; x++){
				switch(getLocation().clone().add(x, -y, 0).getBlock().getType()){
				case IRON_BLOCK: case GOLD_BLOCK:
					sb1.append(bell);
					break;
				case FENCE: case ACACIA_FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
					sb1.append(clapper);
					break;
				//case AIR:
				//	sb1.append(air);
				default:
					sb1.append(other);
					break;
				}
			}
			sb1.append("-");
			for(int z = -2; z <= 2; z++){
				switch(getLocation().clone().add(0, -y, z).getBlock().getType()){
				case IRON_BLOCK: case GOLD_BLOCK:
					sb1.append(bell);
					break;
				case FENCE: case DARK_OAK_FENCE: case SPRUCE_FENCE: case JUNGLE_FENCE: case BIRCH_FENCE: case COBBLE_WALL:
					sb1.append(clapper);
					break;
				default:
					sb1.append(other);
					break;
				}
			}
			sb1.append("]");
			if(!sb1.toString().equalsIgnoreCase("[.....-.....]")){
				sb.append(sb1.toString());
			}
		}
		shape = sb.toString();
		if(isValidShape()){
			Location l = getLocation().clone().add(0, -1, 0);
			blocks = new ArrayList<BlockState>();
			blocks.add(l.getBlock().getState());
			addBlocksAround(l);
		}
	}

{'fraction_non_alphanumeric': 0.23599504797276386, 'fraction_numerical': 0.04178272980501393, 'mean_word_length': 2.982131854590265, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 11, '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': '262769', 'n_tokens_mistral': 3232, 'n_tokens_neox': 2847, 'n_words': 407}