datablock fxDTSBrickData( mc_blockData_grass )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/Grass.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Grass";
	iconName = "Add-Ons/System_Minecraft/icons/grass";
	
	isMC = true;
	mcHealth = 6;
	mcBlastResistance = 3;
};

datablock fxDTSBrickData( mc_blockData_sand )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/sand.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Sand";
	iconName = "Add-Ons/System_Minecraft/icons/sand";
	
	isMC = true;
	mcHealth = 4;
	mcBlastResistance = 2.5;
};

datablock fxDTSBrickData( mc_blockData_dirt )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/dirt.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Dirt";
	iconName = "Add-Ons/System_Minecraft/icons/dirt";
	
	isMC = true;
	mcHealth = 4;
	mcBlastResistance = 2.5;
};

datablock fxDTSBrickData( mc_blockData_smoothStone )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/stone.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Smoothstone";
	iconName = "Add-Ons/System_Minecraft/icons/stone";
	
	isMC = true;
	mcHealth = 18;
	mcBlastResistance = 30;
};

datablock fxDTSBrickData( mc_blockData_snow )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/snow.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Snow";
	iconName = "Add-Ons/System_Minecraft/icons/snow";
	
	isMC = true;
	mcHealth = 6;
	mcBlastResistance = 0.5;
};

datablock fxDTSBrickData( mc_blockData_glass )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/glass.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Glass";
	iconName = "Add-Ons/System_Minecraft/icons/glass";
	
	isMC = true;
	mcHealth = 2;
	mcBlastResistance = 1.5;
};

datablock fxDTSBrickData( mc_blockData_log )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/log.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Log";
	iconName = "Add-Ons/System_Minecraft/icons/log";
	
	isMC = true;
	mcHealth = 8;
	mcBlastResistance = 10;
};

datablock fxDTSBrickData( mc_blockData_leaves )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/leaves.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Leaves";
	iconName = "Add-Ons/System_Minecraft/icons/leaves";
	
	isMC = true;
	mcHealth = 2;
	mcBlastResistance = 1;
};

datablock fxDTSBrickData( mc_blockData_brick )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/brickBlock.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Brick Block";
	iconName = "Add-Ons/System_Minecraft/icons/brickBlock";
	
	isMC = true;
	mcHealth = 18;
	mcBlastResistance = 30;
};

datablock fxDTSBrickData( mc_blockData_stoneBlock )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/stoneBlock.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Stone Block";
	iconName = "Add-Ons/System_Minecraft/icons/stoneBlock";
	
	isMC = true;
	mcHealth = 16;
	mcBlastResistance = 30;
};

datablock fxDTSBrickData( mc_blockData_ice )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/ice.blb";
	category = "Minecraft";
	subCategory = "Blocks";
	uiName = "Ice";
	iconName = "Add-Ons/System_Minecraft/icons/Ice";
	
	isMC = true;
	mcHealth = 6;
	mcBlastResistance = 2.5;
};

//Special
datablock fxDTSBrickData( mc_blockData_woodenDoor )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/WoodenDoor.blb";
	category = "Minecraft";
	subCategory = "Special";
	uiName = "Wooden Door";
	iconName = "";
	CollisionShapeName = "./blocks/DoorCollision.dts";
	
	isMC = true;
	mcHealth = 40;
	mcBlastResistance = 15;
	mcBlockOffsetZ = 0.5;
	isDoor = true;
};

datablock fxDTSBrickData( mc_blockData_ironDoor )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/IronDoor.blb";
	category = "Minecraft";
	subCategory = "Special";
	uiName = "Iron Door";
	iconName = "";
	CollisionShapeName = "./blocks/DoorCollision.dts";
	
	isMC = true;
	mcHealth = 80;
	mcBlastResistance = 25;
	mcBlockOffsetZ = 0.5;
	isDoor = true;
	//mcHasInteractSpecial = true;
};

datablock fxDTSBrickData( mc_blockData_tnt )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/TNT.blb";
	category = "Minecraft";
	subCategory = "Special";
	uiName = "TNT";
	iconName = "";
	
	isMC = true;
	mcHealth = 15;
	mcBlastResistance = 25;
	mcHasInteractSpecial = true;
};
datablock fxDTSBrickData( mc_blockData_coalOre )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/CoalOre.blb";
	category = "Minecraft";
	subCategory = "Ores";
	uiName = "Coal Ore";
	iconName = "";

	isMC = true;
	mcHealth = 16;
	mcBlastResistance = 24;
};

datablock fxDTSBrickData( mc_blockData_ironOre )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/IronOre.blb";
	category = "Minecraft";
	subCategory = "Ores";
	uiName = "Iron Ore";
	iconName = "";

	isMC = true;
	mcHealth = 16;
	mcBlastResistance = 24;
};

datablock fxDTSBrickData( mc_blockData_goldOre )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/GoldOre.blb";
	category = "Minecraft";
	subCategory = "Ores";
	uiName = "Gold Ore";
	iconName = "";

	isMC = true;
	mcHealth = 16;
	mcBlastResistance = 24;
};

datablock fxDTSBrickData( mc_blockData_redstoneOre )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/RedstoneOre.blb";
	category = "Minecraft";
	subCategory = "Ores";
	uiName = "Redstone Ore";
	iconName = "";

	isMC = true;
	mcHealth = 16;
	mcBlastResistance = 24;
};

datablock fxDTSBrickData( mc_blockData_diamondOre )
{
	brickFile = "Add-Ons/System_Minecraft/blocks/DiamondOre.blb";
	category = "Minecraft";
	subCategory = "Ores";
	uiName = "Diamond Ore";
	iconName = "";

	isMC = true;
	mcHealth = 16;
	mcBlastResistance = 24;
};

datablock fxDTSBrickData(mc_blockData_Cobblestone)
{
	brickFile = "Add-ons/System_Minecraft/Blocks/Cobblestone.blb";
	category = "minecraft";
	subCategory="Natural";
	uiName = "Cobblestone";
	iconName = "";

	isMC = true;
	mcHealth = 12;
	mcBlastResistance = 30;
};

datablock fxDTSBrickData(mc_blockData_Glowstone)
{
	brickFile = "Add-ons/System_Minecraft/Blocks/Glowstone.blb";
	category = "minecraft";
	subCategory="Natural";
	uiName = "Glowstone";
	iconName = "";

	isMC = true;
	mcHealth = 17;
	mcBlastResistance = 12;
};

datablock fxDTSBrickData(mc_blockData_Mossstone)
{
	brickFile = "Add-ons/System_Minecraft/Blocks/MossStone.blb";
	category = "minecraft";
	subCategory="Natural";
	uiName = "Mossstone";
	iconName = "";

	isMC = true;
	mcHealth = 12;
	mcBlastResistance = 15;
};

datablock fxDTSBrickData(mc_blockData_MonsterSpawner)
{
	brickFile = "Add-ons/System_Minecraft/Blocks/MonsterSpawner.blb";
	category = "minecraft";
	subCategory="Natural";
	uiName = "Monster Spawner";
	iconName = "";

	isMC = true;
	mcHealth = 10;
	mcBlastResistance = 15;
};

datablock fxDTSBrickData(mc_blockData_veggrass)
{
	brickFile = "Add-ons/System_Minecraft/Blocks/VegGrass.blb";
	category = "Minecraft";
	subCategory="Plants";
	uiName = "VegGrass";
	iconName = "";

	isMC = true;
	mcHealth = 1;
	mcBlastResistance = 1;
};
//Electricity
datablock fxDTSBrickData( mc_elecData_1way )
{
	brickFile = "Add-Ons/System_Minecraft/electricity/1-way.blb";
	category = "Minecraft";
	subCategory = "Electricity";
	uiName = "1-way";
	iconName = "Add-Ons/System_Minecraft/icons/1-way";
};

datablock fxDTSBrickData( mc_elecData_2way )
{
	brickFile = "Add-Ons/System_Minecraft/electricity/2-way.blb";
	category = "Minecraft";
	subCategory = "Electricity";
	uiName = "2-way";
	iconName = "Add-Ons/System_Minecraft/icons/2-way";
};

datablock fxDTSBrickData( mc_elecData_3way )
{
	brickFile = "Add-Ons/System_Minecraft/electricity/3-way.blb";
	category = "Minecraft";
	subCategory = "Electricity";
	uiName = "3-way";
	iconName = "Add-Ons/System_Minecraft/icons/3-way";
};

datablock fxDTSBrickData( mc_elecData_4way )
{
	brickFile = "Add-Ons/System_Minecraft/electricity/4-way.blb";
	category = "Minecraft";
	subCategory = "Electricity";
	uiName = "4-way";
	iconName = "Add-Ons/System_Minecraft/icons/4-way";
};

datablock fxDTSBrickData( mc_elecData_powerBrick )
{
	brickFile = "Add-Ons/System_Minecraft/electricity/powerBrick.blb";
	category = "Minecraft";
	subCategory = "Electricity";
	uiName = "Power Brick";
	iconName = "Add-Ons/System_Minecraft/icons/PowerBrick";
};


//Special Interaction Code
function mc_blockData_tnt_mcInteractSpecial( %this, %obj, %pl )
{
	if ( !%pl.client.isAdmin )
	{
		return true;
	}
	
	if ( isEventPending( %obj.explodeSchedule ) )
	{
		return true;
	}
	
	serverPlay3D( Minecraft_Click, %obj.getPosition() );
	
	%obj.tntActivator = %pl.client;
	%obj.tntBlink = %obj.schedule( 500, "tntBlink" );
	%obj.explodeSchedule = %obj.schedule( 4000, "tntExplode" );
	
	return true;
}

function fxDTSBrick::tntBlink( %this )
{
	cancel( %this.tntBlink );
	
	if ( %this.colorFxID $= 3 )
	{
		//%this.setColorFX( 0 );
		//%this.setColor( mc_tntBlock.colorBCS );
	}
	else
	{
		//%this.setColorFX( 3 );
		//%this.setColor( $completeWhite );
	}
	
	%this.tntBlink = %this.schedule( 500, "tntBlink" );
}

function fxDTSBrick::tntExplode( %this )
{
	if ( %this.startExplode )
	{
		return;
	}
	
	%this.startExplode = true;
	
	%pos = %this.getPosition();
	%near = %this.getNumNearbyTNT();
	%rads = 4 + mFloor( %near );
	%scal = 1 + mFloor( %near / 2 );
	
	%this.spawnExplosion( rocketLauncherProjectile, %scal, %this.tntActivator );
	%this.mcDestroy();
	
	initContainerRadiusSearch( %pos, %rads, $TypeMasks::fxBrickObjectType );
	
	while ( isObject( %obj = containerSearchNext() ) )
	{
		if ( %obj $= %this )
		{
			continue;
		}
		
		%obj.mcDestroy();
	}
}

function fxDTSBrick::getNumNearbyTNT( %this )
{
	%num = 0;
	
	initContainerRadiusSearch( %this.getPosition(), 6, $TypeMasks::fxBrickObjectType );
	
	while ( isObject( %obj = containerSearchNext() ) )
	{
		if ( %obj $= %this )
		{
			continue;
		}
		
		if ( %obj.getDataBlock().uiName $= "TNT" )
		{
			%num++;
		}
	}
	
	return %num;
}

